WebRtcVoiceMediaChannel::AddRecvStream: Don't call SetRecPayloadType
This removes one more place where we were unable to handle codecs not in the built-in set. BUG=webrtc:5805 Review-Url: https://codereview.webrtc.org/2686043006 Cr-Commit-Position: refs/heads/master@{#17370}
This commit is contained in:
@ -16,6 +16,7 @@
|
||||
#include "webrtc/base/logging.h"
|
||||
#include "webrtc/base/stringutils.h"
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/modules/audio_coding/codecs/audio_format_conversion.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/byte_io.h"
|
||||
|
||||
namespace webrtc {
|
||||
@ -119,6 +120,31 @@ RTPPayloadRegistry::RTPPayloadRegistry()
|
||||
|
||||
RTPPayloadRegistry::~RTPPayloadRegistry() = default;
|
||||
|
||||
void RTPPayloadRegistry::SetAudioReceivePayloads(
|
||||
std::map<int, SdpAudioFormat> codecs) {
|
||||
rtc::CritScope cs(&crit_sect_);
|
||||
|
||||
#if RTC_DCHECK_IS_ON
|
||||
RTC_DCHECK(!used_for_video_);
|
||||
used_for_audio_ = true;
|
||||
#endif
|
||||
|
||||
payload_type_map_.clear();
|
||||
for (const auto& kv : codecs) {
|
||||
const int& rtp_payload_type = kv.first;
|
||||
const SdpAudioFormat& audio_format = kv.second;
|
||||
const CodecInst ci = SdpToCodecInst(rtp_payload_type, audio_format);
|
||||
RTC_DCHECK(IsPayloadTypeValid(rtp_payload_type));
|
||||
payload_type_map_.insert(
|
||||
std::make_pair(rtp_payload_type, CreatePayloadType(ci)));
|
||||
}
|
||||
|
||||
// Clear the value of last received payload type since it might mean
|
||||
// something else now.
|
||||
last_received_payload_type_ = -1;
|
||||
last_received_media_payload_type_ = -1;
|
||||
}
|
||||
|
||||
int32_t RTPPayloadRegistry::RegisterReceivePayload(const CodecInst& audio_codec,
|
||||
bool* created_new_payload) {
|
||||
rtc::CritScope cs(&crit_sect_);
|
||||
|
||||
Reference in New Issue
Block a user