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

Unified Diff: content/common/gpu/media/avda_shared_state.cc

Issue 1682343002: AVDACodecImages keep a reference to the SurfaceTexture backing them (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comment Created 4 years, 10 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_shared_state.cc
diff --git a/content/common/gpu/media/avda_shared_state.cc b/content/common/gpu/media/avda_shared_state.cc
index c182bf0538593f17bb80cb237a6a2addaf678a71..718c4fc6198298eea0574fb9470b9c4cdcb11637 100644
--- a/content/common/gpu/media/avda_shared_state.cc
+++ b/content/common/gpu/media/avda_shared_state.cc
@@ -5,7 +5,6 @@
#include "content/common/gpu/media/avda_shared_state.h"
#include "ui/gl/gl_bindings.h"
-#include "ui/gl/scoped_make_current.h"
namespace content {
@@ -14,7 +13,18 @@ AVDASharedState::AVDASharedState()
frame_available_event_(false, false),
surface_texture_is_attached_(false) {}
-AVDASharedState::~AVDASharedState() {}
+AVDASharedState::~AVDASharedState() {
+ if (surface_texture_service_id_ != 0) {
+ delete_texture_cb_.Run(surface_texture_service_id_);
+ }
+}
+
+void AVDASharedState::SetSurfaceTextureServiceID(
+ GLuint id,
+ const base::Callback<void(GLuint)>& delete_texture_cb) {
+ surface_texture_service_id_ = id;
+ delete_texture_cb_ = delete_texture_cb;
+}
void AVDASharedState::SignalFrameAvailable() {
frame_available_event_.Signal();
@@ -24,7 +34,7 @@ void AVDASharedState::WaitForFrameAvailable() {
frame_available_event_.Wait();
}
-void AVDASharedState::did_attach_surface_texture() {
+void AVDASharedState::DidAttachSurfaceTexture() {
context_ = gfx::GLContext::GetCurrent();
surface_ = gfx::GLSurface::GetCurrent();
DCHECK(context_);

Powered by Google App Engine
This is Rietveld 408576698