| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/capture/video/android/video_capture_device_factory_android.h" | 5 #include "media/capture/video/android/video_capture_device_factory_android.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/android/context_utils.h" | 9 #include "base/android/context_utils.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| 11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
| 12 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
| 13 #include "jni/VideoCaptureFactory_jni.h" | 13 #include "jni/VideoCaptureFactory_jni.h" |
| 14 #include "media/capture/video/android/video_capture_device_android.h" | 14 #include "media/capture/video/android/video_capture_device_android.h" |
| 15 | 15 |
| 16 using base::android::AttachCurrentThread; | 16 using base::android::AttachCurrentThread; |
| 17 using base::android::ScopedJavaLocalRef; | 17 using base::android::ScopedJavaLocalRef; |
| 18 | 18 |
| 19 namespace media { | 19 namespace media { |
| 20 | 20 |
| 21 // static | 21 // static |
| 22 bool VideoCaptureDeviceFactoryAndroid::RegisterVideoCaptureDeviceFactory( | |
| 23 JNIEnv* env) { | |
| 24 return RegisterNativesImpl(env); | |
| 25 } | |
| 26 | |
| 27 // static | |
| 28 ScopedJavaLocalRef<jobject> | 22 ScopedJavaLocalRef<jobject> |
| 29 VideoCaptureDeviceFactoryAndroid::createVideoCaptureAndroid( | 23 VideoCaptureDeviceFactoryAndroid::createVideoCaptureAndroid( |
| 30 int id, | 24 int id, |
| 31 jlong nativeVideoCaptureDeviceAndroid) { | 25 jlong nativeVideoCaptureDeviceAndroid) { |
| 32 return (Java_VideoCaptureFactory_createVideoCapture( | 26 return (Java_VideoCaptureFactory_createVideoCapture( |
| 33 AttachCurrentThread(), base::android::GetApplicationContext(), id, | 27 AttachCurrentThread(), base::android::GetApplicationContext(), id, |
| 34 nativeVideoCaptureDeviceAndroid)); | 28 nativeVideoCaptureDeviceAndroid)); |
| 35 } | 29 } |
| 36 | 30 |
| 37 std::unique_ptr<VideoCaptureDevice> | 31 std::unique_ptr<VideoCaptureDevice> |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 } | 131 } |
| 138 | 132 |
| 139 // static | 133 // static |
| 140 VideoCaptureDeviceFactory* | 134 VideoCaptureDeviceFactory* |
| 141 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory( | 135 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory( |
| 142 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { | 136 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { |
| 143 return new VideoCaptureDeviceFactoryAndroid(); | 137 return new VideoCaptureDeviceFactoryAndroid(); |
| 144 } | 138 } |
| 145 | 139 |
| 146 } // namespace media | 140 } // namespace media |
| OLD | NEW |