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

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

Issue 1639963002: AndroidVideoDecodeAccelerator can now render to a SurfaceView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/android_video_decode_accelerator.h
diff --git a/content/common/gpu/media/android_video_decode_accelerator.h b/content/common/gpu/media/android_video_decode_accelerator.h
index 3f20037b7dd2a902cf909779d9043f2ec6bb187f..251d41336339a020d0b98594a9b3dae4bfe89bc9 100644
--- a/content/common/gpu/media/android_video_decode_accelerator.h
+++ b/content/common/gpu/media/android_video_decode_accelerator.h
@@ -23,6 +23,7 @@
#include "media/base/android/sdk_media_codec_bridge.h"
#include "media/base/media_keys.h"
#include "media/video/video_decode_accelerator.h"
+#include "ui/gl/android/scoped_java_surface.h"
namespace gfx {
class SurfaceTexture;
@@ -47,9 +48,12 @@ class CONTENT_EXPORT AndroidVideoDecodeAccelerator
public:
virtual ~BackingStrategy() {}
- // Called after the state provider is given, but before any other
- // calls to the BackingStrategy.
- virtual void Initialize(AVDAStateProvider* provider) = 0;
+ // Called before anything else. |surface_texture| will be null if the
+ // MediaCodec will be configured with a SurfaceView instead of a
+ // SurfaceTexture.
+ virtual void Initialize(
+ AVDAStateProvider* provider,
+ scoped_refptr<gfx::SurfaceTexture> surface_texture) = 0;
// Called before the AVDA does any Destroy() work. This will be
// the last call that the BackingStrategy receives.
@@ -59,9 +63,6 @@ class CONTENT_EXPORT AndroidVideoDecodeAccelerator
// Return the GL texture target that the PictureBuffer textures use.
virtual uint32_t GetTextureTarget() const = 0;
- // Create and return a surface texture for the MediaCodec to use.
- virtual scoped_refptr<gfx::SurfaceTexture> CreateSurfaceTexture() = 0;
-
// Make the provided PictureBuffer draw the image that is represented by
// the decoded output buffer at codec_buffer_index.
virtual void UseCodecBufferForPictureBuffer(
@@ -241,9 +242,14 @@ class CONTENT_EXPORT AndroidVideoDecodeAccelerator
// The low-level decoder which Android SDK provides.
scoped_ptr<media::VideoCodecBridge> media_codec_;
- // A container of texture. Used to set a texture to |media_codec_|.
+ // A container of texture. Used to set a texture to |media_codec_|. This may
+ // be null if we're rendering to a SurfaceView instead.
scoped_refptr<gfx::SurfaceTexture> surface_texture_;
+ // An Android SurfaceView to render to. This may be empty if we're
+ // rendering to a SurfaceTexture instead.
+ gfx::ScopedJavaSurface surface_view_;
+
// Set to true after requesting picture buffers to the client.
bool picturebuffers_requested_;

Powered by Google App Engine
This is Rietveld 408576698