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

Unified Diff: media/mojo/clients/mojo_android_overlay.h

Issue 2688193002: Mojo framework for AndroidOverlay. (Closed)
Patch Set: fixed mojo manifest bug introduced by rebase 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/mojo/clients/BUILD.gn ('k') | media/mojo/clients/mojo_android_overlay.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/clients/mojo_android_overlay.h
diff --git a/media/mojo/clients/mojo_android_overlay.h b/media/mojo/clients/mojo_android_overlay.h
new file mode 100644
index 0000000000000000000000000000000000000000..b96d0f5341446e2288ba0355551a332509fcc0a7
--- /dev/null
+++ b/media/mojo/clients/mojo_android_overlay.h
@@ -0,0 +1,55 @@
+// 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_BASE_MOJO_ANDROID_OVERLAY_H_
+#define MEDIA_BASE_MOJO_ANDROID_OVERLAY_H_
+
+#include "base/macros.h"
+#include "media/base/android/android_overlay.h"
+#include "media/mojo/interfaces/android_overlay.mojom.h"
+#include "mojo/public/cpp/bindings/binding.h"
+
+namespace service_manager {
+namespace mojom {
+class InterfaceProvider;
+}
+}
+
+namespace media {
+
+// AndroidOverlay implementation via mojo.
+class MojoAndroidOverlay : public AndroidOverlay,
+ public mojom::AndroidOverlayClient {
+ public:
+ MojoAndroidOverlay(
+ service_manager::mojom::InterfaceProvider* interface_provider,
+ const AndroidOverlay::Config& config);
+
+ ~MojoAndroidOverlay() override;
+
+ // AndroidOverlay
+ void ScheduleLayout(const gfx::Rect& rect) override;
+ const base::android::JavaRef<jobject>& GetJavaSurface() const override;
+
+ // mojom::AndroidOverlayClient
+ void OnSurfaceReady(uint64_t surface_key) override;
+ void OnDestroyed() override;
+
+ private:
+ service_manager::mojom::InterfaceProvider* interface_provider_;
+ AndroidOverlay::Config config_;
+ mojom::AndroidOverlayProviderPtr provider_ptr_;
+ mojom::AndroidOverlayPtr overlay_ptr_;
+ std::unique_ptr<mojo::Binding<mojom::AndroidOverlayClient>> binding_;
+ gl::ScopedJavaSurface surface_;
+
+ // Have we received OnSurfaceReady yet?
+ bool received_surface_ = false;
+
+ DISALLOW_COPY_AND_ASSIGN(MojoAndroidOverlay);
+};
+
+} // namespace media
+
+#endif // MEDIA_BASE_MOJO_ANDROID_OVERLAY_H_
« no previous file with comments | « media/mojo/clients/BUILD.gn ('k') | media/mojo/clients/mojo_android_overlay.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698