Chromium Code Reviews| Index: media/gpu/avda_surface_bundle.h |
| diff --git a/media/gpu/avda_surface_bundle.h b/media/gpu/avda_surface_bundle.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..439ca4cc22e14786b2ce9b5543299405aada4731 |
| --- /dev/null |
| +++ b/media/gpu/avda_surface_bundle.h |
| @@ -0,0 +1,46 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef MEDIA_GPU_AVDA_SURFACE_BUNDLE_H_ |
| +#define MEDIA_GPU_AVDA_SURFACE_BUNDLE_H_ |
| + |
| +#include "base/memory/ref_counted.h" |
| +#include "media/base/surface_manager.h" |
| +#include "ui/gl/android/scoped_java_surface.h" |
| +#include "ui/gl/android/surface_texture.h" |
| + |
| +namespace media { |
| + |
| +// AVDASurfaceBundle is a collection of everything that the producer-side of |
| +// 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.
|
| +// 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.
|
| +// The idea is that a reference to this should be kept with the codec, even if |
| +// the codec is sent to another thread. This will prevent the output surface |
| +// from being destroyed while the codec depends on it. |
| +// While you may send a reference to this to other threads, be sure that it |
| +// doesn't drop the reference there without creating another one. This has to |
| +// 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.
|
| +class AVDASurfaceBundle : public base::RefCountedThreadSafe<AVDASurfaceBundle> { |
| + public: |
| + explicit AVDASurfaceBundle(int surface_id); |
| + |
| + int surface_id = SurfaceManager::kNoSurfaceID; |
| + |
| + // The surface onto which the codec is writing. |
| + gl::ScopedJavaSurface surface; |
| + |
| + // The SurfaceTexture attached to |surface|, or nullptr if |surface| is |
| + // SurfaceView backed. |
| + scoped_refptr<gl::SurfaceTexture> surface_texture; |
| + |
| + private: |
| + ~AVDASurfaceBundle(); |
| + friend class base::RefCountedThreadSafe<AVDASurfaceBundle>; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(AVDASurfaceBundle); |
| +}; |
| + |
| +} // namespace media |
| + |
| +#endif // MEDIA_GPU_AVDA_SURFACE_BUNDLE_H_ |