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

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

Issue 1972083002: Move logic for calculating needed bitrate overhead used by NACK and FEC to VideoSender. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Removed video_sender_unittest for now. Created 4 years, 7 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) 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
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
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
OLDNEW
« webrtc/video/video_send_stream.cc ('K') | « webrtc/video/vie_encoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698