OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 #include "media/screen_capture/android/screen_capture_factory_android.h" |
| 6 |
| 7 #include "base/android/scoped_java_ref.h" |
| 8 #include "jni/ScreenCaptureFactory_jni.h" |
| 9 #include "media/screen_capture/android/screen_capturer2_android.h" |
| 10 |
| 11 using base::android::AttachCurrentThread; |
| 12 using base::android::ScopedJavaLocalRef; |
| 13 |
| 14 namespace media { |
| 15 |
| 16 // static |
| 17 bool ScreenCaptureFactoryAndroid::RegisterScreenCaptureFactory( |
| 18 JNIEnv* env) { |
| 19 return RegisterNativesImpl(env); |
| 20 } |
| 21 |
| 22 //static |
| 23 ScopedJavaLocalRef<jobject> |
| 24 ScreenCaptureFactoryAndroid::createScreenCaptureAndroid( |
| 25 jlong nativeScreenCapturerAndroid) { |
| 26 return (Java_ScreenCaptureFactory_createScreenCapture( |
| 27 AttachCurrentThread(), |
| 28 base::android::GetApplicationContext(), |
| 29 nativeScreenCapturerAndroid)); |
| 30 } |
| 31 |
| 32 //static |
| 33 ScopedJavaLocalRef<jobject> |
| 34 ScreenCaptureFactoryAndroid::createScreenCapture2Android( |
| 35 jlong nativeScreenCapturer2Android) { |
| 36 return (Java_ScreenCaptureFactory_createScreenCapture( |
| 37 AttachCurrentThread(), |
| 38 base::android::GetApplicationContext(), |
| 39 nativeScreenCapturer2Android)); |
| 40 } |
| 41 |
| 42 scoped_ptr<VideoCaptureDevice> ScreenCaptureFactoryAndroid::Create() { |
| 43 scoped_ptr<ScreenCapturer2Android> screen_capture_device( |
| 44 new ScreenCapturer2Android()); |
| 45 |
| 46 if (screen_capture_device->Init()) |
| 47 return screen_capture_device.Pass(); |
| 48 |
| 49 DLOG(ERROR) << "Error creating Screen Capture Device."; |
| 50 return scoped_ptr<VideoCaptureDevice>(); |
| 51 } |
| 52 |
| 53 } // namespace media |
OLD | NEW |