| Index: webrtc/media/engine/fakewebrtcvoiceengine.h
|
| diff --git a/webrtc/media/engine/fakewebrtcvoiceengine.h b/webrtc/media/engine/fakewebrtcvoiceengine.h
|
| index cd6c42064a1bd9a2da8750d0c73b8eb4df4d6029..dbb6836683598bc7d66db894eccb409a8ac253cd 100644
|
| --- a/webrtc/media/engine/fakewebrtcvoiceengine.h
|
| +++ b/webrtc/media/engine/fakewebrtcvoiceengine.h
|
| @@ -23,6 +23,7 @@
|
| #include "webrtc/media/base/rtputils.h"
|
| #include "webrtc/media/engine/webrtcvoe.h"
|
| #include "webrtc/modules/audio_coding/acm2/rent_a_codec.h"
|
| +#include "webrtc/modules/audio_coding/codecs/audio_format_conversion.h"
|
| #include "webrtc/modules/audio_processing/include/audio_processing.h"
|
|
|
| namespace cricket {
|
| @@ -144,26 +145,29 @@ class FakeWebRtcVoiceEngine
|
| WEBRTC_STUB(GetRecCodec, (int channel, webrtc::CodecInst& codec));
|
| WEBRTC_FUNC(SetRecPayloadType, (int channel,
|
| const webrtc::CodecInst& codec)) {
|
| + return SetRecPayloadType(channel, codec.pltype, CodecInstToSdp(codec));
|
| + }
|
| + WEBRTC_FUNC(SetRecPayloadType,
|
| + (int channel,
|
| + int payload_type,
|
| + const webrtc::SdpAudioFormat& format)) {
|
| WEBRTC_CHECK_CHANNEL(channel);
|
| Channel* ch = channels_[channel];
|
| // Check if something else already has this slot.
|
| - if (codec.pltype != -1) {
|
| + if (payload_type != -1) {
|
| for (std::vector<webrtc::CodecInst>::iterator it =
|
| ch->recv_codecs.begin(); it != ch->recv_codecs.end(); ++it) {
|
| - if (it->pltype == codec.pltype &&
|
| - _stricmp(it->plname, codec.plname) != 0) {
|
| + if (it->pltype == payload_type &&
|
| + _stricmp(it->plname, format.name.c_str()) != 0) {
|
| return -1;
|
| }
|
| }
|
| }
|
| // Otherwise try to find this codec and update its payload type.
|
| int result = -1; // not found
|
| - for (std::vector<webrtc::CodecInst>::iterator it = ch->recv_codecs.begin();
|
| - it != ch->recv_codecs.end(); ++it) {
|
| - if (strcmp(it->plname, codec.plname) == 0 &&
|
| - it->plfreq == codec.plfreq &&
|
| - it->channels == codec.channels) {
|
| - it->pltype = codec.pltype;
|
| + for (auto& codec : ch->recv_codecs) {
|
| + if (CodecInstToSdp(codec) == format) {
|
| + codec.pltype = payload_type;
|
| result = 0;
|
| }
|
| }
|
|
|