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