Bug 1144519 - Rename OnStateMachineThread-like functions to reflect the fact that it's a task queue. r=jya

This commit is contained in:
Bobby Holley 2015-03-17 14:23:12 -07:00
parent 9876857fdb
commit 79bed83dbd
11 changed files with 65 additions and 76 deletions

View File

@ -54,7 +54,7 @@ public:
// Returns true if the decoder is shut down.
virtual bool IsShutdown() const = 0;
virtual bool OnStateMachineThread() const = 0;
virtual bool OnStateMachineTaskQueue() const = 0;
virtual bool OnDecodeThread() const = 0;

View File

@ -1093,7 +1093,7 @@ MediaDecoder::GetStatistics()
double MediaDecoder::ComputePlaybackRate(bool* aReliable)
{
GetReentrantMonitor().AssertCurrentThreadIn();
MOZ_ASSERT(NS_IsMainThread() || OnStateMachineThread() || OnDecodeThread());
MOZ_ASSERT(NS_IsMainThread() || OnStateMachineTaskQueue() || OnDecodeThread());
int64_t length = mResource ? mResource->GetLength() : -1;
if (mDuration >= 0 && length >= 0) {
@ -1105,7 +1105,7 @@ double MediaDecoder::ComputePlaybackRate(bool* aReliable)
void MediaDecoder::UpdatePlaybackRate()
{
MOZ_ASSERT(NS_IsMainThread() || OnStateMachineThread());
MOZ_ASSERT(NS_IsMainThread() || OnStateMachineTaskQueue());
GetReentrantMonitor().AssertCurrentThreadIn();
if (!mResource)
return;
@ -1506,7 +1506,7 @@ void MediaDecoder::Resume(bool aForceBuffering)
void MediaDecoder::StopProgressUpdates()
{
MOZ_ASSERT(OnStateMachineThread() || OnDecodeThread());
MOZ_ASSERT(OnStateMachineTaskQueue() || OnDecodeThread());
GetReentrantMonitor().AssertCurrentThreadIn();
mIgnoreProgressData = true;
if (mResource) {
@ -1516,7 +1516,7 @@ void MediaDecoder::StopProgressUpdates()
void MediaDecoder::StartProgressUpdates()
{
MOZ_ASSERT(OnStateMachineThread() || OnDecodeThread());
MOZ_ASSERT(OnStateMachineTaskQueue() || OnDecodeThread());
GetReentrantMonitor().AssertCurrentThreadIn();
mIgnoreProgressData = false;
if (mResource) {
@ -1538,9 +1538,9 @@ void MediaDecoder::UpdatePlaybackOffset(int64_t aOffset)
mPlaybackPosition = aOffset;
}
bool MediaDecoder::OnStateMachineThread() const
bool MediaDecoder::OnStateMachineTaskQueue() const
{
return mDecoderStateMachine->OnStateMachineThread();
return mDecoderStateMachine->OnTaskQueue();
}
void MediaDecoder::SetPlaybackRate(double aPlaybackRate)

View File

@ -668,7 +668,7 @@ public:
// has changed.
void DurationChanged();
bool OnStateMachineThread() const override;
bool OnStateMachineTaskQueue() const override;
bool OnDecodeThread() const override;

View File

@ -269,7 +269,7 @@ MediaDecoderStateMachine::MediaDecoderStateMachine(MediaDecoder* aDecoder,
#ifdef XP_WIN
// Ensure high precision timers are enabled on Windows, otherwise the state
// machine thread isn't woken up at reliable intervals to set the next frame,
// machine isn't woken up at reliable intervals to set the next frame,
// and we drop frames while painting. Note that multiple calls to this
// function per-process is OK, provided each call is matched by a corresponding
// timeEndPeriod() call.
@ -312,7 +312,7 @@ bool MediaDecoderStateMachine::HaveNextFrameData() {
}
int64_t MediaDecoderStateMachine::GetDecodedAudioDuration() {
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
AssertCurrentThreadInMonitor();
int64_t audioDecoded = AudioQueue().Duration();
if (mAudioEndTime != -1) {
@ -325,7 +325,7 @@ void MediaDecoderStateMachine::SendStreamAudio(AudioData* aAudio,
DecodedStreamData* aStream,
AudioSegment* aOutput)
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
AssertCurrentThreadInMonitor();
// This logic has to mimic AudioSink closely to make sure we write
@ -390,7 +390,7 @@ static void WriteVideoToMediaStream(MediaStream* aStream,
void MediaDecoderStateMachine::SendStreamData()
{
MOZ_ASSERT(OnStateMachineThread(), "Should be on state machine thread");
MOZ_ASSERT(OnTaskQueue());
AssertCurrentThreadInMonitor();
MOZ_ASSERT(!mAudioSink, "Should've been stopped in RunStateMachine()");
@ -710,7 +710,7 @@ MediaDecoderStateMachine::IsVideoSeekComplete()
void
MediaDecoderStateMachine::OnAudioDecoded(AudioData* aAudioSample)
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
nsRefPtr<AudioData> audio(aAudioSample);
MOZ_ASSERT(audio);
@ -831,7 +831,7 @@ void
MediaDecoderStateMachine::OnNotDecoded(MediaData::Type aType,
MediaDecoderReader::NotDecodedReason aReason)
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
SAMPLE_LOG("OnNotDecoded (aType=%u, aReason=%u)", aType, aReason);
bool isAudio = aType == MediaData::AUDIO_DATA;
@ -933,7 +933,7 @@ MediaDecoderStateMachine::OnNotDecoded(MediaData::Type aType,
void
MediaDecoderStateMachine::MaybeFinishDecodeFirstFrame()
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
AssertCurrentThreadInMonitor();
if ((IsAudioDecoding() && AudioQueue().GetSize() == 0) ||
(IsVideoDecoding() && VideoQueue().GetSize() == 0)) {
@ -947,7 +947,7 @@ MediaDecoderStateMachine::MaybeFinishDecodeFirstFrame()
void
MediaDecoderStateMachine::OnVideoDecoded(VideoData* aVideoSample)
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
nsRefPtr<VideoData> video(aVideoSample);
mVideoDataRequest.Complete();
@ -1054,7 +1054,7 @@ MediaDecoderStateMachine::OnVideoDecoded(VideoData* aVideoSample)
void
MediaDecoderStateMachine::CheckIfSeekComplete()
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
AssertCurrentThreadInMonitor();
const bool videoSeekComplete = IsVideoSeekComplete();
@ -1152,7 +1152,7 @@ nsresult MediaDecoderStateMachine::Init(MediaDecoderStateMachine* aCloneDonor)
void MediaDecoderStateMachine::StopPlayback()
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
DECODER_LOG("StopPlayback()");
AssertCurrentThreadInMonitor();
@ -1210,7 +1210,7 @@ void MediaDecoderStateMachine::MaybeStartPlayback()
void MediaDecoderStateMachine::UpdatePlaybackPositionInternal(int64_t aTime)
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
SAMPLE_LOG("UpdatePlaybackPositionInternal(%lld) (mStartTime=%lld)", aTime, mStartTime);
AssertCurrentThreadInMonitor();
@ -1321,21 +1321,11 @@ void MediaDecoderStateMachine::SetAudioCaptured()
double MediaDecoderStateMachine::GetCurrentTime() const
{
NS_ASSERTION(NS_IsMainThread() ||
OnStateMachineThread() ||
OnDecodeThread(),
"Should be on main, decode, or state machine thread.");
return static_cast<double>(mCurrentFrameTime) / static_cast<double>(USECS_PER_S);
}
int64_t MediaDecoderStateMachine::GetCurrentTimeUs() const
{
NS_ASSERTION(NS_IsMainThread() ||
OnStateMachineThread() ||
OnDecodeThread(),
"Should be on main, decode, or state machine thread.");
return mCurrentFrameTime;
}
@ -1450,7 +1440,7 @@ bool MediaDecoderStateMachine::IsDormantNeeded()
void MediaDecoderStateMachine::SetDormant(bool aDormant)
{
MOZ_ASSERT(OnStateMachineThread(), "Should be on state machine thread.");
MOZ_ASSERT(OnTaskQueue());
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
if (IsShutdown()) {
@ -1536,7 +1526,7 @@ void MediaDecoderStateMachine::Shutdown()
void MediaDecoderStateMachine::StartDecoding()
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
if (mState == DECODER_STATE_DECODING) {
return;
@ -1562,7 +1552,7 @@ void MediaDecoderStateMachine::StartDecoding()
void MediaDecoderStateMachine::NotifyWaitingForResourcesStatusChanged()
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
DECODER_LOG("NotifyWaitingForResourcesStatusChanged");
@ -1579,7 +1569,7 @@ void MediaDecoderStateMachine::NotifyWaitingForResourcesStatusChanged()
void MediaDecoderStateMachine::PlayInternal()
{
NS_ASSERTION(OnStateMachineThread(), "Should be on state machine thread.");
MOZ_ASSERT(OnTaskQueue());
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
// Once we start playing, we don't want to minimize our prerolling, as we
@ -1599,7 +1589,7 @@ void MediaDecoderStateMachine::PlayInternal()
// if the main thread invokes Play() and then Seek(), the seek will initiate
// synchronously on the main thread, and the asynchronous PlayInternal task
// will arrive when it's no longer valid. The proper thing to do is to move
// all state transitions to the state machine thread, but for now we just
// all state transitions to the state machine task queue, but for now we just
// make sure that none of the possible main-thread state transitions (Seek(),
// SetDormant(), and Shutdown()) have not occurred.
if (mState != DECODER_STATE_DECODING && mState != DECODER_STATE_BUFFERING &&
@ -1652,7 +1642,7 @@ void MediaDecoderStateMachine::NotifyDataArrived(const char* aBuffer,
nsRefPtr<MediaDecoder::SeekPromise>
MediaDecoderStateMachine::Seek(SeekTarget aTarget)
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
mDecodingFrozenAtStateDecoding = false;
@ -1690,7 +1680,7 @@ MediaDecoderStateMachine::Seek(SeekTarget aTarget)
void MediaDecoderStateMachine::StopAudioThread()
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
AssertCurrentThreadInMonitor();
if (mStopAudioThread) {
@ -1809,7 +1799,7 @@ MediaDecoderStateMachine::DispatchDecodeTasksIfNeeded()
void
MediaDecoderStateMachine::InitiateSeek()
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
AssertCurrentThreadInMonitor();
mCurrentSeek.RejectIfExists(__func__);
@ -1874,7 +1864,7 @@ MediaDecoderStateMachine::InitiateSeek()
nsresult
MediaDecoderStateMachine::DispatchAudioDecodeTaskIfNeeded()
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
if (IsShutdown()) {
@ -1891,7 +1881,7 @@ MediaDecoderStateMachine::DispatchAudioDecodeTaskIfNeeded()
nsresult
MediaDecoderStateMachine::EnsureAudioDecodeTaskQueued()
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
AssertCurrentThreadInMonitor();
SAMPLE_LOG("EnsureAudioDecodeTaskQueued isDecoding=%d status=%s",
@ -1924,7 +1914,7 @@ MediaDecoderStateMachine::EnsureAudioDecodeTaskQueued()
nsresult
MediaDecoderStateMachine::DispatchVideoDecodeTaskIfNeeded()
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
if (IsShutdown()) {
@ -1941,7 +1931,7 @@ MediaDecoderStateMachine::DispatchVideoDecodeTaskIfNeeded()
nsresult
MediaDecoderStateMachine::EnsureVideoDecodeTaskQueued()
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
AssertCurrentThreadInMonitor();
SAMPLE_LOG("EnsureVideoDecodeTaskQueued isDecoding=%d status=%s",
@ -1983,7 +1973,7 @@ MediaDecoderStateMachine::EnsureVideoDecodeTaskQueued()
nsresult
MediaDecoderStateMachine::StartAudioThread()
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
AssertCurrentThreadInMonitor();
if (mAudioCaptured) {
NS_ASSERTION(mStopAudioThread, "mStopAudioThread must always be true if audio is captured");
@ -2090,7 +2080,7 @@ bool MediaDecoderStateMachine::HasLowUndecodedData(int64_t aUsecs)
void
MediaDecoderStateMachine::DecodeError()
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
if (IsShutdown()) {
// Already shutdown.
@ -2118,7 +2108,7 @@ void
MediaDecoderStateMachine::OnMetadataRead(MetadataHolder* aMetadata)
{
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
MOZ_ASSERT(mState == DECODER_STATE_DECODING_METADATA);
mMetadataRequest.Complete();
@ -2158,7 +2148,7 @@ void
MediaDecoderStateMachine::OnMetadataNotRead(ReadMetadataFailureReason aReason)
{
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
MOZ_ASSERT(mState == DECODER_STATE_DECODING_METADATA);
mMetadataRequest.Complete();
@ -2202,7 +2192,7 @@ MediaDecoderStateMachine::EnqueueFirstFrameLoadedEvent()
void
MediaDecoderStateMachine::CallDecodeFirstFrame()
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
if (mState != DECODER_STATE_DECODING_FIRSTFRAME) {
return;
@ -2216,7 +2206,7 @@ MediaDecoderStateMachine::CallDecodeFirstFrame()
nsresult
MediaDecoderStateMachine::DecodeFirstFrame()
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
AssertCurrentThreadInMonitor();
MOZ_ASSERT(mState == DECODER_STATE_DECODING_FIRSTFRAME);
DECODER_LOG("DecodeFirstFrame started");
@ -2268,7 +2258,7 @@ nsresult
MediaDecoderStateMachine::FinishDecodeFirstFrame()
{
AssertCurrentThreadInMonitor();
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
DECODER_LOG("FinishDecodeFirstFrame");
if (IsShutdown()) {
@ -2344,7 +2334,7 @@ void
MediaDecoderStateMachine::OnSeekCompleted(int64_t aTime)
{
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
mSeekRequest.Complete();
// We must decode the first samples of active streams, so we can determine
@ -2358,7 +2348,7 @@ void
MediaDecoderStateMachine::OnSeekFailed(nsresult aResult)
{
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
mSeekRequest.Complete();
MOZ_ASSERT(NS_FAILED(aResult), "Cancels should also disconnect mSeekRequest");
DecodeError();
@ -2367,7 +2357,7 @@ MediaDecoderStateMachine::OnSeekFailed(nsresult aResult)
void
MediaDecoderStateMachine::SeekCompleted()
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
if (mState != DECODER_STATE_SEEKING) {
@ -2488,7 +2478,7 @@ MediaDecoderStateMachine::ShutdownReader()
void
MediaDecoderStateMachine::FinishShutdown()
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
// The reader's listeners hold references to the state machine,
@ -2527,10 +2517,10 @@ MediaDecoderStateMachine::FinishShutdown()
nsresult MediaDecoderStateMachine::RunStateMachine()
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
mDelayedScheduler.Reset(); // Must happen on state machine thread.
mDelayedScheduler.Reset(); // Must happen on state machine task queue.
mDispatchedStateMachine = false;
// If audio is being captured, stop the audio sink if it's running
@ -2730,7 +2720,7 @@ nsresult MediaDecoderStateMachine::RunStateMachine()
void
MediaDecoderStateMachine::Reset()
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
AssertCurrentThreadInMonitor();
DECODER_LOG("MediaDecoderStateMachine::Reset");
@ -2776,7 +2766,7 @@ MediaDecoderStateMachine::Reset()
void MediaDecoderStateMachine::RenderVideoFrame(VideoData* aData,
TimeStamp aTarget)
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
mDecoder->GetReentrantMonitor().AssertNotCurrentThreadIn();
if (aData->mDuplicate) {
@ -2881,7 +2871,7 @@ int64_t MediaDecoderStateMachine::GetClock() const
void MediaDecoderStateMachine::AdvanceFrame()
{
NS_ASSERTION(OnStateMachineThread(), "Should be on state machine thread.");
MOZ_ASSERT(OnTaskQueue());
AssertCurrentThreadInMonitor();
NS_ASSERTION(!HasAudio() || mAudioStartTime != -1,
"Should know audio start time if we have audio.");
@ -3305,9 +3295,9 @@ void
MediaDecoderStateMachine::ScheduleStateMachineIn(int64_t aMicroseconds)
{
AssertCurrentThreadInMonitor();
MOZ_ASSERT(OnStateMachineThread()); // mDelayedScheduler.Ensure() may Disconnect()
MOZ_ASSERT(OnTaskQueue()); // mDelayedScheduler.Ensure() may Disconnect()
// the promise, which must happen on the state
// machine thread.
// machine task queue.
MOZ_ASSERT(aMicroseconds > 0);
if (mState == DECODER_STATE_SHUTDOWN) {
NS_WARNING("Refusing to schedule shutdown state machine");
@ -3335,7 +3325,7 @@ bool MediaDecoderStateMachine::OnDecodeThread() const
return !DecodeTaskQueue() || DecodeTaskQueue()->IsCurrentThreadIn();
}
bool MediaDecoderStateMachine::OnStateMachineThread() const
bool MediaDecoderStateMachine::OnTaskQueue() const
{
return TaskQueue()->IsCurrentThreadIn();
}
@ -3438,7 +3428,7 @@ void MediaDecoderStateMachine::OnAudioSinkComplete()
void MediaDecoderStateMachine::OnAudioSinkError()
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
// AudioSink not used with captured streams, so ignore errors in this case.
if (mAudioCaptured) {

View File

@ -203,7 +203,7 @@ public:
// Functions used by assertions to ensure we're calling things
// on the appropriate threads.
bool OnDecodeThread() const;
bool OnStateMachineThread() const;
bool OnTaskQueue() const;
MediaDecoderOwner::NextFrameStatus GetNextFrameStatus();
@ -330,7 +330,7 @@ public:
void OnDelayedSchedule()
{
MOZ_ASSERT(OnStateMachineThread());
MOZ_ASSERT(OnTaskQueue());
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
mDelayedScheduler.CompleteRequest();
ScheduleStateMachine();
@ -756,8 +756,7 @@ protected:
void Reset()
{
MOZ_ASSERT(mSelf->OnStateMachineThread(),
"Must be on state machine queue to disconnect");
MOZ_ASSERT(mSelf->OnTaskQueue(), "Must be on state machine queue to disconnect");
if (IsScheduled()) {
mRequest.Disconnect();
mTarget = TimeStamp();

View File

@ -156,9 +156,9 @@ SourceBufferDecoder::GetReentrantMonitor()
}
bool
SourceBufferDecoder::OnStateMachineThread() const
SourceBufferDecoder::OnStateMachineTaskQueue() const
{
return mParentDecoder->OnStateMachineThread();
return mParentDecoder->OnStateMachineTaskQueue();
}
bool

View File

@ -41,7 +41,7 @@ public:
virtual bool IsShutdown() const final override;
virtual bool IsTransportSeekable() final override;
virtual bool OnDecodeThread() const final override;
virtual bool OnStateMachineThread() const final override;
virtual bool OnStateMachineTaskQueue() const final override;
virtual int64_t GetMediaDuration() final override;
virtual layers::ImageContainer* GetImageContainer() final override;
virtual MediaDecoderOwner* GetOwner() final override;

View File

@ -1040,8 +1040,8 @@ struct nsAutoOggSyncState {
int64_t OggReader::RangeEndTime(int64_t aEndOffset)
{
NS_ASSERTION(mDecoder->OnStateMachineThread() || mDecoder->OnDecodeThread(),
"Should be on state machine or decode thread.");
NS_ASSERTION(mDecoder->OnStateMachineTaskQueue() || mDecoder->OnDecodeThread(),
"Should be on state machine or decode taks queue");
MediaResource* resource = mDecoder->GetResource();
NS_ENSURE_TRUE(resource != nullptr, -1);
@ -1966,8 +1966,8 @@ nsresult OggReader::GetBuffered(dom::TimeRanges* aBuffered)
VideoData* OggReader::FindStartTime(int64_t& aOutStartTime)
{
NS_ASSERTION(mDecoder->OnStateMachineThread() || mDecoder->OnDecodeThread(),
"Should be on state machine or decode thread.");
NS_ASSERTION(mDecoder->OnStateMachineTaskQueue() || mDecoder->OnDecodeThread(),
"Should be on state machine or decode task queue");
// Extract the start times of the bitstreams in order to calculate
// the duration.

View File

@ -121,8 +121,8 @@ RawReader::IsMediaSeekable()
bool RawReader::DecodeAudioData()
{
NS_ASSERTION(mDecoder->OnStateMachineThread() || mDecoder->OnDecodeThread(),
"Should be on state machine thread or decode thread.");
NS_ASSERTION(mDecoder->OnStateMachineTaskQueue() || mDecoder->OnDecodeThread(),
"Should be on state machine or decode task queue.");
return false;
}

View File

@ -57,7 +57,7 @@ BufferDecoder::IsShutdown() const
}
bool
BufferDecoder::OnStateMachineThread() const
BufferDecoder::OnStateMachineTaskQueue() const
{
// BufferDecoder doesn't have the concept of a state machine.
return true;

View File

@ -34,7 +34,7 @@ public:
virtual bool IsShutdown() const final override;
virtual bool OnStateMachineThread() const final override;
virtual bool OnStateMachineTaskQueue() const final override;
virtual bool OnDecodeThread() const final override;