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/capture/content/android/screen_capture_factory_android.h" |
| 6 |
| 7 #include "base/android/context_utils.h" |
| 8 #include "base/android/scoped_java_ref.h" |
| 9 #include "jni/ScreenCaptureFactory_jni.h" |
| 10 #include "media/capture/content/android/screen_capture_device_android.h" |
| 11 |
| 12 using base::android::AttachCurrentThread; |
| 13 using base::android::ScopedJavaLocalRef; |
| 14 |
| 15 namespace media { |
| 16 |
| 17 // static |
| 18 bool ScreenCaptureFactoryAndroid::RegisterScreenCaptureFactory(JNIEnv* env) { |
| 19 return RegisterNativesImpl(env); |
| 20 } |
| 21 |
| 22 // static |
| 23 ScopedJavaLocalRef<jobject> |
| 24 ScreenCaptureFactoryAndroid::createScreenCaptureMachineAndroid( |
| 25 jlong nativeScreenCaptureMachineAndroid) { |
| 26 return (Java_ScreenCaptureFactory_createScreenCaptureMachine( |
| 27 AttachCurrentThread(), base::android::GetApplicationContext(), |
| 28 nativeScreenCaptureMachineAndroid)); |
| 29 } |
| 30 |
| 31 // static |
| 32 std::unique_ptr<VideoCaptureDevice> ScreenCaptureFactoryAndroid::Create() { |
| 33 std::unique_ptr<ScreenCaptureDeviceAndroid> screen_capture_device( |
| 34 new ScreenCaptureDeviceAndroid()); |
| 35 |
| 36 return std::move(screen_capture_device); |
| 37 } |
| 38 |
| 39 } // namespace media |
OLD | NEW |