[GStreamer] WebVTT caps changed in GStreamer 1.14
authorphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Feb 2018 10:11:26 +0000 (10:11 +0000)
committerphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Feb 2018 10:11:26 +0000 (10:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=182690

Reviewed by Xabier Rodriguez-Calvar.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Use
text/vtt caps only for GStreamer versions inferior or equal to
1.12. In 1.13 (current git master) the VTT caps format changed to
application/x-subtitle-vtt.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228508 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

index a3440fb..5a674a7 100644 (file)
@@ -1,3 +1,16 @@
+2018-02-15  Philippe Normand  <pnormand@igalia.com>
+
+        [GStreamer] WebVTT caps changed in GStreamer 1.14
+        https://bugs.webkit.org/show_bug.cgi?id=182690
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Use
+        text/vtt caps only for GStreamer versions inferior or equal to
+        1.12. In 1.13 (current git master) the VTT caps format changed to
+        application/x-subtitle-vtt.
+
 2018-02-15  Zan Dobersek  <zdobersek@igalia.com>
 
         HarfBuzzFace should not be ref-counted
index 6d1df7e..e4d7b1f 100644 (file)
@@ -2166,7 +2166,11 @@ void MediaPlayerPrivateGStreamer::createGSTPlayBin()
     m_textAppSinkPad = adoptGRef(gst_element_get_static_pad(m_textAppSink.get(), "sink"));
     ASSERT(m_textAppSinkPad);
 
-    GRefPtr<GstCaps> textCaps = adoptGRef(gst_caps_new_empty_simple("text/vtt"));
+    GRefPtr<GstCaps> textCaps;
+    if (webkitGstCheckVersion(1, 13, 0))
+        textCaps = adoptGRef(gst_caps_new_empty_simple("application/x-subtitle-vtt"));
+    else
+        textCaps = adoptGRef(gst_caps_new_empty_simple("text/vtt"));
     g_object_set(m_textAppSink.get(), "emit-signals", TRUE, "enable-last-sample", FALSE, "caps", textCaps.get(), nullptr);
     g_signal_connect_swapped(m_textAppSink.get(), "new-sample", G_CALLBACK(newTextSampleCallback), this);