-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MSE] Remove need for SourceBufferPrivate to query MediaSource duration #21256
[MSE] Remove need for SourceBufferPrivate to query MediaSource duration #21256
Conversation
EWS run on previous version of this PR (hash 7288f22) |
7288f22
to
a401e56
Compare
EWS run on current version of this PR (hash a401e56) |
@@ -129,6 +130,8 @@ class SourceBufferPrivate | |||
WEBCORE_EXPORT void setClient(SourceBufferPrivateClient&); | |||
WEBCORE_EXPORT void detach(); | |||
|
|||
void setMediaSourceDuration(const MediaTime& duration) { m_mediaSourceDuration = duration; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be MediaTime, since it is basically smaller than a uint64_t
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not really.
a MediaTime is :
union {
int64_t m_timeValue;
double m_timeValueAsDouble;
};
uint32_t m_timeScale;
uint8_t m_timeFlags;
so it's 16 bytes as uint8_t would take a word.
https://bugs.webkit.org/show_bug.cgi?id=265778 rdar://119114938 Reviewed by Youenn Fablet. We notify each SourceBufferPrivate that the MediaSource duration has changed and use this cache value instead. Covered by existing tests, no change in observable behaviour. * Source/WebCore/Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::MediaSource): (WebCore::MediaSource::hasFutureTime): (WebCore::MediaSource::setDurationInternal): * Source/WebCore/Modules/mediasource/MediaSource.h: * Source/WebCore/platform/graphics/MediaSourcePrivate.cpp: (WebCore::MediaSourcePrivate::hasFutureTime const): We don't need to pass the duration nor the buffered range as the MediaSourcePrivate owns this information anyway. (WebCore::MediaSourcePrivate::duration const): (WebCore::MediaSourcePrivate::durationChanged): * Source/WebCore/platform/graphics/MediaSourcePrivate.h: * Source/WebCore/platform/graphics/MediaSourcePrivateClient.h: * Source/WebCore/platform/graphics/SourceBufferPrivate.cpp: (WebCore::SourceBufferPrivate::mediaSourceDuration const): Rename duration() to mediaSourceDuration() to remove ambiguity as to which duration this is related to. (WebCore::SourceBufferPrivate::append): (WebCore::SourceBufferPrivate::duration const): Deleted. * Source/WebCore/platform/graphics/SourceBufferPrivate.h: (WebCore::SourceBufferPrivate::setMediaSourceDuration): * Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::currentMediaTimeMayProgress const): * Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: (WebCore::MediaSourcePrivateAVFObjC::durationChanged): * Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::load): (WebCore::MediaPlayerPrivateGStreamerMSE::doSeek): (WebCore::MediaPlayerPrivateGStreamerMSE::buffered const): (WebCore::MediaPlayerPrivateGStreamerMSE::sourceSetup): (WebCore::MediaPlayerPrivateGStreamerMSE::isTimeBuffered const): (WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged): * Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h: remove need to keep reference to MediaSourcePrivateClient, it was an API violation for the MediaPlayerPrivate to talk to the MediaSourcePrivateClient, this interface is reserved for the MediaSourcePrivate to talk to the MediaSource. The MediaPlayerPrivateGStreamerMSE already contains a strong reference to the MediaSourcePrivate so we query it directly instead. (The MediaSourcePrivateClient would have queried its private anyway) (WebCore::MediaPlayerPrivateGStreamerMSE::mediaSourcePrivateClient): Deleted. * Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp: (WebCore::MockMediaPlayerMediaSource::currentMediaTimeMayProgress const): * Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp: (WebCore::MockMediaSourcePrivate::durationChanged): * Source/WebKit/GPUProcess/media/RemoteMediaSourceProxy.cpp: (WebKit::RemoteMediaSourceProxy::durationChanged): (WebKit::RemoteMediaSourceProxy::duration const): Deleted. * Source/WebKit/GPUProcess/media/RemoteMediaSourceProxy.h: Canonical link: https://commits.webkit.org/271514@main
a401e56
to
adb77f8
Compare
Committed 271514@main (adb77f8): https://commits.webkit.org/271514@main Reviewed commits have been landed. Closing PR #21256 and removing active labels. |
adb77f8
a401e56