Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Unified Diff: media/video/video_decode_accelerator.h

Issue 1816203003: Add an additional VDA::Flush() mode to return all allocated buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/gpu/media/vt_video_decode_accelerator_mac.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/video/video_decode_accelerator.h
diff --git a/media/video/video_decode_accelerator.h b/media/video/video_decode_accelerator.h
index 950f3c5e32715227fa9f4c491c6d375790d2a4ca..b3f27b9ff98a45f98907518e068db863a3cc13fb 100644
--- a/media/video/video_decode_accelerator.h
+++ b/media/video/video_decode_accelerator.h
@@ -114,6 +114,27 @@ class MEDIA_EXPORT VideoDecodeAccelerator {
IMPORT,
};
+ // Specifies how the VDA should behave on VDA::Flush().
+ //
+ // - KEEP_OUTPUT_BUFFERS: the VDA may retain PictureBuffers that did not
+ // contain any decoded pictures at the end of flush for later use. In this
+ // mode, VDA returns via PictureReady() only the Pictures containing any
+ // remaining frames, decoded and/or released as a part of the flush, and
+ // ends the flush sequence by posting NotifyFlushDone().
+ //
+ // - RETURN_OUTPUT_BUFFERS: the VDA must return all PictureBuffers via
+ // PictureReady() before posting NotifyFlushDone(), including buffers not
Owen Lin 2016/04/13 09:21:39 Actually, the whole VideoDecodeAccelerator runs in
Pawel Osciak 2016/04/14 02:14:01 That's true, however VDA is also an IPC interface
Owen Lin 2016/04/14 02:57:17 I see. You're right, I only think about the the us
+ // containing decoded frames (if any). Buffers not containing any decoded
+ // data must have bitstream_buffer_id set to -1.
+ // Note: buffers returned to the VDA by the Client via ReusePictureBuffer()
+ // after NotifyFlushDone() is posted by the VDA (even if NotifyFlushDone()
+ // has not yet been serviced by the Client) can be kept by the VDA and
+ // reused after flush.
+ enum class FlushMode {
+ KEEP_OUTPUT_BUFFERS,
+ RETURN_OUTPUT_BUFFERS,
+ };
+
Config() = default;
Config(VideoCodecProfile profile);
Config(const VideoDecoderConfig& video_decoder_config);
@@ -139,6 +160,8 @@ class MEDIA_EXPORT VideoDecodeAccelerator {
gfx::Size initial_expected_coded_size;
OutputMode output_mode = OutputMode::ALLOCATE;
+
+ FlushMode flush_mode = FlushMode::KEEP_OUTPUT_BUFFERS;
};
// Interface for collaborating with picture interface to provide memory for
@@ -170,6 +193,8 @@ class MEDIA_EXPORT VideoDecodeAccelerator {
virtual void DismissPictureBuffer(int32_t picture_buffer_id) = 0;
// Callback to deliver decoded pictures ready to be displayed.
+ // If picture.bitstream_buffer_id is set to -1, the buffer does not contain
+ // any decoded data, but is being returned as a part of Flush().
virtual void PictureReady(const Picture& picture) = 0;
// Callback to notify that decoded has decoded the end of the current
@@ -268,6 +293,8 @@ class MEDIA_EXPORT VideoDecodeAccelerator {
// Flushes the decoder: all pending inputs will be decoded and pictures handed
// back to the client, followed by NotifyFlushDone() being called on the
// client. Can be used to implement "end of stream" notification.
+ // Exact behavior of Flush() depends on the selected FlushMode, set in the
+ // Config passed to Initialize().
virtual void Flush() = 0;
// Resets the decoder: all pending inputs are dropped immediately and the
« no previous file with comments | « content/common/gpu/media/vt_video_decode_accelerator_mac.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698