blob: d0ca29b6f52fba7a71518e47e69936815eb82e95 [file] [log] [blame]
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001/*
kjellander1afca732016-02-07 20:46:45 -08002 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved.
henrike@webrtc.org28e20752013-07-10 00:45:36 +00003 *
kjellander1afca732016-02-07 20:46:45 -08004 * 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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
henrike@webrtc.org28e20752013-07-10 00:45:36 +00009 */
10
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#include "media/base/codec.h"
henrike@webrtc.org28e20752013-07-10 00:45:36 +000012
Steve Anton2c9ebef2019-01-28 17:27:58 -080013#include "absl/algorithm/container.h"
Niels Möller3c7d5992018-10-19 15:29:54 +020014#include "absl/strings/match.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020015#include "media/base/h264_profile_level_id.h"
Emircan Uysaler98badbc2018-06-28 10:59:02 -070016#include "media/base/vp9_profile.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020017#include "rtc_base/checks.h"
18#include "rtc_base/logging.h"
Steve Anton10542f22019-01-11 09:11:00 -080019#include "rtc_base/string_encode.h"
Jonas Olsson88c99562018-05-03 11:45:33 +020020#include "rtc_base/strings/string_builder.h"
henrike@webrtc.org28e20752013-07-10 00:45:36 +000021
22namespace cricket {
23
Magnus Jedvert244ad802017-09-28 21:19:18 +020024FeedbackParams::FeedbackParams() = default;
Paulina Hensmana680a6a2018-04-05 11:42:24 +020025FeedbackParams::~FeedbackParams() = default;
Magnus Jedvert244ad802017-09-28 21:19:18 +020026
henrike@webrtc.org28e20752013-07-10 00:45:36 +000027bool FeedbackParam::operator==(const FeedbackParam& other) const {
Niels Möller3c7d5992018-10-19 15:29:54 +020028 return absl::EqualsIgnoreCase(other.id(), id()) &&
29 absl::EqualsIgnoreCase(other.param(), param());
henrike@webrtc.org28e20752013-07-10 00:45:36 +000030}
31
32bool FeedbackParams::operator==(const FeedbackParams& other) const {
33 return params_ == other.params_;
34}
35
36bool FeedbackParams::Has(const FeedbackParam& param) const {
Steve Anton2c9ebef2019-01-28 17:27:58 -080037 return absl::c_linear_search(params_, param);
henrike@webrtc.org28e20752013-07-10 00:45:36 +000038}
39
40void FeedbackParams::Add(const FeedbackParam& param) {
41 if (param.id().empty()) {
42 return;
43 }
44 if (Has(param)) {
45 // Param already in |this|.
46 return;
47 }
48 params_.push_back(param);
magjed0928a3c2016-11-25 00:40:18 -080049 RTC_CHECK(!HasDuplicateEntries());
henrike@webrtc.org28e20752013-07-10 00:45:36 +000050}
51
52void FeedbackParams::Intersect(const FeedbackParams& from) {
53 std::vector<FeedbackParam>::iterator iter_to = params_.begin();
54 while (iter_to != params_.end()) {
55 if (!from.Has(*iter_to)) {
56 iter_to = params_.erase(iter_to);
57 } else {
58 ++iter_to;
59 }
60 }
61}
62
63bool FeedbackParams::HasDuplicateEntries() const {
64 for (std::vector<FeedbackParam>::const_iterator iter = params_.begin();
65 iter != params_.end(); ++iter) {
66 for (std::vector<FeedbackParam>::const_iterator found = iter + 1;
67 found != params_.end(); ++found) {
68 if (*found == *iter) {
69 return true;
70 }
71 }
72 }
73 return false;
74}
75
deadbeef67cf2c12016-04-13 10:07:16 -070076Codec::Codec(int id, const std::string& name, int clockrate)
77 : id(id), name(name), clockrate(clockrate) {}
guoweis@webrtc.orgbc6961f2015-02-19 17:55:18 +000078
deadbeef67cf2c12016-04-13 10:07:16 -070079Codec::Codec() : id(0), clockrate(0) {}
guoweis@webrtc.orgbc6961f2015-02-19 17:55:18 +000080
81Codec::Codec(const Codec& c) = default;
magjed3663c522016-11-07 10:14:36 -080082Codec::Codec(Codec&& c) = default;
guoweis@webrtc.orgbc6961f2015-02-19 17:55:18 +000083Codec::~Codec() = default;
magjed3663c522016-11-07 10:14:36 -080084Codec& Codec::operator=(const Codec& c) = default;
85Codec& Codec::operator=(Codec&& c) = default;
guoweis@webrtc.orgbc6961f2015-02-19 17:55:18 +000086
87bool Codec::operator==(const Codec& c) const {
88 return this->id == c.id && // id is reserved in objective-c
deadbeef67cf2c12016-04-13 10:07:16 -070089 name == c.name && clockrate == c.clockrate && params == c.params &&
guoweis@webrtc.orgbc6961f2015-02-19 17:55:18 +000090 feedback_params == c.feedback_params;
91}
92
henrike@webrtc.org28e20752013-07-10 00:45:36 +000093bool Codec::Matches(const Codec& codec) const {
94 // Match the codec id/name based on the typical static/dynamic name rules.
95 // Matching is case-insensitive.
pkasting@chromium.orgd3245462015-02-23 21:28:22 +000096 const int kMaxStaticPayloadId = 95;
magjed3663c522016-11-07 10:14:36 -080097 return (id <= kMaxStaticPayloadId || codec.id <= kMaxStaticPayloadId)
98 ? (id == codec.id)
Niels Möller3c7d5992018-10-19 15:29:54 +020099 : (absl::EqualsIgnoreCase(name, codec.name));
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000100}
101
Florent Castelli2d9d82e2019-04-23 19:25:51 +0200102bool Codec::MatchesCapability(
103 const webrtc::RtpCodecCapability& codec_capability) const {
104 webrtc::RtpCodecParameters codec_parameters = ToCodecParameters();
105
106 return codec_parameters.name == codec_capability.name &&
107 codec_parameters.kind == codec_capability.kind &&
108 (codec_parameters.name == cricket::kRtxCodecName ||
109 (codec_parameters.num_channels == codec_capability.num_channels &&
110 codec_parameters.clock_rate == codec_capability.clock_rate &&
111 codec_parameters.parameters == codec_capability.parameters));
112}
113
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000114bool Codec::GetParam(const std::string& name, std::string* out) const {
115 CodecParameterMap::const_iterator iter = params.find(name);
116 if (iter == params.end())
117 return false;
118 *out = iter->second;
119 return true;
120}
121
122bool Codec::GetParam(const std::string& name, int* out) const {
123 CodecParameterMap::const_iterator iter = params.find(name);
124 if (iter == params.end())
125 return false;
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +0000126 return rtc::FromString(iter->second, out);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000127}
128
129void Codec::SetParam(const std::string& name, const std::string& value) {
130 params[name] = value;
131}
132
Yves Gerey665174f2018-06-19 15:03:05 +0200133void Codec::SetParam(const std::string& name, int value) {
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +0000134 params[name] = rtc::ToString(value);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000135}
136
buildbot@webrtc.orgfbd13282014-06-19 19:50:55 +0000137bool Codec::RemoveParam(const std::string& name) {
138 return params.erase(name) == 1;
139}
140
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000141void Codec::AddFeedbackParam(const FeedbackParam& param) {
142 feedback_params.Add(param);
143}
144
145bool Codec::HasFeedbackParam(const FeedbackParam& param) const {
146 return feedback_params.Has(param);
147}
148
149void Codec::IntersectFeedbackParams(const Codec& other) {
150 feedback_params.Intersect(other.feedback_params);
151}
152
Taylor Brandstetter0cd086b2016-04-20 16:23:10 -0700153webrtc::RtpCodecParameters Codec::ToCodecParameters() const {
154 webrtc::RtpCodecParameters codec_params;
155 codec_params.payload_type = id;
deadbeefe702b302017-02-04 12:09:01 -0800156 codec_params.name = name;
Oskar Sundbom78807582017-11-16 11:09:55 +0100157 codec_params.clock_rate = clockrate;
Florent Castellib7d9d832018-05-15 18:14:14 +0200158 codec_params.parameters.insert(params.begin(), params.end());
Taylor Brandstetter0cd086b2016-04-20 16:23:10 -0700159 return codec_params;
160}
161
pkasting25702cb2016-01-08 13:50:27 -0800162AudioCodec::AudioCodec(int id,
163 const std::string& name,
164 int clockrate,
165 int bitrate,
deadbeef67cf2c12016-04-13 10:07:16 -0700166 size_t channels)
167 : Codec(id, name, clockrate), bitrate(bitrate), channels(channels) {}
guoweis@webrtc.orgbc6961f2015-02-19 17:55:18 +0000168
Yves Gerey665174f2018-06-19 15:03:05 +0200169AudioCodec::AudioCodec() : Codec(), bitrate(0), channels(0) {}
guoweis@webrtc.orgbc6961f2015-02-19 17:55:18 +0000170
171AudioCodec::AudioCodec(const AudioCodec& c) = default;
magjed3663c522016-11-07 10:14:36 -0800172AudioCodec::AudioCodec(AudioCodec&& c) = default;
173AudioCodec& AudioCodec::operator=(const AudioCodec& c) = default;
174AudioCodec& AudioCodec::operator=(AudioCodec&& c) = default;
guoweis@webrtc.orgbc6961f2015-02-19 17:55:18 +0000175
176bool AudioCodec::operator==(const AudioCodec& c) const {
guoweis@webrtc.orgcce874b2015-02-19 18:14:36 +0000177 return bitrate == c.bitrate && channels == c.channels && Codec::operator==(c);
guoweis@webrtc.orgbc6961f2015-02-19 17:55:18 +0000178}
179
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000180bool AudioCodec::Matches(const AudioCodec& codec) const {
181 // If a nonzero clockrate is specified, it must match the actual clockrate.
182 // If a nonzero bitrate is specified, it must match the actual bitrate,
183 // unless the codec is VBR (0), where we just force the supplied value.
184 // The number of channels must match exactly, with the exception
185 // that channels=0 is treated synonymously as channels=1, per RFC
186 // 4566 section 6: " [The channels] parameter is OPTIONAL and may be
187 // omitted if the number of channels is one."
188 // Preference is ignored.
189 // TODO(juberti): Treat a zero clockrate as 8000Hz, the RTP default clockrate.
190 return Codec::Matches(codec) &&
Yves Gerey665174f2018-06-19 15:03:05 +0200191 ((codec.clockrate == 0 /*&& clockrate == 8000*/) ||
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000192 clockrate == codec.clockrate) &&
Yves Gerey665174f2018-06-19 15:03:05 +0200193 (codec.bitrate == 0 || bitrate <= 0 || bitrate == codec.bitrate) &&
194 ((codec.channels < 2 && channels < 2) || channels == codec.channels);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000195}
196
197std::string AudioCodec::ToString() const {
Jonas Olsson88c99562018-05-03 11:45:33 +0200198 char buf[256];
199 rtc::SimpleStringBuilder sb(buf);
200 sb << "AudioCodec[" << id << ":" << name << ":" << clockrate << ":" << bitrate
deadbeef67cf2c12016-04-13 10:07:16 -0700201 << ":" << channels << "]";
Jonas Olsson88c99562018-05-03 11:45:33 +0200202 return sb.str();
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000203}
204
deadbeefe702b302017-02-04 12:09:01 -0800205webrtc::RtpCodecParameters AudioCodec::ToCodecParameters() const {
206 webrtc::RtpCodecParameters codec_params = Codec::ToCodecParameters();
Oskar Sundbom78807582017-11-16 11:09:55 +0100207 codec_params.num_channels = static_cast<int>(channels);
deadbeefe702b302017-02-04 12:09:01 -0800208 codec_params.kind = MEDIA_TYPE_AUDIO;
209 return codec_params;
210}
211
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000212std::string VideoCodec::ToString() const {
Jonas Olsson88c99562018-05-03 11:45:33 +0200213 char buf[256];
214 rtc::SimpleStringBuilder sb(buf);
215 sb << "VideoCodec[" << id << ":" << name << "]";
216 return sb.str();
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000217}
218
deadbeefe702b302017-02-04 12:09:01 -0800219webrtc::RtpCodecParameters VideoCodec::ToCodecParameters() const {
220 webrtc::RtpCodecParameters codec_params = Codec::ToCodecParameters();
221 codec_params.kind = MEDIA_TYPE_VIDEO;
222 return codec_params;
223}
224
pkasting25702cb2016-01-08 13:50:27 -0800225VideoCodec::VideoCodec(int id, const std::string& name)
hta9aa96882016-12-06 05:36:03 -0800226 : Codec(id, name, kVideoCodecClockrate) {
227 SetDefaultParameters();
228}
Shao Changbine62202f2015-04-21 20:24:50 +0800229
hta9aa96882016-12-06 05:36:03 -0800230VideoCodec::VideoCodec(const std::string& name) : VideoCodec(0 /* id */, name) {
231 SetDefaultParameters();
232}
magjed1e45cc62016-10-28 07:43:45 -0700233
perkj26752742016-10-24 01:21:16 -0700234VideoCodec::VideoCodec() : Codec() {
guoweis@webrtc.orgbc6961f2015-02-19 17:55:18 +0000235 clockrate = kVideoCodecClockrate;
236}
237
Magnus Jedvert024d8972017-09-29 15:00:29 +0200238VideoCodec::VideoCodec(const webrtc::SdpVideoFormat& c)
239 : Codec(0 /* id */, c.name, kVideoCodecClockrate) {
240 params = c.parameters;
241}
242
guoweis@webrtc.orgbc6961f2015-02-19 17:55:18 +0000243VideoCodec::VideoCodec(const VideoCodec& c) = default;
magjed3663c522016-11-07 10:14:36 -0800244VideoCodec::VideoCodec(VideoCodec&& c) = default;
245VideoCodec& VideoCodec::operator=(const VideoCodec& c) = default;
246VideoCodec& VideoCodec::operator=(VideoCodec&& c) = default;
guoweis@webrtc.orgbc6961f2015-02-19 17:55:18 +0000247
hta9aa96882016-12-06 05:36:03 -0800248void VideoCodec::SetDefaultParameters() {
Niels Möller3c7d5992018-10-19 15:29:54 +0200249 if (absl::EqualsIgnoreCase(kH264CodecName, name)) {
hta9aa96882016-12-06 05:36:03 -0800250 // This default is set for all H.264 codecs created because
251 // that was the default before packetization mode support was added.
252 // TODO(hta): Move this to the places that create VideoCodecs from
253 // SDP or from knowledge of implementation capabilities.
254 SetParam(kH264FmtpPacketizationMode, "1");
255 }
256}
257
guoweis@webrtc.orgbc6961f2015-02-19 17:55:18 +0000258bool VideoCodec::operator==(const VideoCodec& c) const {
perkj26752742016-10-24 01:21:16 -0700259 return Codec::operator==(c);
guoweis@webrtc.orgbc6961f2015-02-19 17:55:18 +0000260}
261
Steve Anton9c1fb1e2018-02-26 15:09:41 -0800262static bool IsSameH264PacketizationMode(const CodecParameterMap& ours,
263 const CodecParameterMap& theirs) {
264 // If packetization-mode is not present, default to "0".
265 // https://tools.ietf.org/html/rfc6184#section-6.2
266 std::string our_packetization_mode = "0";
267 std::string their_packetization_mode = "0";
268 auto ours_it = ours.find(kH264FmtpPacketizationMode);
269 if (ours_it != ours.end()) {
270 our_packetization_mode = ours_it->second;
271 }
272 auto theirs_it = theirs.find(kH264FmtpPacketizationMode);
273 if (theirs_it != theirs.end()) {
274 their_packetization_mode = theirs_it->second;
275 }
276 return our_packetization_mode == their_packetization_mode;
277}
278
magjedf823ede2016-11-12 09:53:04 -0800279bool VideoCodec::Matches(const VideoCodec& other) const {
280 if (!Codec::Matches(other))
281 return false;
Niels Möller039743e2018-10-23 10:07:25 +0200282 if (absl::EqualsIgnoreCase(name, kH264CodecName))
Steve Anton9c1fb1e2018-02-26 15:09:41 -0800283 return webrtc::H264::IsSameH264Profile(params, other.params) &&
284 IsSameH264PacketizationMode(params, other.params);
Niels Möller039743e2018-10-23 10:07:25 +0200285 if (absl::EqualsIgnoreCase(name, kVp9CodecName))
Emircan Uysaler98badbc2018-06-28 10:59:02 -0700286 return webrtc::IsSameVP9Profile(params, other.params);
magjedf823ede2016-11-12 09:53:04 -0800287 return true;
288}
289
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000290VideoCodec VideoCodec::CreateRtxCodec(int rtx_payload_type,
291 int associated_payload_type) {
perkj26752742016-10-24 01:21:16 -0700292 VideoCodec rtx_codec(rtx_payload_type, kRtxCodecName);
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000293 rtx_codec.SetParam(kCodecParamAssociatedPayloadType, associated_payload_type);
294 return rtx_codec;
295}
296
297VideoCodec::CodecType VideoCodec::GetCodecType() const {
298 const char* payload_name = name.c_str();
Niels Möller3c7d5992018-10-19 15:29:54 +0200299 if (absl::EqualsIgnoreCase(payload_name, kRedCodecName)) {
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000300 return CODEC_RED;
301 }
Niels Möller3c7d5992018-10-19 15:29:54 +0200302 if (absl::EqualsIgnoreCase(payload_name, kUlpfecCodecName)) {
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000303 return CODEC_ULPFEC;
304 }
Niels Möller3c7d5992018-10-19 15:29:54 +0200305 if (absl::EqualsIgnoreCase(payload_name, kFlexfecCodecName)) {
brandtr87d7d772016-11-07 03:03:41 -0800306 return CODEC_FLEXFEC;
307 }
Niels Möller3c7d5992018-10-19 15:29:54 +0200308 if (absl::EqualsIgnoreCase(payload_name, kRtxCodecName)) {
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000309 return CODEC_RTX;
310 }
311
312 return CODEC_VIDEO;
313}
314
315bool VideoCodec::ValidateCodecFormat() const {
316 if (id < 0 || id > 127) {
Mirko Bonadei675513b2017-11-09 11:09:25 +0100317 RTC_LOG(LS_ERROR) << "Codec with invalid payload type: " << ToString();
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000318 return false;
319 }
320 if (GetCodecType() != CODEC_VIDEO) {
321 return true;
322 }
323
324 // Video validation from here on.
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000325 int min_bitrate = -1;
326 int max_bitrate = -1;
327 if (GetParam(kCodecParamMinBitrate, &min_bitrate) &&
328 GetParam(kCodecParamMaxBitrate, &max_bitrate)) {
329 if (max_bitrate < min_bitrate) {
Mirko Bonadei675513b2017-11-09 11:09:25 +0100330 RTC_LOG(LS_ERROR) << "Codec with max < min bitrate: " << ToString();
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000331 return false;
332 }
333 }
334 return true;
335}
336
deadbeef67cf2c12016-04-13 10:07:16 -0700337DataCodec::DataCodec(int id, const std::string& name)
338 : Codec(id, name, kDataCodecClockrate) {}
guoweis@webrtc.orgbc6961f2015-02-19 17:55:18 +0000339
340DataCodec::DataCodec() : Codec() {
341 clockrate = kDataCodecClockrate;
342}
343
344DataCodec::DataCodec(const DataCodec& c) = default;
magjed3663c522016-11-07 10:14:36 -0800345DataCodec::DataCodec(DataCodec&& c) = default;
guoweis@webrtc.orgbc6961f2015-02-19 17:55:18 +0000346DataCodec& DataCodec::operator=(const DataCodec& c) = default;
magjed3663c522016-11-07 10:14:36 -0800347DataCodec& DataCodec::operator=(DataCodec&& c) = default;
guoweis@webrtc.orgbc6961f2015-02-19 17:55:18 +0000348
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000349std::string DataCodec::ToString() const {
Jonas Olsson88c99562018-05-03 11:45:33 +0200350 char buf[256];
351 rtc::SimpleStringBuilder sb(buf);
352 sb << "DataCodec[" << id << ":" << name << "]";
353 return sb.str();
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000354}
355
stefanba4c0e42016-02-04 04:12:24 -0800356bool HasNack(const Codec& codec) {
Shao Changbine62202f2015-04-21 20:24:50 +0800357 return codec.HasFeedbackParam(
358 FeedbackParam(kRtcpFbParamNack, kParamValueEmpty));
359}
360
stefanba4c0e42016-02-04 04:12:24 -0800361bool HasRemb(const Codec& codec) {
Shao Changbine62202f2015-04-21 20:24:50 +0800362 return codec.HasFeedbackParam(
363 FeedbackParam(kRtcpFbParamRemb, kParamValueEmpty));
364}
365
Ilya Nikolaevskiy634a7772018-04-04 16:33:49 +0200366bool HasRrtr(const Codec& codec) {
367 return codec.HasFeedbackParam(
368 FeedbackParam(kRtcpFbParamRrtr, kParamValueEmpty));
369}
370
stefanba4c0e42016-02-04 04:12:24 -0800371bool HasTransportCc(const Codec& codec) {
stefan43edf0f2015-11-20 18:05:48 -0800372 return codec.HasFeedbackParam(
373 FeedbackParam(kRtcpFbParamTransportCc, kParamValueEmpty));
374}
375
magjedf823ede2016-11-12 09:53:04 -0800376const VideoCodec* FindMatchingCodec(
377 const std::vector<VideoCodec>& supported_codecs,
378 const VideoCodec& codec) {
379 for (const VideoCodec& supported_codec : supported_codecs) {
Magnus Jedvert523589d2017-11-23 13:24:53 +0100380 if (IsSameCodec(codec.name, codec.params, supported_codec.name,
381 supported_codec.params)) {
382 return &supported_codec;
magjedf823ede2016-11-12 09:53:04 -0800383 }
magjedf823ede2016-11-12 09:53:04 -0800384 }
385 return nullptr;
Shao Changbine62202f2015-04-21 20:24:50 +0800386}
387
Magnus Jedvert523589d2017-11-23 13:24:53 +0100388bool IsSameCodec(const std::string& name1,
389 const CodecParameterMap& params1,
390 const std::string& name2,
391 const CodecParameterMap& params2) {
392 // If different names (case insensitive), then not same formats.
Niels Möller039743e2018-10-23 10:07:25 +0200393 if (!absl::EqualsIgnoreCase(name1, name2))
Magnus Jedvert523589d2017-11-23 13:24:53 +0100394 return false;
Emircan Uysaler98badbc2018-06-28 10:59:02 -0700395 // For every format besides H264 and VP9, comparing names is enough.
Niels Möller039743e2018-10-23 10:07:25 +0200396 if (absl::EqualsIgnoreCase(name1, kH264CodecName))
Emircan Uysaler98badbc2018-06-28 10:59:02 -0700397 return webrtc::H264::IsSameH264Profile(params1, params2);
Niels Möller039743e2018-10-23 10:07:25 +0200398 if (absl::EqualsIgnoreCase(name1, kVp9CodecName))
Emircan Uysaler98badbc2018-06-28 10:59:02 -0700399 return webrtc::IsSameVP9Profile(params1, params2);
400 return true;
Magnus Jedvert523589d2017-11-23 13:24:53 +0100401}
402
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000403} // namespace cricket