зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1371514. P1 - remove AbstractMediaDecoder::IsOggDecoderShutdown() and its friends. r=gerald
MozReview-Commit-ID: 5HOqH6YtB8b --HG-- extra : rebase_source : 49cc525c32d827584c856e815a1ff3e2df968cea
This commit is contained in:
Родитель
fafefc69a1
Коммит
ba75abc972
|
@ -46,10 +46,6 @@ static inline bool IsCurrentThread(nsIThread* aThread)
|
|||
class AbstractMediaDecoder : public nsIObserver
|
||||
{
|
||||
public:
|
||||
// A special version of the above for the ogg decoder that is allowed to be
|
||||
// called cross-thread.
|
||||
virtual bool IsOggDecoderShutdown() { return false; }
|
||||
|
||||
// Get the current MediaResource being used. Its URI will be returned
|
||||
// by currentSrc. Returns what was passed to Load(), if Load() has been called.
|
||||
virtual MediaResource* GetResource() const = 0;
|
||||
|
|
|
@ -427,10 +427,6 @@ MediaDecoder::MediaDecoder(MediaDecoderInit& aInit)
|
|||
// mDuration
|
||||
mWatchManager.Watch(mStateMachineDuration, &MediaDecoder::DurationChanged);
|
||||
|
||||
// mStateMachineIsShutdown
|
||||
mWatchManager.Watch(mStateMachineIsShutdown,
|
||||
&MediaDecoder::ShutdownBitChanged);
|
||||
|
||||
// readyState
|
||||
mWatchManager.Watch(mPlayState, &MediaDecoder::UpdateReadyState);
|
||||
mWatchManager.Watch(mNextFrameStatus, &MediaDecoder::UpdateReadyState);
|
||||
|
|
|
@ -538,9 +538,6 @@ protected:
|
|||
// State-watching manager.
|
||||
WatchManager<MediaDecoder> mWatchManager;
|
||||
|
||||
// Used by the ogg decoder to watch mStateMachineIsShutdown.
|
||||
virtual void ShutdownBitChanged() {}
|
||||
|
||||
double ExplicitDuration() { return mExplicitDuration.Ref().ref(); }
|
||||
|
||||
void SetExplicitDuration(double aValue)
|
||||
|
|
|
@ -17,8 +17,6 @@ class OggDecoder : public MediaDecoder
|
|||
public:
|
||||
explicit OggDecoder(MediaDecoderInit& aInit)
|
||||
: MediaDecoder(aInit)
|
||||
, mShutdownBitMonitor("mShutdownBitMonitor")
|
||||
, mShutdownBit(false)
|
||||
{}
|
||||
|
||||
MediaDecoder* Clone(MediaDecoderInit& aInit) override {
|
||||
|
@ -29,30 +27,10 @@ public:
|
|||
}
|
||||
MediaDecoderStateMachine* CreateStateMachine() override;
|
||||
|
||||
// For yucky legacy reasons, the ogg decoder needs to do a cross-thread read
|
||||
// to check for shutdown while it hogs its own task queue. We don't want to
|
||||
// protect the general state with a lock, so we make a special copy and a
|
||||
// special-purpose lock. This method may be called on any thread.
|
||||
bool IsOggDecoderShutdown() override
|
||||
{
|
||||
MonitorAutoLock lock(mShutdownBitMonitor);
|
||||
return mShutdownBit;
|
||||
}
|
||||
|
||||
// Returns true if aContainerType is an Ogg type that we think we can render
|
||||
// with an enabled platform decoder backend.
|
||||
// If provided, codecs are checked for support.
|
||||
static bool IsSupportedType(const MediaContainerType& aContainerType);
|
||||
|
||||
protected:
|
||||
void ShutdownBitChanged() override
|
||||
{
|
||||
MonitorAutoLock lock(mShutdownBitMonitor);
|
||||
mShutdownBit = mStateMachineIsShutdown;
|
||||
}
|
||||
|
||||
Monitor mShutdownBitMonitor;
|
||||
bool mShutdownBit;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
Загрузка…
Ссылка в новой задаче