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

Unified Diff: media/gpu/avda_picture_buffer_manager.cc

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_picture_buffer_manager.h ('k') | media/gpu/avda_shared_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/avda_picture_buffer_manager.cc
diff --git a/media/gpu/avda_picture_buffer_manager.cc b/media/gpu/avda_picture_buffer_manager.cc
index 27a7eb82d6b5473dfe8ee1cf2404106c9bd35fa4..b37a3885396db53263571a716084fde24c761fd3 100644
--- a/media/gpu/avda_picture_buffer_manager.cc
+++ b/media/gpu/avda_picture_buffer_manager.cc
@@ -72,23 +72,28 @@ AVDAPictureBufferManager::AVDAPictureBufferManager(
AVDAPictureBufferManager::~AVDAPictureBufferManager() {}
-void AVDAPictureBufferManager::InitializeForOverlay() {
- shared_state_ = new AVDASharedState();
+bool AVDAPictureBufferManager::Initialize(
+ scoped_refptr<AVDASurfaceBundle> surface_bundle) {
+ shared_state_ = nullptr;
surface_texture_ = nullptr;
-}
-gl::ScopedJavaSurface AVDAPictureBufferManager::InitializeForSurfaceTexture() {
- shared_state_ = new AVDASharedState();
- surface_texture_ = nullptr;
+ if (!surface_bundle->overlay) {
+ // Create the surface texture.
+ surface_texture_ =
+ CreateAttachedSurfaceTexture(state_provider_->GetGlDecoder());
+ if (!surface_texture_)
+ return false;
+
+ surface_bundle->surface_texture_surface =
+ gl::ScopedJavaSurface(surface_texture_.get());
+ surface_bundle->surface_texture = surface_texture_;
+ }
- // Create a SurfaceTexture.
- surface_texture_ =
- CreateAttachedSurfaceTexture(state_provider_->GetGlDecoder());
- if (!surface_texture_)
- return gl::ScopedJavaSurface();
+ // Only do this once the surface texture is filled in, since the constructor
+ // assumes that it will be.
+ shared_state_ = new AVDASharedState(surface_bundle);
- shared_state_->SetSurfaceTexture(surface_texture_);
- return gl::ScopedJavaSurface(surface_texture_.get());
+ return true;
}
void AVDAPictureBufferManager::Destroy(const PictureBufferMap& buffers) {
« no previous file with comments | « media/gpu/avda_picture_buffer_manager.h ('k') | media/gpu/avda_shared_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698