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

Unified Diff: media/gpu/content_video_view_overlay.h

Issue 2692863011: Add ContentVideoViewOverlay to AVDA. (Closed)
Patch Set: fixed avda unittest 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/gpu/avda_surface_bundle.cc ('k') | media/gpu/content_video_view_overlay.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/content_video_view_overlay.h
diff --git a/media/gpu/content_video_view_overlay.h b/media/gpu/content_video_view_overlay.h
new file mode 100644
index 0000000000000000000000000000000000000000..9c8eb8be518242e8df6c7b2c1bd6ff374bce8913
--- /dev/null
+++ b/media/gpu/content_video_view_overlay.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_CONTENT_VIDEO_VIEW_OVERLAY_H_
+#define MEDIA_GPU_CONTENT_VIDEO_VIEW_OVERLAY_H_
+
+#include "base/memory/weak_ptr.h"
+#include "media/base/android/android_overlay.h"
+#include "media/gpu/avda_codec_allocator.h"
+#include "ui/gl/android/scoped_java_surface.h"
+
+namespace media {
+
+// TODO(liberato): most of Allocate/DeallocateSurface can be moved here, out
+// of AVDACodecAllocator.
+class ContentVideoViewOverlay : public AndroidOverlay,
+ public AVDASurfaceAllocatorClient {
+ public:
+ // |config| is ignored except for callbacks. Callbacks will not be called
+ // before this returns.
+ ContentVideoViewOverlay(AVDACodecAllocator* codec_allocator,
+ int surface_id,
+ const AndroidOverlay::Config& config);
+ ~ContentVideoViewOverlay() override;
+
+ // ContentVideoView ignores this, unfortunately.
+ void ScheduleLayout(const gfx::Rect& rect) override;
+ const base::android::JavaRef<jobject>& GetJavaSurface() const override;
+
+ // AVDASurfaceAllocatorClient
+ void OnSurfaceAvailable(bool success) override;
+ void OnSurfaceDestroyed() override;
+
+ private:
+ AVDACodecAllocator* codec_allocator_;
+ int surface_id_;
+ AndroidOverlay::Config config_;
+ gl::ScopedJavaSurface surface_;
+
+ base::WeakPtrFactory<ContentVideoViewOverlay> weak_factory_;
+};
+
+} // namespace media
+
+#endif // MEDIA_GPU_ANDROID_CONTENT_VIDEO_VIEW_OVERLAY_H_
« no previous file with comments | « media/gpu/avda_surface_bundle.cc ('k') | media/gpu/content_video_view_overlay.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698