Make AudioEncoder::GetFrameLengthRange() pure virtual.

In order for WebRTC to be able to include packet overhead in its
bitrate calculations, the AudioEncoder::GetFrameLengthRange()
function must be implemented by all audio encoders. Making this
member function pure virtual as per the following PSA:

https://groups.google.com/forum/#!topic/discuss-webrtc/qscwYr38je0

Bug: webrtc:11427
Change-Id: I30d297ef05f57453bfc257624729559057cad118
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171517
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31127}
This commit is contained in:
Ali Tofigh
2020-03-24 15:35:25 +01:00
committed by Commit Bot
parent cda577fd59
commit 90ecee1ed9
2 changed files with 1 additions and 6 deletions

View File

@ -110,9 +110,4 @@ ANAStats AudioEncoder::GetANAStats() const {
return ANAStats();
}
absl::optional<std::pair<TimeDelta, TimeDelta>>
AudioEncoder::GetFrameLengthRange() const {
return absl::nullopt;
}
} // namespace webrtc

View File

@ -244,7 +244,7 @@ class AudioEncoder {
// information. This is used to calculated the full bitrate range, including
// overhead.
virtual absl::optional<std::pair<TimeDelta, TimeDelta>> GetFrameLengthRange()
const;
const = 0;
protected:
// Subclasses implement this to perform the actual encoding. Called by