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

Side by Side Diff: media/gpu/avda_surface_bundle.cc

Issue 2813303003: Add AndroidVideoSurfaceChooser to manage overlays. (Closed)
Patch Set: fixed dereference of base::Optional 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 unified diff | Download patch
« no previous file with comments | « media/gpu/avda_surface_bundle.h ('k') | media/gpu/content_video_view_overlay_factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/gpu/avda_surface_bundle.h" 5 #include "media/gpu/avda_surface_bundle.h"
6 #include "media/base/android/android_overlay.h" 6 #include "media/base/android/android_overlay.h"
7 7
8 namespace media { 8 namespace media {
9 9
10 AVDASurfaceBundle::AVDASurfaceBundle(int surface_id) : surface_id(surface_id) {} 10 AVDASurfaceBundle::AVDASurfaceBundle(std::unique_ptr<AndroidOverlay> overlay)
11 : overlay(std::move(overlay)) {}
11 12
12 AVDASurfaceBundle::~AVDASurfaceBundle() { 13 AVDASurfaceBundle::~AVDASurfaceBundle() {
13 // Explicitly free the surface first, just to be sure that it's deleted before 14 // Explicitly free the surface first, just to be sure that it's deleted before
14 // the SurfaceTexture is. 15 // the SurfaceTexture is.
15 surface_texture_surface = gl::ScopedJavaSurface(); 16 surface_texture_surface = gl::ScopedJavaSurface();
16 17
17 // Also release the back buffers. We might want to let the consumer do this 18 // Also release the back buffers. We might want to let the consumer do this
18 // after it has swapped the back buffer it wants, but we don't. 19 // after it has swapped the back buffer it wants, but we don't.
19 if (surface_texture) 20 if (surface_texture)
20 surface_texture->ReleaseSurfaceTexture(); 21 surface_texture->ReleaseSurfaceTexture();
21 surface_texture = nullptr; 22 surface_texture = nullptr;
22 } 23 }
23 24
24 } // namespace media 25 } // namespace media
OLDNEW
« no previous file with comments | « media/gpu/avda_surface_bundle.h ('k') | media/gpu/content_video_view_overlay_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698