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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_sender.cc

Issue 2066473002: RtpRtcp: Remove the SetSendREDPayloadType and SendREDPayloadType methods (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@remove-red3
Patch Set: rebase Created 4 years, 4 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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 } 385 }
386 386
387 int32_t RTPSender::CheckPayloadType(int8_t payload_type, 387 int32_t RTPSender::CheckPayloadType(int8_t payload_type,
388 RtpVideoCodecTypes* video_type) { 388 RtpVideoCodecTypes* video_type) {
389 rtc::CritScope lock(&send_critsect_); 389 rtc::CritScope lock(&send_critsect_);
390 390
391 if (payload_type < 0) { 391 if (payload_type < 0) {
392 LOG(LS_ERROR) << "Invalid payload_type " << payload_type; 392 LOG(LS_ERROR) << "Invalid payload_type " << payload_type;
393 return -1; 393 return -1;
394 } 394 }
395 if (audio_configured_) {
396 int8_t red_pl_type = -1;
397 if (audio_->RED(&red_pl_type) == 0) {
398 // We have configured RED.
399 if (red_pl_type == payload_type) {
400 // And it's a match...
401 return 0;
402 }
403 }
404 }
405 if (payload_type_ == payload_type) { 395 if (payload_type_ == payload_type) {
406 if (!audio_configured_) { 396 if (!audio_configured_) {
407 *video_type = video_->VideoCodecType(); 397 *video_type = video_->VideoCodecType();
408 } 398 }
409 return 0; 399 return 0;
410 } 400 }
411 std::map<int8_t, RtpUtility::Payload*>::iterator it = 401 std::map<int8_t, RtpUtility::Payload*>::iterator it =
412 payload_type_map_.find(payload_type); 402 payload_type_map_.find(payload_type);
413 if (it == payload_type_map_.end()) { 403 if (it == payload_type_map_.end()) {
414 LOG(LS_WARNING) << "Payload type " << static_cast<int>(payload_type) 404 LOG(LS_WARNING) << "Payload type " << static_cast<int>(payload_type)
(...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1617 if (!audio_configured_) { 1607 if (!audio_configured_) {
1618 return -1; 1608 return -1;
1619 } 1609 }
1620 return audio_->SetAudioPacketSize(packet_size_samples); 1610 return audio_->SetAudioPacketSize(packet_size_samples);
1621 } 1611 }
1622 1612
1623 int32_t RTPSender::SetAudioLevel(uint8_t level_d_bov) { 1613 int32_t RTPSender::SetAudioLevel(uint8_t level_d_bov) {
1624 return audio_->SetAudioLevel(level_d_bov); 1614 return audio_->SetAudioLevel(level_d_bov);
1625 } 1615 }
1626 1616
1627 int32_t RTPSender::SetRED(int8_t payload_type) {
1628 if (!audio_configured_) {
1629 return -1;
1630 }
1631 return audio_->SetRED(payload_type);
1632 }
1633
1634 int32_t RTPSender::RED(int8_t *payload_type) const {
1635 if (!audio_configured_) {
1636 return -1;
1637 }
1638 return audio_->RED(payload_type);
1639 }
1640
1641 RtpVideoCodecTypes RTPSender::VideoCodecType() const { 1617 RtpVideoCodecTypes RTPSender::VideoCodecType() const {
1642 assert(!audio_configured_ && "Sender is an audio stream!"); 1618 assert(!audio_configured_ && "Sender is an audio stream!");
1643 return video_->VideoCodecType(); 1619 return video_->VideoCodecType();
1644 } 1620 }
1645 1621
1646 void RTPSender::SetGenericFECStatus(bool enable, 1622 void RTPSender::SetGenericFECStatus(bool enable,
1647 uint8_t payload_type_red, 1623 uint8_t payload_type_red,
1648 uint8_t payload_type_fec) { 1624 uint8_t payload_type_fec) {
1649 RTC_DCHECK(!audio_configured_); 1625 RTC_DCHECK(!audio_configured_);
1650 video_->SetGenericFECStatus(enable, payload_type_red, payload_type_fec); 1626 video_->SetGenericFECStatus(enable, payload_type_red, payload_type_fec);
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1758 rtc::CritScope lock(&send_critsect_); 1734 rtc::CritScope lock(&send_critsect_);
1759 1735
1760 RtpState state; 1736 RtpState state;
1761 state.sequence_number = sequence_number_rtx_; 1737 state.sequence_number = sequence_number_rtx_;
1762 state.start_timestamp = start_timestamp_; 1738 state.start_timestamp = start_timestamp_;
1763 1739
1764 return state; 1740 return state;
1765 } 1741 }
1766 1742
1767 } // namespace webrtc 1743 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender.h ('k') | webrtc/modules/rtp_rtcp/source/rtp_sender_audio.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698