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

Unified Diff: content/browser/android/external_video_surface_view_holder.h

Issue 12443003: Implement out-of-band video compositing on Android: Step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit2 Created 7 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
Index: content/browser/android/external_video_surface_view_holder.h
diff --git a/content/browser/android/external_video_surface_view_holder.h b/content/browser/android/external_video_surface_view_holder.h
new file mode 100644
index 0000000000000000000000000000000000000000..3fd5f0aefa9296db31bc57210321f35d6920798d
--- /dev/null
+++ b/content/browser/android/external_video_surface_view_holder.h
@@ -0,0 +1,52 @@
+// Copyright (c) 2013 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 CONTENT_BROWSER_ANDROID_EXTERNAL_VIDEO_SURFACE_VIEW_HOLDER_H_
+#define CONTENT_BROWSER_ANDROID_EXTERNAL_VIDEO_SURFACE_VIEW_HOLDER_H_
+
+#include <jni.h>
+
+#include "base/android/jni_helper.h"
+#include "base/basictypes.h"
+
+namespace media {
+class MediaPlayerBridge;
+} // namespace media
+
+namespace content {
+
+class ExternalVideoSurfaceViewHolder {
+ public:
+ // Registers the JNI methods for ExternalVideoSurfaceViewHolder.
+ static bool RegisterExternalVideoSurfaceViewHolder(JNIEnv* env);
+
+ ExternalVideoSurfaceViewHolder(JNIEnv *env, jobject obj);
+ ~ExternalVideoSurfaceViewHolder();
+
+ // Registers/unregisters media player that wants to render to external video
+ // surface. Note that the client must unregister the player before deleting
+ // the media player to prevent access to deleted object.
+ void registerPlayer(media::MediaPlayerBridge* player);
+ void unregisterPlayer(media::MediaPlayerBridge* player);
+
+ // --------------------------------------------------------------------------
+ // Methods called from Java via JNI
+ // --------------------------------------------------------------------------
+ void Destroy(JNIEnv* env, jobject obj);
+ void AttachExternalVideoSurface(JNIEnv* env, jobject obj, jobject jsurface);
+ void DetachExternalVideoSurface(JNIEnv* env, jobject obj);
+
+ private:
+ // A weak reference to the Java ExternalVideoSurfaceViewHolder object.
+ JavaObjectWeakGlobalRef java_ref_;
+
+ // The MediaPlayerBridge object that should receive video surface updates.
+ media::MediaPlayerBridge* player_;
+
+ DISALLOW_COPY_AND_ASSIGN(ExternalVideoSurfaceViewHolder);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_ANDROID_EXTERNAL_VIDEO_SURFACE_VIEW_HOLDER_H_

Powered by Google App Engine
This is Rietveld 408576698