OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 static const int kMaxNackListSize = 250; | 47 static const int kMaxNackListSize = 250; |
48 video_receiver_->SetNackSettings(kMaxNackListSize, | 48 video_receiver_->SetNackSettings(kMaxNackListSize, |
49 kMaxPacketAgeToNack, 0); | 49 kMaxPacketAgeToNack, 0); |
50 video_receiver_->RegisterReceiveCallback(this); | 50 video_receiver_->RegisterReceiveCallback(this); |
51 video_receiver_->RegisterFrameTypeCallback(vcm_frame_type_callback); | 51 video_receiver_->RegisterFrameTypeCallback(vcm_frame_type_callback); |
52 video_receiver_->RegisterReceiveStatisticsCallback(this); | 52 video_receiver_->RegisterReceiveStatisticsCallback(this); |
53 video_receiver_->RegisterDecoderTimingCallback(this); | 53 video_receiver_->RegisterDecoderTimingCallback(this); |
54 static const int kDefaultRenderDelayMs = 10; | 54 static const int kDefaultRenderDelayMs = 10; |
55 video_receiver_->SetRenderDelay(kDefaultRenderDelayMs); | 55 video_receiver_->SetRenderDelay(kDefaultRenderDelayMs); |
56 | 56 |
57 VCMVideoProtection video_protection = enable_nack ? kProtectionNack | 57 VCMVideoProtection video_protection = kProtectionNone; |
58 : kProtectionNone; | 58 if (enable_nack) { |
59 if (enable_fec) | |
60 video_protection = kProtectionNackFEC; | |
61 else | |
stefan-webrtc
2016/05/06 14:11:46
Remove else and move line 62 to line 59
philipel
2016/05/06 15:12:11
Hmm.. I think the way it is now is a clearer and e
| |
62 video_protection = kProtectionNack; | |
63 } | |
64 | |
59 VCMDecodeErrorMode decode_error_mode = enable_nack ? kNoErrors : kWithErrors; | 65 VCMDecodeErrorMode decode_error_mode = enable_nack ? kNoErrors : kWithErrors; |
60 video_receiver_->SetVideoProtection(video_protection, true); | 66 video_receiver_->SetVideoProtection(video_protection, true); |
61 video_receiver_->SetDecodeErrorMode(decode_error_mode); | 67 video_receiver_->SetDecodeErrorMode(decode_error_mode); |
62 VCMPacketRequestCallback* packet_request_callback = | 68 VCMPacketRequestCallback* packet_request_callback = |
63 enable_nack ? vcm_packet_request_callback : nullptr; | 69 enable_nack ? vcm_packet_request_callback : nullptr; |
64 video_receiver_->RegisterPacketRequestCallback(packet_request_callback); | 70 video_receiver_->RegisterPacketRequestCallback(packet_request_callback); |
65 } | 71 } |
66 | 72 |
67 VideoStreamDecoder::~VideoStreamDecoder() {} | 73 VideoStreamDecoder::~VideoStreamDecoder() {} |
68 | 74 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
124 jitter_buffer_ms, min_playout_delay_ms, render_delay_ms, last_rtt); | 130 jitter_buffer_ms, min_playout_delay_ms, render_delay_ms, last_rtt); |
125 } | 131 } |
126 | 132 |
127 void VideoStreamDecoder::OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) { | 133 void VideoStreamDecoder::OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) { |
128 video_receiver_->SetReceiveChannelParameters(max_rtt_ms); | 134 video_receiver_->SetReceiveChannelParameters(max_rtt_ms); |
129 | 135 |
130 rtc::CritScope lock(&crit_); | 136 rtc::CritScope lock(&crit_); |
131 last_rtt_ms_ = avg_rtt_ms; | 137 last_rtt_ms_ = avg_rtt_ms; |
132 } | 138 } |
133 } // namespace webrtc | 139 } // namespace webrtc |
OLD | NEW |