WebKit Bugzilla
Attachment 360727 Details for
Bug 194091
: [MSE][GStreamer] Use reference instead of pointer in m_playerPrivate
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194091-20190131170553.patch (text/plain), 8.18 KB, created by
Alicia Boya García
on 2019-01-31 08:05:54 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alicia Boya García
Created:
2019-01-31 08:05:54 PST
Size:
8.18 KB
patch
obsolete
>Subversion Revision: 240726 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 20aa8de6278528f9bfb5b8c5c74af1b494982100..ef58f506fbaf0562e621bac0bc5048f5deed0c25 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,29 @@ >+2019-01-31 Alicia Boya GarcÃa <aboya@igalia.com> >+ >+ [MSE][GStreamer] Use reference instead of pointer in m_playerPrivate >+ https://bugs.webkit.org/show_bug.cgi?id=194091 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Since the pointer is initialized with the class, it's never null and >+ never changes, it's preferrable to use a reference instead of a >+ pointer. >+ >+ * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp: >+ (WebCore::MediaSourceClientGStreamerMSE::MediaSourceClientGStreamerMSE): >+ (WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer): >+ (WebCore::MediaSourceClientGStreamerMSE::durationChanged): >+ (WebCore::MediaSourceClientGStreamerMSE::abort): >+ (WebCore::MediaSourceClientGStreamerMSE::resetParserState): >+ (WebCore::MediaSourceClientGStreamerMSE::append): >+ (WebCore::MediaSourceClientGStreamerMSE::markEndOfStream): >+ (WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource): >+ (WebCore::MediaSourceClientGStreamerMSE::flush): >+ (WebCore::MediaSourceClientGStreamerMSE::enqueueSample): >+ (WebCore::MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued): >+ (WebCore::MediaSourceClientGStreamerMSE::webKitMediaSrc): >+ * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h: >+ > 2019-01-30 Alicia Boya GarcÃa <aboya@igalia.com> > > [MSE][GStreamer] Remove if (m_playerPrivate) from MediaSourceClientGStreamerMSE >diff --git a/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp b/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp >index 3fe48bbf547ddda016f2fdbc82f1073b45a44e94..f2edfa4928cd6aaf886ba20d0440c1df686fdcb9 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp >@@ -45,7 +45,7 @@ Ref<MediaSourceClientGStreamerMSE> MediaSourceClientGStreamerMSE::create(MediaPl > } > > MediaSourceClientGStreamerMSE::MediaSourceClientGStreamerMSE(MediaPlayerPrivateGStreamerMSE& playerPrivate) >- : m_playerPrivate(&playerPrivate) >+ : m_playerPrivate(playerPrivate) > , m_duration(MediaTime::invalidTime()) > { > ASSERT(WTF::isMainThread()); >@@ -60,14 +60,14 @@ MediaSourcePrivate::AddStatus MediaSourceClientGStreamerMSE::addSourceBuffer(Ref > { > ASSERT(WTF::isMainThread()); > >- ASSERT(m_playerPrivate->m_playbackPipeline); >+ ASSERT(m_playerPrivate.m_playbackPipeline); > ASSERT(sourceBufferPrivate); > >- RefPtr<AppendPipeline> appendPipeline = adoptRef(new AppendPipeline(*this, *sourceBufferPrivate, *m_playerPrivate)); >+ RefPtr<AppendPipeline> appendPipeline = adoptRef(new AppendPipeline(*this, *sourceBufferPrivate, m_playerPrivate)); > GST_TRACE("Adding SourceBuffer to AppendPipeline: this=%p sourceBuffer=%p appendPipeline=%p", this, sourceBufferPrivate.get(), appendPipeline.get()); >- m_playerPrivate->m_appendPipelinesMap.add(sourceBufferPrivate, appendPipeline); >+ m_playerPrivate.m_appendPipelinesMap.add(sourceBufferPrivate, appendPipeline); > >- return m_playerPrivate->m_playbackPipeline->addSourceBuffer(sourceBufferPrivate); >+ return m_playerPrivate.m_playbackPipeline->addSourceBuffer(sourceBufferPrivate); > } > > const MediaTime& MediaSourceClientGStreamerMSE::duration() >@@ -86,7 +86,7 @@ void MediaSourceClientGStreamerMSE::durationChanged(const MediaTime& duration) > return; > > m_duration = duration; >- m_playerPrivate->durationChanged(); >+ m_playerPrivate.durationChanged(); > } > > void MediaSourceClientGStreamerMSE::abort(RefPtr<SourceBufferPrivateGStreamer> sourceBufferPrivate) >@@ -95,7 +95,7 @@ void MediaSourceClientGStreamerMSE::abort(RefPtr<SourceBufferPrivateGStreamer> s > > GST_DEBUG("aborting"); > >- RefPtr<AppendPipeline> appendPipeline = m_playerPrivate->m_appendPipelinesMap.get(sourceBufferPrivate); >+ RefPtr<AppendPipeline> appendPipeline = m_playerPrivate.m_appendPipelinesMap.get(sourceBufferPrivate); > > ASSERT(appendPipeline); > >@@ -108,7 +108,7 @@ void MediaSourceClientGStreamerMSE::resetParserState(RefPtr<SourceBufferPrivateG > > GST_DEBUG("resetting parser state"); > >- RefPtr<AppendPipeline> appendPipeline = m_playerPrivate->m_appendPipelinesMap.get(sourceBufferPrivate); >+ RefPtr<AppendPipeline> appendPipeline = m_playerPrivate.m_appendPipelinesMap.get(sourceBufferPrivate); > > ASSERT(appendPipeline); > >@@ -123,7 +123,7 @@ void MediaSourceClientGStreamerMSE::append(RefPtr<SourceBufferPrivateGStreamer> > > ASSERT(m_playerPrivate); > >- RefPtr<AppendPipeline> appendPipeline = m_playerPrivate->m_appendPipelinesMap.get(sourceBufferPrivate); >+ RefPtr<AppendPipeline> appendPipeline = m_playerPrivate.m_appendPipelinesMap.get(sourceBufferPrivate); > > ASSERT(appendPipeline); > >@@ -143,21 +143,21 @@ void MediaSourceClientGStreamerMSE::markEndOfStream(MediaSourcePrivate::EndOfStr > { > ASSERT(WTF::isMainThread()); > >- m_playerPrivate->markEndOfStream(status); >+ m_playerPrivate.markEndOfStream(status); > } > > void MediaSourceClientGStreamerMSE::removedFromMediaSource(RefPtr<SourceBufferPrivateGStreamer> sourceBufferPrivate) > { > ASSERT(WTF::isMainThread()); > >- ASSERT(m_playerPrivate->m_playbackPipeline); >+ ASSERT(m_playerPrivate.m_playbackPipeline); > > // Remove the AppendPipeline from the map. This should cause its destruction since there should be no alive > // references at this point. >- ASSERT(m_playerPrivate->m_appendPipelinesMap.get(sourceBufferPrivate)->hasOneRef()); >- m_playerPrivate->m_appendPipelinesMap.remove(sourceBufferPrivate); >+ ASSERT(m_playerPrivate.m_appendPipelinesMap.get(sourceBufferPrivate)->hasOneRef()); >+ m_playerPrivate.m_appendPipelinesMap.remove(sourceBufferPrivate); > >- m_playerPrivate->m_playbackPipeline->removeSourceBuffer(sourceBufferPrivate); >+ m_playerPrivate.m_playbackPipeline->removeSourceBuffer(sourceBufferPrivate); > } > > void MediaSourceClientGStreamerMSE::flush(AtomicString trackId) >@@ -165,29 +165,29 @@ void MediaSourceClientGStreamerMSE::flush(AtomicString trackId) > 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_seeking) >- m_playerPrivate->m_playbackPipeline->flush(trackId); >+ if (!m_playerPrivate.m_seeking) >+ m_playerPrivate.m_playbackPipeline->flush(trackId); > } > > void MediaSourceClientGStreamerMSE::enqueueSample(Ref<MediaSample>&& sample) > { > ASSERT(WTF::isMainThread()); > >- m_playerPrivate->m_playbackPipeline->enqueueSample(WTFMove(sample)); >+ m_playerPrivate.m_playbackPipeline->enqueueSample(WTFMove(sample)); > } > > void MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued(const AtomicString& trackId) > { > ASSERT(WTF::isMainThread()); > >- m_playerPrivate->m_playbackPipeline->allSamplesInTrackEnqueued(trackId); >+ m_playerPrivate.m_playbackPipeline->allSamplesInTrackEnqueued(trackId); > } > > GRefPtr<WebKitMediaSrc> MediaSourceClientGStreamerMSE::webKitMediaSrc() > { > ASSERT(WTF::isMainThread()); > >- WebKitMediaSrc* source = WEBKIT_MEDIA_SRC(m_playerPrivate->m_source.get()); >+ WebKitMediaSrc* source = WEBKIT_MEDIA_SRC(m_playerPrivate.m_source.get()); > > ASSERT(WEBKIT_IS_MEDIA_SRC(source)); > >diff --git a/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h b/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h >index a2360bcdc0c030a6a8562f2c13ba906177197c4a..b381e69a1808374c577ce39e2623525fd41f4274 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h >+++ b/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h >@@ -60,7 +60,7 @@ public: > private: > MediaSourceClientGStreamerMSE(MediaPlayerPrivateGStreamerMSE&); > >- MediaPlayerPrivateGStreamerMSE* m_playerPrivate; >+ MediaPlayerPrivateGStreamerMSE& m_playerPrivate; > MediaTime m_duration; > }; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194091
: 360727