WebKit Bugzilla
Attachment 362824 Details for
Bug 194220
: [MSE][GStreamer] Batch player duration updates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194220-20190223133212.patch (text/plain), 5.59 KB, created by
Alicia Boya García
on 2019-02-23 04:32:14 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alicia Boya García
Created:
2019-02-23 04:32:14 PST
Size:
5.59 KB
patch
obsolete
>Subversion Revision: 241865 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 384c6eda7a23d255259b38b1a533b77d868a0cf4..e5ac8d05cfe90cbdcbd4151e1b48f975b5c57fe0 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,24 @@ >+2019-02-21 Alicia Boya GarcÃa <aboya@igalia.com> >+ >+ [MSE][GStreamer] Batch player duration updates >+ https://bugs.webkit.org/show_bug.cgi?id=194220 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This saves up a ton of CPU cycles doing layout unnecessarily when all >+ the appended frames extend the duration of the movie, like in >+ YTTV 2018 59.DASHLatencyVP9. >+ >+ This patch is an optimization that introduces no new behavior. >+ >+ * platform/graphics/gstreamer/mse/AppendPipeline.cpp: >+ (WebCore::AppendPipeline::consumeAppsinkAvailableSamples): >+ * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: >+ (WebCore::MediaPlayerPrivateGStreamerMSE::blockDurationChanges): >+ (WebCore::MediaPlayerPrivateGStreamerMSE::unblockDurationChanges): >+ (WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged): >+ * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h: >+ > 2019-02-21 Rob Buis <rbuis@igalia.com> > > Update MIME type parser >diff --git a/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp b/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp >index 97fc42a57a3fcf5136ca0bbe9cb1db9ad2de7574..cee536073a6ee4269beb6f99a47c190fc06478fe 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp >@@ -512,10 +512,15 @@ void AppendPipeline::consumeAppsinkAvailableSamples() > > GRefPtr<GstSample> sample; > int batchedSampleCount = 0; >+ // In some cases each frame increases the duration of the movie. >+ // Batch duration changes so that if we pick 100 of such samples we don't have to run 100 times >+ // layout for the video controls, but only once. >+ m_playerPrivate->blockDurationChanges(); > while ((sample = adoptGRef(gst_app_sink_try_pull_sample(GST_APP_SINK(m_appsink.get()), 0)))) { > appsinkNewSample(WTFMove(sample)); > batchedSampleCount++; > } >+ m_playerPrivate->unblockDurationChanges(); > > GST_TRACE_OBJECT(m_pipeline.get(), "batchedSampleCount = %d", batchedSampleCount); > } >diff --git a/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp b/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp >index 8769b524fd4490a21e5f9b8ce7b6b197fc7b415f..1c840a1b856b7dd6232a9efd84ce2abfeb55a066 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp >@@ -661,8 +661,28 @@ RefPtr<MediaSourceClientGStreamerMSE> MediaPlayerPrivateGStreamerMSE::mediaSourc > return m_mediaSourceClient; > } > >+void MediaPlayerPrivateGStreamerMSE::blockDurationChanges() >+{ >+ ASSERT(isMainThread()); >+ m_areDurationChangesBlocked = true; >+ m_shouldReportDurationWhenUnblocking = false; >+} >+ >+void MediaPlayerPrivateGStreamerMSE::unblockDurationChanges() >+{ >+ ASSERT(isMainThread()); >+ if (m_shouldReportDurationWhenUnblocking) { >+ m_player->durationChanged(); >+ m_playbackPipeline->notifyDurationChanged(); >+ m_shouldReportDurationWhenUnblocking = false; >+ } >+ >+ m_areDurationChangesBlocked = false; >+} >+ > void MediaPlayerPrivateGStreamerMSE::durationChanged() > { >+ ASSERT(isMainThread()); > if (!m_mediaSourceClient) { > GST_DEBUG("m_mediaSourceClient is null, doing nothing"); > return; >@@ -676,8 +696,11 @@ void MediaPlayerPrivateGStreamerMSE::durationChanged() > // Avoid emiting durationchanged in the case where the previous duration was 0 because that case is already handled > // by the HTMLMediaElement. > if (m_mediaTimeDuration != previousDuration && m_mediaTimeDuration.isValid() && previousDuration.isValid()) { >- m_player->durationChanged(); >- m_playbackPipeline->notifyDurationChanged(); >+ if (!m_areDurationChangesBlocked) { >+ m_player->durationChanged(); >+ m_playbackPipeline->notifyDurationChanged(); >+ } else >+ m_shouldReportDurationWhenUnblocking = true; > m_mediaSource->durationChanged(m_mediaTimeDuration); > } > } >diff --git a/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h b/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h >index 87aa2ac088f6748467299f995ca5eb2c1e0d1469..7d74057b9be9deb83d798ff88bb8953bdc6c1e00 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h >+++ b/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h >@@ -82,6 +82,9 @@ public: > void trackDetected(RefPtr<AppendPipeline>, RefPtr<WebCore::TrackPrivateBase>, bool firstTrackDetected); > void notifySeekNeedsDataForTime(const MediaTime&); > >+ void blockDurationChanges(); >+ void unblockDurationChanges(); >+ > private: > static void getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>&); > static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&); >@@ -111,6 +114,8 @@ private: > RefPtr<MediaSourceClientGStreamerMSE> m_mediaSourceClient; > MediaTime m_mediaTimeDuration; > bool m_mseSeekCompleted = true; >+ bool m_areDurationChangesBlocked = false; >+ bool m_shouldReportDurationWhenUnblocking = false; > RefPtr<PlaybackPipeline> m_playbackPipeline; > }; >
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 194220
:
361314
|
361317
|
362380
|
362381
|
362607
|
362616
|
362652
|
362742
|
362818
| 362824