Added a flag to AudioCodecSpec to indicate adaptive bitrate support.

It's currently only used to ensure transport-cc is enabled for the format in question. It might be used to toggle more things in future.

BUG=webrtc:5806

Review-Url: https://codereview.webrtc.org/2669583002
Cr-Commit-Position: refs/heads/master@{#16514}
This commit is contained in:
ossu
2017-02-09 05:14:32 -08:00
committed by Commit bot
parent 0289364abc
commit 9def800b70
5 changed files with 135 additions and 32 deletions

View File

@ -54,10 +54,26 @@ struct SdpAudioFormat {
void swap(SdpAudioFormat& a, SdpAudioFormat& b);
std::ostream& operator<<(std::ostream& os, const SdpAudioFormat& saf);
// To avoid API breakage, and make the code clearer, AudioCodecSpec should not
// be directly initializable with any flags indicating optional support. If it
// were, these initializers would break any time a new flag was added. It's also
// more difficult to understand:
// AudioCodecSpec spec{{"format", 8000, 1}, true, false, false, true, true};
// than
// AudioCodecSpec spec({"format", 8000, 1});
// spec.allow_comfort_noise = true;
// spec.future_flag_b = true;
// spec.future_flag_c = true;
struct AudioCodecSpec {
explicit AudioCodecSpec(const SdpAudioFormat& format);
explicit AudioCodecSpec(SdpAudioFormat&& format);
~AudioCodecSpec() = default;
SdpAudioFormat format;
bool allow_comfort_noise; // This encoder can be used with an external
// comfort noise generator.
bool allow_comfort_noise = true; // This codec can be used with an external
// comfort noise generator.
bool supports_network_adaption = false; // This codec can adapt to varying
// network conditions.
};
} // namespace webrtc