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

Unified Diff: webrtc/voice_engine/channel.cc

Issue 2523843002: Send audio and video codecs to RTPPayloadRegistry (Closed)
Patch Set: Change strcpy to strncpy 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/video/rtp_stream_receiver.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/voice_engine/channel.cc
diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc
index c1410fa8b83ae27c1752dac6420fef285df8e13a..bdf6fb538798ed8bc1851ab845389aa15b7fcb37 100644
--- a/webrtc/voice_engine/channel.cc
+++ b/webrtc/voice_engine/channel.cc
@@ -1035,9 +1035,7 @@ int32_t Channel::Init() {
for (int idx = 0; idx < nSupportedCodecs; idx++) {
// Open up the RTP/RTCP receiver for all supported codecs
if ((audio_coding_->Codec(idx, &codec) == -1) ||
- (rtp_receiver_->RegisterReceivePayload(
- codec.plname, codec.pltype, codec.plfreq, codec.channels,
- (codec.rate < 0) ? 0 : codec.rate) == -1)) {
+ (rtp_receiver_->RegisterReceivePayload(codec) == -1)) {
WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, _channelId),
"Channel::Init() unable to register %s "
"(%d/%d/%" PRIuS "/%d) to RTP/RTCP receiver",
@@ -1362,9 +1360,7 @@ int32_t Channel::SetRecPayloadType(const CodecInst& codec) {
CodecInst rxCodec = codec;
// Get payload type for the given codec
- rtp_payload_registry_->ReceivePayloadType(
- rxCodec.plname, rxCodec.plfreq, rxCodec.channels,
- (rxCodec.rate < 0) ? 0 : rxCodec.rate, &pltype);
+ rtp_payload_registry_->ReceivePayloadType(rxCodec, &pltype);
rxCodec.pltype = pltype;
if (rtp_receiver_->DeRegisterReceivePayload(pltype) != 0) {
@@ -1383,16 +1379,12 @@ int32_t Channel::SetRecPayloadType(const CodecInst& codec) {
return 0;
}
- if (rtp_receiver_->RegisterReceivePayload(
- codec.plname, codec.pltype, codec.plfreq, codec.channels,
- (codec.rate < 0) ? 0 : codec.rate) != 0) {
+ if (rtp_receiver_->RegisterReceivePayload(codec) != 0) {
// First attempt to register failed => de-register and try again
// TODO(kwiberg): Retrying is probably not necessary, since
// AcmReceiver::AddCodec also retries.
rtp_receiver_->DeRegisterReceivePayload(codec.pltype);
- if (rtp_receiver_->RegisterReceivePayload(
- codec.plname, codec.pltype, codec.plfreq, codec.channels,
- (codec.rate < 0) ? 0 : codec.rate) != 0) {
+ if (rtp_receiver_->RegisterReceivePayload(codec) != 0) {
_engineStatisticsPtr->SetLastError(
VE_RTP_RTCP_MODULE_ERROR, kTraceError,
"SetRecPayloadType() RTP/RTCP-module registration failed");
@@ -1415,9 +1407,7 @@ int32_t Channel::SetRecPayloadType(const CodecInst& codec) {
int32_t Channel::GetRecPayloadType(CodecInst& codec) {
int8_t payloadType(-1);
- if (rtp_payload_registry_->ReceivePayloadType(
- codec.plname, codec.plfreq, codec.channels,
- (codec.rate < 0) ? 0 : codec.rate, &payloadType) != 0) {
+ if (rtp_payload_registry_->ReceivePayloadType(codec, &payloadType) != 0) {
_engineStatisticsPtr->SetLastError(
VE_RTP_RTCP_MODULE_ERROR, kTraceWarning,
"GetRecPayloadType() failed to retrieve RX payload type");
@@ -3152,9 +3142,7 @@ void Channel::RegisterReceiveCodecsToRTPModule() {
for (int idx = 0; idx < nSupportedCodecs; idx++) {
// Open up the RTP/RTCP receiver for all supported codecs
if ((audio_coding_->Codec(idx, &codec) == -1) ||
- (rtp_receiver_->RegisterReceivePayload(
- codec.plname, codec.pltype, codec.plfreq, codec.channels,
- (codec.rate < 0) ? 0 : codec.rate) == -1)) {
+ (rtp_receiver_->RegisterReceivePayload(codec) == -1)) {
WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, _channelId),
"Channel::RegisterReceiveCodecsToRTPModule() unable"
" to register %s (%d/%d/%" PRIuS
« no previous file with comments | « webrtc/video/rtp_stream_receiver.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698