OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 22 matching lines...) Expand all Loading... |
33 } | 33 } |
34 | 34 |
35 vcm_ = webrtc::VideoCaptureFactory::Create(unique_name); | 35 vcm_ = webrtc::VideoCaptureFactory::Create(unique_name); |
36 vcm_->RegisterCaptureDataCallback(this); | 36 vcm_->RegisterCaptureDataCallback(this); |
37 | 37 |
38 device_info->GetCapability(vcm_->CurrentDeviceName(), 0, capability_); | 38 device_info->GetCapability(vcm_->CurrentDeviceName(), 0, capability_); |
39 | 39 |
40 capability_.width = static_cast<int32_t>(width); | 40 capability_.width = static_cast<int32_t>(width); |
41 capability_.height = static_cast<int32_t>(height); | 41 capability_.height = static_cast<int32_t>(height); |
42 capability_.maxFPS = static_cast<int32_t>(target_fps); | 42 capability_.maxFPS = static_cast<int32_t>(target_fps); |
43 capability_.rawType = kVideoI420; | 43 capability_.videoType = VideoType::kI420; |
44 | 44 |
45 if (vcm_->StartCapture(capability_) != 0) { | 45 if (vcm_->StartCapture(capability_) != 0) { |
46 Destroy(); | 46 Destroy(); |
47 return false; | 47 return false; |
48 } | 48 } |
49 | 49 |
50 RTC_CHECK(vcm_->CaptureStarted()); | 50 RTC_CHECK(vcm_->CaptureStarted()); |
51 | 51 |
52 return true; | 52 return true; |
53 } | 53 } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 rtc::CritScope lock(&crit_); | 105 rtc::CritScope lock(&crit_); |
106 if (started_ && sink_) { | 106 if (started_ && sink_) { |
107 rtc::Optional<VideoFrame> out_frame = AdaptFrame(frame); | 107 rtc::Optional<VideoFrame> out_frame = AdaptFrame(frame); |
108 if (out_frame) | 108 if (out_frame) |
109 sink_->OnFrame(*out_frame); | 109 sink_->OnFrame(*out_frame); |
110 } | 110 } |
111 } | 111 } |
112 | 112 |
113 } // test | 113 } // test |
114 } // webrtc | 114 } // webrtc |
OLD | NEW |