Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Side by Side Diff: webrtc/media/base/videocapturer.cc

Issue 1695263002: Move direct use of VideoCapturer::VideoAdapter to VideoSinkWants. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Removed test for screencast from videocapturer Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 GetVariableSnapshot(frame_time_data_, frame_time_stats); 313 GetVariableSnapshot(frame_time_data_, frame_time_stats);
314 *last_captured_frame_format = last_captured_frame_format_; 314 *last_captured_frame_format = last_captured_frame_format_;
315 315
316 adapt_frame_drops_data_.Reset(); 316 adapt_frame_drops_data_.Reset();
317 frame_time_data_.Reset(); 317 frame_time_data_.Reset();
318 } 318 }
319 319
320 void VideoCapturer::RemoveSink( 320 void VideoCapturer::RemoveSink(
321 rtc::VideoSinkInterface<cricket::VideoFrame>* sink) { 321 rtc::VideoSinkInterface<cricket::VideoFrame>* sink) {
322 broadcaster_.RemoveSink(sink); 322 broadcaster_.RemoveSink(sink);
323 OnSinkWantsChanged(broadcaster_.wants());
323 } 324 }
324 325
325 void VideoCapturer::AddOrUpdateSink( 326 void VideoCapturer::AddOrUpdateSink(
326 rtc::VideoSinkInterface<cricket::VideoFrame>* sink, 327 rtc::VideoSinkInterface<cricket::VideoFrame>* sink,
327 const rtc::VideoSinkWants& wants) { 328 const rtc::VideoSinkWants& wants) {
328 broadcaster_.AddOrUpdateSink(sink, wants); 329 broadcaster_.AddOrUpdateSink(sink, wants);
329 OnSinkWantsChanged(broadcaster_.wants()); 330 OnSinkWantsChanged(broadcaster_.wants());
330 } 331 }
331 332
332 void VideoCapturer::OnSinkWantsChanged(const rtc::VideoSinkWants& wants) { 333 void VideoCapturer::OnSinkWantsChanged(const rtc::VideoSinkWants& wants) {
333 apply_rotation_ = wants.rotation_applied; 334 apply_rotation_ = wants.rotation_applied;
334 if (frame_factory_) { 335 if (frame_factory_) {
335 frame_factory_->SetApplyRotation(apply_rotation_); 336 frame_factory_->SetApplyRotation(apply_rotation_);
336 } 337 }
338
339 if (video_adapter()) {
340 video_adapter()->OnCpuResolutionRequest(wants.max_pixel_count,
341 wants.max_pixel_count_step_up);
342 }
337 } 343 }
338 344
339 void VideoCapturer::OnFrameCaptured(VideoCapturer*, 345 void VideoCapturer::OnFrameCaptured(VideoCapturer*,
340 const CapturedFrame* captured_frame) { 346 const CapturedFrame* captured_frame) {
341 if (muted_) { 347 if (muted_) {
342 if (black_frame_count_down_ == 0) { 348 if (black_frame_count_down_ == 0) {
343 thread_->Post(this, MSG_DO_PAUSE, NULL); 349 thread_->Post(this, MSG_DO_PAUSE, NULL);
344 } else { 350 } else {
345 --black_frame_count_down_; 351 --black_frame_count_down_;
346 } 352 }
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 void VideoCapturer::GetVariableSnapshot( 724 void VideoCapturer::GetVariableSnapshot(
719 const rtc::RollingAccumulator<T>& data, 725 const rtc::RollingAccumulator<T>& data,
720 VariableInfo<T>* stats) { 726 VariableInfo<T>* stats) {
721 stats->max_val = data.ComputeMax(); 727 stats->max_val = data.ComputeMax();
722 stats->mean = data.ComputeMean(); 728 stats->mean = data.ComputeMean();
723 stats->min_val = data.ComputeMin(); 729 stats->min_val = data.ComputeMin();
724 stats->variance = data.ComputeVariance(); 730 stats->variance = data.ComputeVariance();
725 } 731 }
726 732
727 } // namespace cricket 733 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698