From 90ecee1ed97821b6444ef070813f73dfa6e17627 Mon Sep 17 00:00:00 2001 From: Ali Tofigh Date: Tue, 24 Mar 2020 15:35:25 +0100 Subject: [PATCH] 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 Reviewed-by: Karl Wiberg Cr-Commit-Position: refs/heads/master@{#31127} --- api/audio_codecs/audio_encoder.cc | 5 ----- api/audio_codecs/audio_encoder.h | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/api/audio_codecs/audio_encoder.cc b/api/audio_codecs/audio_encoder.cc index 2c1111814e..cd4d2000d2 100644 --- a/api/audio_codecs/audio_encoder.cc +++ b/api/audio_codecs/audio_encoder.cc @@ -110,9 +110,4 @@ ANAStats AudioEncoder::GetANAStats() const { return ANAStats(); } -absl::optional> -AudioEncoder::GetFrameLengthRange() const { - return absl::nullopt; -} - } // namespace webrtc diff --git a/api/audio_codecs/audio_encoder.h b/api/audio_codecs/audio_encoder.h index c6e572c87b..fd2d948863 100644 --- a/api/audio_codecs/audio_encoder.h +++ b/api/audio_codecs/audio_encoder.h @@ -244,7 +244,7 @@ class AudioEncoder { // information. This is used to calculated the full bitrate range, including // overhead. virtual absl::optional> GetFrameLengthRange() - const; + const = 0; protected: // Subclasses implement this to perform the actual encoding. Called by