Revert of WebRtcVoiceMediaChannel::AddRecvStream: Don't call SetRecPayloadType (patchset #13 id:260001 of https://codereview.webrtc.org/2686043006/ )

Reason for revert:
Makes perf and Chromium FYI bots unhappy.

Original issue's description:
> 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}
> Committed: 1724cfbdba

TBR=ossu@webrtc.org,solenberg@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5805

Review-Url: https://codereview.webrtc.org/2772043002
Cr-Commit-Position: refs/heads/master@{#17374}
This commit is contained in:
kwiberg
2017-03-24 05:56:21 -07:00
committed by Commit bot
parent 6d7900de66
commit 670a7f3611
28 changed files with 150 additions and 221 deletions

View File

@ -168,7 +168,6 @@ rtc_static_library("rtp_rtcp") {
deps = [
"../..:webrtc_common",
"../../api:transport_api",
"../../api/audio_codecs:audio_codecs_api",
"../../base:gtest_prod",
"../../base:rtc_base_approved",
"../../base:rtc_task_queue",
@ -176,7 +175,6 @@ rtc_static_library("rtp_rtcp") {
"../../common_video",
"../../logging:rtc_event_log_api",
"../../system_wrappers",
"../audio_coding:audio_format_conversion",
"../remote_bitrate_estimator",
]

View File

@ -15,7 +15,6 @@
#include <memory>
#include <set>
#include "webrtc/api/audio_codecs/audio_format.h"
#include "webrtc/base/criticalsection.h"
#include "webrtc/base/deprecation.h"
#include "webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.h"
@ -44,10 +43,6 @@ class RTPPayloadRegistry {
// TODO(magjed): Split RTPPayloadRegistry into separate Audio and Video class
// and simplify the code. http://crbug/webrtc/6743.
// Replace all audio receive payload types with the given map.
void SetAudioReceivePayloads(std::map<int, SdpAudioFormat> codecs);
int32_t RegisterReceivePayload(const CodecInst& audio_codec,
bool* created_new_payload_type);
int32_t RegisterReceivePayload(const VideoCodec& video_codec);

View File

@ -16,7 +16,6 @@
#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 {
@ -120,31 +119,6 @@ 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_);