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

Side by Side Diff: webrtc/modules/video_coding/main/source/video_sender.cc

Issue 1226143013: Merge methods for configuring NACK/FEC/hybrid. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years, 5 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 // Note: this callback is assumed to only be registered once and before it is 289 // Note: this callback is assumed to only be registered once and before it is
290 // used in this class. 290 // used in this class.
291 int32_t VideoSender::RegisterProtectionCallback( 291 int32_t VideoSender::RegisterProtectionCallback(
292 VCMProtectionCallback* protection_callback) { 292 VCMProtectionCallback* protection_callback) {
293 DCHECK(protection_callback == nullptr || protection_callback_ == nullptr); 293 DCHECK(protection_callback == nullptr || protection_callback_ == nullptr);
294 protection_callback_ = protection_callback; 294 protection_callback_ = protection_callback;
295 return VCM_OK; 295 return VCM_OK;
296 } 296 }
297 297
298 // Enable or disable a video protection method. 298 // Enable or disable a video protection method.
299 void VideoSender::SetVideoProtection(bool enable, 299 void VideoSender::SetVideoProtection(VCMVideoProtection videoProtection) {
300 VCMVideoProtection videoProtection) {
301 CriticalSectionScoped cs(_sendCritSect); 300 CriticalSectionScoped cs(_sendCritSect);
302 switch (videoProtection) { 301 switch (videoProtection) {
303 case kProtectionNone: 302 case kProtectionNone:
304 _mediaOpt.EnableProtectionMethod(enable, media_optimization::kNone); 303 _mediaOpt.SetProtectionMethod(media_optimization::kNone);
305 break; 304 break;
306 case kProtectionNack: 305 case kProtectionNack:
307 case kProtectionNackSender: 306 _mediaOpt.SetProtectionMethod(media_optimization::kNack);
308 _mediaOpt.EnableProtectionMethod(enable, media_optimization::kNack);
309 break; 307 break;
310 case kProtectionNackFEC: 308 case kProtectionNackFEC:
311 _mediaOpt.EnableProtectionMethod(enable, media_optimization::kNackFec); 309 _mediaOpt.SetProtectionMethod(media_optimization::kNackFec);
312 break; 310 break;
313 case kProtectionFEC: 311 case kProtectionFEC:
314 _mediaOpt.EnableProtectionMethod(enable, media_optimization::kFec); 312 _mediaOpt.SetProtectionMethod(media_optimization::kFec);
315 break; 313 break;
316 case kProtectionNackReceiver:
317 case kProtectionKeyOnLoss: 314 case kProtectionKeyOnLoss:
318 case kProtectionKeyOnKeyLoss: 315 case kProtectionKeyOnKeyLoss:
319 // Ignore receiver modes. 316 // Ignore receiver modes.
320 return; 317 return;
321 } 318 }
322 } 319 }
323 // Add one raw video frame to the encoder, blocking. 320 // Add one raw video frame to the encoder, blocking.
324 int32_t VideoSender::AddVideoFrame(const VideoFrame& videoFrame, 321 int32_t VideoSender::AddVideoFrame(const VideoFrame& videoFrame,
325 const VideoContentMetrics* contentMetrics, 322 const VideoContentMetrics* contentMetrics,
326 const CodecSpecificInfo* codecSpecificInfo) { 323 const CodecSpecificInfo* codecSpecificInfo) {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 int window_bps = std::max(threshold_bps / 10, 10000); 402 int window_bps = std::max(threshold_bps / 10, 10000);
406 _mediaOpt.SuspendBelowMinBitrate(threshold_bps, window_bps); 403 _mediaOpt.SuspendBelowMinBitrate(threshold_bps, window_bps);
407 } 404 }
408 405
409 bool VideoSender::VideoSuspended() const { 406 bool VideoSender::VideoSuspended() const {
410 CriticalSectionScoped cs(_sendCritSect); 407 CriticalSectionScoped cs(_sendCritSect);
411 return _mediaOpt.IsVideoSuspended(); 408 return _mediaOpt.IsVideoSuspended();
412 } 409 }
413 } // namespace vcm 410 } // namespace vcm
414 } // namespace webrtc 411 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/main/source/video_receiver.cc ('k') | webrtc/video/video_receive_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698