Title: [240783] trunk/Source/WebCore
Revision
240783
Author
ab...@igalia.com
Date
2019-01-31 06:52:44 -0800 (Thu, 31 Jan 2019)

Log Message

[MSE][GStreamer] Remove if (m_playerPrivate) from MediaSourceClientGStreamerMSE
https://bugs.webkit.org/show_bug.cgi?id=194069

Reviewed by Xabier Rodriguez-Calvar.

m_playerPrivate is non-NULL since MediaSourceClientGStreamerMSE
creation well until its destruction.

The only case that could make a NULL m_playerPrivate is
clearPlayerPrivate() but that method is not used anymore.

* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
(WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer):
(WebCore::MediaSourceClientGStreamerMSE::durationChanged):
(WebCore::MediaSourceClientGStreamerMSE::abort):
(WebCore::MediaSourceClientGStreamerMSE::resetParserState):
(WebCore::MediaSourceClientGStreamerMSE::markEndOfStream):
(WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
(WebCore::MediaSourceClientGStreamerMSE::flush):
(WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
(WebCore::MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued):
(WebCore::MediaSourceClientGStreamerMSE::webKitMediaSrc):
(WebCore::MediaSourceClientGStreamerMSE::clearPlayerPrivate): Deleted.
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (240782 => 240783)


--- trunk/Source/WebCore/ChangeLog	2019-01-31 14:24:05 UTC (rev 240782)
+++ trunk/Source/WebCore/ChangeLog	2019-01-31 14:52:44 UTC (rev 240783)
@@ -1,3 +1,30 @@
+2019-01-31  Alicia Boya GarcĂ­a  <ab...@igalia.com>
+
+        [MSE][GStreamer] Remove if (m_playerPrivate) from MediaSourceClientGStreamerMSE
+        https://bugs.webkit.org/show_bug.cgi?id=194069
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        m_playerPrivate is non-NULL since MediaSourceClientGStreamerMSE
+        creation well until its destruction.
+
+        The only case that could make a NULL m_playerPrivate is
+        clearPlayerPrivate() but that method is not used anymore.
+
+        * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
+        (WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer):
+        (WebCore::MediaSourceClientGStreamerMSE::durationChanged):
+        (WebCore::MediaSourceClientGStreamerMSE::abort):
+        (WebCore::MediaSourceClientGStreamerMSE::resetParserState):
+        (WebCore::MediaSourceClientGStreamerMSE::markEndOfStream):
+        (WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
+        (WebCore::MediaSourceClientGStreamerMSE::flush):
+        (WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
+        (WebCore::MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued):
+        (WebCore::MediaSourceClientGStreamerMSE::webKitMediaSrc):
+        (WebCore::MediaSourceClientGStreamerMSE::clearPlayerPrivate): Deleted.
+        * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
+
 2019-01-31  Thibault Saunier  <tsaun...@igalia.com>
 
         [GStreamer][WebRTC] Avoid returning FLUSHING when it is not the case in GStreamerMediaStreamSource

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp (240782 => 240783)


--- trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp	2019-01-31 14:24:05 UTC (rev 240782)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp	2019-01-31 14:52:44 UTC (rev 240783)
@@ -60,9 +60,6 @@
 {
     ASSERT(WTF::isMainThread());
 
-    if (!m_playerPrivate)
-        return MediaSourcePrivate::AddStatus::NotSupported;
-
     ASSERT(m_playerPrivate->m_playbackPipeline);
     ASSERT(sourceBufferPrivate);
 
@@ -89,8 +86,7 @@
         return;
 
     m_duration = duration;
-    if (m_playerPrivate)
-        m_playerPrivate->durationChanged();
+    m_playerPrivate->durationChanged();
 }
 
 void MediaSourceClientGStreamerMSE::abort(RefPtr<SourceBufferPrivateGStreamer> sourceBufferPrivate)
@@ -99,9 +95,6 @@
 
     GST_DEBUG("aborting");
 
-    if (!m_playerPrivate)
-        return;
-
     RefPtr<AppendPipeline> appendPipeline = m_playerPrivate->m_appendPipelinesMap.get(sourceBufferPrivate);
 
     ASSERT(appendPipeline);
@@ -115,9 +108,6 @@
 
     GST_DEBUG("resetting parser state");
 
-    if (!m_playerPrivate)
-        return;
-
     RefPtr<AppendPipeline> appendPipeline = m_playerPrivate->m_appendPipelinesMap.get(sourceBufferPrivate);
 
     ASSERT(appendPipeline);
@@ -154,9 +144,6 @@
 {
     ASSERT(WTF::isMainThread());
 
-    if (!m_playerPrivate)
-        return;
-
     m_playerPrivate->markEndOfStream(status);
 }
 
@@ -164,9 +151,6 @@
 {
     ASSERT(WTF::isMainThread());
 
-    if (!m_playerPrivate)
-        return;
-
     ASSERT(m_playerPrivate->m_playbackPipeline);
 
     // Remove the AppendPipeline from the map. This should cause its destruction since there should be no alive
@@ -182,7 +166,7 @@
     ASSERT(WTF::isMainThread());
 
     // This is only for on-the-fly reenqueues after appends. When seeking, the seek will do its own flush.
-    if (m_playerPrivate && !m_playerPrivate->m_seeking)
+    if (!m_playerPrivate->m_seeking)
         m_playerPrivate->m_playbackPipeline->flush(trackId);
 }
 
@@ -190,8 +174,7 @@
 {
     ASSERT(WTF::isMainThread());
 
-    if (m_playerPrivate)
-        m_playerPrivate->m_playbackPipeline->enqueueSample(WTFMove(sample));
+    m_playerPrivate->m_playbackPipeline->enqueueSample(WTFMove(sample));
 }
 
 void MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued(const AtomicString& trackId)
@@ -198,8 +181,7 @@
 {
     ASSERT(WTF::isMainThread());
 
-    if (m_playerPrivate)
-        m_playerPrivate->m_playbackPipeline->allSamplesInTrackEnqueued(trackId);
+    m_playerPrivate->m_playbackPipeline->allSamplesInTrackEnqueued(trackId);
 }
 
 GRefPtr<WebKitMediaSrc> MediaSourceClientGStreamerMSE::webKitMediaSrc()
@@ -206,9 +188,6 @@
 {
     ASSERT(WTF::isMainThread());
 
-    if (!m_playerPrivate)
-        return nullptr;
-
     WebKitMediaSrc* source = WEBKIT_MEDIA_SRC(m_playerPrivate->m_source.get());
 
     ASSERT(WEBKIT_IS_MEDIA_SRC(source));
@@ -216,13 +195,6 @@
     return source;
 }
 
-void MediaSourceClientGStreamerMSE::clearPlayerPrivate()
-{
-    ASSERT(WTF::isMainThread());
-
-    m_playerPrivate = nullptr;
-}
-
 } // namespace WebCore.
 
 #endif // USE(GSTREAMER)

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h (240782 => 240783)


--- trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h	2019-01-31 14:24:05 UTC (rev 240782)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h	2019-01-31 14:52:44 UTC (rev 240783)
@@ -54,8 +54,6 @@
     void enqueueSample(Ref<MediaSample>&&);
     void allSamplesInTrackEnqueued(const AtomicString&);
 
-    void clearPlayerPrivate();
-
     const MediaTime& duration();
     GRefPtr<WebKitMediaSrc> webKitMediaSrc();
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to