Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2010 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 176 return ss.str(); | 176 return ss.str(); |
| 177 } | 177 } |
| 178 | 178 |
| 179 void VideoCapturer::set_frame_factory(VideoFrameFactory* frame_factory) { | 179 void VideoCapturer::set_frame_factory(VideoFrameFactory* frame_factory) { |
| 180 frame_factory_.reset(frame_factory); | 180 frame_factory_.reset(frame_factory); |
| 181 if (frame_factory) { | 181 if (frame_factory) { |
| 182 frame_factory->SetApplyRotation(apply_rotation_); | 182 frame_factory->SetApplyRotation(apply_rotation_); |
| 183 } | 183 } |
| 184 } | 184 } |
| 185 | 185 |
| 186 void VideoCapturer::GetStats(VideoFormat* last_captured_frame_format) { | |
| 187 rtc::CritScope cs(&frame_stats_crit_); | |
| 188 *last_captured_frame_format = last_captured_frame_format_; | |
| 189 } | |
| 190 | |
| 191 void VideoCapturer::RemoveSink( | 186 void VideoCapturer::RemoveSink( |
| 192 rtc::VideoSinkInterface<cricket::VideoFrame>* sink) { | 187 rtc::VideoSinkInterface<cricket::VideoFrame>* sink) { |
| 193 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 188 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
| 194 broadcaster_.RemoveSink(sink); | 189 broadcaster_.RemoveSink(sink); |
| 195 OnSinkWantsChanged(broadcaster_.wants()); | 190 OnSinkWantsChanged(broadcaster_.wants()); |
| 196 } | 191 } |
| 197 | 192 |
| 198 void VideoCapturer::AddOrUpdateSink( | 193 void VideoCapturer::AddOrUpdateSink( |
| 199 rtc::VideoSinkInterface<cricket::VideoFrame>* sink, | 194 rtc::VideoSinkInterface<cricket::VideoFrame>* sink, |
| 200 const rtc::VideoSinkWants& wants) { | 195 const rtc::VideoSinkWants& wants) { |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 533 | 528 |
| 534 bool VideoCapturer::ShouldFilterFormat(const VideoFormat& format) const { | 529 bool VideoCapturer::ShouldFilterFormat(const VideoFormat& format) const { |
| 535 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 530 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
| 536 if (!enable_camera_list_) { | 531 if (!enable_camera_list_) { |
| 537 return false; | 532 return false; |
| 538 } | 533 } |
| 539 return format.width > max_format_->width || | 534 return format.width > max_format_->width || |
| 540 format.height > max_format_->height; | 535 format.height > max_format_->height; |
| 541 } | 536 } |
| 542 | 537 |
| 543 void VideoCapturer::UpdateStats(const CapturedFrame* captured_frame) { | 538 void VideoCapturer::UpdateStats(const CapturedFrame* captured_frame) { |
|
perkj_webrtc
2016/03/22 08:56:36
Remove?
nisse-webrtc
2016/03/22 10:18:59
Done, deleted together with last_capturered_frame_
| |
| 544 // Update stats protected from fetches from different thread. | 539 // Update stats protected from fetches from different thread. |
| 545 rtc::CritScope cs(&frame_stats_crit_); | 540 rtc::CritScope cs(&frame_stats_crit_); |
| 546 | 541 |
| 547 last_captured_frame_format_.width = captured_frame->width; | 542 last_captured_frame_format_.width = captured_frame->width; |
| 548 last_captured_frame_format_.height = captured_frame->height; | 543 last_captured_frame_format_.height = captured_frame->height; |
| 549 // TODO(ronghuawu): Useful to report interval as well? | 544 // TODO(ronghuawu): Useful to report interval as well? |
| 550 last_captured_frame_format_.interval = 0; | 545 last_captured_frame_format_.interval = 0; |
| 551 last_captured_frame_format_.fourcc = captured_frame->fourcc; | 546 last_captured_frame_format_.fourcc = captured_frame->fourcc; |
| 552 } | 547 } |
| 553 | 548 |
| 554 } // namespace cricket | 549 } // namespace cricket |
| OLD | NEW |