Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: e25a76a6050724c85a623b23746c2a143f844be3 https://github.com/WebKit/WebKit/commit/e25a76a6050724c85a623b23746c2a143f844be3 Author: Jean-Yves Avenard <j...@apple.com> Date: 2023-11-07 (Tue, 07 Nov 2023)
Changed paths: 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.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/graphics/gstreamer/mse/AppendPipeline.cpp M Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp M Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h M Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp M Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h M Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp M Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h M Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp M Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.h M Source/WebKit/WebProcess/GPU/media/MediaSourcePrivateRemote.cpp M Source/WebKit/WebProcess/GPU/media/MediaSourcePrivateRemote.h M Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.cpp M Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.h Log Message: ----------- Move duplicated methods from MediaSourcePrivate/SourceBufferPrivate to base class https://bugs.webkit.org/show_bug.cgi?id=264142 rdar://117892834 Reviewed by Jer Noble. We have three MSE implementations in our tree: - Cocoa/AVFObjC - Mock - GStreamer In a lot of instances, all three duplicate the same code. It makes it harder to maintain and too easy to introduce discrepancy between the three implementations. So we move to their respective base classes what can be moved. Covered by existing tests. * Source/WebCore/platform/graphics/MediaSourcePrivate.cpp: (WebCore::MediaSourcePrivate::~MediaSourcePrivate): (WebCore::MediaSourcePrivate::removeSourceBuffer): (WebCore::MediaSourcePrivate::sourceBufferPrivateDidChangeActiveState): (WebCore::MediaSourcePrivate::hasAudio const): (WebCore::MediaSourcePrivate::hasVideo const): (WebCore::MediaSourcePrivate::setCDMSession): * Source/WebCore/platform/graphics/MediaSourcePrivate.h: (WebCore::MediaSourcePrivate::bufferedChanged): Deleted. (WebCore::MediaSourcePrivate::setTimeFudgeFactor): Deleted. (WebCore::MediaSourcePrivate::timeFudgeFactor const): Deleted. * Source/WebCore/platform/graphics/SourceBufferPrivate.cpp: (WebCore::SourceBufferPrivate::SourceBufferPrivate): (WebCore::SourceBufferPrivate::removedFromMediaSource): (WebCore::SourceBufferPrivate::currentMediaTime const): (WebCore::SourceBufferPrivate::duration const): (WebCore::SourceBufferPrivate::setActive): * Source/WebCore/platform/graphics/SourceBufferPrivate.h: (WebCore::SourceBufferPrivate::clearMediaSource): (WebCore::SourceBufferPrivate::didReceiveInitializationSegment const): (WebCore::SourceBufferPrivate::setCDMSession): (WebCore::SourceBufferPrivate::setCDMInstance): (WebCore::SourceBufferPrivate::waitingForKey const): (WebCore::SourceBufferPrivate::attemptToDecrypt): (WebCore::SourceBufferPrivate::isActive const): (WebCore::SourceBufferPrivate::isSeeking const): (WebCore::SourceBufferPrivate::currentMediaTime const): Deleted. (WebCore::SourceBufferPrivate::duration const): Deleted. * Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::shouldEnsureLayer const): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession): * Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h: * Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: (WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC): (WebCore::MediaSourcePrivateAVFObjC::~MediaSourcePrivateAVFObjC): (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer): (WebCore::MediaSourcePrivateAVFObjC::removeSourceBuffer): (WebCore::MediaSourcePrivateAVFObjC::notifyActiveSourceBuffersChanged): (WebCore::MediaSourcePrivateAVFObjC::markEndOfStream): (WebCore::MediaSourcePrivateAVFObjC::hasSelectedVideo const): (WebCore::MediaSourcePrivateAVFObjC::willSeek): (WebCore::MediaSourcePrivateAVFObjC::naturalSize const): (WebCore::MediaSourcePrivateAVFObjC::flushActiveSourceBuffersIfNeeded): (WebCore::MediaSourcePrivateAVFObjC::needsVideoLayer const): (WebCore::MediaSourcePrivateAVFObjC::unmarkEndOfStream): Deleted. (WebCore::MediaSourcePrivateAVFObjC::sourceBufferPrivateDidChangeActiveState): Deleted. (WebCore::MediaSourcePrivateAVFObjCHasAudio): Deleted. (WebCore::MediaSourcePrivateAVFObjC::hasAudio const): Deleted. (WebCore::MediaSourcePrivateAVFObjC::hasVideo const): Deleted. * Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: (isType): * Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::create): (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): (WebCore::m_logIdentifier): (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeSelected): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::SourceBufferPrivateAVFObjC::setCDMSession): (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): (WebCore::SourceBufferPrivateAVFObjC::player const): (WebCore::SourceBufferPrivateAVFObjC::removedFromMediaSource): Deleted. (WebCore::SourceBufferPrivateAVFObjC::setActive): Deleted. (WebCore::SourceBufferPrivateAVFObjC::isActive const): Deleted. (WebCore::SourceBufferPrivateAVFObjC::currentMediaTime const): Deleted. (WebCore::SourceBufferPrivateAVFObjC::duration const): Deleted. * Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp: (WebCore::MediaSourcePrivateGStreamer::~MediaSourcePrivateGStreamer): (WebCore::MediaSourcePrivateGStreamer::addSourceBuffer): (WebCore::MediaSourcePrivateGStreamer::markEndOfStream): (WebCore::MediaSourcePrivateGStreamer::startPlaybackIfHasAllTracks): (WebCore::MediaSourcePrivateGStreamer::removeSourceBuffer): Deleted. (WebCore::MediaSourcePrivateGStreamer::unmarkEndOfStream): Deleted. (WebCore::MediaSourcePrivateGStreamer::sourceBufferPrivateDidChangeActiveState): Deleted. * Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h: * Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: (WebCore::SourceBufferPrivateGStreamer::create): (WebCore::SourceBufferPrivateGStreamer::SourceBufferPrivateGStreamer): (WebCore::SourceBufferPrivateGStreamer::removedFromMediaSource): (WebCore::SourceBufferPrivateGStreamer::flush): (WebCore::SourceBufferPrivateGStreamer::didReceiveInitializationSegment): (WebCore::SourceBufferPrivateGStreamer::setActive): Deleted. (WebCore::SourceBufferPrivateGStreamer::isActive const): Deleted. (WebCore::SourceBufferPrivateGStreamer::currentMediaTime const): Deleted. (WebCore::SourceBufferPrivateGStreamer::duration const): Deleted. * Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: (isType): * Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp: (WebCore::MockMediaSourcePrivate::addSourceBuffer): (WebCore::MockMediaSourcePrivate::duration const): (WebCore::MockMediaSourcePrivate::markEndOfStream): (WebCore::MockMediaSourcePrivate::notifyActiveSourceBuffersChanged): (WebCore::MockMediaSourcePrivate::~MockMediaSourcePrivate): Deleted. (WebCore::MockMediaSourcePrivate::removeSourceBuffer): Deleted. (WebCore::MockMediaSourcePrivate::duration): Deleted. (WebCore::MockMediaSourcePrivate::unmarkEndOfStream): Deleted. (WebCore::MockMediaSourcePrivate::sourceBufferPrivateDidChangeActiveState): Deleted. (WebCore::MockSourceBufferPrivateHasAudio): Deleted. (WebCore::MockMediaSourcePrivate::hasAudio const): Deleted. (WebCore::MockSourceBufferPrivateHasVideo): Deleted. (WebCore::MockMediaSourcePrivate::hasVideo const): Deleted. * Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h: * Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp: (WebCore::MockSourceBufferPrivate::create): (WebCore::MockSourceBufferPrivate::MockSourceBufferPrivate): (WebCore::MockSourceBufferPrivate::mediaSourcePrivate const): (WebCore::MockSourceBufferPrivate::readyState const): (WebCore::MockSourceBufferPrivate::setReadyState): (WebCore::MockSourceBufferPrivate::enqueueSample): (WebCore::MockSourceBufferPrivate::removedFromMediaSource): Deleted. (WebCore::MockSourceBufferPrivate::setActive): Deleted. (WebCore::MockSourceBufferPrivate::isActive const): Deleted. (WebCore::MockSourceBufferPrivate::currentMediaTime const): Deleted. (WebCore::MockSourceBufferPrivate::duration const): Deleted. * Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.h: * Source/WebKit/WebProcess/GPU/media/MediaSourcePrivateRemote.cpp: (WebKit::MediaSourcePrivateRemote::markEndOfStream): (WebKit::MediaSourcePrivateRemote::unmarkEndOfStream): (WebKit::MediaSourcePrivateRemote::isEnded const): Deleted. * Source/WebKit/WebProcess/GPU/media/MediaSourcePrivateRemote.h: * Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.cpp: (WebKit::SourceBufferPrivateRemote::create): (WebKit::SourceBufferPrivateRemote::SourceBufferPrivateRemote): (WebKit::SourceBufferPrivateRemote::setReadyState): (WebKit::SourceBufferPrivateRemote::setActive): * Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.h: Canonical link: https://commits.webkit.org/270354@main _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes