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 |