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/video/capture/android/video_capture_device_factory_android.h" | 5 #include "media/video/capture/android/video_capture_device_factory_android.h" |
6 | 6 |
7 #include "base/android/jni_string.h" | 7 #include "base/android/jni_string.h" |
8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 int id, | 28 int id, |
29 jlong nativeVideoCaptureDeviceAndroid) { | 29 jlong nativeVideoCaptureDeviceAndroid) { |
30 return (Java_VideoCaptureFactory_createVideoCapture( | 30 return (Java_VideoCaptureFactory_createVideoCapture( |
31 AttachCurrentThread(), | 31 AttachCurrentThread(), |
32 base::android::GetApplicationContext(), | 32 base::android::GetApplicationContext(), |
33 id, | 33 id, |
34 nativeVideoCaptureDeviceAndroid)); | 34 nativeVideoCaptureDeviceAndroid)); |
35 } | 35 } |
36 | 36 |
37 scoped_ptr<VideoCaptureDevice> VideoCaptureDeviceFactoryAndroid::Create( | 37 scoped_ptr<VideoCaptureDevice> VideoCaptureDeviceFactoryAndroid::Create( |
| 38 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
38 const VideoCaptureDevice::Name& device_name) { | 39 const VideoCaptureDevice::Name& device_name) { |
39 DCHECK(thread_checker_.CalledOnValidThread()); | 40 DCHECK(thread_checker_.CalledOnValidThread()); |
40 int id; | 41 int id; |
41 if (!base::StringToInt(device_name.id(), &id)) | 42 if (!base::StringToInt(device_name.id(), &id)) |
42 return scoped_ptr<VideoCaptureDevice>(); | 43 return scoped_ptr<VideoCaptureDevice>(); |
43 | 44 |
44 VideoCaptureDeviceAndroid* video_capture_device( | 45 VideoCaptureDeviceAndroid* video_capture_device( |
45 new VideoCaptureDeviceAndroid(device_name)); | 46 new VideoCaptureDeviceAndroid(device_name)); |
46 | 47 |
47 if (video_capture_device->Init()) | 48 if (video_capture_device->Init()) |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 pixel_format); | 122 pixel_format); |
122 capture_formats->push_back(capture_format); | 123 capture_formats->push_back(capture_format); |
123 DVLOG(1) << device.name() << " resolution: " | 124 DVLOG(1) << device.name() << " resolution: " |
124 << capture_format.frame_size.ToString() << ", fps: " | 125 << capture_format.frame_size.ToString() << ", fps: " |
125 << capture_format.frame_rate << ", pixel format: " | 126 << capture_format.frame_rate << ", pixel format: " |
126 << capture_format.pixel_format; | 127 << capture_format.pixel_format; |
127 } | 128 } |
128 } | 129 } |
129 | 130 |
130 } // namespace media | 131 } // namespace media |
OLD | NEW |