| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 return; | 144 return; |
| 145 } | 145 } |
| 146 | 146 |
| 147 // Store current width and height. | 147 // Store current width and height. |
| 148 current_settings_.width = | 148 current_settings_.width = |
| 149 Java_VideoCapture_queryWidth(env, j_capture_.obj()); | 149 Java_VideoCapture_queryWidth(env, j_capture_.obj()); |
| 150 current_settings_.height = | 150 current_settings_.height = |
| 151 Java_VideoCapture_queryHeight(env, j_capture_.obj()); | 151 Java_VideoCapture_queryHeight(env, j_capture_.obj()); |
| 152 current_settings_.frame_rate = | 152 current_settings_.frame_rate = |
| 153 Java_VideoCapture_queryFrameRate(env, j_capture_.obj()); | 153 Java_VideoCapture_queryFrameRate(env, j_capture_.obj()); |
| 154 current_settings_.color = VideoCaptureCapability::kYV12; | 154 current_settings_.color = kYV12; |
| 155 CHECK(current_settings_.width > 0 && !(current_settings_.width % 2)); | 155 CHECK(current_settings_.width > 0 && !(current_settings_.width % 2)); |
| 156 CHECK(current_settings_.height > 0 && !(current_settings_.height % 2)); | 156 CHECK(current_settings_.height > 0 && !(current_settings_.height % 2)); |
| 157 | 157 |
| 158 DVLOG(1) << "VideoCaptureDeviceAndroid::Allocate: queried width=" | 158 DVLOG(1) << "VideoCaptureDeviceAndroid::Allocate: queried width=" |
| 159 << current_settings_.width | 159 << current_settings_.width |
| 160 << ", height=" | 160 << ", height=" |
| 161 << current_settings_.height | 161 << current_settings_.height |
| 162 << ", frame_rate=" | 162 << ", frame_rate=" |
| 163 << current_settings_.frame_rate; | 163 << current_settings_.frame_rate; |
| 164 // Report the frame size to the observer. | 164 // Report the frame size to the observer. |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 void VideoCaptureDeviceAndroid::SetErrorState(const std::string& reason) { | 259 void VideoCaptureDeviceAndroid::SetErrorState(const std::string& reason) { |
| 260 LOG(ERROR) << "VideoCaptureDeviceAndroid::SetErrorState: " << reason; | 260 LOG(ERROR) << "VideoCaptureDeviceAndroid::SetErrorState: " << reason; |
| 261 { | 261 { |
| 262 base::AutoLock lock(lock_); | 262 base::AutoLock lock(lock_); |
| 263 state_ = kError; | 263 state_ = kError; |
| 264 } | 264 } |
| 265 observer_->OnError(); | 265 observer_->OnError(); |
| 266 } | 266 } |
| 267 | 267 |
| 268 } // namespace media | 268 } // namespace media |
| OLD | NEW |