зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1144519 - Switch MediaDecoderReader subclasses to use OnTaskQueue(). r=jya
This commit is contained in:
Родитель
e9a60fe021
Коммит
3c6cda710d
|
@ -43,7 +43,7 @@ nsresult AndroidMediaReader::Init(MediaDecoderReader* aCloneDonor)
|
|||
nsresult AndroidMediaReader::ReadMetadata(MediaInfo* aInfo,
|
||||
MetadataTags** aTags)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
if (!mPlugin) {
|
||||
mPlugin = GetAndroidMediaPluginHost()->CreateDecoder(mDecoder->GetResource(), mType);
|
||||
|
@ -289,7 +289,7 @@ bool AndroidMediaReader::DecodeVideoFrame(bool &aKeyframeSkip,
|
|||
|
||||
bool AndroidMediaReader::DecodeAudioData()
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
// This is the approximate byte position in the stream.
|
||||
int64_t pos = mDecoder->GetResource()->Tell();
|
||||
|
@ -322,7 +322,7 @@ bool AndroidMediaReader::DecodeAudioData()
|
|||
nsRefPtr<MediaDecoderReader::SeekPromise>
|
||||
AndroidMediaReader::Seek(int64_t aTarget, int64_t aEndTime)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
if (mHasAudio && mHasVideo) {
|
||||
// The decoder seeks/demuxes audio and video streams separately. So if
|
||||
|
|
|
@ -280,7 +280,7 @@ AppleMP3Reader::AudioSampleCallback(UInt32 aNumBytes,
|
|||
bool
|
||||
AppleMP3Reader::DecodeAudioData()
|
||||
{
|
||||
MOZ_ASSERT(mDecoder->OnDecodeThread(), "Should be on decode thread");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
// Read AUDIO_READ_BYTES if we can
|
||||
char bytes[AUDIO_READ_BYTES];
|
||||
|
@ -314,7 +314,7 @@ bool
|
|||
AppleMP3Reader::DecodeVideoFrame(bool &aKeyframeSkip,
|
||||
int64_t aTimeThreshold)
|
||||
{
|
||||
MOZ_ASSERT(mDecoder->OnDecodeThread(), "Should be on decode thread");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -322,14 +322,14 @@ AppleMP3Reader::DecodeVideoFrame(bool &aKeyframeSkip,
|
|||
bool
|
||||
AppleMP3Reader::HasAudio()
|
||||
{
|
||||
MOZ_ASSERT(mDecoder->OnDecodeThread(), "Should be on decode thread");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
return mStreamReady;
|
||||
}
|
||||
|
||||
bool
|
||||
AppleMP3Reader::HasVideo()
|
||||
{
|
||||
MOZ_ASSERT(mDecoder->OnDecodeThread(), "Should be on decode thread");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -369,7 +369,7 @@ nsresult
|
|||
AppleMP3Reader::ReadMetadata(MediaInfo* aInfo,
|
||||
MetadataTags** aTags)
|
||||
{
|
||||
MOZ_ASSERT(mDecoder->OnDecodeThread(), "Should be on decode thread");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
*aTags = nullptr;
|
||||
|
||||
|
@ -495,7 +495,7 @@ AppleMP3Reader::SetupDecoder()
|
|||
nsRefPtr<MediaDecoderReader::SeekPromise>
|
||||
AppleMP3Reader::Seek(int64_t aTime, int64_t aEndTime)
|
||||
{
|
||||
MOZ_ASSERT(mDecoder->OnDecodeThread(), "Should be on decode thread");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
// Find the exact frame/packet that contains |aTime|.
|
||||
mCurrentAudioFrame = aTime * mAudioSampleRate / USECS_PER_S;
|
||||
|
|
|
@ -104,7 +104,7 @@ nsresult
|
|||
DirectShowReader::ReadMetadata(MediaInfo* aInfo,
|
||||
MetadataTags** aTags)
|
||||
{
|
||||
MOZ_ASSERT(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
HRESULT hr;
|
||||
nsresult rv;
|
||||
|
||||
|
@ -245,7 +245,7 @@ UnsignedByteToAudioSample(uint8_t aValue)
|
|||
bool
|
||||
DirectShowReader::Finish(HRESULT aStatus)
|
||||
{
|
||||
MOZ_ASSERT(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
LOG("DirectShowReader::Finish(0x%x)", aStatus);
|
||||
// Notify the filter graph of end of stream.
|
||||
|
@ -302,7 +302,7 @@ private:
|
|||
bool
|
||||
DirectShowReader::DecodeAudioData()
|
||||
{
|
||||
MOZ_ASSERT(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
HRESULT hr;
|
||||
|
||||
SampleSink* sink = mAudioSinkFilter->GetSampleSink();
|
||||
|
@ -349,21 +349,21 @@ bool
|
|||
DirectShowReader::DecodeVideoFrame(bool &aKeyframeSkip,
|
||||
int64_t aTimeThreshold)
|
||||
{
|
||||
MOZ_ASSERT(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
DirectShowReader::HasAudio()
|
||||
{
|
||||
MOZ_ASSERT(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
DirectShowReader::HasVideo()
|
||||
{
|
||||
MOZ_ASSERT(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -382,7 +382,7 @@ nsresult
|
|||
DirectShowReader::SeekInternal(int64_t aTargetUs)
|
||||
{
|
||||
HRESULT hr;
|
||||
MOZ_ASSERT(mDecoder->OnDecodeThread(), "Should be on decode thread.");\
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
LOG("DirectShowReader::Seek() target=%lld", aTargetUs);
|
||||
|
||||
|
|
|
@ -366,7 +366,7 @@ GStreamerReader::GetDataLength()
|
|||
nsresult GStreamerReader::ReadMetadata(MediaInfo* aInfo,
|
||||
MetadataTags** aTags)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
nsresult ret = NS_OK;
|
||||
|
||||
/*
|
||||
|
@ -638,7 +638,7 @@ nsresult GStreamerReader::ResetDecode()
|
|||
|
||||
bool GStreamerReader::DecodeAudioData()
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
GstBuffer *buffer = nullptr;
|
||||
|
||||
|
@ -724,7 +724,7 @@ bool GStreamerReader::DecodeAudioData()
|
|||
bool GStreamerReader::DecodeVideoFrame(bool &aKeyFrameSkip,
|
||||
int64_t aTimeThreshold)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
GstBuffer *buffer = nullptr;
|
||||
|
||||
|
@ -844,7 +844,7 @@ bool GStreamerReader::DecodeVideoFrame(bool &aKeyFrameSkip,
|
|||
nsRefPtr<MediaDecoderReader::SeekPromise>
|
||||
GStreamerReader::Seek(int64_t aTarget, int64_t aEndTime)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
gint64 seekPos = aTarget * GST_USECOND;
|
||||
LOG(PR_LOG_DEBUG, "%p About to seek to %" GST_TIME_FORMAT,
|
||||
|
|
|
@ -165,7 +165,7 @@ nsresult OggReader::ResetDecode()
|
|||
|
||||
nsresult OggReader::ResetDecode(bool start)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (NS_FAILED(MediaDecoderReader::ResetDecode())) {
|
||||
|
@ -369,7 +369,7 @@ void OggReader::SetupMediaTracksInfo(const nsTArray<uint32_t>& aSerials)
|
|||
nsresult OggReader::ReadMetadata(MediaInfo* aInfo,
|
||||
MetadataTags** aTags)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
// We read packets until all bitstreams have read all their header packets.
|
||||
// We record the offset of the first non-header page so that we know
|
||||
|
@ -671,7 +671,7 @@ nsresult OggReader::DecodeOpus(ogg_packet* aPacket) {
|
|||
|
||||
bool OggReader::DecodeAudioData()
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
DebugOnly<bool> haveCodecState = mVorbisState != nullptr ||
|
||||
mOpusState != nullptr;
|
||||
NS_ASSERTION(haveCodecState, "Need audio codec state to decode audio");
|
||||
|
@ -895,7 +895,7 @@ nsresult OggReader::DecodeTheora(ogg_packet* aPacket, int64_t aTimeThreshold)
|
|||
bool OggReader::DecodeVideoFrame(bool &aKeyframeSkip,
|
||||
int64_t aTimeThreshold)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
// Record number of frames decoded and parsed. Automatically update the
|
||||
// stats counters using the AutoNotifyDecoded stack-based class.
|
||||
|
@ -941,7 +941,7 @@ bool OggReader::DecodeVideoFrame(bool &aKeyframeSkip,
|
|||
|
||||
bool OggReader::ReadOggPage(ogg_page* aPage)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
int ret = 0;
|
||||
while((ret = ogg_sync_pageseek(&mOggState, aPage)) <= 0) {
|
||||
|
@ -975,7 +975,7 @@ bool OggReader::ReadOggPage(ogg_page* aPage)
|
|||
|
||||
ogg_packet* OggReader::NextOggPacket(OggCodecState* aCodecState)
|
||||
{
|
||||
MOZ_ASSERT(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
if (!aCodecState || !aCodecState->mActive) {
|
||||
return nullptr;
|
||||
|
@ -1018,7 +1018,7 @@ GetChecksum(ogg_page* page)
|
|||
|
||||
int64_t OggReader::RangeStartTime(int64_t aOffset)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
MediaResource* resource = mDecoder->GetResource();
|
||||
NS_ENSURE_TRUE(resource != nullptr, 0);
|
||||
nsresult res = resource->Seek(nsISeekableStream::NS_SEEK_SET, aOffset);
|
||||
|
@ -1040,8 +1040,7 @@ struct nsAutoOggSyncState {
|
|||
|
||||
int64_t OggReader::RangeEndTime(int64_t aEndOffset)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnStateMachineTaskQueue() || mDecoder->OnDecodeThread(),
|
||||
"Should be on state machine or decode taks queue");
|
||||
MOZ_ASSERT(OnTaskQueue() || mDecoder->OnStateMachineTaskQueue());
|
||||
|
||||
MediaResource* resource = mDecoder->GetResource();
|
||||
NS_ENSURE_TRUE(resource != nullptr, -1);
|
||||
|
@ -1181,7 +1180,7 @@ int64_t OggReader::RangeEndTime(int64_t aStartOffset,
|
|||
|
||||
nsresult OggReader::GetSeekRanges(nsTArray<SeekRange>& aRanges)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
AutoPinned<MediaResource> resource(mDecoder->GetResource());
|
||||
nsTArray<MediaByteRange> cached;
|
||||
nsresult res = resource->GetCachedRanges(cached);
|
||||
|
@ -1221,7 +1220,7 @@ OggReader::SelectSeekRange(const nsTArray<SeekRange>& ranges,
|
|||
int64_t aEndTime,
|
||||
bool aExact)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
int64_t so = 0;
|
||||
int64_t eo = mDecoder->GetResource()->GetLength();
|
||||
int64_t st = aStartTime;
|
||||
|
@ -1437,7 +1436,7 @@ OggReader::Seek(int64_t aTarget, int64_t aEndTime)
|
|||
|
||||
nsresult OggReader::SeekInternal(int64_t aTarget, int64_t aEndTime)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
if (mIsChained)
|
||||
return NS_ERROR_FAILURE;
|
||||
LOG(PR_LOG_DEBUG, ("%p About to seek to %lld", mDecoder, aTarget));
|
||||
|
@ -1594,7 +1593,7 @@ nsresult OggReader::SeekBisection(int64_t aTarget,
|
|||
const SeekRange& aRange,
|
||||
uint32_t aFuzz)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
nsresult res;
|
||||
MediaResource* resource = mDecoder->GetResource();
|
||||
|
||||
|
@ -1966,8 +1965,7 @@ nsresult OggReader::GetBuffered(dom::TimeRanges* aBuffered)
|
|||
|
||||
VideoData* OggReader::FindStartTime(int64_t& aOutStartTime)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnStateMachineTaskQueue() || mDecoder->OnDecodeThread(),
|
||||
"Should be on state machine or decode task queue");
|
||||
MOZ_ASSERT(OnTaskQueue() || mDecoder->OnStateMachineTaskQueue());
|
||||
|
||||
// Extract the start times of the bitstreams in order to calculate
|
||||
// the duration.
|
||||
|
|
|
@ -658,7 +658,7 @@ nsresult
|
|||
MediaCodecReader::ReadMetadata(MediaInfo* aInfo,
|
||||
MetadataTags** aTags)
|
||||
{
|
||||
MOZ_ASSERT(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
if (!ReallocateResources()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -1031,7 +1031,7 @@ MediaCodecReader::DecodeVideoFrameSync(int64_t aTimeThreshold)
|
|||
nsRefPtr<MediaDecoderReader::SeekPromise>
|
||||
MediaCodecReader::Seek(int64_t aTime, int64_t aEndTime)
|
||||
{
|
||||
MOZ_ASSERT(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
mVideoTrack.mSeekTimeUs = aTime;
|
||||
mAudioTrack.mSeekTimeUs = aTime;
|
||||
|
|
|
@ -44,7 +44,7 @@ MediaOmxCommonReader::MediaOmxCommonReader(AbstractMediaDecoder *aDecoder)
|
|||
#ifdef MOZ_AUDIO_OFFLOAD
|
||||
void MediaOmxCommonReader::CheckAudioOffload()
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
char offloadProp[128];
|
||||
property_get("audio.offload.disable", offloadProp, "0");
|
||||
|
|
|
@ -255,7 +255,7 @@ void MediaOmxReader::PreReadMetadata()
|
|||
nsresult MediaOmxReader::ReadMetadata(MediaInfo* aInfo,
|
||||
MetadataTags** aTags)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
EnsureActive();
|
||||
|
||||
*aTags = nullptr;
|
||||
|
@ -365,7 +365,7 @@ MediaOmxReader::IsMediaSeekable()
|
|||
bool MediaOmxReader::DecodeVideoFrame(bool &aKeyframeSkip,
|
||||
int64_t aTimeThreshold)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
EnsureActive();
|
||||
|
||||
// Record number of frames decoded and parsed. Automatically update the
|
||||
|
@ -509,7 +509,7 @@ void MediaOmxReader::NotifyDataArrived(const char* aBuffer, uint32_t aLength, in
|
|||
|
||||
bool MediaOmxReader::DecodeAudioData()
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
EnsureActive();
|
||||
|
||||
// This is the approximate byte position in the stream.
|
||||
|
@ -544,7 +544,7 @@ bool MediaOmxReader::DecodeAudioData()
|
|||
nsRefPtr<MediaDecoderReader::SeekPromise>
|
||||
MediaOmxReader::Seek(int64_t aTarget, int64_t aEndTime)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
EnsureActive();
|
||||
|
||||
VideoFrameContainer* container = mDecoder->GetVideoFrameContainer();
|
||||
|
|
|
@ -39,8 +39,7 @@ nsresult RawReader::ResetDecode()
|
|||
nsresult RawReader::ReadMetadata(MediaInfo* aInfo,
|
||||
MetadataTags** aTags)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(),
|
||||
"Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
MediaResource* resource = mDecoder->GetResource();
|
||||
NS_ASSERTION(resource, "Decoder has no media resource");
|
||||
|
@ -121,8 +120,7 @@ RawReader::IsMediaSeekable()
|
|||
|
||||
bool RawReader::DecodeAudioData()
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnStateMachineTaskQueue() || mDecoder->OnDecodeThread(),
|
||||
"Should be on state machine or decode task queue.");
|
||||
MOZ_ASSERT(OnTaskQueue() || mDecoder->OnStateMachineTaskQueue());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -152,8 +150,7 @@ bool RawReader::ReadFromResource(MediaResource *aResource, uint8_t* aBuf,
|
|||
bool RawReader::DecodeVideoFrame(bool &aKeyframeSkip,
|
||||
int64_t aTimeThreshold)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(),
|
||||
"Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
// Record number of frames decoded and parsed. Automatically update the
|
||||
// stats counters using the AutoNotifyDecoded stack-based class.
|
||||
|
@ -246,8 +243,7 @@ RawReader::Seek(int64_t aTime, int64_t aEndTime)
|
|||
|
||||
nsresult RawReader::SeekInternal(int64_t aTime)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(),
|
||||
"Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
MediaResource *resource = mDecoder->GetResource();
|
||||
NS_ASSERTION(resource, "Decoder has no media resource");
|
||||
|
|
|
@ -128,7 +128,7 @@ nsresult WaveReader::Init(MediaDecoderReader* aCloneDonor)
|
|||
nsresult WaveReader::ReadMetadata(MediaInfo* aInfo,
|
||||
MetadataTags** aTags)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
bool loaded = LoadRIFFChunk();
|
||||
if (!loaded) {
|
||||
|
@ -192,7 +192,7 @@ SignedShortToAudioSample<int16_t>(int16_t aValue)
|
|||
|
||||
bool WaveReader::DecodeAudioData()
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
int64_t pos = GetPosition() - mWavePCMOffset;
|
||||
int64_t len = GetDataLength();
|
||||
|
@ -252,7 +252,7 @@ bool WaveReader::DecodeAudioData()
|
|||
bool WaveReader::DecodeVideoFrame(bool &aKeyframeSkip,
|
||||
int64_t aTimeThreshold)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -260,7 +260,7 @@ bool WaveReader::DecodeVideoFrame(bool &aKeyframeSkip,
|
|||
nsRefPtr<MediaDecoderReader::SeekPromise>
|
||||
WaveReader::Seek(int64_t aTarget, int64_t aEndTime)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
LOG(PR_LOG_DEBUG, ("%p About to seek to %lld", mDecoder, aTarget));
|
||||
|
||||
if (NS_FAILED(ResetDecode())) {
|
||||
|
|
|
@ -353,7 +353,7 @@ IntelWebMVideoDecoder::DecodeVideoFrame(bool& aKeyframeSkip,
|
|||
NS_ENSURE_SUCCESS(rv, false);
|
||||
}
|
||||
|
||||
NS_ASSERTION(mReader->GetDecoder()->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(mReader->OnTaskQueue());
|
||||
bool rv = Decode();
|
||||
{
|
||||
// Report the number of "decoded" frames as the difference in the
|
||||
|
|
|
@ -74,8 +74,7 @@ bool
|
|||
SoftwareWebMVideoDecoder::DecodeVideoFrame(bool &aKeyframeSkip,
|
||||
int64_t aTimeThreshold)
|
||||
{
|
||||
NS_ASSERTION(mReader->GetDecoder()->OnDecodeThread(),
|
||||
"Should be on decode thread.");
|
||||
MOZ_ASSERT(mReader->OnTaskQueue());
|
||||
|
||||
// Record number of frames decoded and parsed. Automatically update the
|
||||
// stats counters using the AutoNotifyDecoded stack-based class.
|
||||
|
|
|
@ -329,7 +329,10 @@ void WebMReader::Cleanup()
|
|||
nsresult WebMReader::ReadMetadata(MediaInfo* aInfo,
|
||||
MetadataTags** aTags)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
// We can't use OnTaskQueue() here because of the wacky initialization task
|
||||
// queue that TrackBuffer uses. We should be able to fix this when we do
|
||||
// bug 1148234.
|
||||
MOZ_ASSERT(mDecoder->OnDecodeThread());
|
||||
|
||||
nestegg_io io;
|
||||
io.read = webm_read;
|
||||
|
@ -583,7 +586,7 @@ bool WebMReader::InitOpusDecoder()
|
|||
|
||||
bool WebMReader::DecodeAudioPacket(nestegg_packet* aPacket, int64_t aOffset)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
int r = 0;
|
||||
unsigned int count = 0;
|
||||
|
@ -931,7 +934,7 @@ nsReturnRef<NesteggPacketHolder> WebMReader::NextPacket(TrackType aTrackType)
|
|||
|
||||
bool WebMReader::DecodeAudioData()
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
nsAutoRef<NesteggPacketHolder> holder(NextPacket(AUDIO));
|
||||
if (!holder) {
|
||||
|
@ -1064,7 +1067,7 @@ WebMReader::Seek(int64_t aTarget, int64_t aEndTime)
|
|||
|
||||
nsresult WebMReader::SeekInternal(int64_t aTarget)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
if (mVideoDecoder) {
|
||||
nsresult rv = mVideoDecoder->Flush();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
|
|
@ -143,13 +143,13 @@ public:
|
|||
|
||||
virtual bool HasAudio() override
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
return mHasAudio;
|
||||
}
|
||||
|
||||
virtual bool HasVideo() override
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
return mHasVideo;
|
||||
}
|
||||
|
||||
|
|
|
@ -154,14 +154,14 @@ WMFReader::Init(MediaDecoderReader* aCloneDonor)
|
|||
bool
|
||||
WMFReader::HasAudio()
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
return mHasAudio;
|
||||
}
|
||||
|
||||
bool
|
||||
WMFReader::HasVideo()
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
return mHasVideo;
|
||||
}
|
||||
|
||||
|
@ -507,7 +507,7 @@ nsresult
|
|||
WMFReader::ReadMetadata(MediaInfo* aInfo,
|
||||
MetadataTags** aTags)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
DECODER_LOG("WMFReader::ReadMetadata()");
|
||||
HRESULT hr;
|
||||
|
@ -575,7 +575,7 @@ WMFReader::IsMediaSeekable()
|
|||
bool
|
||||
WMFReader::DecodeAudioData()
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
HRESULT hr;
|
||||
hr = mSourceReader->ReadSample(MF_SOURCE_READER_FIRST_AUDIO_STREAM,
|
||||
|
@ -804,7 +804,7 @@ bool
|
|||
WMFReader::DecodeVideoFrame(bool &aKeyframeSkip,
|
||||
int64_t aTimeThreshold)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
// Record number of frames decoded and parsed. Automatically update the
|
||||
// stats counters using the AutoNotifyDecoded stack-based class.
|
||||
|
@ -909,7 +909,7 @@ WMFReader::SeekInternal(int64_t aTargetUs)
|
|||
{
|
||||
DECODER_LOG("WMFReader::Seek() %lld", aTargetUs);
|
||||
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
#ifdef DEBUG
|
||||
bool canSeek = false;
|
||||
GetSourceReaderCanSeek(mSourceReader, canSeek);
|
||||
|
|
Загрузка…
Ссылка в новой задаче