[GStreamer] Start implementing Audio/VideoTrackPrivateGSTreamer::kind method
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Apr 2018 13:39:53 +0000 (13:39 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Apr 2018 13:39:53 +0000 (13:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=184650

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-04-23
Reviewed by Philippe Normand.

In the playbin3 case we can assume that if the GstStream is selected by default,
it is the Main track of that kind.

No new tests are added as:
    * It relies on playbin3 case which support might be compiled out
    * we already have a few test that are currently disabled in the mediastream
      testsuite. This patch is part of the work to enable them.

* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
(WebCore::AudioTrackPrivateGStreamer::kind const):
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
(WebCore::VideoTrackPrivateGStreamer::kind const):
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h
Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h

index c54ceba..be8d167 100644 (file)
@@ -1,3 +1,25 @@
+2018-04-23  Thibault Saunier  <tsaunier@igalia.com>
+
+        [GStreamer] Start implementing Audio/VideoTrackPrivateGSTreamer::kind method
+        https://bugs.webkit.org/show_bug.cgi?id=184650
+
+        Reviewed by Philippe Normand.
+
+        In the playbin3 case we can assume that if the GstStream is selected by default,
+        it is the Main track of that kind.
+
+        No new tests are added as:
+            * It relies on playbin3 case which support might be compiled out
+            * we already have a few test that are currently disabled in the mediastream
+              testsuite. This patch is part of the work to enable them.
+
+        * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
+        (WebCore::AudioTrackPrivateGStreamer::kind const):
+        * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
+        * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
+        (WebCore::VideoTrackPrivateGStreamer::kind const):
+        * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
+
 2018-04-23  Alicia Boya GarcĂ­a  <aboya@igalia.com>
 
         [MSE] Add allSamplesInTrackEnqueued event
index 8c226bc..dd1f3bb 100644 (file)
@@ -52,6 +52,14 @@ AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer(WeakPtr<MediaPlayerPrivat
     setActive(gst_stream_get_stream_flags(stream.get()) & GST_STREAM_FLAG_SELECT);
     notifyTrackOfActiveChanged();
 }
+
+AudioTrackPrivate::Kind AudioTrackPrivateGStreamer::kind() const
+{
+    if (m_stream.get() && gst_stream_get_stream_flags(m_stream.get()) & GST_STREAM_FLAG_SELECT)
+        return AudioTrackPrivate::Kind::Main;
+
+    return AudioTrackPrivate::kind();
+}
 #endif
 
 void AudioTrackPrivateGStreamer::disconnect()
index ca05958..8b954ae 100644 (file)
@@ -48,6 +48,8 @@ public:
     {
         return adoptRef(*new AudioTrackPrivateGStreamer(player, index, stream));
     }
+
+    Kind kind() const final;
 #endif
 
     void disconnect() override;
index 1c23a4c..c54200e 100644 (file)
@@ -52,6 +52,14 @@ VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer(WeakPtr<MediaPlayerPrivat
     setActive(gst_stream_get_stream_flags(stream.get()) & GST_STREAM_FLAG_SELECT);
     notifyTrackOfActiveChanged();
 }
+
+VideoTrackPrivate::Kind VideoTrackPrivateGStreamer::kind() const
+{
+    if (m_stream.get() && gst_stream_get_stream_flags(m_stream.get()) & GST_STREAM_FLAG_SELECT)
+        return VideoTrackPrivate::Kind::Main;
+
+    return VideoTrackPrivate::kind();
+}
 #endif
 
 void VideoTrackPrivateGStreamer::disconnect()
index 4c27fb6..74ba717 100644 (file)
@@ -48,6 +48,7 @@ public:
     {
         return adoptRef(*new VideoTrackPrivateGStreamer(player, index, stream));
     }
+    Kind kind() const final;
 #endif
 
     void disconnect() override;