| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 captured_frames_ = 0; | 271 captured_frames_ = 0; |
| 272 | 272 |
| 273 SetCaptureFormat(&capture_format); | 273 SetCaptureFormat(&capture_format); |
| 274 | 274 |
| 275 webrtc::VideoCaptureCapability cap; | 275 webrtc::VideoCaptureCapability cap; |
| 276 if (!FormatToCapability(capture_format, &cap)) { | 276 if (!FormatToCapability(capture_format, &cap)) { |
| 277 LOG(LS_ERROR) << "Invalid capture format specified"; | 277 LOG(LS_ERROR) << "Invalid capture format specified"; |
| 278 return CS_FAILED; | 278 return CS_FAILED; |
| 279 } | 279 } |
| 280 | 280 |
| 281 uint32_t start = rtc::Time(); | 281 int64_t start = rtc::TimeMillis(); |
| 282 module_->RegisterCaptureDataCallback(*this); | 282 module_->RegisterCaptureDataCallback(*this); |
| 283 if (module_->StartCapture(cap) != 0) { | 283 if (module_->StartCapture(cap) != 0) { |
| 284 LOG(LS_ERROR) << "Camera '" << GetId() << "' failed to start"; | 284 LOG(LS_ERROR) << "Camera '" << GetId() << "' failed to start"; |
| 285 module_->DeRegisterCaptureDataCallback(); | 285 module_->DeRegisterCaptureDataCallback(); |
| 286 async_invoker_.reset(); | 286 async_invoker_.reset(); |
| 287 SetCaptureFormat(nullptr); | 287 SetCaptureFormat(nullptr); |
| 288 start_thread_ = nullptr; | 288 start_thread_ = nullptr; |
| 289 return CS_FAILED; | 289 return CS_FAILED; |
| 290 } | 290 } |
| 291 | 291 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 pixel_width = 1; | 411 pixel_width = 1; |
| 412 pixel_height = 1; | 412 pixel_height = 1; |
| 413 // Convert units from VideoFrame RenderTimeMs to CapturedFrame (nanoseconds). | 413 // Convert units from VideoFrame RenderTimeMs to CapturedFrame (nanoseconds). |
| 414 time_stamp = sample.render_time_ms() * rtc::kNumNanosecsPerMillisec; | 414 time_stamp = sample.render_time_ms() * rtc::kNumNanosecsPerMillisec; |
| 415 data_size = rtc::checked_cast<uint32_t>(length); | 415 data_size = rtc::checked_cast<uint32_t>(length); |
| 416 data = buffer; | 416 data = buffer; |
| 417 rotation = sample.rotation(); | 417 rotation = sample.rotation(); |
| 418 } | 418 } |
| 419 | 419 |
| 420 } // namespace cricket | 420 } // namespace cricket |
| OLD | NEW |