diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /third_party/libwebrtc/pc/media_session.cc | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | third_party/libwebrtc/pc/media_session.cc | 52 |
1 files changed, 38 insertions, 14 deletions
diff --git a/third_party/libwebrtc/pc/media_session.cc b/third_party/libwebrtc/pc/media_session.cc index 573e35225e..a118beebb0 100644 --- a/third_party/libwebrtc/pc/media_session.cc +++ b/third_party/libwebrtc/pc/media_session.cc @@ -728,6 +728,16 @@ void NegotiatePacketization(const Codec& local_codec, : absl::nullopt; } +#ifdef RTC_ENABLE_H265 +void NegotiateTxMode(const Codec& local_codec, + const Codec& remote_codec, + Codec* negotiated_codec) { + negotiated_codec->tx_mode = (local_codec.tx_mode == remote_codec.tx_mode) + ? local_codec.tx_mode + : absl::nullopt; +} +#endif + // Finds a codec in `codecs2` that matches `codec_to_match`, which is // a member of `codecs1`. If `codec_to_match` is an RED or RTX codec, both // the codecs themselves and their associated codecs must match. @@ -849,6 +859,13 @@ void NegotiateCodecs(const std::vector<Codec>& local_codecs, webrtc::H264GenerateProfileLevelIdForAnswer(ours.params, theirs->params, &negotiated.params); } +#ifdef RTC_ENABLE_H265 + if (absl::EqualsIgnoreCase(ours.name, kH265CodecName)) { + webrtc::H265GenerateProfileTierLevelForAnswer( + ours.params, theirs->params, &negotiated.params); + NegotiateTxMode(ours, *theirs, &negotiated); + } +#endif negotiated.id = theirs->id; negotiated.name = theirs->name; negotiated_codecs->push_back(std::move(negotiated)); @@ -1864,11 +1881,13 @@ MediaSessionDescriptionFactory::CreateOfferOrError( // Be conservative and signal using both a=msid and a=ssrc lines. Unified // Plan answerers will look at a=msid and Plan B answerers will look at the // a=ssrc MSID line. - offer->set_msid_signaling(cricket::kMsidSignalingMediaSection | + offer->set_msid_signaling(cricket::kMsidSignalingSemantic | + cricket::kMsidSignalingMediaSection | cricket::kMsidSignalingSsrcAttribute); } else { // Plan B always signals MSID using a=ssrc lines. - offer->set_msid_signaling(cricket::kMsidSignalingSsrcAttribute); + offer->set_msid_signaling(cricket::kMsidSignalingSemantic | + cricket::kMsidSignalingSsrcAttribute); } offer->set_extmap_allow_mixed(session_options.offer_extmap_allow_mixed); @@ -2041,7 +2060,16 @@ MediaSessionDescriptionFactory::CreateAnswerOrError( if (is_unified_plan_) { // Unified Plan needs to look at what the offer included to find the most // compatible answer. - if (offer->msid_signaling() == 0) { + int msid_signaling = offer->msid_signaling(); + if (msid_signaling == + (cricket::kMsidSignalingSemantic | cricket::kMsidSignalingMediaSection | + cricket::kMsidSignalingSsrcAttribute)) { + // If both a=msid and a=ssrc MSID signaling methods were used, we're + // probably talking to a Unified Plan endpoint so respond with just + // a=msid. + answer->set_msid_signaling(cricket::kMsidSignalingSemantic | + cricket::kMsidSignalingMediaSection); + } else if (msid_signaling == cricket::kMsidSignalingSemantic) { // We end up here in one of three cases: // 1. An empty offer. We'll reply with an empty answer so it doesn't // matter what we pick here. @@ -2050,23 +2078,19 @@ MediaSessionDescriptionFactory::CreateAnswerOrError( // 3. Media that's either sendonly or inactive from the remote endpoint. // We don't have any information to say whether the endpoint is Plan B // or Unified Plan, so be conservative and send both. - answer->set_msid_signaling(cricket::kMsidSignalingMediaSection | + answer->set_msid_signaling(cricket::kMsidSignalingSemantic | + cricket::kMsidSignalingMediaSection | cricket::kMsidSignalingSsrcAttribute); - } else if (offer->msid_signaling() == - (cricket::kMsidSignalingMediaSection | - cricket::kMsidSignalingSsrcAttribute)) { - // If both a=msid and a=ssrc MSID signaling methods were used, we're - // probably talking to a Unified Plan endpoint so respond with just - // a=msid. - answer->set_msid_signaling(cricket::kMsidSignalingMediaSection); } else { // Otherwise, it's clear which method the offerer is using so repeat that - // back to them. - answer->set_msid_signaling(offer->msid_signaling()); + // back to them. This includes the case where the msid-semantic line is + // not included. + answer->set_msid_signaling(msid_signaling); } } else { // Plan B always signals MSID using a=ssrc lines. - answer->set_msid_signaling(cricket::kMsidSignalingSsrcAttribute); + answer->set_msid_signaling(cricket::kMsidSignalingSemantic | + cricket::kMsidSignalingSsrcAttribute); } return answer; |