Revert "Sanitize the codec list before sending it to the media engine"
This reverts commit add7ef974ee2642a3b55a36ec80be50a615bc60a. Reason for revert: Cause regression in pc_full_stack_tests.cc Original change's description: > Sanitize the codec list before sending it to the media engine > > The SDP can assign the same codec to two different payload types > which gets represented as two separate codecs in the SDP structure. > The media engine assumes that the client does not pass down > duplicate codecs. This change adds logic to BaseChannel to filter > out codecs of the same name with different payload types, picking > the one which is listed first in the m= line. > > Bug: chromium:987598 > Change-Id: I6fa813db1769e572ff7c3f322dc9b1de39817ea2 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/147602 > Reviewed-by: Amit Hilbuch <amithi@webrtc.org> > Commit-Queue: Steve Anton <steveanton@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#28726} TBR=steveanton@webrtc.org,amithi@webrtc.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: chromium:987598 Change-Id: I4ffbfcd90c81c6c6c8ee8f872f7e217d8291c857 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/147864 Commit-Queue: Artem Titov <titovartem@webrtc.org> Reviewed-by: Artem Titov <titovartem@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28744}
This commit is contained in:
@ -94,20 +94,6 @@ static void SafeSetError(const std::string& message, std::string* error_desc) {
|
||||
}
|
||||
}
|
||||
|
||||
template <class Codec>
|
||||
std::vector<Codec> SanitizeCodecList(const std::vector<Codec>& codecs) {
|
||||
std::vector<Codec> sanitized;
|
||||
for (const Codec& codec : codecs) {
|
||||
if (absl::c_any_of(sanitized, [&](const Codec& other) {
|
||||
return codec.Matches(other);
|
||||
})) {
|
||||
continue;
|
||||
}
|
||||
sanitized.push_back(codec);
|
||||
}
|
||||
return sanitized;
|
||||
}
|
||||
|
||||
template <class Codec>
|
||||
void RtpParametersFromMediaDescription(
|
||||
const MediaContentDescriptionImpl<Codec>* desc,
|
||||
@ -117,7 +103,7 @@ void RtpParametersFromMediaDescription(
|
||||
// a description without codecs. Currently the ORTC implementation is relying
|
||||
// on this.
|
||||
if (desc->has_codecs()) {
|
||||
params->codecs = SanitizeCodecList(desc->codecs());
|
||||
params->codecs = desc->codecs();
|
||||
}
|
||||
// TODO(pthatcher): See if we really need
|
||||
// rtp_header_extensions_set() and remove it if we don't.
|
||||
|
Reference in New Issue
Block a user