Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move duplicated methods from MediaSourcePrivate/SourceBufferPrivate t…
…o 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
- Loading branch information