| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_android.h" | 5 #include "media/video/capture/android/video_capture_device_android.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 int num_cameras = Java_ChromiumCameraInfo_getNumberOfCameras(env); | 45 int num_cameras = Java_ChromiumCameraInfo_getNumberOfCameras(env); |
| 46 DVLOG(1) << "VideoCaptureDevice::GetDeviceNames: num_cameras=" << num_cameras; | 46 DVLOG(1) << "VideoCaptureDevice::GetDeviceNames: num_cameras=" << num_cameras; |
| 47 if (num_cameras <= 0) | 47 if (num_cameras <= 0) |
| 48 return; | 48 return; |
| 49 | 49 |
| 50 for (int camera_id = num_cameras - 1; camera_id >= 0; --camera_id) { | 50 for (int camera_id = num_cameras - 1; camera_id >= 0; --camera_id) { |
| 51 ScopedJavaLocalRef<jobject> ci = | 51 ScopedJavaLocalRef<jobject> ci = |
| 52 Java_ChromiumCameraInfo_getAt(env, camera_id); | 52 Java_ChromiumCameraInfo_getAt(env, camera_id); |
| 53 | 53 |
| 54 Name name; | 54 Name name; |
| 55 name.unique_id = StringPrintf( | 55 name.unique_id = base::StringPrintf( |
| 56 "%d", Java_ChromiumCameraInfo_getId(env, ci.obj())); | 56 "%d", Java_ChromiumCameraInfo_getId(env, ci.obj())); |
| 57 name.device_name = base::android::ConvertJavaStringToUTF8( | 57 name.device_name = base::android::ConvertJavaStringToUTF8( |
| 58 Java_ChromiumCameraInfo_getDeviceName(env, ci.obj())); | 58 Java_ChromiumCameraInfo_getDeviceName(env, ci.obj())); |
| 59 device_names->push_back(name); | 59 device_names->push_back(name); |
| 60 | 60 |
| 61 DVLOG(1) << "VideoCaptureDevice::GetDeviceNames: camera device_name=" | 61 DVLOG(1) << "VideoCaptureDevice::GetDeviceNames: camera device_name=" |
| 62 << name.device_name | 62 << name.device_name |
| 63 << ", unique_id=" | 63 << ", unique_id=" |
| 64 << name.unique_id | 64 << name.unique_id |
| 65 << ", orientation " | 65 << ", orientation " |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 void VideoCaptureDeviceAndroid::SetErrorState(const std::string& reason) { | 255 void VideoCaptureDeviceAndroid::SetErrorState(const std::string& reason) { |
| 256 LOG(ERROR) << "VideoCaptureDeviceAndroid::SetErrorState: " << reason; | 256 LOG(ERROR) << "VideoCaptureDeviceAndroid::SetErrorState: " << reason; |
| 257 { | 257 { |
| 258 base::AutoLock lock(lock_); | 258 base::AutoLock lock(lock_); |
| 259 state_ = kError; | 259 state_ = kError; |
| 260 } | 260 } |
| 261 observer_->OnError(); | 261 observer_->OnError(); |
| 262 } | 262 } |
| 263 | 263 |
| 264 } // namespace media | 264 } // namespace media |
| OLD | NEW |