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

Side by Side Diff: webrtc/media/engine/webrtcmediaengine.cc

Issue 2534173002: Wire up x-google-{min,start,max}-bitrate to WebRtcVoiceMediaChannel. (Closed)
Patch Set: . Created 4 years 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 // Keep just the highest priority extension of any in the following list. 161 // Keep just the highest priority extension of any in the following list.
162 static const char* kBweExtensionPriorities[] = { 162 static const char* kBweExtensionPriorities[] = {
163 webrtc::RtpExtension::kTransportSequenceNumberUri, 163 webrtc::RtpExtension::kTransportSequenceNumberUri,
164 webrtc::RtpExtension::kAbsSendTimeUri, 164 webrtc::RtpExtension::kAbsSendTimeUri,
165 webrtc::RtpExtension::kTimestampOffsetUri}; 165 webrtc::RtpExtension::kTimestampOffsetUri};
166 DiscardRedundantExtensions(&result, kBweExtensionPriorities); 166 DiscardRedundantExtensions(&result, kBweExtensionPriorities);
167 } 167 }
168 168
169 return result; 169 return result;
170 } 170 }
171
172 webrtc::Call::Config::BitrateConfig GetBitrateConfigForCodec(
173 const Codec& codec) {
174 webrtc::Call::Config::BitrateConfig config;
175 int bitrate_kbps = 0;
176 if (codec.GetParam(kCodecParamMinBitrate, &bitrate_kbps) &&
177 bitrate_kbps > 0) {
178 config.min_bitrate_bps = bitrate_kbps * 1000;
179 } else {
180 config.min_bitrate_bps = 0;
181 }
182 if (codec.GetParam(kCodecParamStartBitrate, &bitrate_kbps) &&
183 bitrate_kbps > 0) {
184 config.start_bitrate_bps = bitrate_kbps * 1000;
185 } else {
186 // Do not reconfigure start bitrate unless it's specified and positive.
187 config.start_bitrate_bps = -1;
188 }
189 if (codec.GetParam(kCodecParamMaxBitrate, &bitrate_kbps) &&
190 bitrate_kbps > 0) {
191 config.max_bitrate_bps = bitrate_kbps * 1000;
192 } else {
193 config.max_bitrate_bps = -1;
194 }
195 return config;
196 }
171 } // namespace cricket 197 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698