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

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

Issue 2716643002: Add framerate to VideoSinkWants and ability to signal on overuse (Closed)
Patch Set: Comments Created 3 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 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.target_pixel_count, 152 video_adapter()->OnResolutionFramerateRequest(wants.target_pixel_count,
153 wants.max_pixel_count); 153 wants.max_pixel_count,
154 wants.max_framerate_fps);
154 } 155 }
155 } 156 }
156 157
157 bool VideoCapturer::AdaptFrame(int width, 158 bool VideoCapturer::AdaptFrame(int width,
158 int height, 159 int height,
159 int64_t camera_time_us, 160 int64_t camera_time_us,
160 int64_t system_time_us, 161 int64_t system_time_us,
161 int* out_width, 162 int* out_width,
162 int* out_height, 163 int* out_height,
163 int* crop_width, 164 int* crop_width,
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 void VideoCapturer::UpdateInputSize(int width, int height) { 364 void VideoCapturer::UpdateInputSize(int width, int height) {
364 // Update stats protected from fetches from different thread. 365 // Update stats protected from fetches from different thread.
365 rtc::CritScope cs(&frame_stats_crit_); 366 rtc::CritScope cs(&frame_stats_crit_);
366 367
367 input_size_valid_ = true; 368 input_size_valid_ = true;
368 input_width_ = width; 369 input_width_ = width;
369 input_height_ = height; 370 input_height_ = height;
370 } 371 }
371 372
372 } // namespace cricket 373 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/media/base/videobroadcaster_unittest.cc ('k') | webrtc/media/base/videocapturer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698