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

Unified Diff: webrtc/media/engine/webrtcvoiceengine.cc

Issue 2669583002: Added a flag to AudioCodecSpec to indicate adaptive bitrate support. (Closed)
Patch Set: Created 3 years, 11 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/media/engine/webrtcvoiceengine.cc
diff --git a/webrtc/media/engine/webrtcvoiceengine.cc b/webrtc/media/engine/webrtcvoiceengine.cc
index df93ac28f44db14448bc59ef597d70e5415c71f6..3c15385dbdfd943c597e1abf748b9f95100a75cd 100644
--- a/webrtc/media/engine/webrtcvoiceengine.cc
+++ b/webrtc/media/engine/webrtcvoiceengine.cc
@@ -1159,22 +1159,19 @@ AudioCodecs WebRtcVoiceEngine::CollectRecvCodecs() const {
rtc::Optional<AudioCodec> opt_codec = mapper.ToAudioCodec(format);
if (!opt_codec) {
LOG(LS_ERROR) << "Unable to assign payload type to format: " << format;
- return false;
- }
-
- auto& codec = *opt_codec;
- if (IsCodec(codec, kOpusCodecName)) {
- // TODO(ossu): Set this specifically for Opus for now, until we have a
- // better way of dealing with rtcp-fb parameters.
- codec.AddFeedbackParam(
- FeedbackParam(kRtcpFbParamTransportCc, kParamValueEmpty));
}
- out.push_back(codec);
- return true;
+ return opt_codec;
};
for (const auto& spec : specs) {
- if (map_format(spec.format)) {
+ rtc::Optional<AudioCodec> opt_codec = map_format(spec.format);
+ if (opt_codec) {
+ AudioCodec& codec = *opt_codec;
+ if (spec.supports_network_adaption) {
+ codec.AddFeedbackParam(
+ FeedbackParam(kRtcpFbParamTransportCc, kParamValueEmpty));
+ }
+
if (spec.allow_comfort_noise) {
// Generate a CN entry if the decoder allows it and we support the
// clockrate.
@@ -1189,6 +1186,8 @@ AudioCodecs WebRtcVoiceEngine::CollectRecvCodecs() const {
if (dtmf != generate_dtmf.end()) {
dtmf->second = true;
}
+
+ out.push_back(codec);
}
}

Powered by Google App Engine
This is Rietveld 408576698