Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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); |
|
stefan-webrtc
2017/01/13 09:10:58
Please add a todo to clean this up. Maybe the Qual
| |
| 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, ¤t_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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |