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_MANAGER_H_ | |
| 6 #define CONTENT_COMMON_GPU_MEDIA_AVDA_SURFACE_MANAGER_H_ | |
| 7 | |
| 8 #include "base/observer_list.h" | |
| 9 #include "content/common/content_export.h" | |
| 10 | |
| 11 namespace content { | |
| 12 | |
| 13 class SurfaceDestructionObserver { | |
|
no sievers
2016/04/19 23:30:17
nit: This only has one method so could be a base::
watk
2016/04/22 02:48:55
Done.
| |
| 14 public: | |
| 15 // The given surface is being destroyed. If the observer owns the surface | |
| 16 // it should quickly release it before returning from this because this will | |
| 17 // be called while blocking the Browser UI thread. | |
| 18 virtual void OnDestroyingSurface(int surface_id) = 0; | |
| 19 | |
| 20 protected: | |
| 21 ~SurfaceDestructionObserver() {} | |
| 22 }; | |
| 23 | |
| 24 // AVDASurfaceTracker provides AndroidVideoDecodeAccelerators a way to register | |
| 25 // as observers of surface destruction. This is important because Android | |
| 26 // SurfaceView Surfaces can be destroyed by the framework at any time and we | |
| 27 // must stop rendering to them before returning from onSurfaceDestroyed(). | |
| 28 class AVDASurfaceTracker { | |
| 29 public: | |
| 30 static AVDASurfaceTracker* GetInstance(); | |
| 31 | |
| 32 AVDASurfaceTracker(); | |
| 33 ~AVDASurfaceTracker(); | |
| 34 | |
| 35 void AddSurfaceDestructionObserver(SurfaceDestructionObserver* observer); | |
|
no sievers
2016/04/18 23:41:25
I don't see any call sites to this.
I'm asking al
watk
2016/04/19 21:15:08
I forgot to mention that I was going to do the AVD
| |
| 36 void RemoveSurfaceDestructionObserver(SurfaceDestructionObserver* observer); | |
| 37 | |
| 38 // Called in response to a message from the Browser indicating that the given | |
| 39 // surface is in the process of being destroyed. | |
| 40 void NotifyDestroyingSurface(int surface_id); | |
| 41 | |
| 42 private: | |
| 43 base::ObserverList<SurfaceDestructionObserver> observers_; | |
| 44 DISALLOW_COPY_AND_ASSIGN(AVDASurfaceTracker); | |
| 45 }; | |
| 46 | |
| 47 } // namespace content | |
| 48 | |
| 49 #endif // CONTENT_COMMON_GPU_MEDIA_AVDA_SURFACE_MANAGER_H_ | |
| OLD | NEW |