зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1230338 - Record video frames dropped by the compositor, or while flushing during skip-to-keyframe. r=jya
This commit is contained in:
Родитель
caf5976449
Коммит
6ef854d267
|
@ -510,6 +510,14 @@ MediaFormatReader::RequestVideoData(bool aSkipToNextKeyframe,
|
|||
if (ShouldSkip(aSkipToNextKeyframe, timeThreshold)) {
|
||||
// Cancel any pending demux request.
|
||||
mVideo.mDemuxRequest.DisconnectIfExists();
|
||||
|
||||
// I think it's still possible for an output to have been sent from the decoder
|
||||
// and is currently sitting in our event queue waiting to be processed. The following
|
||||
// flush won't clear it, and when we return to the event loop it'll be added to our
|
||||
// output queue and be used.
|
||||
// This code will count that as dropped, which was the intent, but not quite true.
|
||||
mDecoder->NotifyDecodedFrames(0, 0, SizeOfVideoQueueInFrames());
|
||||
|
||||
Flush(TrackInfo::kVideoTrack);
|
||||
RefPtr<VideoDataPromise> p = mVideo.mPromise.Ensure(__func__);
|
||||
SkipVideoDemuxToNextKeyFrame(timeThreshold);
|
||||
|
|
|
@ -78,6 +78,8 @@ public:
|
|||
B2G_ACL_EXPORT ImageContainer* GetImageContainer();
|
||||
void ForgetElement() { mElement = nullptr; }
|
||||
|
||||
uint32_t GetDroppedImageCount() { return mImageContainer->GetDroppedImageCount(); }
|
||||
|
||||
protected:
|
||||
void SetCurrentFramesLocked(const gfx::IntSize& aIntrinsicSize,
|
||||
const nsTArray<ImageContainer::NonOwningImage>& aImages);
|
||||
|
|
|
@ -35,6 +35,7 @@ VideoSink::VideoSink(AbstractThread* aThread,
|
|||
, mRealTime(aRealTime)
|
||||
, mFrameStats(aFrameStats)
|
||||
, mVideoFrameEndTime(-1)
|
||||
, mOldDroppedCount(0)
|
||||
, mHasVideo(false)
|
||||
, mUpdateScheduler(aThread)
|
||||
, mVideoQueueSendToCompositorSize(aVQueueSentToCompositerSize)
|
||||
|
@ -327,6 +328,10 @@ VideoSink::RenderVideoFrames(int32_t aMaxFrames,
|
|||
frame->mTime, frame->mFrameID, VideoQueue().GetSize());
|
||||
}
|
||||
mContainer->SetCurrentFrames(frames[0]->As<VideoData>()->mDisplay, images);
|
||||
|
||||
uint32_t dropped = mContainer->GetDroppedImageCount();
|
||||
mFrameStats.NotifyDecodedFrames(0, 0, dropped - mOldDroppedCount);
|
||||
mOldDroppedCount = dropped;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -129,6 +129,8 @@ private:
|
|||
// in microseconds.
|
||||
int64_t mVideoFrameEndTime;
|
||||
|
||||
uint32_t mOldDroppedCount;
|
||||
|
||||
// Event listeners for VideoQueue
|
||||
MediaEventListener mPushListener;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче