Remove ACMCodecDB::CodecFreq
BUG=webrtc:5028 Review URL: https://codereview.webrtc.org/1408773005 Cr-Commit-Position: refs/heads/master@{#10536}
This commit is contained in:
parent
288886b2ec
commit
fb3d8b3df2
@ -340,14 +340,6 @@ int ACMCodecDB::ReceiverCodecNumber(const CodecInst& codec_inst) {
|
||||
return CodecId(codec_inst);
|
||||
}
|
||||
|
||||
// Returns the codec sampling frequency for codec with id = "codec_id" in
|
||||
// database.
|
||||
int ACMCodecDB::CodecFreq(int codec_id) {
|
||||
const size_t i = static_cast<size_t>(codec_id);
|
||||
const auto db = RentACodec::Database();
|
||||
return i < db.size() ? db[i].plfreq : -1;
|
||||
}
|
||||
|
||||
} // namespace acm2
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -74,17 +74,6 @@ class ACMCodecDB {
|
||||
static int CodecId(const char* payload_name, int frequency, int channels);
|
||||
static int ReceiverCodecNumber(const CodecInst& codec_inst);
|
||||
|
||||
// Returns the codec sampling frequency for codec with id = "codec_id" in
|
||||
// database.
|
||||
// TODO(tlegrand): Check if function is needed, or if we can change
|
||||
// to access database directly.
|
||||
// Input:
|
||||
// [codec_id] - number that specifies at what position in the database to
|
||||
// get the information.
|
||||
// Return:
|
||||
// codec sampling frequency if successful, otherwise -1.
|
||||
static int CodecFreq(int codec_id);
|
||||
|
||||
private:
|
||||
// Databases with information about the supported codecs
|
||||
// database_ - stored information about all codecs: payload type, name,
|
||||
|
||||
@ -178,7 +178,10 @@ int AcmReceiver::InsertPacket(const WebRtcRTPHeader& rtp_header,
|
||||
<< " is not registered.";
|
||||
return -1;
|
||||
}
|
||||
const int sample_rate_hz = ACMCodecDB::CodecFreq(decoder->acm_codec_id);
|
||||
const int sample_rate_hz = [&decoder] {
|
||||
const auto ci = RentACodec::CodecIdFromIndex(decoder->acm_codec_id);
|
||||
return ci ? RentACodec::CodecInstById(*ci)->plfreq : -1;
|
||||
}();
|
||||
receive_timestamp = NowInTimestamp(sample_rate_hz);
|
||||
|
||||
// If this is a CNG while the audio codec is not mono, skip pushing in
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user