Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Side by Side Diff: media/gpu/avda_overlay_helper.h

Issue 2813303003: Add AndroidVideoSurfaceChooser to manage overlays. (Closed)
Patch Set: cl feedback. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_OVERLAY_HELPER_H_
6 #define MEDIA_GPU_AVDA_OVERLAY_HELPER_H_
7
8 #include "base/bind.h"
9 #include "base/macros.h"
10 #include "base/memory/weak_ptr.h"
11 #include "media/base/android/android_overlay.h"
12 #include "media/base/android/android_overlay_factory.h"
13 #include "media/gpu/media_gpu_export.h"
14
15 namespace media {
16
17 // Manage details of which overlay to use for video playback, if any.
18 class MEDIA_GPU_EXPORT AVDAOverlayHelper {
19 public:
20 // Notify the client that |overlay| is ready for use. The client may get
21 // the surface immediatly.
tguilbert 2017/04/21 22:55:46 s/immediatly/immediately
liberato (no reviews please) 2017/04/27 18:30:12 Done.
22 using UseOverlayCB =
23 base::Callback<void(std::unique_ptr<AndroidOverlay> overlay)>;
24
25 // Notify the client that the most recently provided overlay should be
26 // discarded. The overlay is still valid, but we recommend against
27 // using it soon, in favor of a SurfaceTexture.
28 // TODO(liberato): document the differences between this an 'Immediately'
tguilbert 2017/04/21 22:55:46 s/an/and
liberato (no reviews please) 2017/04/27 18:30:12 Done.
29 using UseSurfaceTextureCB = base::Callback<void(void)>;
30
31 // Callback that mirrors AndroidOverlay::DestroyedCB . The surface
32 // that was provided with |overlay| is being destroyed.
33 using StopUsingOverlayImmediatelyCB = base::Callback<void(AndroidOverlay*)>;
34
35 AVDAOverlayHelper() {}
36 virtual ~AVDAOverlayHelper() {}
37
38 // Notify us that our client is ready for overlays. We will send it a
39 // callback telling it whether to start with a SurfaceTexture or overlay,
40 // either synchronously or post one very soon.
41 virtual void Startup(
watk 2017/04/22 00:29:07 nit: startup is a noun. Start() or Initialize()? I
liberato (no reviews please) 2017/04/27 18:30:12 Done, Initialize.
42 const UseOverlayCB& use_overlay_cb,
43 const UseSurfaceTextureCB& use_surface_texture_cb,
44 const StopUsingOverlayImmediatelyCB& stop_immediately_cb,
45 std::unique_ptr<AndroidOverlayFactory> initial_factory) = 0;
46
47 // Notify us that a new factory has arrived. May be null to indicate that
48 // WMPI has revoked the most recent factory.
49 virtual void OnOverlayFactory(
50 std::unique_ptr<AndroidOverlayFactory> factory) = 0;
51
52 private:
53 DISALLOW_COPY_AND_ASSIGN(AVDAOverlayHelper);
54 };
55
56 } // namespace media
57
58 #endif // MEDIA_GPU_AVDA_OVERLAY_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698