Chromium Code Reviews| OLD | NEW |
|---|---|
| (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_ | |
| OLD | NEW |