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> VideoCaptureDeviceFactoryAndroid::Create( | 31 std::unique_ptr<VideoCaptureDevice> VideoCaptureDeviceFactoryAndroid::Create( |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 } | 127 } |
134 | 128 |
135 // static | 129 // static |
136 VideoCaptureDeviceFactory* | 130 VideoCaptureDeviceFactory* |
137 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory( | 131 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory( |
138 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { | 132 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { |
139 return new VideoCaptureDeviceFactoryAndroid(); | 133 return new VideoCaptureDeviceFactoryAndroid(); |
140 } | 134 } |
141 | 135 |
142 } // namespace media | 136 } // namespace media |
OLD | NEW |