Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SourceBufferPrivateClient/MediaSourcePrivateClient should use NativeP…
…romise https://bugs.webkit.org/show_bug.cgi?id=264847 rdar://problem/118426574 Reviewed by Youenn Fablet. By using NativePromise, the SourceBufferPrivate and MediaSourcePrivate can be made to run on any threads as NativePromise let you control on which thread the result of an operation should be delivered. We make all internal SourceBufferPrivate/MediaSourcePrivate methods communicate via their respective SourceBufferPrivateClient/MediaSourcePrivateClient using NativePromise instead of CompletionHandler. It also allows to more explicitly handle errors. The communication between SourceBuffer and SourceBufferPrivate will also be made to use NativePromise in a follow-up change. No change in behaviour in WK2, in WK1 some asynchronicity introduced which makes the behaviour more similar to WK2 * LayoutTests/media/media-source/media-source-restrictions.html: Update test as we've introduced more asynchronicity, and in WK1 events are fired in a different order (but still per spec). So ensure the events are still fired but don't log them. * Source/WebCore/Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::waitForTarget): (WebCore::MediaSource::completeSeek): (WebCore::MediaSource::seekToTime): (WebCore::MediaSource::detachFromElement): (WebCore::MediaSource::stop): (WebCore::MediaSource::onReadyStateChange): * Source/WebCore/Modules/mediasource/MediaSource.h: * Source/WebCore/Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::computeSeekTime): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): (WebCore::SourceBuffer::sourceBufferPrivateDurationChanged): (WebCore::SourceBuffer::sourceBufferPrivateBufferedChanged): * Source/WebCore/Modules/mediasource/SourceBuffer.h: * Source/WebCore/Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::decodeAudioData): * Source/WebCore/platform/audio/cocoa/AudioFileReaderCocoa.cpp: (WebCore::AudioFileReader::demuxWebMData const): * Source/WebCore/platform/graphics/MediaSourcePrivate.h: * Source/WebCore/platform/graphics/MediaSourcePrivateClient.h: * Source/WebCore/platform/graphics/SourceBufferPrivate.cpp: (WebCore::SourceBufferPrivate::setBufferedRanges): (WebCore::SourceBufferPrivate::updateBufferedFromTrackBuffers): (WebCore::SourceBufferPrivate::processAppendCompletedOperation): (WebCore::SourceBufferPrivate::computeSeekTime): (WebCore::SourceBufferPrivate::removeCodedFrames): (WebCore::SourceBufferPrivate::didReceiveInitializationSegment): (WebCore::SourceBufferPrivate::didUpdateFormatDescriptionForTrackId): (WebCore::SourceBufferPrivate::processPendingOperations): (WebCore::SourceBufferPrivate::abortPendingOperations): (WebCore::SourceBufferPrivate::processInitOperation): (WebCore::SourceBufferPrivate::appendCompleted): Deleted. * Source/WebCore/platform/graphics/SourceBufferPrivate.h: (WebCore::SourceBufferPrivate::precheckInitialisationSegment): (WebCore::SourceBufferPrivate::processInitialisationSegment): (WebCore::SourceBufferPrivate::processFormatDescriptionForTrackId): (WebCore::SourceBufferPrivate::updateBufferedFromTrackBuffers): Deleted. (WebCore::SourceBufferPrivate::setBufferedRanges): Deleted. * Source/WebCore/platform/graphics/SourceBufferPrivateClient.h: (WebCore::SourceBufferPrivateClient::isAsync const): Deleted. * Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal): * Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h: * Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: (WebCore::MediaSourcePrivateAVFObjC::waitForTarget): (WebCore::MediaSourcePrivateAVFObjC::seekToTime): * Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.h: * Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.mm: (WebCore::SourceBufferParserAVFObjC::appendData): (WebCore::SourceBufferParserAVFObjC::didFailToParseStreamDataWithError): * Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::setTrackChangeCallbacks): (WebCore::SourceBufferPrivateAVFObjC::didParseInitializationData): (WebCore::SourceBufferPrivateAVFObjC::precheckInitialisationSegment): (WebCore::SourceBufferPrivateAVFObjC::processInitialisationSegment): (WebCore::SourceBufferPrivateAVFObjC::processFormatDescriptionForTrackId): (WebCore::SourceBufferPrivateAVFObjC::appendInternal): (WebCore::SourceBufferPrivateAVFObjC::appendCompleted): (WebCore::SourceBufferPrivateAVFObjC::didEncounterErrorDuringParsing): Deleted. (WebCore::SourceBufferPrivateAVFObjC::didUpdateFormatDescriptionForTrackId): Deleted. * Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.h: * Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.mm: (WebCore::MediaPlayerPrivateWebM::~MediaPlayerPrivateWebM): (WebCore::MediaPlayerPrivateWebM::append): (WebCore::MediaPlayerPrivateWebM::didEncounterErrorDuringParsing): Deleted. (WebCore::MediaPlayerPrivateWebM::abort): Deleted. * Source/WebCore/platform/graphics/cocoa/SourceBufferParser.h: * Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::appendData): * Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.h: (WebCore::SourceBufferParserWebM::appendData): Deleted. * Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::doSeek): * Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp: (WebCore::MediaSourcePrivateGStreamer::waitForTarget): (WebCore::MediaSourcePrivateGStreamer::seekToTime): * Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h: * Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: (WebCore::SourceBufferPrivateGStreamer::appendInternal): (WebCore::SourceBufferPrivateGStreamer::didReceiveInitializationSegment): (WebCore::SourceBufferPrivateGStreamer::precheckInitialisationSegment): (WebCore::SourceBufferPrivateGStreamer::processInitialisationSegment): (WebCore::SourceBufferPrivateGStreamer::didReceiveAllPendingSamples): (WebCore::SourceBufferPrivateGStreamer::appendParsingFailed): * Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: * Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp: (WebCore::MockMediaPlayerMediaSource::seekToTarget): * Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp: (WebCore::MockMediaSourcePrivate::waitForTarget): (WebCore::MockMediaSourcePrivate::seekToTime): * Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h: * Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp: (WebCore::MockSourceBufferPrivate::appendInternal): (WebCore::MockSourceBufferPrivate::didReceiveInitializationSegment): * Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.h: * Source/WebKit/GPUProcess/media/RemoteMediaSourceProxy.cpp: (WebKit::RemoteMediaSourceProxy::waitForTarget): (WebKit::RemoteMediaSourceProxy::seekToTime): * Source/WebKit/GPUProcess/media/RemoteMediaSourceProxy.h: * Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.cpp: (WebKit::RemoteSourceBufferProxy::sourceBufferPrivateDidReceiveInitializationSegment): (WebKit::RemoteSourceBufferProxy::sourceBufferPrivateDurationChanged): (WebKit::RemoteSourceBufferProxy::sourceBufferPrivateBufferedChanged): (WebKit::RemoteSourceBufferProxy::computeSeekTime): * Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.h: * Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.messages.in: * Source/WebKit/WebProcess/GPU/media/MediaSourcePrivateRemote.cpp: (WebKit::MediaSourcePrivateRemote::waitForTarget): (WebKit::MediaSourcePrivateRemote::proxyWaitForTarget): (WebKit::MediaSourcePrivateRemote::seekToTime): (WebKit::MediaSourcePrivateRemote::proxySeekToTime): * Source/WebKit/WebProcess/GPU/media/MediaSourcePrivateRemote.h: * Source/WebKit/WebProcess/GPU/media/MediaSourcePrivateRemote.messages.in: * Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.cpp: (WebKit::SourceBufferPrivateRemote::appendInternal): (WebKit::SourceBufferPrivateRemote::removeCodedFrames): (WebKit::SourceBufferPrivateRemote::computeSeekTime): (WebKit::SourceBufferPrivateRemote::sourceBufferPrivateDidReceiveInitializationSegment): (WebKit::SourceBufferPrivateRemote::sourceBufferPrivateDurationChanged): (WebKit::SourceBufferPrivateRemote::sourceBufferPrivateBufferedChanged): * Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.h: * Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.messages.in: Canonical link: https://commits.webkit.org/270788@main
- Loading branch information