Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MEDIA_GPU_AVDA_SURFACE_BUNDLE_H_ | |
| 6 #define MEDIA_GPU_AVDA_SURFACE_BUNDLE_H_ | |
| 7 | |
| 8 #include "base/memory/ref_counted.h" | |
| 9 #include "media/base/surface_manager.h" | |
| 10 #include "ui/gl/android/scoped_java_surface.h" | |
| 11 #include "ui/gl/android/surface_texture.h" | |
| 12 | |
| 13 namespace media { | |
| 14 | |
| 15 // AVDASurfaceBundle is a collection of everything that the producer-side of | |
| 16 // the output surface that one needs. In other words, it's the surface, any | |
|
watk
2017/02/22 20:38:56
First sentence a word.
liberato (no reviews please)
2017/02/23 18:18:46
parse i could not.
watk
2017/02/23 20:03:47
Sorry :) I was trying to say that I couldn't parse
liberato (no reviews please)
2017/03/06 22:59:36
Done.
| |
| 17 // SurfaceTexture that backs it, and / or, eventually, the AndroidOverlay. | |
|
watk
2017/02/22 20:38:56
Can we delete the AndroidOverlay comment until tha
liberato (no reviews please)
2017/02/23 18:18:46
Done.
| |
| 18 // The idea is that a reference to this should be kept with the codec, even if | |
| 19 // the codec is sent to another thread. This will prevent the output surface | |
| 20 // from being destroyed while the codec depends on it. | |
| 21 // While you may send a reference to this to other threads, be sure that it | |
| 22 // doesn't drop the reference there without creating another one. This has to | |
| 23 // be destroyed on the main thread. | |
|
watk
2017/02/22 20:38:56
s/main/gpu main/ (ambiguous for in-process gpu).
liberato (no reviews please)
2017/02/23 18:18:46
Done.
| |
| 24 class AVDASurfaceBundle : public base::RefCountedThreadSafe<AVDASurfaceBundle> { | |
| 25 public: | |
| 26 explicit AVDASurfaceBundle(int surface_id); | |
| 27 | |
| 28 int surface_id = SurfaceManager::kNoSurfaceID; | |
| 29 | |
| 30 // The surface onto which the codec is writing. | |
| 31 gl::ScopedJavaSurface surface; | |
| 32 | |
| 33 // The SurfaceTexture attached to |surface|, or nullptr if |surface| is | |
| 34 // SurfaceView backed. | |
| 35 scoped_refptr<gl::SurfaceTexture> surface_texture; | |
| 36 | |
| 37 private: | |
| 38 ~AVDASurfaceBundle(); | |
| 39 friend class base::RefCountedThreadSafe<AVDASurfaceBundle>; | |
| 40 | |
| 41 DISALLOW_COPY_AND_ASSIGN(AVDASurfaceBundle); | |
| 42 }; | |
| 43 | |
| 44 } // namespace media | |
| 45 | |
| 46 #endif // MEDIA_GPU_AVDA_SURFACE_BUNDLE_H_ | |
| OLD | NEW |