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

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

Issue 1740133002: Simplify registration of RTP-header extensions. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: header Created 4 years, 9 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
« no previous file with comments | « webrtc/video/vie_channel.h ('k') | webrtc/video/vie_receiver.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 } 370 }
371 } 371 }
372 372
373 int ViEChannel::GetRequiredNackListSize(int target_delay_ms) { 373 int ViEChannel::GetRequiredNackListSize(int target_delay_ms) {
374 // The max size of the nack list should be large enough to accommodate the 374 // The max size of the nack list should be large enough to accommodate the
375 // the number of packets (frames) resulting from the increased delay. 375 // the number of packets (frames) resulting from the increased delay.
376 // Roughly estimating for ~40 packets per frame @ 30fps. 376 // Roughly estimating for ~40 packets per frame @ 30fps.
377 return target_delay_ms * 40 * 30 / 1000; 377 return target_delay_ms * 40 * 30 / 1000;
378 } 378 }
379 379
380 int ViEChannel::EnableSendTimestampOffset(int id) {
381 // Enable the extension.
382 int error = 0;
383 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
384 error |= rtp_rtcp->RegisterSendRtpHeaderExtension(
385 kRtpExtensionTransmissionTimeOffset, id);
386 }
387 return error;
388 }
389
390 int ViEChannel::EnableSendAbsoluteSendTime(int id) {
391 // Enable the extension.
392 int error = 0;
393 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
394 error |= rtp_rtcp->RegisterSendRtpHeaderExtension(
395 kRtpExtensionAbsoluteSendTime, id);
396 }
397 return error;
398 }
399
400 int ViEChannel::EnableSendVideoRotation(int id) {
401 // Enable the extension.
402 int error = 0;
403 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
404 error |= rtp_rtcp->RegisterSendRtpHeaderExtension(
405 kRtpExtensionVideoRotation, id);
406 }
407 return error;
408 }
409
410 int ViEChannel::EnableSendTransportSequenceNumber(int id) {
411 RTC_DCHECK(sender_);
412 // Enable the extension.
413 int error = 0;
414 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
415 error |= rtp_rtcp->RegisterSendRtpHeaderExtension(
416 kRtpExtensionTransportSequenceNumber, id);
417 }
418 return error;
419 }
420
421 RtpState ViEChannel::GetRtpStateForSsrc(uint32_t ssrc) const { 380 RtpState ViEChannel::GetRtpStateForSsrc(uint32_t ssrc) const {
422 RTC_DCHECK(!rtp_rtcp_modules_[0]->Sending()); 381 RTC_DCHECK(!rtp_rtcp_modules_[0]->Sending());
423 RtpState rtp_state; 382 RtpState rtp_state;
424 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { 383 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
425 if (rtp_rtcp->GetRtpStateForSsrc(ssrc, &rtp_state)) 384 if (rtp_rtcp->GetRtpStateForSsrc(ssrc, &rtp_state))
426 return rtp_state; 385 return rtp_state;
427 } 386 }
428 LOG(LS_ERROR) << "Couldn't get RTP state for ssrc: " << ssrc; 387 LOG(LS_ERROR) << "Couldn't get RTP state for ssrc: " << ssrc;
429 return rtp_state; 388 return rtp_state;
430 } 389 }
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 rtc::CritScope lock(&crit_); 664 rtc::CritScope lock(&crit_);
706 receive_stats_callback_ = receive_statistics_proxy; 665 receive_stats_callback_ = receive_statistics_proxy;
707 } 666 }
708 667
709 void ViEChannel::SetIncomingVideoStream( 668 void ViEChannel::SetIncomingVideoStream(
710 IncomingVideoStream* incoming_video_stream) { 669 IncomingVideoStream* incoming_video_stream) {
711 rtc::CritScope lock(&crit_); 670 rtc::CritScope lock(&crit_);
712 incoming_video_stream_ = incoming_video_stream; 671 incoming_video_stream_ = incoming_video_stream;
713 } 672 }
714 } // namespace webrtc 673 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/vie_channel.h ('k') | webrtc/video/vie_receiver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698