| 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 |
| 11 #include "webrtc/media/engine/webrtcvideocapturer.h" | 11 #include "webrtc/media/engine/webrtcvideocapturer.h" |
| 12 | 12 |
| 13 #include "webrtc/base/arraysize.h" | 13 #include "webrtc/base/arraysize.h" |
| 14 #include "webrtc/base/bind.h" | 14 #include "webrtc/base/bind.h" |
| 15 #include "webrtc/base/checks.h" | 15 #include "webrtc/base/checks.h" |
| 16 #include "webrtc/base/criticalsection.h" | 16 #include "webrtc/base/criticalsection.h" |
| 17 #include "webrtc/base/logging.h" | 17 #include "webrtc/base/logging.h" |
| 18 #include "webrtc/base/safe_conversions.h" | 18 #include "webrtc/base/safe_conversions.h" |
| 19 #include "webrtc/base/thread.h" | 19 #include "webrtc/base/thread.h" |
| 20 #include "webrtc/base/timeutils.h" | 20 #include "webrtc/base/timeutils.h" |
| 21 #include "webrtc/media/engine/webrtcvideoframe.h" | |
| 22 | 21 |
| 23 #include "webrtc/base/win32.h" // Need this to #include the impl files. | 22 #include "webrtc/base/win32.h" // Need this to #include the impl files. |
| 24 #include "webrtc/modules/video_capture/video_capture_factory.h" | 23 #include "webrtc/modules/video_capture/video_capture_factory.h" |
| 25 #include "webrtc/system_wrappers/include/field_trial.h" | 24 #include "webrtc/system_wrappers/include/field_trial.h" |
| 26 | 25 |
| 27 namespace cricket { | 26 namespace cricket { |
| 28 | 27 |
| 29 struct kVideoFourCCEntry { | 28 struct kVideoFourCCEntry { |
| 30 uint32_t fourcc; | 29 uint32_t fourcc; |
| 31 webrtc::RawVideoType webrtc_type; | 30 webrtc::RawVideoType webrtc_type; |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 RTC_DCHECK(async_invoker_); | 345 RTC_DCHECK(async_invoker_); |
| 347 | 346 |
| 348 ++captured_frames_; | 347 ++captured_frames_; |
| 349 // Log the size and pixel aspect ratio of the first captured frame. | 348 // Log the size and pixel aspect ratio of the first captured frame. |
| 350 if (1 == captured_frames_) { | 349 if (1 == captured_frames_) { |
| 351 LOG(LS_INFO) << "Captured frame size " | 350 LOG(LS_INFO) << "Captured frame size " |
| 352 << sample.width() << "x" << sample.height() | 351 << sample.width() << "x" << sample.height() |
| 353 << ". Expected format " << GetCaptureFormat()->ToString(); | 352 << ". Expected format " << GetCaptureFormat()->ToString(); |
| 354 } | 353 } |
| 355 | 354 |
| 356 OnFrame(cricket::WebRtcVideoFrame( | 355 OnFrame(sample, sample.width(), sample.height()); |
| 357 sample.video_frame_buffer(), sample.rotation(), | |
| 358 sample.render_time_ms() * rtc::kNumMicrosecsPerMillisec), | |
| 359 sample.width(), sample.height()); | |
| 360 } | 356 } |
| 361 | 357 |
| 362 void WebRtcVideoCapturer::OnCaptureDelayChanged(const int32_t id, | 358 void WebRtcVideoCapturer::OnCaptureDelayChanged(const int32_t id, |
| 363 const int32_t delay) { | 359 const int32_t delay) { |
| 364 LOG(LS_INFO) << "Capture delay changed to " << delay << " ms"; | 360 LOG(LS_INFO) << "Capture delay changed to " << delay << " ms"; |
| 365 } | 361 } |
| 366 | 362 |
| 367 } // namespace cricket | 363 } // namespace cricket |
| OLD | NEW |