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

Unified Diff: media/screen_capture/android/screen_capture_factory_android.cc

Issue 1140113002: Implement screen capture for android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add ScreenCaptureMachineAndroid which inherited from content::VideoCaptureMachine Created 5 years, 7 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: media/screen_capture/android/screen_capture_factory_android.cc
diff --git a/media/screen_capture/android/screen_capture_factory_android.cc b/media/screen_capture/android/screen_capture_factory_android.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1b6f9549809829a831aaa0ba4ce5978610cc8757
--- /dev/null
+++ b/media/screen_capture/android/screen_capture_factory_android.cc
@@ -0,0 +1,40 @@
+// Copyright 2015 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.
+
+#include "media/screen_capture/android/screen_capture_factory_android.h"
+
+#include "base/android/scoped_java_ref.h"
+#include "jni/ScreenCaptureFactory_jni.h"
+#include "media/screen_capture/android/screen_capture_device_android.h"
+
+using base::android::AttachCurrentThread;
+using base::android::ScopedJavaLocalRef;
+
+namespace media {
+
+// static
+bool ScreenCaptureFactoryAndroid::RegisterScreenCaptureFactory(
+ JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
+
+//static
+ScopedJavaLocalRef<jobject>
+ScreenCaptureFactoryAndroid::createScreenCaptureMachineAndroid(
+ jlong nativeScreenCaptureMachineAndroid) {
+ return (Java_ScreenCaptureFactory_createScreenCaptureMachine(
+ AttachCurrentThread(),
+ base::android::GetApplicationContext(),
+ nativeScreenCaptureMachineAndroid));
+}
+
+//static
+scoped_ptr<VideoCaptureDevice> ScreenCaptureFactoryAndroid::Create() {
+ scoped_ptr<ScreenCaptureDeviceAndroid> screen_capture_device(
+ new ScreenCaptureDeviceAndroid());
+
+ return screen_capture_device.Pass();
+}
+
+} // namespace media

Powered by Google App Engine
This is Rietveld 408576698