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

Side by Side Diff: webrtc/video/video_send_stream.cc

Issue 2455963003: Simplify SetFecParameters signature. (Closed)
Patch Set: Return type int32_t replaced by bool and void. Created 4 years, 1 month 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 #include "webrtc/video/video_send_stream.h" 10 #include "webrtc/video/video_send_stream.h"
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 private: 277 private:
278 class CheckEncoderActivityTask; 278 class CheckEncoderActivityTask;
279 class EncoderReconfiguredTask; 279 class EncoderReconfiguredTask;
280 280
281 // Implements BitrateAllocatorObserver. 281 // Implements BitrateAllocatorObserver.
282 uint32_t OnBitrateUpdated(uint32_t bitrate_bps, 282 uint32_t OnBitrateUpdated(uint32_t bitrate_bps,
283 uint8_t fraction_loss, 283 uint8_t fraction_loss,
284 int64_t rtt) override; 284 int64_t rtt) override;
285 285
286 // Implements webrtc::VCMProtectionCallback. 286 // Implements webrtc::VCMProtectionCallback.
287 int ProtectionRequest(const FecProtectionParams* delta_params, 287 void ProtectionRequest(const FecProtectionParams& delta_params,
288 const FecProtectionParams* key_params, 288 const FecProtectionParams& key_params,
289 uint32_t* sent_video_rate_bps, 289 uint32_t* sent_video_rate_bps,
290 uint32_t* sent_nack_rate_bps, 290 uint32_t* sent_nack_rate_bps,
291 uint32_t* sent_fec_rate_bps) override; 291 uint32_t* sent_fec_rate_bps) override;
292 292
293 void OnEncoderConfigurationChanged(std::vector<VideoStream> streams, 293 void OnEncoderConfigurationChanged(std::vector<VideoStream> streams,
294 int min_transmit_bitrate_bps) override; 294 int min_transmit_bitrate_bps) override;
295 295
296 // Implements EncodedImageCallback. The implementation routes encoded frames 296 // Implements EncodedImageCallback. The implementation routes encoded frames
297 // to the |payload_router_| and |config.pre_encode_callback| if set. 297 // to the |payload_router_| and |config.pre_encode_callback| if set.
298 // Called on an arbitrary encoder callback thread. 298 // Called on an arbitrary encoder callback thread.
299 EncodedImageCallback::Result OnEncodedImage( 299 EncodedImageCallback::Result OnEncodedImage(
300 const EncodedImage& encoded_image, 300 const EncodedImage& encoded_image,
301 const CodecSpecificInfo* codec_specific_info, 301 const CodecSpecificInfo* codec_specific_info,
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
1073 } 1073 }
1074 } 1074 }
1075 1075
1076 if (!files.empty()) { 1076 if (!files.empty()) {
1077 // Make a keyframe appear as early as possible in the logs, to give actually 1077 // Make a keyframe appear as early as possible in the logs, to give actually
1078 // decodable output. 1078 // decodable output.
1079 vie_encoder_->SendKeyFrame(); 1079 vie_encoder_->SendKeyFrame();
1080 } 1080 }
1081 } 1081 }
1082 1082
1083 int VideoSendStreamImpl::ProtectionRequest( 1083 void VideoSendStreamImpl::ProtectionRequest(
1084 const FecProtectionParams* delta_params, 1084 const FecProtectionParams& delta_params,
1085 const FecProtectionParams* key_params, 1085 const FecProtectionParams& key_params,
1086 uint32_t* sent_video_rate_bps, 1086 uint32_t* sent_video_rate_bps,
1087 uint32_t* sent_nack_rate_bps, 1087 uint32_t* sent_nack_rate_bps,
1088 uint32_t* sent_fec_rate_bps) { 1088 uint32_t* sent_fec_rate_bps) {
1089 RTC_DCHECK_RUN_ON(worker_queue_); 1089 RTC_DCHECK_RUN_ON(worker_queue_);
1090 *sent_video_rate_bps = 0; 1090 *sent_video_rate_bps = 0;
1091 *sent_nack_rate_bps = 0; 1091 *sent_nack_rate_bps = 0;
1092 *sent_fec_rate_bps = 0; 1092 *sent_fec_rate_bps = 0;
1093 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { 1093 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
1094 uint32_t not_used = 0; 1094 uint32_t not_used = 0;
1095 uint32_t module_video_rate = 0; 1095 uint32_t module_video_rate = 0;
1096 uint32_t module_fec_rate = 0; 1096 uint32_t module_fec_rate = 0;
1097 uint32_t module_nack_rate = 0; 1097 uint32_t module_nack_rate = 0;
1098 rtp_rtcp->SetFecParameters(delta_params, key_params); 1098 rtp_rtcp->SetFecParameters(delta_params, key_params);
1099 rtp_rtcp->BitrateSent(&not_used, &module_video_rate, &module_fec_rate, 1099 rtp_rtcp->BitrateSent(&not_used, &module_video_rate, &module_fec_rate,
1100 &module_nack_rate); 1100 &module_nack_rate);
1101 *sent_video_rate_bps += module_video_rate; 1101 *sent_video_rate_bps += module_video_rate;
1102 *sent_nack_rate_bps += module_nack_rate; 1102 *sent_nack_rate_bps += module_nack_rate;
1103 *sent_fec_rate_bps += module_fec_rate; 1103 *sent_fec_rate_bps += module_fec_rate;
1104 } 1104 }
1105 return 0;
1106 } 1105 }
1107 1106
1108 } // namespace internal 1107 } // namespace internal
1109 } // namespace webrtc 1108 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698