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

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

Issue 2692863011: Add ContentVideoViewOverlay to AVDA. (Closed)
Patch Set: make DequeueOutput require NO_ERROR from setsurface Created 3 years, 9 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_CONTENT_VIDEO_VIEW_OVERLAY_H_
6 #define MEDIA_GPU_CONTENT_VIDEO_VIEW_OVERLAY_H_
7
8 #include "base/memory/weak_ptr.h"
9 #include "media/base/android/android_overlay.h"
10 #include "media/gpu/avda_codec_allocator.h"
11 #include "ui/gl/android/scoped_java_surface.h"
12
13 namespace media {
14
15 // TODO(liberato): most of Allocate/DeallocateSurface can be moved here, out
16 // of AVDACodecAllocator.
17 class ContentVideoViewOverlay : public AndroidOverlay,
18 public AVDASurfaceAllocatorClient {
19 public:
20 // |config| is ignored except for callbacks. Callbacks will not be called
21 // before this returns.
22 ContentVideoViewOverlay(AVDACodecAllocator* codec_allocator,
23 int surface_id,
24 const AndroidOverlay::Config& config);
25 ~ContentVideoViewOverlay() override;
26
27 // ContentVideoView ignores this, unfortunately.
28 void ScheduleLayout(const gfx::Rect& rect) override;
29 const base::android::JavaRef<jobject>& GetJavaSurface() const override;
30
31 // AVDASurfaceAllocatorClient
32 void OnSurfaceAvailable(bool success) override;
33 void OnSurfaceDestroyed() override;
34
35 private:
36 AVDACodecAllocator* codec_allocator_;
37 int surface_id_;
38 AndroidOverlay::Config config_;
39 gl::ScopedJavaSurface surface_;
40
41 base::WeakPtrFactory<ContentVideoViewOverlay> weak_factory_;
42 };
43
44 } // namespace media
45
46 #endif // MEDIA_GPU_ANDROID_CONTENT_VIDEO_VIEW_OVERLAY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698