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

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: 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..bfcc164714fe5b2aee4d4c333a114c097c58e567 100644
--- a/content/common/gpu/media/avda_shared_state.cc
+++ b/content/common/gpu/media/avda_shared_state.cc
@@ -14,7 +14,14 @@ AVDASharedState::AVDASharedState()
frame_available_event_(false, false),
surface_texture_is_attached_(false) {}
-AVDASharedState::~AVDASharedState() {}
+AVDASharedState::~AVDASharedState() {
liberato (no reviews please) 2016/02/10 21:05:15 i think that you have to maintain a list of Textur
watk 2016/02/11 00:26:51 Discussed offline that this is not necessary becau
+ if (surface_texture_service_id_ != 0 && context_) {
liberato (no reviews please) 2016/02/10 21:05:15 it might be worthwhile to pass in the avda's conte
+ // XXX: This is the wrong context.
liberato (no reviews please) 2016/02/10 06:39:12 it's worth a comment that it's a different one tha
watk 2016/02/11 00:26:51 Ah, that's why everything works, thanks.
+ auto scoped_make_current = make_scoped_ptr(
+ new ui::ScopedMakeCurrent(context_.get(), surface_.get()));
+ glDeleteTextures(1, &surface_texture_service_id_);
+ }
+}
void AVDASharedState::SignalFrameAvailable() {
frame_available_event_.Signal();
@@ -24,7 +31,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