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

Unified Diff: media/gpu/avda_picture_buffer_manager.h

Issue 2889603005: Position overlays in AVDACodecImage (Closed)
Patch Set: rebased Created 3 years, 7 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 | « media/gpu/avda_codec_image.cc ('k') | media/gpu/avda_picture_buffer_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/avda_picture_buffer_manager.h
diff --git a/media/gpu/avda_picture_buffer_manager.h b/media/gpu/avda_picture_buffer_manager.h
index 377da6003277cc7939164466e41c9472e2c304cc..b0587848e91c080ed2e68b0bff26d92f37121acc 100644
--- a/media/gpu/avda_picture_buffer_manager.h
+++ b/media/gpu/avda_picture_buffer_manager.h
@@ -10,6 +10,7 @@
#include "base/macros.h"
#include "media/gpu/avda_state_provider.h"
+#include "media/gpu/avda_surface_bundle.h"
#include "media/gpu/media_gpu_export.h"
#include "media/gpu/surface_texture_gl_owner.h"
@@ -19,11 +20,6 @@ class GLStreamTextureImage;
}
}
-namespace gl {
-class ScopedJavaSurface;
-class SurfaceTexture;
-}
-
namespace media {
class AVDACodecImage;
class AVDASharedState;
@@ -43,21 +39,24 @@ class MEDIA_GPU_EXPORT AVDAPictureBufferManager {
explicit AVDAPictureBufferManager(AVDAStateProvider* state_provider);
virtual ~AVDAPictureBufferManager();
- // Call either InitializeForOverlay or InitializeForSurfaceTexture before
- // anything else. InitializeForOverlay will set us up to render codec buffers
- // at the approrpriate time for display, but will assume that consuming the
- // resulting buffers is handled elsewhere (e.g., SurfaceFlinger).
+ // Call Initialize, providing the surface bundle that holds the surface that
+ // will back the frames. If an overlay is present in the bundle, then this
+ // will set us up to render codec buffers at the appropriate time for display,
+ // but will assume that consuming the resulting buffers is handled elsewhere
+ // (e.g., SurfaceFlinger). We will ensure that any reference to the bundle
+ // is dropped if the overlay sends OnSurfaceDestroyed.
//
- // InitializeForSurfaceTexture will create a SurfaceTexture and return the
- // surface for it. We will arrange to consume the buffers at the right time,
- // in addition to releasing codec buffers for rendering.
+ // Without an overlay, we will create a SurfaceTexture and add it (and its
+ // surface) to |surface_bundle|. We will arrange to consume the buffers at
+ // the right time, in addition to releasing the codec buffers for rendering.
//
// One may call these multiple times to change between overlay and ST.
//
// Picture buffers will be updated to reflect the new surface during the call
// to UseCodecBufferForPicture().
- void InitializeForOverlay();
- gl::ScopedJavaSurface InitializeForSurfaceTexture();
+ //
+ // Returns true on success.
+ bool Initialize(scoped_refptr<AVDASurfaceBundle> surface_bundle);
void Destroy(const PictureBufferMap& buffers);
@@ -90,10 +89,6 @@ class MEDIA_GPU_EXPORT AVDAPictureBufferManager {
// Are there any unrendered picture buffers oustanding?
bool HasUnrenderedPictures() const;
- scoped_refptr<gl::SurfaceTexture> surface_texture() {
- return surface_texture_;
- }
-
// Returns the GL texture target that the PictureBuffer textures use.
// Always use OES textures even though this will cause flickering in dev tools
// when inspecting a fullscreen video. See http://crbug.com/592798
« no previous file with comments | « media/gpu/avda_codec_image.cc ('k') | media/gpu/avda_picture_buffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698