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

Side by Side Diff: webrtc/modules/video_coding/video_receiver.cc

Issue 2627463004: Make the new jitter buffer the default jitter buffer. (Closed)
Patch Set: Offline feedback. Created 3 years, 11 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) 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 _keyRequestTimer(500, clock_) {} 53 _keyRequestTimer(500, clock_) {}
54 54
55 VideoReceiver::~VideoReceiver() {} 55 VideoReceiver::~VideoReceiver() {}
56 56
57 void VideoReceiver::Process() { 57 void VideoReceiver::Process() {
58 // Receive-side statistics 58 // Receive-side statistics
59 if (_receiveStatsTimer.TimeUntilProcess() == 0) { 59 if (_receiveStatsTimer.TimeUntilProcess() == 0) {
60 _receiveStatsTimer.Processed(); 60 _receiveStatsTimer.Processed();
61 rtc::CritScope cs(&process_crit_); 61 rtc::CritScope cs(&process_crit_);
62 if (_receiveStatsCallback != nullptr) { 62 if (_receiveStatsCallback != nullptr) {
63 uint32_t bitRate; 63 _receiveStatsCallback->OnReceiveRatesUpdated(0, 0);
philipel 2017/01/11 16:12:34 See ReceiveStatisticsProxy::OnIncomingRate why we
stefan-webrtc 2017/01/12 14:16:15 I don't understand the question? We want to notify
philipel 2017/01/12 16:41:35 Yes, but this since the old jitter buffer wont be
64 uint32_t frameRate;
65 _receiver.ReceiveStatistics(&bitRate, &frameRate);
66 _receiveStatsCallback->OnReceiveRatesUpdated(bitRate, frameRate);
67 }
68
69 if (_decoderTimingCallback != nullptr) {
70 int decode_ms;
71 int max_decode_ms;
72 int current_delay_ms;
73 int target_delay_ms;
74 int jitter_buffer_ms;
75 int min_playout_delay_ms;
76 int render_delay_ms;
77 if (_timing->GetTimings(&decode_ms, &max_decode_ms, &current_delay_ms,
78 &target_delay_ms, &jitter_buffer_ms,
79 &min_playout_delay_ms, &render_delay_ms)) {
80 _decoderTimingCallback->OnDecoderTiming(
81 decode_ms, max_decode_ms, current_delay_ms, target_delay_ms,
82 jitter_buffer_ms, min_playout_delay_ms, render_delay_ms);
83 }
84 } 64 }
85 } 65 }
86 66
87 // Key frame requests 67 // Key frame requests
88 if (_keyRequestTimer.TimeUntilProcess() == 0) { 68 if (_keyRequestTimer.TimeUntilProcess() == 0) {
89 _keyRequestTimer.Processed(); 69 _keyRequestTimer.Processed();
90 bool request_key_frame = false; 70 bool request_key_frame = false;
91 { 71 {
92 rtc::CritScope cs(&process_crit_); 72 rtc::CritScope cs(&process_crit_);
93 request_key_frame = _scheduleKeyRequest && _frameTypeCallback != nullptr; 73 request_key_frame = _scheduleKeyRequest && _frameTypeCallback != nullptr;
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 LOG(LS_INFO) << "Received first " 265 LOG(LS_INFO) << "Received first "
286 << (frame->Complete() ? "complete" : "incomplete") 266 << (frame->Complete() ? "complete" : "incomplete")
287 << " decodable video frame"; 267 << " decodable video frame";
288 } 268 }
289 269
290 const int32_t ret = Decode(*frame); 270 const int32_t ret = Decode(*frame);
291 _receiver.ReleaseFrame(frame); 271 _receiver.ReleaseFrame(frame);
292 return ret; 272 return ret;
293 } 273 }
294 274
295 // Used for the WebRTC-NewVideoJitterBuffer experiment. 275 // Used for the new jitter buffer.
296 // TODO(philipel): Clean up among the Decode functions as we replace 276 // TODO(philipel): Clean up among the Decode functions as we replace
297 // VCMEncodedFrame with FrameObject. 277 // VCMEncodedFrame with FrameObject.
298 int32_t VideoReceiver::Decode(const webrtc::VCMEncodedFrame* frame) { 278 int32_t VideoReceiver::Decode(const webrtc::VCMEncodedFrame* frame) {
299 rtc::CritScope lock(&receive_crit_); 279 rtc::CritScope lock(&receive_crit_);
300 if (pre_decode_image_callback_) { 280 if (pre_decode_image_callback_) {
301 EncodedImage encoded_image(frame->EncodedImage()); 281 EncodedImage encoded_image(frame->EncodedImage());
302 int qp = -1; 282 int qp = -1;
303 if (qp_parser_.GetQp(*frame, &qp)) { 283 if (qp_parser_.GetQp(*frame, &qp)) {
304 encoded_image.qp_ = qp; 284 encoded_image.qp_ = qp;
305 } 285 }
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 _receiver.SetNackSettings(max_nack_list_size, max_packet_age_to_nack, 495 _receiver.SetNackSettings(max_nack_list_size, max_packet_age_to_nack,
516 max_incomplete_time_ms); 496 max_incomplete_time_ms);
517 } 497 }
518 498
519 int VideoReceiver::SetMinReceiverDelay(int desired_delay_ms) { 499 int VideoReceiver::SetMinReceiverDelay(int desired_delay_ms) {
520 return _receiver.SetMinReceiverDelay(desired_delay_ms); 500 return _receiver.SetMinReceiverDelay(desired_delay_ms);
521 } 501 }
522 502
523 } // namespace vcm 503 } // namespace vcm
524 } // namespace webrtc 504 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698