Title: [164362] trunk/Source/WebCore
Revision
164362
Author
[email protected]
Date
2014-02-19 02:25:05 -0800 (Wed, 19 Feb 2014)

Log Message

[GStreamer] the GstPlayFlags enum diverged from upstream
https://bugs.webkit.org/show_bug.cgi?id=128957

Reviewed by Philippe Normand.

Removed the GstPlayFlags from the GStreamer implementation and
replaced by the use of the GFlags.

* platform/graphics/gstreamer/GStreamerUtilities.h:
* platform/graphics/gstreamer/GStreamerUtilities.cpp:
(WebCore::getGstPlaysFlag): Created to get the flags by using the
GFlags infrastructure.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering):
Replaced GST_PLAY_FLAG_DOWNLOAD with getGstPlaysFlag.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (164361 => 164362)


--- trunk/Source/WebCore/ChangeLog	2014-02-19 09:45:25 UTC (rev 164361)
+++ trunk/Source/WebCore/ChangeLog	2014-02-19 10:25:05 UTC (rev 164362)
@@ -1,3 +1,21 @@
+2014-02-19  Xabier Rodriguez Calvar  <[email protected]>
+
+        [GStreamer] the GstPlayFlags enum diverged from upstream
+        https://bugs.webkit.org/show_bug.cgi?id=128957
+
+        Reviewed by Philippe Normand.
+
+        Removed the GstPlayFlags from the GStreamer implementation and
+        replaced by the use of the GFlags.
+
+        * platform/graphics/gstreamer/GStreamerUtilities.h:
+        * platform/graphics/gstreamer/GStreamerUtilities.cpp:
+        (WebCore::getGstPlaysFlag): Created to get the flags by using the
+        GFlags infrastructure.
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering):
+        Replaced GST_PLAY_FLAG_DOWNLOAD with getGstPlaysFlag.
+
 2014-02-19  Zan Dobersek  <[email protected]>
 
         Replace WTF::bind() uses in RTCPeerConnection with C++11 lambdas

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.cpp (164361 => 164362)


--- trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.cpp	2014-02-19 09:45:25 UTC (rev 164361)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.cpp	2014-02-19 10:25:05 UTC (rev 164362)
@@ -133,6 +133,18 @@
     return gstInitialized;
 }
 
+unsigned getGstPlaysFlag(const char* nick)
+{
+    static GFlagsClass* flagsClass = static_cast<GFlagsClass*>(g_type_class_ref(g_type_from_name("GstPlayFlags")));
+    ASSERT(flagsClass);
+
+    GFlagsValue* flag = g_flags_get_value_by_nick(flagsClass, nick);
+    if (!flag)
+        return 0;
+
+    return flag->value;
 }
 
+}
+
 #endif // USE(GSTREAMER)

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.h (164361 => 164362)


--- trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.h	2014-02-19 09:45:25 UTC (rev 164361)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.h	2014-02-19 10:25:05 UTC (rev 164362)
@@ -72,5 +72,6 @@
 void mapGstBuffer(GstBuffer*);
 void unmapGstBuffer(GstBuffer*);
 bool initializeGStreamer();
+unsigned getGstPlaysFlag(const char* nick);
 
 }

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (164361 => 164362)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2014-02-19 09:45:25 UTC (rev 164361)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2014-02-19 10:25:05 UTC (rev 164362)
@@ -56,21 +56,6 @@
 #include "WebKitMediaSourceGStreamer.h"
 #endif
 
-// GstPlayFlags flags from playbin2. It is the policy of GStreamer to
-// not publicly expose element-specific enums. That's why this
-// GstPlayFlags enum has been copied here.
-typedef enum {
-    GST_PLAY_FLAG_VIDEO         = 0x00000001,
-    GST_PLAY_FLAG_AUDIO         = 0x00000002,
-    GST_PLAY_FLAG_TEXT          = 0x00000004,
-    GST_PLAY_FLAG_VIS           = 0x00000008,
-    GST_PLAY_FLAG_SOFT_VOLUME   = 0x00000010,
-    GST_PLAY_FLAG_NATIVE_AUDIO  = 0x00000020,
-    GST_PLAY_FLAG_NATIVE_VIDEO  = 0x00000040,
-    GST_PLAY_FLAG_DOWNLOAD      = 0x00000080,
-    GST_PLAY_FLAG_BUFFERING     = 0x000000100
-} GstPlayFlags;
-
 // Max interval in seconds to stay in the READY state on manual
 // state change requests.
 static const guint gReadyStateTimerInterval = 60;
@@ -1784,21 +1769,23 @@
     if (!m_playBin)
         return;
 
-    GstPlayFlags flags;
+    unsigned flags;
     g_object_get(m_playBin.get(), "flags", &flags, NULL);
 
+    unsigned flagDownload = getGstPlaysFlag("download");
+
     // We don't want to stop downloading if we already started it.
-    if (flags & GST_PLAY_FLAG_DOWNLOAD && m_readyState > MediaPlayer::HaveNothing && !m_resetPipeline)
+    if (flags & flagDownload && m_readyState > MediaPlayer::HaveNothing && !m_resetPipeline)
         return;
 
     bool shouldDownload = !isLiveStream() && m_preload == MediaPlayer::Auto;
     if (shouldDownload) {
         LOG_MEDIA_MESSAGE("Enabling on-disk buffering");
-        g_object_set(m_playBin.get(), "flags", flags | GST_PLAY_FLAG_DOWNLOAD, NULL);
+        g_object_set(m_playBin.get(), "flags", flags | flagDownload, NULL);
         m_fillTimer.startRepeating(0.2);
     } else {
         LOG_MEDIA_MESSAGE("Disabling on-disk buffering");
-        g_object_set(m_playBin.get(), "flags", flags & ~GST_PLAY_FLAG_DOWNLOAD, NULL);
+        g_object_set(m_playBin.get(), "flags", flags & ~flagDownload, NULL);
         m_fillTimer.stop();
     }
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to