Changeset 147279 in webkit


Ignore:
Timestamp:
Mar 30, 2013 6:08:24 AM (11 years ago)
Author:
Philippe Normand
Message:

[GTK] Should use GStreamer codec installation infrastructure
https://bugs.webkit.org/show_bug.cgi?id=34085

Reviewed by Martin Robinson.

Initial support for the GStreamer codec installer. The player will
handle missing-plugins messages and use the pbutils codec
installer facilities to install the missing GStreamer
plugins. Once the plugins are installed reset the pipeline state.

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:

(WebCore::mediaPlayerPrivatePluginInstallerResultFunction): This
method is used to notify the player that the missing plugins were installed.
(WebCore):
(WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Ignore
errors while installing plugins and handle the missing-plugin message.
(WebCore::MediaPlayerPrivateGStreamer::handlePluginInstallerResult):
This method is invoked after the installer finished its task.

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:

(MediaPlayerPrivateGStreamer):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r147278 r147279  
     12013-03-30  Philippe Normand  <pnormand@igalia.com>
     2
     3        [GTK] Should use GStreamer codec installation infrastructure
     4        https://bugs.webkit.org/show_bug.cgi?id=34085
     5
     6        Reviewed by Martin Robinson.
     7
     8        Initial support for the GStreamer codec installer. The player will
     9        handle missing-plugins messages and use the pbutils codec
     10        installer facilities to install the missing GStreamer
     11        plugins. Once the plugins are installed reset the pipeline state.
     12
     13        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
     14        (WebCore::mediaPlayerPrivatePluginInstallerResultFunction): This
     15        method is used to notify the player that the missing plugins were installed.
     16        (WebCore):
     17        (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
     18        (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Ignore
     19        errors while installing plugins and handle the missing-plugin message.
     20        (WebCore::MediaPlayerPrivateGStreamer::handlePluginInstallerResult):
     21        This method is invoked after the installer finished its task.
     22        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
     23        (MediaPlayerPrivateGStreamer):
     24
    1252013-03-30  Praveen R Jadhav  <praveen.j@samsung.com>
    226
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

    r147206 r147279  
    3838#include "WebKitWebSourceGStreamer.h"
    3939#include <gst/gst.h>
     40#include <gst/pbutils/missing-plugins.h>
    4041#include <limits>
    4142#include <wtf/gobject/GOwnPtr.h>
     
    130131    player->notifyPlayerOfVideo();
    131132    return FALSE;
     133}
     134
     135static void mediaPlayerPrivatePluginInstallerResultFunction(GstInstallPluginsReturn result, gpointer userData)
     136{
     137    MediaPlayerPrivateGStreamer* player = reinterpret_cast<MediaPlayerPrivateGStreamer*>(userData);
     138    player->handlePluginInstallerResult(result);
    132139}
    133140
     
    213220    , m_preservesPitch(false)
    214221    , m_requestedState(GST_STATE_VOID_PENDING)
     222    , m_missingPlugins(false)
    215223{
    216224}
     
    686694    case GST_MESSAGE_ERROR:
    687695        if (m_resetPipeline)
     696            break;
     697        if (m_missingPlugins)
    688698            break;
    689699        gst_message_parse_error(message, &err.outPtr(), &debug.outPtr());
     
    766776        }
    767777        break;
     778    case GST_MESSAGE_ELEMENT:
     779        if (gst_is_missing_plugin_message(message)) {
     780            char* detail = gst_missing_plugin_message_get_installer_detail(message);
     781            GstInstallPluginsReturn result = gst_install_plugins_async(&detail, 0, mediaPlayerPrivatePluginInstallerResultFunction, this);
     782            m_missingPlugins = result == GST_INSTALL_PLUGINS_STARTED_OK;
     783        }
     784        break;
    768785    default:
    769786        LOG_MEDIA_MESSAGE("Unhandled GStreamer message type: %s",
     
    772789    }
    773790    return TRUE;
     791}
     792
     793void MediaPlayerPrivateGStreamer::handlePluginInstallerResult(GstInstallPluginsReturn result)
     794{
     795    m_missingPlugins = false;
     796    if (result == GST_INSTALL_PLUGINS_SUCCESS) {
     797        gst_element_set_state(m_playBin.get(), GST_STATE_READY);
     798        gst_element_set_state(m_playBin.get(), GST_STATE_PAUSED);
     799    }
    774800}
    775801
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h

    r146770 r147279  
    3131#include <glib.h>
    3232#include <gst/gst.h>
     33#include <gst/pbutils/install-plugins.h>
    3334#include <wtf/Forward.h>
    3435
     
    4445    static void registerMediaEngine(MediaEngineRegistrar);
    4546    gboolean handleMessage(GstMessage*);
     47    void handlePluginInstallerResult(GstInstallPluginsReturn);
    4648
    4749    bool hasVideo() const { return m_hasVideo; }
     
    163165    GstState m_requestedState;
    164166    GRefPtr<GstElement> m_autoAudioSink;
     167    bool m_missingPlugins;
    165168};
    166169}
Note: See TracChangeset for help on using the changeset viewer.