Chromium Code Reviews| Index: media/gpu/android_video_surface_chooser.h |
| diff --git a/media/gpu/android_video_surface_chooser.h b/media/gpu/android_video_surface_chooser.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a2a2610e811d2a3af53945d5387845249d770e9b |
| --- /dev/null |
| +++ b/media/gpu/android_video_surface_chooser.h |
| @@ -0,0 +1,57 @@ |
| +// 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_ANDROID_VIDEO_SURFACE_CHOOSER_H_ |
| +#define MEDIA_GPU_ANDROID_VIDEO_SURFACE_CHOOSER_H_ |
| + |
| +#include "base/bind.h" |
| +#include "base/macros.h" |
| +#include "base/memory/weak_ptr.h" |
| +#include "media/base/android/android_overlay.h" |
| +#include "media/base/android/android_overlay_factory.h" |
| +#include "media/gpu/media_gpu_export.h" |
| + |
| +namespace media { |
| + |
| +// Manage details of which overlay to use for video playback, if any. |
|
watk
2017/05/02 21:00:01
"which surface"
delete "if any".
liberato (no reviews please)
2017/05/02 21:50:04
Done.
|
| +class MEDIA_GPU_EXPORT AndroidVideoSurfaceChooser { |
| + public: |
| + // Notify the client that |overlay| is ready for use. The client may get |
| + // the surface immediately. |
| + using UseOverlayCB = |
| + base::Callback<void(std::unique_ptr<AndroidOverlay> overlay)>; |
| + |
| + // Notify the client that the most recently provided overlay should be |
| + // discarded. The overlay is still valid, but we recommend against |
| + // using it soon, in favor of a SurfaceTexture. |
| + using UseSurfaceTextureCB = base::Callback<void(void)>; |
| + |
| + // Callback that mirrors AndroidOverlay::DestroyedCB . The surface |
| + // that was provided with |overlay| is being destroyed. |
| + using StopUsingOverlayImmediatelyCB = base::Callback<void(AndroidOverlay*)>; |
| + |
| + AndroidVideoSurfaceChooser() {} |
| + virtual ~AndroidVideoSurfaceChooser() {} |
| + |
| + // Notify us that our client is ready for overlays. We will send it a |
| + // callback telling it whether to start with a SurfaceTexture or overlay, |
| + // either synchronously or post one very soon. |
| + virtual void Initialize( |
| + UseOverlayCB use_overlay_cb, |
| + UseSurfaceTextureCB use_surface_texture_cb, |
| + StopUsingOverlayImmediatelyCB stop_immediately_cb, |
| + std::unique_ptr<AndroidOverlayFactory> initial_factory) = 0; |
| + |
| + // Notify us that a new factory has arrived. May be null to indicate that |
| + // WMPI has revoked the most recent factory. |
|
watk
2017/05/02 21:00:01
I don't think it's really helpful to mention WMPI
liberato (no reviews please)
2017/05/02 21:50:04
Done.
|
| + virtual void ReplaceOverlayFactory( |
| + std::unique_ptr<AndroidOverlayFactory> factory) = 0; |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(AndroidVideoSurfaceChooser); |
| +}; |
| + |
| +} // namespace media |
| + |
| +#endif // MEDIA_GPU_ANDROID_VIDEO_SURFACE_CHOOSER_H_ |