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

Unified Diff: webrtc/modules/audio_coding/neteq/decoder_database.cc

Issue 2472083002: NetEq: Don't forget to save the codec name (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/modules/audio_coding/neteq/decoder_database.cc
diff --git a/webrtc/modules/audio_coding/neteq/decoder_database.cc b/webrtc/modules/audio_coding/neteq/decoder_database.cc
index 483c9b96ba28d02272ff7ab416eeb2635ee9545e..fa120d235386f1007744a0d22ff617cc8186feec 100644
--- a/webrtc/modules/audio_coding/neteq/decoder_database.cc
+++ b/webrtc/modules/audio_coding/neteq/decoder_database.cc
@@ -27,24 +27,29 @@ DecoderDatabase::DecoderDatabase(
DecoderDatabase::~DecoderDatabase() = default;
DecoderDatabase::DecoderInfo::DecoderInfo(const SdpAudioFormat& audio_format,
- AudioDecoderFactory* factory)
- : audio_format_(audio_format),
+ AudioDecoderFactory* factory,
+ const std::string& codec_name)
+ : name_(codec_name),
+ audio_format_(audio_format),
factory_(factory),
external_decoder_(nullptr),
cng_decoder_(CngDecoder::Create(audio_format)),
subtype_(SubtypeFromFormat(audio_format)) {}
+DecoderDatabase::DecoderInfo::DecoderInfo(const SdpAudioFormat& audio_format,
+ AudioDecoderFactory* factory)
+ : DecoderInfo(audio_format, factory, audio_format.name) {}
kwiberg-webrtc 2016/11/03 12:02:58 The functional change is here; we actually fill in
+
DecoderDatabase::DecoderInfo::DecoderInfo(NetEqDecoder ct,
AudioDecoderFactory* factory)
- : audio_format_(*acm2::RentACodec::NetEqDecoderToSdpAudioFormat(ct)),
- factory_(factory),
- external_decoder_(nullptr),
- cng_decoder_(CngDecoder::Create(audio_format_)),
- subtype_(SubtypeFromFormat(audio_format_)) {}
+ : DecoderInfo(*acm2::RentACodec::NetEqDecoderToSdpAudioFormat(ct),
+ factory) {}
DecoderDatabase::DecoderInfo::DecoderInfo(const SdpAudioFormat& audio_format,
- AudioDecoder* ext_dec)
- : audio_format_(audio_format),
+ AudioDecoder* ext_dec,
+ const std::string& codec_name)
+ : name_(codec_name),
+ audio_format_(audio_format),
factory_(nullptr),
external_decoder_(ext_dec),
subtype_(Subtype::kNormal) {
@@ -135,8 +140,7 @@ int DecoderDatabase::RegisterPayload(uint8_t rtp_payload_type,
if (!opt_format) {
return kCodecNotSupported;
}
- DecoderInfo info(*opt_format, decoder_factory_);
- info.name = name;
+ DecoderInfo info(*opt_format, decoder_factory_, name);
auto ret =
decoders_.insert(std::make_pair(rtp_payload_type, std::move(info)));
if (ret.second == false) {
@@ -176,8 +180,7 @@ int DecoderDatabase::InsertExternal(uint8_t rtp_payload_type,
const SdpAudioFormat format = opt_db_format.value_or({"arbitrary", 0, 0});
std::pair<DecoderMap::iterator, bool> ret;
- DecoderInfo info(format, decoder);
- info.name = codec_name;
+ DecoderInfo info(format, decoder, codec_name);
ret = decoders_.insert(std::make_pair(rtp_payload_type, std::move(info)));
if (ret.second == false) {
// Database already contains a decoder with type |rtp_payload_type|.
« no previous file with comments | « webrtc/modules/audio_coding/neteq/decoder_database.h ('k') | webrtc/modules/audio_coding/neteq/decoder_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698