mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 13:25:37 +00:00
Bug 1112446 - Add logging for media queue lengths. r=ajones
This commit is contained in:
parent
5bb2a0b324
commit
675718e2ea
@ -104,6 +104,16 @@ size_t MediaDecoderReader::SizeOfAudioQueueInBytes() const
|
|||||||
return functor.mSize;
|
return functor.mSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t MediaDecoderReader::SizeOfVideoQueueInFrames()
|
||||||
|
{
|
||||||
|
return mVideoQueue.GetSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t MediaDecoderReader::SizeOfAudioQueueInFrames()
|
||||||
|
{
|
||||||
|
return mAudioQueue.GetSize();
|
||||||
|
}
|
||||||
|
|
||||||
nsresult MediaDecoderReader::ResetDecode()
|
nsresult MediaDecoderReader::ResetDecode()
|
||||||
{
|
{
|
||||||
nsresult res = NS_OK;
|
nsresult res = NS_OK;
|
||||||
|
@ -188,6 +188,9 @@ public:
|
|||||||
// the audio queue.
|
// the audio queue.
|
||||||
size_t SizeOfAudioQueueInBytes() const;
|
size_t SizeOfAudioQueueInBytes() const;
|
||||||
|
|
||||||
|
virtual size_t SizeOfVideoQueueInFrames();
|
||||||
|
virtual size_t SizeOfAudioQueueInFrames();
|
||||||
|
|
||||||
// Only used by WebMReader and MediaOmxReader for now, so stub here rather
|
// Only used by WebMReader and MediaOmxReader for now, so stub here rather
|
||||||
// than in every reader than inherits from MediaDecoderReader.
|
// than in every reader than inherits from MediaDecoderReader.
|
||||||
virtual void NotifyDataArrived(const char* aBuffer, uint32_t aLength, int64_t aOffset) {}
|
virtual void NotifyDataArrived(const char* aBuffer, uint32_t aLength, int64_t aOffset) {}
|
||||||
|
@ -623,6 +623,9 @@ MediaDecoderStateMachine::DecodeVideo()
|
|||||||
mVideoDecodeStartTime = TimeStamp::Now();
|
mVideoDecodeStartTime = TimeStamp::Now();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SAMPLE_LOG("DecodeVideo() queued=%i, decoder-queued=%o, skip=%i, time=%lld",
|
||||||
|
VideoQueue().GetSize(), mReader->SizeOfVideoQueueInFrames(), skipToNextKeyFrame, currentTime);
|
||||||
|
|
||||||
mReader->RequestVideoData(skipToNextKeyFrame, currentTime)
|
mReader->RequestVideoData(skipToNextKeyFrame, currentTime)
|
||||||
->Then(DecodeTaskQueue(), __func__, this,
|
->Then(DecodeTaskQueue(), __func__, this,
|
||||||
&MediaDecoderStateMachine::OnVideoDecoded,
|
&MediaDecoderStateMachine::OnVideoDecoded,
|
||||||
@ -669,6 +672,10 @@ MediaDecoderStateMachine::DecodeAudio()
|
|||||||
mIsAudioPrerolling = false;
|
mIsAudioPrerolling = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SAMPLE_LOG("DecodeAudio() queued=%i, decoder-queued=%o",
|
||||||
|
AudioQueue().GetSize(), mReader->SizeOfAudioQueueInFrames());
|
||||||
|
|
||||||
mReader->RequestAudioData()->Then(DecodeTaskQueue(), __func__, this,
|
mReader->RequestAudioData()->Then(DecodeTaskQueue(), __func__, this,
|
||||||
&MediaDecoderStateMachine::OnAudioDecoded,
|
&MediaDecoderStateMachine::OnAudioDecoded,
|
||||||
&MediaDecoderStateMachine::OnAudioNotDecoded);
|
&MediaDecoderStateMachine::OnAudioNotDecoded);
|
||||||
@ -2760,7 +2767,9 @@ void MediaDecoderStateMachine::RenderVideoFrame(VideoData* aData,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
VERBOSE_LOG("playing video frame %lld", aData->mTime);
|
VERBOSE_LOG("playing video frame %lld (queued=%i, state-machine=%i, decoder-queued=%i)",
|
||||||
|
aData->mTime, VideoQueue().GetSize() + mReader->SizeOfVideoQueueInFrames(),
|
||||||
|
VideoQueue().GetSize(), mReader->SizeOfVideoQueueInFrames());
|
||||||
|
|
||||||
VideoFrameContainer* container = mDecoder->GetVideoFrameContainer();
|
VideoFrameContainer* container = mDecoder->GetVideoFrameContainer();
|
||||||
if (container) {
|
if (container) {
|
||||||
|
@ -647,6 +647,26 @@ MP4Reader::PopSample(TrackType aTrack)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t
|
||||||
|
MP4Reader::SizeOfVideoQueueInFrames()
|
||||||
|
{
|
||||||
|
return SizeOfQueue(kVideo);
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t
|
||||||
|
MP4Reader::SizeOfAudioQueueInFrames()
|
||||||
|
{
|
||||||
|
return SizeOfQueue(kAudio);
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t
|
||||||
|
MP4Reader::SizeOfQueue(TrackType aTrack)
|
||||||
|
{
|
||||||
|
auto& decoder = GetDecoderData(aTrack);
|
||||||
|
MonitorAutoLock lock(decoder.mMonitor);
|
||||||
|
return decoder.mOutput.Length() + (decoder.mNumSamplesInput - decoder.mNumSamplesOutput);
|
||||||
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
MP4Reader::ResetDecode()
|
MP4Reader::ResetDecode()
|
||||||
{
|
{
|
||||||
|
@ -37,6 +37,9 @@ public:
|
|||||||
|
|
||||||
virtual nsresult Init(MediaDecoderReader* aCloneDonor) MOZ_OVERRIDE;
|
virtual nsresult Init(MediaDecoderReader* aCloneDonor) MOZ_OVERRIDE;
|
||||||
|
|
||||||
|
virtual size_t SizeOfVideoQueueInFrames() MOZ_OVERRIDE;
|
||||||
|
virtual size_t SizeOfAudioQueueInFrames() MOZ_OVERRIDE;
|
||||||
|
|
||||||
virtual nsRefPtr<VideoDataPromise>
|
virtual nsRefPtr<VideoDataPromise>
|
||||||
RequestVideoData(bool aSkipToNextKeyframe, int64_t aTimeThreshold) MOZ_OVERRIDE;
|
RequestVideoData(bool aSkipToNextKeyframe, int64_t aTimeThreshold) MOZ_OVERRIDE;
|
||||||
|
|
||||||
@ -117,6 +120,8 @@ private:
|
|||||||
bool IsWaitingOnCodecResource();
|
bool IsWaitingOnCodecResource();
|
||||||
virtual bool IsWaitingOnCDMResource() MOZ_OVERRIDE;
|
virtual bool IsWaitingOnCDMResource() MOZ_OVERRIDE;
|
||||||
|
|
||||||
|
size_t SizeOfQueue(TrackType aTrack);
|
||||||
|
|
||||||
nsAutoPtr<mp4_demuxer::MP4Demuxer> mDemuxer;
|
nsAutoPtr<mp4_demuxer::MP4Demuxer> mDemuxer;
|
||||||
nsAutoPtr<PlatformDecoderModule> mPlatform;
|
nsAutoPtr<PlatformDecoderModule> mPlatform;
|
||||||
|
|
||||||
|
@ -93,6 +93,26 @@ MediaSourceReader::IsWaitingMediaResources()
|
|||||||
return !mHasEssentialTrackBuffers;
|
return !mHasEssentialTrackBuffers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t
|
||||||
|
MediaSourceReader::SizeOfVideoQueueInFrames()
|
||||||
|
{
|
||||||
|
if (!mVideoReader) {
|
||||||
|
MSE_DEBUG("MediaSourceReader(%p)::SizeOfVideoQueue called with no video reader", this);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return mVideoReader->SizeOfVideoQueueInFrames();
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t
|
||||||
|
MediaSourceReader::SizeOfAudioQueueInFrames()
|
||||||
|
{
|
||||||
|
if (!mAudioReader) {
|
||||||
|
MSE_DEBUG("MediaSourceReader(%p)::SizeOfAudioQueue called with no audio reader", this);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return mAudioReader->SizeOfAudioQueueInFrames();
|
||||||
|
}
|
||||||
|
|
||||||
nsRefPtr<MediaDecoderReader::AudioDataPromise>
|
nsRefPtr<MediaDecoderReader::AudioDataPromise>
|
||||||
MediaSourceReader::RequestAudioData()
|
MediaSourceReader::RequestAudioData()
|
||||||
{
|
{
|
||||||
|
@ -50,6 +50,9 @@ public:
|
|||||||
nsRefPtr<VideoDataPromise>
|
nsRefPtr<VideoDataPromise>
|
||||||
RequestVideoData(bool aSkipToNextKeyframe, int64_t aTimeThreshold) MOZ_OVERRIDE;
|
RequestVideoData(bool aSkipToNextKeyframe, int64_t aTimeThreshold) MOZ_OVERRIDE;
|
||||||
|
|
||||||
|
virtual size_t SizeOfVideoQueueInFrames() MOZ_OVERRIDE;
|
||||||
|
virtual size_t SizeOfAudioQueueInFrames() MOZ_OVERRIDE;
|
||||||
|
|
||||||
void OnAudioDecoded(AudioData* aSample);
|
void OnAudioDecoded(AudioData* aSample);
|
||||||
void OnAudioNotDecoded(NotDecodedReason aReason);
|
void OnAudioNotDecoded(NotDecodedReason aReason);
|
||||||
void OnVideoDecoded(VideoData* aSample);
|
void OnVideoDecoded(VideoData* aSample);
|
||||||
|
Loading…
Reference in New Issue
Block a user