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

Side by Side Diff: content/common/gpu/media/avda_surface_tracker.h

Issue 1878103002: Plumb a Browser->GPU surface destruction message for Android VDAs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed sievers comments. Created 4 years, 8 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 | « content/common/BUILD.gn ('k') | content/common/gpu/media/avda_surface_tracker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_COMMON_GPU_MEDIA_AVDA_SURFACE_TRACKER_H_
6 #define CONTENT_COMMON_GPU_MEDIA_AVDA_SURFACE_TRACKER_H_
7
8 #include "content/common/content_export.h"
9
10 namespace content {
11
12 using OnDestroyingSurfaceCallback = base::Callback<void(int)>;
13
14 // AVDASurfaceTracker provides AndroidVideoDecodeAccelerators a way to register
DaleCurtis 2016/04/22 18:17:14 Kind of feels like we should merge this and the AV
liberato (no reviews please) 2016/04/22 20:31:29 might want to hold off on that until MediaCodecLoo
15 // callbacks that will be called when surfaces are destroyed. This is important
16 // because Android SurfaceView Surfaces can be destroyed by the framework at any
17 // time and we must stop rendering to them before returning from
18 // onSurfaceDestroyed().
19 // This is not thread safe. All access should be on the gpu main thread.
20 // Callbacks will be run on the same thread.
21 class AVDASurfaceTracker {
22 public:
23 AVDASurfaceTracker();
24 ~AVDASurfaceTracker();
25
26 static AVDASurfaceTracker* GetInstance();
27
28 void RegisterOnDestroyingSurfaceCallback(
29 const OnDestroyingSurfaceCallback& cb);
30
31 // Unregister a callback that was previously registered.
32 void UnregisterOnDestroyingSurfaceCallback(
33 const OnDestroyingSurfaceCallback& cb);
34
35 // Called in response to a message from the Browser indicating that the given
36 // surface is in the process of being destroyed.
37 void NotifyDestroyingSurface(int surface_id);
38
39 private:
40 std::vector<OnDestroyingSurfaceCallback> callbacks_;
41 DISALLOW_COPY_AND_ASSIGN(AVDASurfaceTracker);
42 };
43
44 } // namespace content
45
46 #endif // CONTENT_COMMON_GPU_MEDIA_AVDA_SURFACE_TRACKER_H_
OLDNEW
« no previous file with comments | « content/common/BUILD.gn ('k') | content/common/gpu/media/avda_surface_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698