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

Unified Diff: content/common/gpu/media/avda_codec_image.h

Issue 1639963002: AndroidVideoDecodeAccelerator can now render to a SurfaceView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase only Created 4 years, 11 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
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 ef0456a9fba9d7766e6616079a9c829109d7687e..8bbcf13d916af38ce0cfbd8902672e15f696c9f9 100644
--- a/content/common/gpu/media/avda_codec_image.h
+++ b/content/common/gpu/media/avda_codec_image.h
@@ -13,8 +13,8 @@
namespace content {
-// GLImage that renders MediaCodec buffers to a SurfaceTexture as needed
-// in order to draw them.
+// GLImage that renders MediaCodec buffers to a SurfaceTexture or SurfaceView as
+// needed in order to draw them.
class AVDACodecImage : public gl::GLImage {
public:
AVDACodecImage(const scoped_refptr<AVDASharedState>&,
@@ -58,9 +58,11 @@ class AVDACodecImage : public gl::GLImage {
void SetMediaCodec(media::MediaCodecBridge* codec);
- void setTexture(gpu::gles2::Texture* texture);
+ void SetTexture(gpu::gles2::Texture* texture);
private:
+ enum { kInvalidCodecBufferIndex = -1 };
+
// Make sure that the surface texture's front buffer is current.
void UpdateSurfaceTexture();
@@ -74,8 +76,8 @@ class AVDACodecImage : public gl::GLImage {
// Shared state between the AVDA and all AVDACodecImages.
scoped_refptr<AVDASharedState> shared_state_;
- // Codec's buffer index that we should render to the surface texture,
- // or <0 if none.
+ // The MediaCodec buffer index that we should render. Only valid if not equal
+ // to |kInvalidCodecBufferIndex|.
int codec_buffer_index_;
// Our image size.
@@ -86,6 +88,8 @@ class AVDACodecImage : public gl::GLImage {
const base::WeakPtr<gpu::gles2::GLES2Decoder> decoder_;
+ // The SurfaceTexture to render to. This is null when rendering to a
+ // SurfaceView.
const scoped_refptr<gfx::SurfaceTexture> surface_texture_;
// Should we detach |surface_texture_| from its GL context when we are
« no previous file with comments | « content/common/gpu/media/android_video_decode_accelerator_unittest.cc ('k') | content/common/gpu/media/avda_codec_image.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698