Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 27f78b632f899bf8da735cb3fb14c8ae06d3ba30
https://github.com/WebKit/WebKit/commit/27f78b632f899bf8da735cb3fb14c8ae06d3ba30
Author: Jean-Yves Avenard <[email protected]>
Date: 2025-11-23 (Sun, 23 Nov 2025)
Changed paths:
M LayoutTests/media/media-source/media-detachablemse-append-expected.txt
M LayoutTests/media/media-source/media-detachablemse-append.html
M Source/WebCore/platform/graphics/MediaPlayerPrivate.h
M Source/WebCore/platform/graphics/MediaSourcePrivate.cpp
M Source/WebCore/platform/graphics/MediaSourcePrivate.h
M Source/WebCore/platform/graphics/SourceBufferPrivate.cpp
M Source/WebCore/platform/graphics/SourceBufferPrivate.h
M
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h
M
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
M
Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h
M
Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm
M
Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h
M
Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm
M Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp
M Source/WebKit/WebProcess/GPU/media/MediaSourcePrivateRemote.cpp
Log Message:
-----------
MediaSourcePrivate/SourceBufferPrivate should run on their own work queue.
https://bugs.webkit.org/show_bug.cgi?id=302054
rdar://164133100
Reviewed by Youenn Fablet.
Preliminary work had been earlier done to SourceBufferPrivate and
MediaSourcePrivate
to use a dedicated queue. However this work was never completed and the queue
used was always the main thread.
We complete this work so that a different workqueue can be provided and
adopt it with the AVFoundation port of MSE.
This will allow to easily have SourceBuffer and MediaSource object runs
in a different thread (e.g a worker) than their private counterparts.
For now, the dedicated workqueue is only enabled when the MediaPlayerPrivate
is running in the web content process; in the GPU process we will continue
to use the main thread.
No observable changes, covered by existing tests.
* LayoutTests/media/media-source/media-detachablemse-append-expected.txt:
* LayoutTests/media/media-source/media-detachablemse-append.html: Test was
missing an `await`
*
LayoutTests/media/media-source/media-source-webm-append-buffer-after-abort-expected.txt:
*
LayoutTests/media/media-source/media-source-webm-append-buffer-after-abort.html:
Update event can be fired at anytime. Make the event silent.
* Source/WebCore/Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
(WebCore::SourceBuffer::sourceBufferPrivateBufferedChanged):
* Source/WebCore/platform/graphics/MediaSourcePrivate.cpp:
(WebCore::MediaSourcePrivate::seekToTime):
(WebCore::MediaSourcePrivate::removeSourceBuffer):
(WebCore::MediaSourcePrivate::hasAudio const):
(WebCore::MediaSourcePrivate::hasVideo const):
(WebCore::MediaSourcePrivate::tracksTypeChanged):
(WebCore::MediaSourcePrivate::updateTracksType):
(WebCore::MediaSourcePrivate::durationChanged):
(WebCore::MediaSourcePrivate::trackBufferedChanged):
(WebCore::MediaSourcePrivate::updateBufferedRanges):
* Source/WebCore/platform/graphics/MediaSourcePrivate.h:
* Source/WebCore/platform/graphics/SourceBufferPrivate.cpp:
(WebCore::SourceBufferPrivate::setMediaSourceDuration):
(WebCore::SourceBufferPrivate::mediaSourceDuration const):
(WebCore::SourceBufferPrivate::setMode):
(WebCore::SourceBufferPrivate::resetTimestampOffsetInTrackBuffers):
(WebCore::SourceBufferPrivate::startChangingType):
(WebCore::SourceBufferPrivate::resetTrackBuffers):
(WebCore::SourceBufferPrivate::setTimestampOffset):
(WebCore::SourceBufferPrivate::setAppendWindowStart):
(WebCore::SourceBufferPrivate::setAppendWindowEnd):
(WebCore::SourceBufferPrivate::timestampOffset const):
(WebCore::SourceBufferPrivate::appendWindow const):
(WebCore::SourceBufferPrivate::updateHighestPresentationTimestamp):
(WebCore::SourceBufferPrivate::trackBuffersRanges const):
(WebCore::SourceBufferPrivate::hasAudio const):
(WebCore::SourceBufferPrivate::hasVideo const):
(WebCore::SourceBufferPrivate::hasReceivedFirstInitializationSegment const):
(WebCore::SourceBufferPrivate::reenqueSamples):
(WebCore::SourceBufferPrivate::computeSeekTime):
(WebCore::SourceBufferPrivate::seekToTime):
(WebCore::SourceBufferPrivate::clearTrackBuffers):
(WebCore::SourceBufferPrivate::bufferedSamplesForTrackId):
(WebCore::SourceBufferPrivate::minimumUpcomingPresentationTimeForTrackID):
(WebCore::SourceBufferPrivate::updateMinimumUpcomingPresentationTime):
(WebCore::SourceBufferPrivate::setMediaSourceEnded):
(WebCore::SourceBufferPrivate::trySignalAllSamplesInTrackEnqueued):
(WebCore::SourceBufferPrivate::provideMediaData):
(WebCore::SourceBufferPrivate::reenqueueMediaForTime):
(WebCore::SourceBufferPrivate::reenqueueMediaIfNeeded):
(WebCore::SourceBufferPrivate::removeCodedFramesInternal):
(WebCore::SourceBufferPrivate::setMaximumBufferSize):
(WebCore::SourceBufferPrivate::computeEvictionData):
(WebCore::SourceBufferPrivate::hasTooManySamples const):
(WebCore::SourceBufferPrivate::asyncEvictCodedFrames):
(WebCore::SourceBufferPrivate::evictCodedFrames):
(WebCore::SourceBufferPrivate::evictCodedFramesInternal):
(WebCore::SourceBufferPrivate::isBufferFullFor const):
(WebCore::SourceBufferPrivate::canAppend const):
(WebCore::SourceBufferPrivate::evictionData const):
(WebCore::SourceBufferPrivate::contentSize const):
(WebCore::SourceBufferPrivate::addTrackBuffer):
(WebCore::SourceBufferPrivate::updateTrackIds):
(WebCore::SourceBufferPrivate::setAllTrackBuffersNeedRandomAccess):
(WebCore::SourceBufferPrivate::setGroupStartTimestamp):
(WebCore::SourceBufferPrivate::setGroupStartTimestampToEndTimestamp):
(WebCore::SourceBufferPrivate::setShouldGenerateTimestamps):
(WebCore::SourceBufferPrivate::protectedCurrentAppendProcessing const):
(WebCore::SourceBufferPrivate::didReceiveInitializationSegment):
(WebCore::SourceBufferPrivate::didUpdateFormatDescriptionForTrackId):
(WebCore::SourceBufferPrivate::validateInitializationSegment):
(WebCore::SourceBufferPrivate::didReceiveSample):
(WebCore::SourceBufferPrivate::append):
(WebCore::SourceBufferPrivate::processPendingMediaSamples):
(WebCore::SourceBufferPrivate::processMediaSample):
(WebCore::SourceBufferPrivate::memoryPressure):
(WebCore::SourceBufferPrivate::protectedCurrentSourceBufferOperation const):
(WebCore::SourceBufferPrivate::minimumBufferedTime const):
(WebCore::SourceBufferPrivate::maximumBufferedTime const):
(WebCore::SourceBufferPrivate::evictFrames):
(WebCore::SourceBufferPrivate::setActive):
(WebCore::SourceBufferPrivate::iterateTrackBuffers):
(WebCore::SourceBufferPrivate::iterateTrackBuffers const):
(WebCore::SourceBufferPrivate::ensureWeakOnDispatcher):
(WebCore::SourceBufferPrivate::attach):
* Source/WebCore/platform/graphics/SourceBufferPrivate.h:
(WebCore::SourceBufferPrivate::WTF_GUARDED_BY_CAPABILITY):
(WebCore::SourceBufferPrivate::WTF_GUARDED_BY_LOCK):
(WebCore::SourceBufferPrivate::setMode): Deleted.
(WebCore::SourceBufferPrivate::setGroupStartTimestamp): Deleted.
(WebCore::SourceBufferPrivate::setGroupStartTimestampToEndTimestamp): Deleted.
(WebCore::SourceBufferPrivate::setShouldGenerateTimestamps): Deleted.
(WebCore::SourceBufferPrivate::startChangingType): Deleted.
(WebCore::SourceBufferPrivate::setTimestampOffset): Deleted.
(WebCore::SourceBufferPrivate::setAppendWindowStart): Deleted.
(WebCore::SourceBufferPrivate::setAppendWindowEnd): Deleted.
(WebCore::SourceBufferPrivate::setMediaSourceDuration): Deleted.
(WebCore::SourceBufferPrivate::evictionData const): Deleted.
(WebCore::SourceBufferPrivate::hasAudio const): Deleted.
(WebCore::SourceBufferPrivate::hasVideo const): Deleted.
(WebCore::SourceBufferPrivate::hasReceivedFirstInitializationSegment const):
Deleted.
(WebCore::SourceBufferPrivate::timestampOffset const): Deleted.
*
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
*
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCurrentTimeDidChangeCallback):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::startSeek):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::bufferedChanged):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::startVideoFrameMetadataGathering):
*
Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
*
Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::queueSingleton):
(WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC):
(WebCore::MediaSourcePrivateAVFObjC::setPlayer):
(WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
(WebCore::MediaSourcePrivateAVFObjC::removeSourceBuffer):
(WebCore::MediaSourcePrivateAVFObjC::notifyActiveSourceBuffersChanged):
(WebCore::MediaSourcePrivateAVFObjC::durationChanged):
(WebCore::MediaSourcePrivateAVFObjC::markEndOfStream):
(WebCore::MediaSourcePrivateAVFObjC::bufferedChanged):
(WebCore::MediaSourcePrivateAVFObjC::trackBufferedChanged): Deleted.
*
Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
*
Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::setTrackChangeCallbacks):
(WebCore::SourceBufferPrivateAVFObjC::precheckInitializationSegment):
(WebCore::SourceBufferPrivateAVFObjC::processInitializationSegment):
(WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
(WebCore::SourceBufferPrivateAVFObjC::appendCompleted):
(WebCore::SourceBufferPrivateAVFObjC::clearTracks):
(WebCore::SourceBufferPrivateAVFObjC::videoTrackDidChangeSelected):
(WebCore::SourceBufferPrivateAVFObjC::audioTrackDidChangeEnabled):
(WebCore::SourceBufferPrivateAVFObjC::removeTrackID):
(WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples):
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeSelected): Deleted.
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): Deleted.
* Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.cpp:
(WebKit::SourceBufferPrivateRemote::setActive):
(WebKit::SourceBufferPrivateRemote::setTimestampOffset):
(WebKit::SourceBufferPrivateRemote::setMaximumBufferSize):
(WebKit::SourceBufferPrivateRemote::isActive const): Deleted.
(WebKit::SourceBufferPrivateRemote::timestampOffset const): Deleted.
(WebKit::SourceBufferPrivateRemote::totalTrackBufferSizeInBytes const): Deleted.
(WebKit::SourceBufferPrivateRemote::isBufferFullFor const): Deleted.
(WebKit::SourceBufferPrivateRemote::canAppend const): Deleted.
* Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.h:
Canonical link: https://commits.webkit.org/303467@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications