Index: webrtc/voice_engine/voe_codec_impl.cc |
diff --git a/webrtc/voice_engine/voe_codec_impl.cc b/webrtc/voice_engine/voe_codec_impl.cc |
index 8ac24da4e7974ec893987b531d048799f3299937..d6a108fa45e9dbab363a9dcf88262d6db4c71aaf 100644 |
--- a/webrtc/voice_engine/voe_codec_impl.cc |
+++ b/webrtc/voice_engine/voe_codec_impl.cc |
@@ -8,6 +8,8 @@ |
* be found in the AUTHORS file in the root of the source tree. |
*/ |
+#include <sstream> |
+ |
#include "webrtc/voice_engine/voe_codec_impl.h" |
#include "webrtc/base/format_macros.h" |
@@ -179,6 +181,33 @@ int VoECodecImpl::SetRecPayloadType(int channel, const CodecInst& codec) { |
return channelPtr->SetRecPayloadType(codec); |
} |
+int VoECodecImpl::SetRecPayloadType(int channel, |
+ int payload_type, |
+ const SdpAudioFormat& format) { |
+ WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1), |
+ "SetRecPayloadType(channel=%d, payload_type=%d, format)", |
+ channel, payload_type); |
+ auto sdp_fmt = [](const SdpAudioFormat& format) { |
+ std::ostringstream o; |
+ o << format; |
+ return o.str(); |
+ }; |
+ WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_shared->instance_id(), -1), |
+ "format: %s", sdp_fmt(format).c_str()); |
+ if (!_shared->statistics().Initialized()) { |
+ _shared->SetLastError(VE_NOT_INITED, kTraceError); |
+ return -1; |
+ } |
+ voe::Channel* const channel_ptr = |
+ _shared->channel_manager().GetChannel(channel).channel(); |
+ if (!channel_ptr) { |
+ _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, |
+ "GetRecPayloadType() failed to locate channel"); |
+ return -1; |
+ } |
+ return channel_ptr->SetRecPayloadType(payload_type, format); |
+} |
+ |
int VoECodecImpl::GetRecPayloadType(int channel, CodecInst& codec) { |
if (!_shared->statistics().Initialized()) { |
_shared->SetLastError(VE_NOT_INITED, kTraceError); |