Index: content/common/gpu/media/avda_codec_image.h |
diff --git a/content/common/gpu/media/avda_codec_image.h b/content/common/gpu/media/avda_codec_image.h |
index 71baf25ce157fd73fe8aaed2dc3d4e19119a81f0..1914fd09c280952d4c1eb67e77d0b855c0630003 100644 |
--- a/content/common/gpu/media/avda_codec_image.h |
+++ b/content/common/gpu/media/avda_codec_image.h |
@@ -52,13 +52,23 @@ class AVDACodecImage : public gpu::gles2::GLStreamTextureImage { |
// Decoded buffer index that has the image for us to display. |
void SetMediaCodecBufferIndex(int buffer_index); |
- // Return the codec buffer that we will return to the codec, or |
- // <0 if there is no such buffer. |
- int GetMediaCodecBufferIndex() const; |
- |
// Set the size of the current image. |
void SetSize(const gfx::Size& size); |
+ enum class ReleaseMode { SKIP_RENDER, RENDER_ONLY, RENDER_AND_UPDATE }; |
liberato (no reviews please)
2016/04/22 00:51:06
i think these might be better named { DISCARD_CODE
DaleCurtis
2016/04/22 01:33:58
I like it. Done.
|
+ void ReleaseOutputBuffer(ReleaseMode release_mode); |
+ |
+ // Indicates if the codec buffer has been released to the back buffer. |
+ bool is_rendered_to_back_buffer() const { |
+ return codec_buffer_index_ == kUpdateOnly; |
+ } |
+ |
+ // Indicates if the codec buffer has been released to the front or back |
+ // buffer. |
+ bool is_rendered() const { |
+ return codec_buffer_index_ <= kInvalidCodecBufferIndex; |
+ } |
+ |
// Updates the MediaCodec for this image; clears |codec_buffer_index_|. |
void SetMediaCodec(media::MediaCodecBridge* codec); |
@@ -67,9 +77,9 @@ class AVDACodecImage : public gpu::gles2::GLStreamTextureImage { |
protected: |
~AVDACodecImage() override; |
- private: |
- enum { kInvalidCodecBufferIndex = -1 }; |
+ enum { kInvalidCodecBufferIndex = -1, kUpdateOnly = -2 }; |
+ private: |
// Make sure that the surface texture's front buffer is current. This will |
// save / restore the current context. It will optionally restore the texture |
// bindings in the surface texture's context, based on |mode|. This is |