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

Unified Diff: webrtc/voice_engine/voe_codec_impl.cc

Issue 2516993002: Pass SdpAudioFormat through Channel, without converting to CodecInst (Closed)
Patch Set: 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
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);
« webrtc/voice_engine/include/voe_codec.h ('K') | « webrtc/voice_engine/voe_codec_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698