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

Unified Diff: media/gpu/avda_picture_buffer_manager.cc

Issue 2629223003: media: Ensure MediaCodecs are released before attached SurfaceTextures (Closed)
Patch Set: more comments Created 3 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: 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 a77de5a1b6cc912f01424b3ad120b7b0b5b18f97..1509ad0999f554e6cc7a9f33c6c89c060147d787 100644
--- a/media/gpu/avda_picture_buffer_manager.cc
+++ b/media/gpu/avda_picture_buffer_manager.cc
@@ -81,15 +81,11 @@ AVDAPictureBufferManager::~AVDAPictureBufferManager() {}
gl::ScopedJavaSurface AVDAPictureBufferManager::Initialize(int surface_id) {
shared_state_ = new AVDASharedState();
+ surface_texture_ = nullptr;
// Acquire the SurfaceView surface if given a valid id.
- if (surface_id != SurfaceManager::kNoSurfaceID) {
- if (surface_texture_) {
- surface_texture_->ReleaseSurfaceTexture();
- surface_texture_ = nullptr;
- }
+ if (surface_id != SurfaceManager::kNoSurfaceID)
return gpu::GpuSurfaceLookup::GetInstance()->AcquireJavaSurface(surface_id);
- }
// Otherwise create a SurfaceTexture.
GLuint service_id;
@@ -106,11 +102,7 @@ void AVDAPictureBufferManager::Destroy(const PictureBufferMap& buffers) {
ReleaseCodecBuffers(buffers);
CodecChanged(nullptr);
-
- // Release the surface texture and any back buffers. This will preserve the
- // front buffer, if any.
- if (surface_texture_)
- surface_texture_->ReleaseSurfaceTexture();
+ surface_texture_ = nullptr;
}
void AVDAPictureBufferManager::SetImageForPicture(
« media/gpu/avda_codec_allocator.h ('K') | « media/gpu/avda_picture_buffer_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698