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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 video_sender_.AddVideoFrame(*frame_to_send, &codec_specific_info); | 257 video_sender_.AddVideoFrame(*frame_to_send, &codec_specific_info); |
258 return; | 258 return; |
259 } | 259 } |
260 video_sender_.AddVideoFrame(*frame_to_send, nullptr); | 260 video_sender_.AddVideoFrame(*frame_to_send, nullptr); |
261 } | 261 } |
262 | 262 |
263 void ViEEncoder::SendKeyFrame() { | 263 void ViEEncoder::SendKeyFrame() { |
264 video_sender_.IntraFrameRequest(0); | 264 video_sender_.IntraFrameRequest(0); |
265 } | 265 } |
266 | 266 |
267 void ViEEncoder::SetProtectionMethod(bool nack, bool fec) { | |
268 // Set Video Protection for VCM. | |
269 VCMVideoProtection protection_mode; | |
270 if (fec) { | |
271 protection_mode = | |
272 nack ? webrtc::kProtectionNackFEC : kProtectionFEC; | |
273 } else { | |
274 protection_mode = nack ? kProtectionNack : kProtectionNone; | |
275 } | |
276 video_sender_.SetVideoProtection(protection_mode); | |
277 } | |
278 | |
279 void ViEEncoder::OnSetRates(uint32_t bitrate_bps, int framerate) { | 267 void ViEEncoder::OnSetRates(uint32_t bitrate_bps, int framerate) { |
280 if (stats_proxy_) | 268 if (stats_proxy_) |
281 stats_proxy_->OnSetRates(bitrate_bps, framerate); | 269 stats_proxy_->OnSetRates(bitrate_bps, framerate); |
282 } | 270 } |
283 | 271 |
284 int32_t ViEEncoder::Encoded(const EncodedImage& encoded_image, | 272 int32_t ViEEncoder::Encoded(const EncodedImage& encoded_image, |
285 const CodecSpecificInfo* codec_specific_info, | 273 const CodecSpecificInfo* codec_specific_info, |
286 const RTPFragmentationHeader* fragmentation) { | 274 const RTPFragmentationHeader* fragmentation) { |
287 { | 275 { |
288 rtc::CritScope lock(&data_cs_); | 276 rtc::CritScope lock(&data_cs_); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 if (!video_suspension_changed) | 332 if (!video_suspension_changed) |
345 return; | 333 return; |
346 // Video suspend-state changed, inform codec observer. | 334 // Video suspend-state changed, inform codec observer. |
347 LOG(LS_INFO) << "Video suspend state changed " << video_is_suspended; | 335 LOG(LS_INFO) << "Video suspend state changed " << video_is_suspended; |
348 | 336 |
349 if (stats_proxy_) | 337 if (stats_proxy_) |
350 stats_proxy_->OnSuspendChange(video_is_suspended); | 338 stats_proxy_->OnSuspendChange(video_is_suspended); |
351 } | 339 } |
352 | 340 |
353 } // namespace webrtc | 341 } // namespace webrtc |
OLD | NEW |