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

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

Issue 2813303003: Add AndroidVideoSurfaceChooser to manage overlays. (Closed)
Patch Set: gn fixes for non-android 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_IMPL_H_
6 #define MEDIA_GPU_AVDA_OVERLAY_HELPER_IMPL_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/avda_overlay_helper.h"
14 #include "media/gpu/media_gpu_export.h"
15
16 namespace media {
17
18 // Implementation of AVDAOverlayHelper.
19 class MEDIA_GPU_EXPORT AVDAOverlayHelperImpl : public AVDAOverlayHelper {
20 public:
21 AVDAOverlayHelperImpl();
22 ~AVDAOverlayHelperImpl() override;
23
24 // AVDAOverlayHelper
25 void Startup(const UseOverlayCB& use_overlay_cb,
26 const UseSurfaceTextureCB& use_surface_texture_cb,
27 const StopUsingOverlayImmediatelyCB& stop_immediately_cb,
28 std::unique_ptr<AndroidOverlayFactory> initial_factory) override;
29 void OnOverlayFactory(
30 std::unique_ptr<AndroidOverlayFactory> factory) override;
31
32 private:
33 // AndroidOverlay callbacks.
34 void OnOverlayReady(AndroidOverlay*);
35 void OnOverlayFailed(AndroidOverlay*);
36 void OnSurfaceDestroyed(AndroidOverlay*);
37
38 // Client callbacks.
39 UseOverlayCB use_overlay_cb_;
40 UseSurfaceTextureCB use_surface_texture_cb_;
41 StopUsingOverlayImmediatelyCB stop_immediately_cb_;
42
43 // Current overlay that we've consructed but haven't received ready / failed
44 // callbacks yet. Will be nullptr if we haven't constructed one, or if we
45 // sent it to the client already once it became ready to use.
46 std::unique_ptr<AndroidOverlay> overlay_;
47
48 // If true, we owe the client notification about whether to use an overlay
49 // or a surface texture.
50 bool client_notification_pending_ = false;
51
52 std::unique_ptr<AndroidOverlayFactory> overlay_factory_;
53
54 base::WeakPtrFactory<AVDAOverlayHelperImpl> weak_factory_;
55 };
DaleCurtis 2017/04/20 19:10:43 DISALLOW...
liberato (no reviews please) 2017/04/20 22:01:39 Done. i didn't think i needed it if the base clas
56
57 } // namespace media
58
59 #endif // MEDIA_GPU_AVDA_OVERLAY_HELPER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698