Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(507)

Side by Side Diff: media/video/capture/android/video_capture_device_factory_android.cc

Issue 294893006: VideoCaptureDeviceFactory: Change device enumeration to callback + QTKit enumerates in UI thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: QTKit/AVFoundation Factory create of inexistent device and associated unit tests Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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,
39 const VideoCaptureDevice::Name& device_name) { 38 const VideoCaptureDevice::Name& device_name) {
40 DCHECK(thread_checker_.CalledOnValidThread()); 39 DCHECK(thread_checker_.CalledOnValidThread());
41 int id; 40 int id;
42 if (!base::StringToInt(device_name.id(), &id)) 41 if (!base::StringToInt(device_name.id(), &id))
43 return scoped_ptr<VideoCaptureDevice>(); 42 return scoped_ptr<VideoCaptureDevice>();
44 43
45 VideoCaptureDeviceAndroid* video_capture_device( 44 VideoCaptureDeviceAndroid* video_capture_device(
46 new VideoCaptureDeviceAndroid(device_name)); 45 new VideoCaptureDeviceAndroid(device_name));
47 46
48 if (video_capture_device->Init()) 47 if (video_capture_device->Init())
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 pixel_format); 121 pixel_format);
123 capture_formats->push_back(capture_format); 122 capture_formats->push_back(capture_format);
124 DVLOG(1) << device.name() << " resolution: " 123 DVLOG(1) << device.name() << " resolution: "
125 << capture_format.frame_size.ToString() << ", fps: " 124 << capture_format.frame_size.ToString() << ", fps: "
126 << capture_format.frame_rate << ", pixel format: " 125 << capture_format.frame_rate << ", pixel format: "
127 << capture_format.pixel_format; 126 << capture_format.pixel_format;
128 } 127 }
129 } 128 }
130 129
131 } // namespace media 130 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698