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

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

Issue 2672793002: Change rtc::VideoSinkWants to have target and a max pixel count (Closed)
Patch Set: Fixed incorrect behavior in VideoAdapter, updated test Created 3 years, 10 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 142 RTC_DCHECK(thread_checker_.CalledOnValidThread());
143 broadcaster_.AddOrUpdateSink(sink, wants); 143 broadcaster_.AddOrUpdateSink(sink, wants);
144 OnSinkWantsChanged(broadcaster_.wants()); 144 OnSinkWantsChanged(broadcaster_.wants());
145 } 145 }
146 146
147 void VideoCapturer::OnSinkWantsChanged(const rtc::VideoSinkWants& wants) { 147 void VideoCapturer::OnSinkWantsChanged(const rtc::VideoSinkWants& wants) {
148 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 148 RTC_DCHECK(thread_checker_.CalledOnValidThread());
149 apply_rotation_ = wants.rotation_applied; 149 apply_rotation_ = wants.rotation_applied;
150 150
151 if (video_adapter()) { 151 if (video_adapter()) {
152 video_adapter()->OnResolutionRequest(wants.max_pixel_count, 152 video_adapter()->OnResolutionRequest(wants.target_pixel_count,
153 wants.max_pixel_count_step_up); 153 wants.max_pixel_count);
154 } 154 }
155 } 155 }
156 156
157 bool VideoCapturer::AdaptFrame(int width, 157 bool VideoCapturer::AdaptFrame(int width,
158 int height, 158 int height,
159 int64_t camera_time_us, 159 int64_t camera_time_us,
160 int64_t system_time_us, 160 int64_t system_time_us,
161 int* out_width, 161 int* out_width,
162 int* out_height, 162 int* out_height,
163 int* crop_width, 163 int* crop_width,
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 void VideoCapturer::UpdateInputSize(int width, int height) { 363 void VideoCapturer::UpdateInputSize(int width, int height) {
364 // Update stats protected from fetches from different thread. 364 // Update stats protected from fetches from different thread.
365 rtc::CritScope cs(&frame_stats_crit_); 365 rtc::CritScope cs(&frame_stats_crit_);
366 366
367 input_size_valid_ = true; 367 input_size_valid_ = true;
368 input_width_ = width; 368 input_width_ = width;
369 input_height_ = height; 369 input_height_ = height;
370 } 370 }
371 371
372 } // namespace cricket 372 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698