OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 Loading... |
161 return kVideoCodecH264; | 161 return kVideoCodecH264; |
162 if (CodecNamesEq(name.c_str(), kPayloadNameI420)) | 162 if (CodecNamesEq(name.c_str(), kPayloadNameI420)) |
163 return kVideoCodecI420; | 163 return kVideoCodecI420; |
164 if (CodecNamesEq(name.c_str(), kPayloadNameRED)) | 164 if (CodecNamesEq(name.c_str(), kPayloadNameRED)) |
165 return kVideoCodecRED; | 165 return kVideoCodecRED; |
166 if (CodecNamesEq(name.c_str(), kPayloadNameULPFEC)) | 166 if (CodecNamesEq(name.c_str(), kPayloadNameULPFEC)) |
167 return kVideoCodecULPFEC; | 167 return kVideoCodecULPFEC; |
168 return kVideoCodecGeneric; | 168 return kVideoCodecGeneric; |
169 } | 169 } |
170 | 170 |
| 171 // TODO(kthelgason): Remove these methods once upstream projects |
| 172 // have been updated. |
| 173 rtc::Optional<const char*> CodecTypeToPayloadName(VideoCodecType type) { |
| 174 return rtc::Optional<const char*>(CodecTypeToPayloadString(type)); |
| 175 } |
| 176 |
| 177 rtc::Optional<VideoCodecType> PayloadNameToCodecType(const std::string& name) { |
| 178 return rtc::Optional<VideoCodecType>(PayloadStringToCodecType(name)); |
| 179 } |
| 180 |
171 const uint32_t BitrateAllocation::kMaxBitrateBps = | 181 const uint32_t BitrateAllocation::kMaxBitrateBps = |
172 std::numeric_limits<uint32_t>::max(); | 182 std::numeric_limits<uint32_t>::max(); |
173 | 183 |
174 BitrateAllocation::BitrateAllocation() : sum_(0), bitrates_{} {} | 184 BitrateAllocation::BitrateAllocation() : sum_(0), bitrates_{} {} |
175 | 185 |
176 bool BitrateAllocation::SetBitrate(size_t spatial_index, | 186 bool BitrateAllocation::SetBitrate(size_t spatial_index, |
177 size_t temporal_index, | 187 size_t temporal_index, |
178 uint32_t bitrate_bps) { | 188 uint32_t bitrate_bps) { |
179 RTC_CHECK_LT(spatial_index, kMaxSpatialLayers); | 189 RTC_CHECK_LT(spatial_index, kMaxSpatialLayers); |
180 RTC_CHECK_LT(temporal_index, kMaxTemporalStreams); | 190 RTC_CHECK_LT(temporal_index, kMaxTemporalStreams); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 oss << " ]"; | 259 oss << " ]"; |
250 return oss.str(); | 260 return oss.str(); |
251 } | 261 } |
252 | 262 |
253 std::ostream& BitrateAllocation::operator<<(std::ostream& os) const { | 263 std::ostream& BitrateAllocation::operator<<(std::ostream& os) const { |
254 os << ToString(); | 264 os << ToString(); |
255 return os; | 265 return os; |
256 } | 266 } |
257 | 267 |
258 } // namespace webrtc | 268 } // namespace webrtc |
OLD | NEW |