diff options
author | sandersd <sandersd@chromium.org> | 2014-12-02 11:37:35 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-02 19:37:57 +0000 |
commit | a6d54b69098f7b4da1606cdcc6f39156fbdbf9ac (patch) | |
tree | b51462aaed0f8771dc5973b7ea1a1fec64e9940c /content | |
parent | 5ff45d90dc1fae834dc16003474d216a96a90d09 (diff) | |
download | chromium_src-a6d54b69098f7b4da1606cdcc6f39156fbdbf9ac.zip chromium_src-a6d54b69098f7b4da1606cdcc6f39156fbdbf9ac.tar.gz chromium_src-a6d54b69098f7b4da1606cdcc6f39156fbdbf9ac.tar.bz2 |
Flush correctly in VTVideoDecodeAccelerator.
Previously flushing was requested but not actually waited for, resulting
in flushing completing before frames were actually decoded.
BUG=133828
Review URL: https://codereview.chromium.org/763063004
Cr-Commit-Position: refs/heads/master@{#306435}
Diffstat (limited to 'content')
-rw-r--r-- | content/common/gpu/media/vt.sig | 2 | ||||
-rw-r--r-- | content/common/gpu/media/vt_video_decode_accelerator.cc | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/content/common/gpu/media/vt.sig b/content/common/gpu/media/vt.sig index 236a52a..a9639a3 100644 --- a/content/common/gpu/media/vt.sig +++ b/content/common/gpu/media/vt.sig @@ -13,4 +13,4 @@ CMVideoDimensions CMVideoFormatDescriptionGetDimensions(CMVideoFormatDescription Boolean VTDecompressionSessionCanAcceptFormatDescription(VTDecompressionSessionRef session, CMFormatDescriptionRef newFormatDesc); OSStatus VTDecompressionSessionCreate(CFAllocatorRef allocator, CMVideoFormatDescriptionRef videoFormatDescription, CFDictionaryRef videoDecoderSpecification, CFDictionaryRef destinationImageBufferAttributes, const VTDecompressionOutputCallbackRecord *outputCallback, VTDecompressionSessionRef *decompressionSessionOut); OSStatus VTDecompressionSessionDecodeFrame(VTDecompressionSessionRef session, CMSampleBufferRef sampleBuffer, VTDecodeFrameFlags decodeFlags, void *sourceFrameRefCon, VTDecodeInfoFlags *infoFlagsOut); -OSStatus VTDecompressionSessionFinishDelayedFrames(VTDecompressionSessionRef session); +OSStatus VTDecompressionSessionWaitForAsynchronousFrames(VTDecompressionSessionRef session); diff --git a/content/common/gpu/media/vt_video_decode_accelerator.cc b/content/common/gpu/media/vt_video_decode_accelerator.cc index 9a91c9c..d4ad116 100644 --- a/content/common/gpu/media/vt_video_decode_accelerator.cc +++ b/content/common/gpu/media/vt_video_decode_accelerator.cc @@ -246,9 +246,10 @@ bool VTVideoDecodeAccelerator::Initialize( bool VTVideoDecodeAccelerator::FinishDelayedFrames() { DCHECK(decoder_thread_.message_loop_proxy()->BelongsToCurrentThread()); if (session_) { - OSStatus status = VTDecompressionSessionFinishDelayedFrames(session_); + OSStatus status = VTDecompressionSessionWaitForAsynchronousFrames(session_); if (status) { - NOTIFY_STATUS("VTDecompressionSessionFinishDelayedFrames()", status); + NOTIFY_STATUS("VTDecompressionSessionWaitForAsynchronousFrames()", + status); return false; } } @@ -318,7 +319,8 @@ bool VTVideoDecodeAccelerator::ConfigureDecoder() { base::ScopedCFTypeRef<CFMutableDictionaryRef> image_config( BuildImageConfig(coded_dimensions)); - // TODO(sandersd): Does the old session need to be flushed first? + if (!FinishDelayedFrames()) + return false; session_.reset(); status = VTDecompressionSessionCreate( kCFAllocatorDefault, |