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

Unified Diff: webrtc/modules/audio_coding/codecs/audio_format.h

Issue 2669583002: Added a flag to AudioCodecSpec to indicate adaptive bitrate support. (Closed)
Patch Set: int -> size_t to avoid unsigned/signed mismatch warnings on Windows. Created 3 years, 10 months 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/codecs/audio_format.h
diff --git a/webrtc/modules/audio_coding/codecs/audio_format.h b/webrtc/modules/audio_coding/codecs/audio_format.h
index b3f803cd967f03958f86ad45e43a4f263774ab74..6f2c8cfa54e150b32d3f1a597f45f0d7dd98b4ff 100644
--- a/webrtc/modules/audio_coding/codecs/audio_format.h
+++ b/webrtc/modules/audio_coding/codecs/audio_format.h
@@ -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

Powered by Google App Engine
This is Rietveld 408576698