Bug 1963249 - support extmap-allow-mixed;r=bwc

Differential Revision: https://phabricator.services.mozilla.com/D247412
This commit is contained in:
Nico Grunbaum
2025-05-09 19:24:19 +00:00
committed by na-g@nostrum.com
parent 0905650fec
commit ae22a488c2
18 changed files with 231 additions and 67 deletions

View File

@@ -308,6 +308,9 @@ nsresult JsepSessionImpl::CreateOfferMsection(const JsepOfferOptions& options,
new SdpFlagAttribute(SdpAttribute::kRtcpRsizeAttribute)); new SdpFlagAttribute(SdpAttribute::kRtcpRsizeAttribute));
} }
} }
// Ditto for extmap-allow-mixed
msection->GetAttributeList().SetAttribute(
new SdpFlagAttribute(SdpAttribute::kExtmapAllowMixedAttribute));
nsresult rv = AddTransportAttributes(msection, SdpSetupAttribute::kActpass); nsresult rv = AddTransportAttributes(msection, SdpSetupAttribute::kActpass);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
@@ -570,6 +573,16 @@ JsepSession::Result JsepSessionImpl::CreateAnswer(
mSdpHelper.GetBundleGroups(offer, &groupAttr->mGroups); mSdpHelper.GetBundleGroups(offer, &groupAttr->mGroups);
sdp->GetAttributeList().SetAttribute(groupAttr.release()); sdp->GetAttributeList().SetAttribute(groupAttr.release());
// Copy EXTMAP-ALLOW-MIXED from the offer to the answer
if (offer.GetAttributeList().HasAttribute(
SdpAttribute::kExtmapAllowMixedAttribute)) {
sdp->GetAttributeList().SetAttribute(
new SdpFlagAttribute(SdpAttribute::kExtmapAllowMixedAttribute));
} else {
sdp->GetAttributeList().RemoveAttribute(
SdpAttribute::kExtmapAllowMixedAttribute);
}
for (size_t i = 0; i < offer.GetMediaSectionCount(); ++i) { for (size_t i = 0; i < offer.GetMediaSectionCount(); ++i) {
// The transceivers are already in place, due to setRemote // The transceivers are already in place, due to setRemote
Maybe<JsepTransceiver> transceiver(GetTransceiverForLevel(i)); Maybe<JsepTransceiver> transceiver(GetTransceiverForLevel(i));

View File

@@ -421,7 +421,11 @@ void JsepTrack::CreateEncodings(
SdpAttribute::kRtcpRsizeAttribute)) { SdpAttribute::kRtcpRsizeAttribute)) {
rtcpMode = webrtc::RtcpMode::kReducedSize; rtcpMode = webrtc::RtcpMode::kReducedSize;
} }
negotiatedDetails->mRtpRtcpConf = RtpRtcpConfig(rtcpMode); // extmap-allow-mixed which can be at the media level or the session level
constexpr bool SESSION_FALLBACK = true;
bool extmapAllowMixed = remote.GetAttributeList().HasAttribute(
SdpAttribute::kExtmapAllowMixedAttribute, SESSION_FALLBACK);
negotiatedDetails->mRtpRtcpConf = RtpRtcpConfig(rtcpMode, extmapAllowMixed);
// TODO add support for b=AS if TIAS is not set (bug 976521) // TODO add support for b=AS if TIAS is not set (bug 976521)

View File

@@ -27,7 +27,7 @@ namespace mozilla {
class JsepTrackNegotiatedDetails { class JsepTrackNegotiatedDetails {
public: public:
JsepTrackNegotiatedDetails() JsepTrackNegotiatedDetails()
: mTias(0), mRtpRtcpConf(webrtc::RtcpMode::kCompound) {} : mTias(0), mRtpRtcpConf(webrtc::RtcpMode::kCompound, true) {}
JsepTrackNegotiatedDetails(const JsepTrackNegotiatedDetails& orig) JsepTrackNegotiatedDetails(const JsepTrackNegotiatedDetails& orig)
: mExtmap(orig.mExtmap), : mExtmap(orig.mExtmap),
@@ -65,7 +65,7 @@ class JsepTrackNegotiatedDetails {
void ForEachRTPHeaderExtension( void ForEachRTPHeaderExtension(
const std::function<void(const SdpExtmapAttributeList::Extmap& extmap)>& const std::function<void(const SdpExtmapAttributeList::Extmap& extmap)>&
fn) const { fn) const {
for (auto entry : mExtmap) { for (const auto& entry : mExtmap) {
fn(entry.second); fn(entry.second);
} }
} }

View File

@@ -10,15 +10,20 @@ namespace mozilla {
class RtpRtcpConfig { class RtpRtcpConfig {
public: public:
RtpRtcpConfig() = delete; RtpRtcpConfig() = delete;
explicit RtpRtcpConfig(const webrtc::RtcpMode aMode) : mRtcpMode(aMode) {} explicit RtpRtcpConfig(const webrtc::RtcpMode aMode,
const bool aExtmapAllowMixed)
: mRtcpMode(aMode), mExtmapAllowMixed(aExtmapAllowMixed) {}
webrtc::RtcpMode GetRtcpMode() const { return mRtcpMode; } webrtc::RtcpMode GetRtcpMode() const { return mRtcpMode; }
bool GetExtmapAllowMixed() const { return mExtmapAllowMixed; }
bool operator==(const RtpRtcpConfig& aOther) const { bool operator==(const RtpRtcpConfig& aOther) const {
return mRtcpMode == aOther.mRtcpMode; return mRtcpMode == aOther.mRtcpMode &&
mExtmapAllowMixed == aOther.mExtmapAllowMixed;
} }
private: private:
webrtc::RtcpMode mRtcpMode; webrtc::RtcpMode mRtcpMode;
bool mExtmapAllowMixed;
}; };
} // namespace mozilla } // namespace mozilla
#endif #endif

View File

@@ -506,7 +506,6 @@ void WebrtcVideoConduit::OnControlConfigChange() {
rtpRtcpConfig != mControl.mConfiguredRecvRtpRtcpConfig)) { rtpRtcpConfig != mControl.mConfiguredRecvRtpRtcpConfig)) {
mControl.mConfiguredRecvCodecs = codecConfigList; mControl.mConfiguredRecvCodecs = codecConfigList;
mControl.mConfiguredRecvRtpRtcpConfig = rtpRtcpConfig; mControl.mConfiguredRecvRtpRtcpConfig = rtpRtcpConfig;
webrtc::VideoReceiveStreamInterface::Config::Rtp newRtp( webrtc::VideoReceiveStreamInterface::Config::Rtp newRtp(
mRecvStreamConfig.rtp); mRecvStreamConfig.rtp);
MOZ_ASSERT(newRtp == mRecvStreamConfig.rtp); MOZ_ASSERT(newRtp == mRecvStreamConfig.rtp);
@@ -800,6 +799,7 @@ void WebrtcVideoConduit::OnControlConfigChange() {
newRtp.payload_name = codecConfig->mName; newRtp.payload_name = codecConfig->mName;
newRtp.payload_type = codecConfig->mType; newRtp.payload_type = codecConfig->mType;
newRtp.rtcp_mode = rtpRtcpConfig->GetRtcpMode(); newRtp.rtcp_mode = rtpRtcpConfig->GetRtcpMode();
newRtp.extmap_allow_mixed = rtpRtcpConfig->GetExtmapAllowMixed();
newRtp.max_packet_size = kVideoMtu; newRtp.max_packet_size = kVideoMtu;
newRtp.rtx.payload_type = codecConfig->RtxPayloadTypeIsSet() newRtp.rtx.payload_type = codecConfig->RtxPayloadTypeIsSet()
? codecConfig->mRTXPayloadType ? codecConfig->mRTXPayloadType

View File

@@ -379,6 +379,7 @@ void RsdparsaSdpAttributeList::LoadAttribute(RustAttributeList* attributeList,
case SdpAttribute::kRtcpRsizeAttribute: case SdpAttribute::kRtcpRsizeAttribute:
case SdpAttribute::kBundleOnlyAttribute: case SdpAttribute::kBundleOnlyAttribute:
case SdpAttribute::kEndOfCandidatesAttribute: case SdpAttribute::kEndOfCandidatesAttribute:
case SdpAttribute::kExtmapAllowMixedAttribute:
LoadFlags(attributeList); LoadFlags(attributeList);
return; return;
case SdpAttribute::kMaxMessageSizeAttribute: case SdpAttribute::kMaxMessageSizeAttribute:
@@ -846,6 +847,10 @@ void RsdparsaSdpAttributeList::LoadFlags(RustAttributeList* attributeList) {
if (flags.endOfCandidates) { if (flags.endOfCandidates) {
SetAttribute(new SdpFlagAttribute(SdpAttribute::kEndOfCandidatesAttribute)); SetAttribute(new SdpFlagAttribute(SdpAttribute::kEndOfCandidatesAttribute));
} }
if (flags.extmapAllowMixed) {
SetAttribute(
new SdpFlagAttribute(SdpAttribute::kExtmapAllowMixedAttribute));
}
} }
void RsdparsaSdpAttributeList::LoadMaxMessageSize( void RsdparsaSdpAttributeList::LoadMaxMessageSize(

View File

@@ -263,6 +263,7 @@ struct RustSdpAttributeFlags {
bool rtcpRsize; bool rtcpRsize;
bool bundleOnly; bool bundleOnly;
bool endOfCandidates; bool endOfCandidates;
bool extmapAllowMixed;
}; };
struct RustSdpAttributeMsid { struct RustSdpAttributeMsid {

View File

@@ -1333,6 +1333,8 @@ bool SdpAttribute::IsAllowedAtMediaLevel(AttributeType type) {
return true; return true;
case kExtmapAttribute: case kExtmapAttribute:
return true; return true;
case kExtmapAllowMixedAttribute:
return true;
case kFingerprintAttribute: case kFingerprintAttribute:
return true; return true;
case kFmtpAttribute: case kFmtpAttribute:
@@ -1416,6 +1418,8 @@ bool SdpAttribute::IsAllowedAtSessionLevel(AttributeType type) {
return true; return true;
case kExtmapAttribute: case kExtmapAttribute:
return true; return true;
case kExtmapAllowMixedAttribute:
return true;
case kFingerprintAttribute: case kFingerprintAttribute:
return true; return true;
case kFmtpAttribute: case kFmtpAttribute:
@@ -1494,6 +1498,8 @@ const std::string SdpAttribute::GetAttributeTypeString(AttributeType type) {
return "end-of-candidates"; return "end-of-candidates";
case kExtmapAttribute: case kExtmapAttribute:
return "extmap"; return "extmap";
case kExtmapAllowMixedAttribute:
return "extmap-allow-mixed";
case kFingerprintAttribute: case kFingerprintAttribute:
return "fingerprint"; return "fingerprint";
case kFmtpAttribute: case kFmtpAttribute:

View File

@@ -41,6 +41,7 @@ class SdpAttribute {
kDtlsMessageAttribute, kDtlsMessageAttribute,
kEndOfCandidatesAttribute, kEndOfCandidatesAttribute,
kExtmapAttribute, kExtmapAttribute,
kExtmapAllowMixedAttribute,
kFingerprintAttribute, kFingerprintAttribute,
kFmtpAttribute, kFmtpAttribute,
kGroupAttribute, kGroupAttribute,

View File

@@ -553,6 +553,11 @@ nsresult SdpHelper::CopyStickyParams(const SdpMediaSection& source,
new SdpFlagAttribute(SdpAttribute::kRtcpRsizeAttribute)); new SdpFlagAttribute(SdpAttribute::kRtcpRsizeAttribute));
} }
// Keep extmap-allow-mixed setting
if (sourceAttrs.HasAttribute(SdpAttribute::kExtmapAllowMixedAttribute)) {
destAttrs.SetAttribute(
new SdpFlagAttribute(SdpAttribute::kExtmapAllowMixedAttribute));
}
return NS_OK; return NS_OK;
} }

View File

@@ -142,7 +142,12 @@ void SipccSdpAttributeList::LoadSimpleNumbers(sdp_t* sdp, uint16_t level,
} }
void SipccSdpAttributeList::LoadFlags(sdp_t* sdp, uint16_t level) { void SipccSdpAttributeList::LoadFlags(sdp_t* sdp, uint16_t level) {
if (AtSessionLevel()) { // any-level
if (sdp_attr_valid(sdp, SDP_ATTR_EXTMAP_ALLOW_MIXED, level, 0, 1)) {
SetAttribute(
new SdpFlagAttribute(SdpAttribute::kExtmapAllowMixedAttribute));
}
if (AtSessionLevel()) { // session-level only
if (sdp_attr_valid(sdp, SDP_ATTR_ICE_LITE, level, 0, 1)) { if (sdp_attr_valid(sdp, SDP_ATTR_ICE_LITE, level, 0, 1)) {
SetAttribute(new SdpFlagAttribute(SdpAttribute::kIceLiteAttribute)); SetAttribute(new SdpFlagAttribute(SdpAttribute::kIceLiteAttribute));
} }
@@ -157,8 +162,9 @@ void SipccSdpAttributeList::LoadFlags(sdp_t* sdp, uint16_t level) {
if (sdp_attr_valid(sdp, SDP_ATTR_BUNDLE_ONLY, level, 0, 1)) { if (sdp_attr_valid(sdp, SDP_ATTR_BUNDLE_ONLY, level, 0, 1)) {
SetAttribute(new SdpFlagAttribute(SdpAttribute::kBundleOnlyAttribute)); SetAttribute(new SdpFlagAttribute(SdpAttribute::kBundleOnlyAttribute));
} }
if (sdp_attr_valid(sdp, SDP_ATTR_RTCP_RSIZE, level, 0, 1)) if (sdp_attr_valid(sdp, SDP_ATTR_RTCP_RSIZE, level, 0, 1)) {
SetAttribute(new SdpFlagAttribute(SdpAttribute::kRtcpRsizeAttribute)); SetAttribute(new SdpFlagAttribute(SdpAttribute::kRtcpRsizeAttribute));
}
} }
} }
@@ -180,7 +186,8 @@ static void ConvertDirection(sdp_direction_e sipcc_direction,
case SDP_MAX_QOS_DIRECTIONS: case SDP_MAX_QOS_DIRECTIONS:
// Nothing actually sets this value. // Nothing actually sets this value.
// Fall through to MOZ_CRASH below. // Fall through to MOZ_CRASH below.
{} {
}
} }
MOZ_CRASH("Invalid direction from sipcc; this is probably corruption"); MOZ_CRASH("Invalid direction from sipcc; this is probably corruption");
@@ -459,7 +466,8 @@ void SipccSdpAttributeList::LoadSetup(sdp_t* sdp, uint16_t level) {
case SDP_MAX_SETUP: case SDP_MAX_SETUP:
// There is no code that will set these. // There is no code that will set these.
// Fall through to MOZ_CRASH() below. // Fall through to MOZ_CRASH() below.
{} {
}
} }
MOZ_CRASH("Invalid setup type from sipcc. This is probably corruption."); MOZ_CRASH("Invalid setup type from sipcc. This is probably corruption.");

View File

@@ -613,6 +613,7 @@ pub struct RustSdpAttributeFlags {
pub rtcp_rsize: bool, pub rtcp_rsize: bool,
pub bundle_only: bool, pub bundle_only: bool,
pub end_of_candidates: bool, pub end_of_candidates: bool,
pub extmap_allow_mixed: bool,
} }
#[no_mangle] #[no_mangle]
@@ -625,6 +626,7 @@ pub unsafe extern "C" fn sdp_get_attribute_flags(
rtcp_rsize: false, rtcp_rsize: false,
bundle_only: false, bundle_only: false,
end_of_candidates: false, end_of_candidates: false,
extmap_allow_mixed: false,
}; };
for attribute in (*attributes).iter() { for attribute in (*attributes).iter() {
if let SdpAttribute::IceLite = *attribute { if let SdpAttribute::IceLite = *attribute {
@@ -637,6 +639,8 @@ pub unsafe extern "C" fn sdp_get_attribute_flags(
ret.bundle_only = true; ret.bundle_only = true;
} else if let SdpAttribute::EndOfCandidates = *attribute { } else if let SdpAttribute::EndOfCandidates = *attribute {
ret.end_of_candidates = true; ret.end_of_candidates = true;
} else if let SdpAttribute::ExtmapAllowMixed = *attribute {
ret.extmap_allow_mixed = true;
} }
} }
ret ret

View File

@@ -1163,12 +1163,12 @@ class JsepSessionTest : public JsepSessionTestBase,
} }
private: private:
typedef size_t Level; using Level = size_t;
typedef std::string TransportId; using TransportId = std::string;
typedef std::string Mid; using Mid = std::string;
typedef std::string Candidate; using Candidate = std::string;
typedef std::string Address; using Address = std::string;
typedef uint16_t Port; using Port = uint16_t;
// Default candidates are put into the m-line, c-line, and rtcp // Default candidates are put into the m-line, c-line, and rtcp
// attribute for endpoints that don't support ICE. // attribute for endpoints that don't support ICE.
std::map<TransportId, std::map<ComponentType, std::pair<Address, Port>>> std::map<TransportId, std::map<ComponentType, std::pair<Address, Port>>>
@@ -1505,6 +1505,20 @@ class JsepSessionTest : public JsepSessionTestBase,
} }
} }
protected:
bool ExtmapAllowMixed(const JsepSessionImpl& aSession) {
if (aSession.mCurrentLocalDescription) {
return aSession.mCurrentLocalDescription->GetAttributeList().HasAttribute(
SdpAttribute::kExtmapAllowMixedAttribute);
}
if (aSession.mPendingLocalDescription) {
return aSession.mPendingLocalDescription->GetAttributeList().HasAttribute(
SdpAttribute::kExtmapAllowMixedAttribute);
}
return false;
}
private:
std::string mLastError; std::string mLastError;
SdpHelper mSdpHelper; SdpHelper mSdpHelper;
@@ -7774,4 +7788,58 @@ TEST_F(JsepSessionTest, TestBundleSupportWithZeroPort) {
ASSERT_TRUE(offerTransceiver.mSendTrack.GetActive()); ASSERT_TRUE(offerTransceiver.mSendTrack.GetActive());
} }
} }
TEST_F(JsepSessionTest, ExtmapAllowMixedTrueWhenPrensentAtSessionLevel) {
AddTracks(*mSessionOff, "audio,video,datachannel");
AddTracks(*mSessionAns, "audio,video,datachannel");
std::string offer;
mSessionOff->CreateOffer(JsepOfferOptions(), &offer);
// Remove extmap-allow-mixed from the media level
ReplaceAll("a=extmap-allow-mixed\r\n", "", &offer);
// Add extmap-allow-mixed to the session level
Replace("m=audio", "a=extmap-allow-mixed\r\nm=audio", &offer);
mSessionOff->SetLocalDescription(kJsepSdpOffer, offer);
mSessionAns->SetRemoteDescription(kJsepSdpOffer, offer);
std::string answer;
mSessionAns->CreateAnswer(JsepAnswerOptions(), &answer);
mSessionOff->SetRemoteDescription(kJsepSdpAnswer, answer);
mSessionAns->SetLocalDescription(kJsepSdpAnswer, answer);
ASSERT_TRUE(ExtmapAllowMixed(*mSessionOff));
ASSERT_TRUE(ExtmapAllowMixed(*mSessionAns));
mSessionAns->ForEachTransceiver([](JsepTransceiver& aTransceiver) {
if (aTransceiver.mSendTrack.GetMediaType()) {
ASSERT_TRUE(aTransceiver.mSendTrack.GetNegotiatedDetails()
->GetRtpRtcpConfig()
.GetExtmapAllowMixed());
}
});
}
TEST_F(JsepSessionTest, ExtmapAllowMixedCheckDoNotDefaultToSessionLevel) {
AddTracks(*mSessionOff, "audio,video,datachannel");
AddTracks(*mSessionAns, "audio,video,datachannel");
std::string offer;
mSessionOff->CreateOffer(JsepOfferOptions(), &offer);
mSessionOff->SetLocalDescription(kJsepSdpOffer, offer);
mSessionAns->SetRemoteDescription(kJsepSdpOffer, offer);
std::string answer;
mSessionAns->CreateAnswer(JsepAnswerOptions(), &answer);
mSessionOff->SetRemoteDescription(kJsepSdpAnswer, answer);
mSessionAns->SetLocalDescription(kJsepSdpAnswer, answer);
ASSERT_FALSE(ExtmapAllowMixed(*mSessionOff));
ASSERT_FALSE(ExtmapAllowMixed(*mSessionAns));
}
} // namespace mozilla } // namespace mozilla

View File

@@ -420,6 +420,20 @@ class CheckForCodecType {
SdpMediaSection::MediaType mType; SdpMediaSection::MediaType mType;
}; };
TEST_F(JsepTrackTest, CheckForAnsweringWithExtmapAllowMixedWhenNotOffered) {
Init(SdpMediaSection::kAudio);
CreateOffer();
mOffer->GetMediaSection(0).GetAttributeList().RemoveAttribute(
SdpAttribute::kExtmapAllowMixedAttribute);
CreateAnswer();
ASSERT_FALSE(mAnswer->GetMediaSection(0).GetAttributeList().HasAttribute(
SdpAttribute::kExtmapAllowMixedAttribute));
Negotiate();
SanityCheck();
}
TEST_F(JsepTrackTest, CheckForMismatchedAudioCodecAndVideoTrack) { TEST_F(JsepTrackTest, CheckForMismatchedAudioCodecAndVideoTrack) {
std::vector<UniquePtr<JsepCodecDescription>> offerCodecs; std::vector<UniquePtr<JsepCodecDescription>> offerCodecs;

View File

@@ -1555,6 +1555,18 @@ TEST_F(SdpTest, parseIceLite) {
sdp_attr_is_present(sdp_ptr_, SDP_ATTR_ICE_LITE, SDP_SESSION_LEVEL, 0)); sdp_attr_is_present(sdp_ptr_, SDP_ATTR_ICE_LITE, SDP_SESSION_LEVEL, 0));
} }
TEST_F(SdpTest, parseExtmapAllowMixed) {
std::string sdp =
"v=0\r\n"
"o=- 4294967296 2 IN IP4 127.0.0.1\r\n"
"s=SIP Call\r\n"
"t=0 0\r\n"
"a=extmap-allow-mixed\r\n";
ParseSdp(sdp);
ASSERT_TRUE(sdp_attr_is_present(sdp_ptr_, SDP_ATTR_EXTMAP_ALLOW_MIXED,
SDP_SESSION_LEVEL, 0));
}
class NewSdpTest class NewSdpTest
: public ::testing::Test, : public ::testing::Test,
public ::testing::WithParamInterface< ::testing::tuple<bool, bool> > { public ::testing::WithParamInterface< ::testing::tuple<bool, bool> > {
@@ -1918,6 +1930,7 @@ MOZ_RUNINIT const std::vector<std::string> kBasicAudioVideoOfferLines = {
"a=ice-pwd:0000000000000000000000000000000", "a=ice-pwd:0000000000000000000000000000000",
"a=sendonly", "a=sendonly",
"a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level", "a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level",
"a=extmap-allow-mixed",
"a=setup:actpass", "a=setup:actpass",
"a=rtcp-mux", "a=rtcp-mux",
"a=msid:stream track", "a=msid:stream track",
@@ -1950,6 +1963,7 @@ MOZ_RUNINIT const std::vector<std::string> kBasicAudioVideoOfferLines = {
"a=rtpmap:122 red/90000", "a=rtpmap:122 red/90000",
"a=rtpmap:123 ulpfec/90000", "a=rtpmap:123 ulpfec/90000",
"a=fmtp:122 120/121/123", "a=fmtp:122 120/121/123",
"a=extmap-allow-mixed",
"a=recvonly", "a=recvonly",
"a=rtcp-fb:120 nack", "a=rtcp-fb:120 nack",
"a=rtcp-fb:120 nack pli", "a=rtcp-fb:120 nack pli",
@@ -1991,6 +2005,7 @@ MOZ_RUNINIT const std::vector<std::string> kBasicAudioVideoOfferLines = {
"a=rtpmap:0 PCMU/8000", "a=rtpmap:0 PCMU/8000",
"a=ice-options:foo bar", "a=ice-options:foo bar",
"a=msid:noappdata", "a=msid:noappdata",
"a=extmap-allow-mixed",
"a=bundle-only"}; "a=bundle-only"};
// SDP from a basic A/V apprtc call FFX/FFX // SDP from a basic A/V apprtc call FFX/FFX
@@ -2030,6 +2045,7 @@ MOZ_RUNINIT const std::vector<std::string> kBasicAV1AudioVideoOfferLines = {
"a=ice-pwd:0000000000000000000000000000000", "a=ice-pwd:0000000000000000000000000000000",
"a=sendonly", "a=sendonly",
"a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level", "a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level",
"a=extmap-allow-mixed",
"a=setup:actpass", "a=setup:actpass",
"a=rtcp-mux", "a=rtcp-mux",
"a=msid:stream track", "a=msid:stream track",
@@ -2056,6 +2072,7 @@ MOZ_RUNINIT const std::vector<std::string> kBasicAV1AudioVideoOfferLines = {
"DF:FA:FB:08:3B:3C:54:1D:D7:D4:05:77:A0:72:9B:14:08:6D:0F:4C", "DF:FA:FB:08:3B:3C:54:1D:D7:D4:05:77:A0:72:9B:14:08:6D:0F:4C",
"a=mid:second", "a=mid:second",
"a=rtpmap:98 AV1/90000", "a=rtpmap:98 AV1/90000",
"a=extmap-allow-mixed",
"a=fmtp:98 profile=1;level-idx=1;tier=1;max-fs=3600;max-fr=30", "a=fmtp:98 profile=1;level-idx=1;tier=1;max-fs=3600;max-fr=30",
"a=rtpmap:122 red/90000", "a=rtpmap:122 red/90000",
"a=rtpmap:123 ulpfec/90000", "a=rtpmap:123 ulpfec/90000",
@@ -2098,6 +2115,7 @@ MOZ_RUNINIT const std::vector<std::string> kBasicAV1AudioVideoOfferLines = {
"a=rtpmap:0 PCMU/8000", "a=rtpmap:0 PCMU/8000",
"a=ice-options:foo bar", "a=ice-options:foo bar",
"a=msid:noappdata", "a=msid:noappdata",
"a=extmap-allow-mixed",
"a=bundle-only"}; "a=bundle-only"};
static std::string joinSdp(const std::vector<std::string>& aSdp, static std::string joinSdp(const std::vector<std::string>& aSdp,
@@ -2936,6 +2954,15 @@ TEST_P(NewSdpTest, CheckFlags) {
ASSERT_FALSE(Sdp()->GetMediaSection(2).GetAttributeList().HasAttribute( ASSERT_FALSE(Sdp()->GetMediaSection(2).GetAttributeList().HasAttribute(
SdpAttribute::kIceLiteAttribute)); SdpAttribute::kIceLiteAttribute));
ASSERT_FALSE(Sdp()->GetAttributeList().HasAttribute(
SdpAttribute::kExtmapAllowMixedAttribute));
ASSERT_TRUE(Sdp()->GetMediaSection(0).GetAttributeList().HasAttribute(
SdpAttribute::kExtmapAllowMixedAttribute));
ASSERT_TRUE(Sdp()->GetMediaSection(1).GetAttributeList().HasAttribute(
SdpAttribute::kExtmapAllowMixedAttribute));
ASSERT_TRUE(Sdp()->GetMediaSection(2).GetAttributeList().HasAttribute(
SdpAttribute::kExtmapAllowMixedAttribute));
ASSERT_TRUE(Sdp()->GetMediaSection(0).GetAttributeList().HasAttribute( ASSERT_TRUE(Sdp()->GetMediaSection(0).GetAttributeList().HasAttribute(
SdpAttribute::kRtcpMuxAttribute)); SdpAttribute::kRtcpMuxAttribute));
ASSERT_FALSE(Sdp()->GetMediaSection(2).GetAttributeList().HasAttribute( ASSERT_FALSE(Sdp()->GetMediaSection(2).GetAttributeList().HasAttribute(

View File

@@ -177,7 +177,7 @@ TEST_F(VideoConduitTest, TestConfigureReceiveMediaCodecs) {
VideoCodecConfig codec(120, "VP8", EncodingConstraints()); VideoCodecConfig codec(120, "VP8", EncodingConstraints());
aControl.mVideoRecvCodecs = {codec}; aControl.mVideoRecvCodecs = {codec};
aControl.mVideoRecvRtpRtcpConfig = aControl.mVideoRecvRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
}); });
ASSERT_TRUE(Call()->mVideoReceiveConfig); ASSERT_TRUE(Call()->mVideoReceiveConfig);
ASSERT_EQ(Call()->mVideoReceiveConfig->decoders.size(), 1U); ASSERT_EQ(Call()->mVideoReceiveConfig->decoders.size(), 1U);
@@ -206,7 +206,7 @@ TEST_F(VideoConduitTest, TestConfigureReceiveMediaCodecsFEC) {
codecConfig, VideoCodecConfig(1, "ulpfec", EncodingConstraints()), codecConfig, VideoCodecConfig(1, "ulpfec", EncodingConstraints()),
VideoCodecConfig(2, "red", EncodingConstraints())}; VideoCodecConfig(2, "red", EncodingConstraints())};
aControl.mVideoRecvRtpRtcpConfig = aControl.mVideoRecvRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mReceiving = true; aControl.mReceiving = true;
}); });
ASSERT_TRUE(Call()->mVideoReceiveConfig); ASSERT_TRUE(Call()->mVideoReceiveConfig);
@@ -234,7 +234,7 @@ TEST_F(VideoConduitTest, TestConfigureReceiveMediaCodecsH264) {
aControl.mVideoRecvCodecs = { aControl.mVideoRecvCodecs = {
VideoCodecConfig(120, "H264", EncodingConstraints())}; VideoCodecConfig(120, "H264", EncodingConstraints())};
aControl.mVideoRecvRtpRtcpConfig = aControl.mVideoRecvRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
}); });
ASSERT_TRUE(Call()->mVideoReceiveConfig); ASSERT_TRUE(Call()->mVideoReceiveConfig);
ASSERT_EQ(Call()->mVideoReceiveConfig->decoders.size(), 1U); ASSERT_EQ(Call()->mVideoReceiveConfig->decoders.size(), 1U);
@@ -269,7 +269,7 @@ TEST_F(VideoConduitTest, TestConfigureReceiveMediaCodecsMultipleH264) {
h264_h.mLevel = 0x01; h264_h.mLevel = 0x01;
aControl.mVideoRecvCodecs = {h264_b, h264_h}; aControl.mVideoRecvCodecs = {h264_b, h264_h};
aControl.mVideoRecvRtpRtcpConfig = aControl.mVideoRecvRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
}); });
ASSERT_TRUE(Call()->mVideoReceiveConfig); ASSERT_TRUE(Call()->mVideoReceiveConfig);
ASSERT_EQ(Call()->mVideoReceiveConfig->decoders.size(), 2U); ASSERT_EQ(Call()->mVideoReceiveConfig->decoders.size(), 2U);
@@ -301,7 +301,7 @@ TEST_F(VideoConduitTest, TestConfigureReceiveMediaCodecsKeyframeRequestType) {
aControl.mReceiving = true; aControl.mReceiving = true;
aControl.mVideoRecvCodecs = {codecConfig}; aControl.mVideoRecvCodecs = {codecConfig};
aControl.mVideoRecvRtpRtcpConfig = aControl.mVideoRecvRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
}); });
ASSERT_TRUE(Call()->mVideoReceiveConfig); ASSERT_TRUE(Call()->mVideoReceiveConfig);
ASSERT_EQ(Call()->mVideoReceiveConfig->decoders.size(), 1U); ASSERT_EQ(Call()->mVideoReceiveConfig->decoders.size(), 1U);
@@ -340,7 +340,7 @@ TEST_F(VideoConduitTest, TestConfigureReceiveMediaCodecsNack) {
codecConfig.mNackFbTypes.push_back(""); codecConfig.mNackFbTypes.push_back("");
aControl.mVideoRecvCodecs = {codecConfig}; aControl.mVideoRecvCodecs = {codecConfig};
aControl.mVideoRecvRtpRtcpConfig = aControl.mVideoRecvRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
}); });
ASSERT_TRUE(Call()->mVideoReceiveConfig); ASSERT_TRUE(Call()->mVideoReceiveConfig);
ASSERT_EQ(Call()->mVideoReceiveConfig->decoders.size(), 1U); ASSERT_EQ(Call()->mVideoReceiveConfig->decoders.size(), 1U);
@@ -368,7 +368,7 @@ TEST_F(VideoConduitTest, TestConfigureReceiveMediaCodecsRemb) {
codecConfig.mRembFbSet = true; codecConfig.mRembFbSet = true;
aControl.mVideoRecvCodecs = {codecConfig}; aControl.mVideoRecvCodecs = {codecConfig};
aControl.mVideoRecvRtpRtcpConfig = aControl.mVideoRecvRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
}); });
ASSERT_TRUE(Call()->mVideoReceiveConfig); ASSERT_TRUE(Call()->mVideoReceiveConfig);
ASSERT_EQ(Call()->mVideoReceiveConfig->decoders.size(), 1U); ASSERT_EQ(Call()->mVideoReceiveConfig->decoders.size(), 1U);
@@ -396,7 +396,7 @@ TEST_F(VideoConduitTest, TestConfigureReceiveMediaCodecsTmmbr) {
codecConfig.mCcmFbTypes.push_back("tmmbr"); codecConfig.mCcmFbTypes.push_back("tmmbr");
aControl.mVideoRecvCodecs = {codecConfig}; aControl.mVideoRecvCodecs = {codecConfig};
aControl.mVideoRecvRtpRtcpConfig = aControl.mVideoRecvRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
}); });
ASSERT_TRUE(Call()->mVideoReceiveConfig); ASSERT_TRUE(Call()->mVideoReceiveConfig);
ASSERT_EQ(Call()->mVideoReceiveConfig->decoders.size(), 1U); ASSERT_EQ(Call()->mVideoReceiveConfig->decoders.size(), 1U);
@@ -425,7 +425,7 @@ TEST_F(VideoConduitTest, TestConfigureSendMediaCodec) {
codecConfig.mEncodings.emplace_back(); codecConfig.mEncodings.emplace_back();
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
}); });
ASSERT_TRUE(Call()->mVideoSendConfig); ASSERT_TRUE(Call()->mVideoSendConfig);
ASSERT_EQ(Call()->mVideoSendConfig->rtp.payload_name, "VP8"); ASSERT_EQ(Call()->mVideoSendConfig->rtp.payload_name, "VP8");
@@ -456,7 +456,7 @@ TEST_F(VideoConduitTest, TestConfigureSendMediaCodecMaxFps) {
codecConfig.mEncodings.emplace_back(); codecConfig.mEncodings.emplace_back();
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
}); });
ASSERT_TRUE(Call()->mVideoSendEncoderConfig); ASSERT_TRUE(Call()->mVideoSendEncoderConfig);
std::vector<webrtc::VideoStream> videoStreams; std::vector<webrtc::VideoStream> videoStreams;
@@ -486,7 +486,7 @@ TEST_F(VideoConduitTest, TestConfigureSendMediaCodecMaxMbps) {
codecConfig.mEncodings.emplace_back(); codecConfig.mEncodings.emplace_back();
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
}); });
ASSERT_TRUE(Call()->mVideoSendEncoderConfig); ASSERT_TRUE(Call()->mVideoSendEncoderConfig);
SendVideoFrame(640, 480, 1); SendVideoFrame(640, 480, 1);
@@ -516,7 +516,7 @@ TEST_F(VideoConduitTest, TestConfigureSendMediaCodecDefaults) {
codecConfig.mEncodings.emplace_back(); codecConfig.mEncodings.emplace_back();
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
}); });
{ {
@@ -550,7 +550,7 @@ TEST_F(VideoConduitTest, TestConfigureSendMediaCodecTias) {
codecConfigTias.mTias = 2000000; codecConfigTias.mTias = 2000000;
aControl.mVideoSendCodec = Some(codecConfigTias); aControl.mVideoSendCodec = Some(codecConfigTias);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
}); });
ASSERT_EQ(Call()->mVideoSendEncoderConfig->max_bitrate_bps, 2000000); ASSERT_EQ(Call()->mVideoSendEncoderConfig->max_bitrate_bps, 2000000);
{ {
@@ -592,7 +592,7 @@ TEST_F(VideoConduitTest, TestConfigureSendMediaCodecMaxBr) {
encoding.constraints.maxBr = 50000; encoding.constraints.maxBr = 50000;
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
}); });
ASSERT_TRUE(Call()->mVideoSendEncoderConfig); ASSERT_TRUE(Call()->mVideoSendEncoderConfig);
SendVideoFrame(1280, 720, 1); SendVideoFrame(1280, 720, 1);
@@ -618,7 +618,7 @@ TEST_F(VideoConduitTest, TestConfigureSendMediaCodecScaleResolutionBy) {
} }
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mLocalSsrcs = {42, 1729}; aControl.mLocalSsrcs = {42, 1729};
aControl.mLocalVideoRtxSsrcs = {43, 1730}; aControl.mLocalVideoRtxSsrcs = {43, 1730};
}); });
@@ -642,7 +642,7 @@ TEST_F(VideoConduitTest, TestConfigureSendMediaCodecCodecMode) {
codecConfig.mEncodings.emplace_back(); codecConfig.mEncodings.emplace_back();
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mVideoCodecMode = webrtc::VideoCodecMode::kScreensharing; aControl.mVideoCodecMode = webrtc::VideoCodecMode::kScreensharing;
}); });
ASSERT_TRUE(Call()->mVideoSendEncoderConfig); ASSERT_TRUE(Call()->mVideoSendEncoderConfig);
@@ -663,7 +663,7 @@ TEST_F(VideoConduitTest, TestConfigureSendMediaCodecFEC) {
codecConfig.mREDRTXPayloadType = 3; codecConfig.mREDRTXPayloadType = 3;
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
}); });
ASSERT_TRUE(Call()->mVideoSendConfig); ASSERT_TRUE(Call()->mVideoSendConfig);
ASSERT_EQ(Call()->mVideoSendConfig->rtp.ulpfec.ulpfec_payload_type, 1); ASSERT_EQ(Call()->mVideoSendConfig->rtp.ulpfec.ulpfec_payload_type, 1);
@@ -715,7 +715,7 @@ TEST_F(VideoConduitTest, TestConfigureSendMediaCodecNack) {
codecConfig.mEncodings.emplace_back(); codecConfig.mEncodings.emplace_back();
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
}); });
ASSERT_TRUE(Call()->mVideoSendConfig); ASSERT_TRUE(Call()->mVideoSendConfig);
ASSERT_EQ(Call()->mVideoSendConfig->rtp.nack.rtp_history_ms, 0); ASSERT_EQ(Call()->mVideoSendConfig->rtp.nack.rtp_history_ms, 0);
@@ -736,7 +736,7 @@ TEST_F(VideoConduitTest, TestConfigureSendMediaCodecRids) {
codecConfig.mEncodings.emplace_back(); codecConfig.mEncodings.emplace_back();
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
}); });
ASSERT_TRUE(Call()->mVideoSendConfig); ASSERT_TRUE(Call()->mVideoSendConfig);
ASSERT_EQ(Call()->mVideoSendConfig->rtp.rids.size(), 0U); ASSERT_EQ(Call()->mVideoSendConfig->rtp.rids.size(), 0U);
@@ -769,7 +769,7 @@ TEST_F(VideoConduitTest, TestOnSinkWantsChanged) {
codecConfig.mEncodingConstraints.maxFs = 0; codecConfig.mEncodingConstraints.maxFs = 0;
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
}); });
ASSERT_TRUE(Call()->mVideoSendEncoderConfig); ASSERT_TRUE(Call()->mVideoSendEncoderConfig);
rtc::VideoSinkWants wants; rtc::VideoSinkWants wants;
@@ -857,7 +857,7 @@ TEST_F(VideoConduitTestScalingLocked, TestOnSinkWantsChanged) {
codecConfig.mEncodings.emplace_back(); codecConfig.mEncodings.emplace_back();
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
}); });
ASSERT_TRUE(Call()->mVideoSendEncoderConfig); ASSERT_TRUE(Call()->mVideoSendEncoderConfig);
rtc::VideoSinkWants wants; rtc::VideoSinkWants wants;
@@ -911,7 +911,7 @@ TEST_P(VideoConduitCodecModeTest,
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
} }
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mVideoCodecMode = GetParam(); aControl.mVideoCodecMode = GetParam();
aControl.mLocalSsrcs = {42, 43, 44}; aControl.mLocalSsrcs = {42, 43, 44};
aControl.mLocalVideoRtxSsrcs = {45, 46, 47}; aControl.mLocalVideoRtxSsrcs = {45, 46, 47};
@@ -971,7 +971,7 @@ TEST_P(VideoConduitCodecModeTest,
} }
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mVideoCodecMode = GetParam(); aControl.mVideoCodecMode = GetParam();
aControl.mLocalSsrcs = {42, 43, 44}; aControl.mLocalSsrcs = {42, 43, 44};
aControl.mLocalVideoRtxSsrcs = {45, 46, 47}; aControl.mLocalVideoRtxSsrcs = {45, 46, 47};
@@ -1050,7 +1050,7 @@ TEST_F(VideoConduitTest, TestReconfigureReceiveMediaCodecs) {
aControl.mVideoRecvCodecs = { aControl.mVideoRecvCodecs = {
VideoCodecConfig(120, "VP8", EncodingConstraints())}; VideoCodecConfig(120, "VP8", EncodingConstraints())};
aControl.mVideoRecvRtpRtcpConfig = aControl.mVideoRecvRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
}); });
ASSERT_TRUE(Call()->mVideoReceiveConfig); ASSERT_TRUE(Call()->mVideoReceiveConfig);
ASSERT_EQ(Call()->mVideoReceiveConfig->decoders.size(), 1U); ASSERT_EQ(Call()->mVideoReceiveConfig->decoders.size(), 1U);
@@ -1199,7 +1199,7 @@ TEST_P(VideoConduitCodecModeTest, TestReconfigureSendMediaCodec) {
codecConfig.mEncodings.emplace_back(); codecConfig.mEncodings.emplace_back();
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mVideoCodecMode = GetParam(); aControl.mVideoCodecMode = GetParam();
}); });
ASSERT_FALSE(Call()->mVideoSendConfig); ASSERT_FALSE(Call()->mVideoSendConfig);
@@ -1349,7 +1349,7 @@ TEST_P(VideoConduitCodecModeTest,
codecConfig.mEncodings.emplace_back(); codecConfig.mEncodings.emplace_back();
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mVideoCodecMode = GetParam(); aControl.mVideoCodecMode = GetParam();
}); });
ASSERT_FALSE(Call()->mVideoSendConfig); ASSERT_FALSE(Call()->mVideoSendConfig);
@@ -1507,7 +1507,7 @@ TEST_P(VideoConduitCodecModeTest, TestVideoEncode) {
codecConfig.mEncodings.emplace_back(); codecConfig.mEncodings.emplace_back();
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mVideoCodecMode = GetParam(); aControl.mVideoCodecMode = GetParam();
}); });
ASSERT_TRUE(Call()->mVideoSendEncoderConfig); ASSERT_TRUE(Call()->mVideoSendEncoderConfig);
@@ -1539,7 +1539,7 @@ TEST_P(VideoConduitCodecModeTest, TestVideoEncodeMaxFs) {
codecConfig.mEncodings.emplace_back(); codecConfig.mEncodings.emplace_back();
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mVideoCodecMode = GetParam(); aControl.mVideoCodecMode = GetParam();
}); });
ASSERT_TRUE(Call()->mVideoSendEncoderConfig); ASSERT_TRUE(Call()->mVideoSendEncoderConfig);
@@ -1625,7 +1625,7 @@ TEST_P(VideoConduitCodecModeTest, TestVideoEncodeMaxFsNegotiatedThenSinkWants) {
codecConfig.mEncodingConstraints.maxFs = 3500; codecConfig.mEncodingConstraints.maxFs = 3500;
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mVideoCodecMode = GetParam(); aControl.mVideoCodecMode = GetParam();
}); });
ASSERT_TRUE(Call()->mVideoSendEncoderConfig); ASSERT_TRUE(Call()->mVideoSendEncoderConfig);
@@ -1667,7 +1667,7 @@ TEST_P(VideoConduitCodecModeTest, TestVideoEncodeMaxFsCodecChange) {
codecConfig.mEncodingConstraints.maxFs = 3500; codecConfig.mEncodingConstraints.maxFs = 3500;
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mVideoCodecMode = GetParam(); aControl.mVideoCodecMode = GetParam();
}); });
ASSERT_TRUE(Call()->mVideoSendEncoderConfig); ASSERT_TRUE(Call()->mVideoSendEncoderConfig);
@@ -1713,7 +1713,7 @@ TEST_P(VideoConduitCodecModeTest,
codecConfig.mEncodings.emplace_back(); codecConfig.mEncodings.emplace_back();
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mVideoCodecMode = GetParam(); aControl.mVideoCodecMode = GetParam();
}); });
ASSERT_TRUE(Call()->mVideoSendEncoderConfig); ASSERT_TRUE(Call()->mVideoSendEncoderConfig);
@@ -1759,7 +1759,7 @@ TEST_P(VideoConduitCodecModeTest, TestVideoEncodeMaxFsNegotiated) {
codecConfig.mEncodings.emplace_back(); codecConfig.mEncodings.emplace_back();
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mVideoCodecMode = GetParam(); aControl.mVideoCodecMode = GetParam();
}); });
ASSERT_TRUE(Call()->mVideoSendEncoderConfig); ASSERT_TRUE(Call()->mVideoSendEncoderConfig);
@@ -1814,7 +1814,7 @@ TEST_P(VideoConduitCodecModeTest, TestVideoEncodeMaxWidthAndHeight) {
codecConfig.mEncodings.emplace_back(); codecConfig.mEncodings.emplace_back();
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mVideoCodecMode = GetParam(); aControl.mVideoCodecMode = GetParam();
}); });
ASSERT_TRUE(Call()->mVideoSendEncoderConfig); ASSERT_TRUE(Call()->mVideoSendEncoderConfig);
@@ -1852,7 +1852,7 @@ TEST_P(VideoConduitCodecModeTest, TestVideoEncodeScaleResolutionBy) {
encoding.constraints.scaleDownBy = 2; encoding.constraints.scaleDownBy = 2;
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mVideoCodecMode = GetParam(); aControl.mVideoCodecMode = GetParam();
}); });
ASSERT_TRUE(Call()->mVideoSendEncoderConfig); ASSERT_TRUE(Call()->mVideoSendEncoderConfig);
@@ -1899,7 +1899,7 @@ TEST_P(VideoConduitCodecModeTest, TestVideoEncodeSimulcastScaleResolutionBy) {
aControl.mTransmitting = true; aControl.mTransmitting = true;
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mVideoCodecMode = GetParam(); aControl.mVideoCodecMode = GetParam();
aControl.mLocalSsrcs = {42, 43, 44}; aControl.mLocalSsrcs = {42, 43, 44};
aControl.mLocalVideoRtxSsrcs = {45, 46, 47}; aControl.mLocalVideoRtxSsrcs = {45, 46, 47};
@@ -1945,7 +1945,7 @@ TEST_P(VideoConduitCodecModeTest,
} }
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mVideoCodecMode = GetParam(); aControl.mVideoCodecMode = GetParam();
aControl.mLocalSsrcs = scales; aControl.mLocalSsrcs = scales;
}); });
@@ -2027,7 +2027,7 @@ TEST_P(VideoConduitCodecModeTest,
} }
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mVideoCodecMode = GetParam(); aControl.mVideoCodecMode = GetParam();
aControl.mLocalSsrcs = scales; aControl.mLocalSsrcs = scales;
}); });
@@ -2122,7 +2122,7 @@ TEST_P(VideoConduitCodecModeTest, TestVideoEncodeResolutionAlignment) {
} }
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mVideoCodecMode = GetParam(); aControl.mVideoCodecMode = GetParam();
aControl.mLocalSsrcs = scales; aControl.mLocalSsrcs = scales;
}); });
@@ -2156,7 +2156,7 @@ TEST_F(VideoConduitTest, TestSettingRtpRtcpRsize) {
mControl.Update([&](auto& aControl) { mControl.Update([&](auto& aControl) {
VideoCodecConfig codecConfig(120, "VP8", EncodingConstraints()); VideoCodecConfig codecConfig(120, "VP8", EncodingConstraints());
codecConfig.mEncodings.emplace_back(); codecConfig.mEncodings.emplace_back();
RtpRtcpConfig rtcpConf(webrtc::RtcpMode::kReducedSize); RtpRtcpConfig rtcpConf(webrtc::RtcpMode::kReducedSize, true);
aControl.mReceiving = true; aControl.mReceiving = true;
aControl.mVideoRecvCodecs = {codecConfig}; aControl.mVideoRecvCodecs = {codecConfig};
@@ -2181,7 +2181,7 @@ TEST_F(VideoConduitTest, TestRemoteSsrcDefault) {
codecConfig.mEncodings.emplace_back(); codecConfig.mEncodings.emplace_back();
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mReceiving = true; aControl.mReceiving = true;
aControl.mTransmitting = true; aControl.mTransmitting = true;
}); });
@@ -2202,7 +2202,7 @@ TEST_F(VideoConduitTest, TestRemoteSsrcCollision) {
codecConfig.mEncodings.emplace_back(); codecConfig.mEncodings.emplace_back();
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mReceiving = true; aControl.mReceiving = true;
aControl.mTransmitting = true; aControl.mTransmitting = true;
}); });
@@ -2223,7 +2223,7 @@ TEST_F(VideoConduitTest, TestLocalSsrcDefault) {
codecConfig.mEncodings.emplace_back(); codecConfig.mEncodings.emplace_back();
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mReceiving = true; aControl.mReceiving = true;
aControl.mTransmitting = true; aControl.mTransmitting = true;
}); });
@@ -2245,7 +2245,7 @@ TEST_F(VideoConduitTest, TestLocalSsrcCollision) {
codecConfig.mEncodings.emplace_back(); codecConfig.mEncodings.emplace_back();
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mReceiving = true; aControl.mReceiving = true;
aControl.mTransmitting = true; aControl.mTransmitting = true;
}); });
@@ -2268,7 +2268,7 @@ TEST_F(VideoConduitTest, TestLocalSsrcUnorderedCollision) {
} }
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mReceiving = true; aControl.mReceiving = true;
aControl.mTransmitting = true; aControl.mTransmitting = true;
}); });
@@ -2291,7 +2291,7 @@ TEST_F(VideoConduitTest, TestLocalAndRemoteSsrcCollision) {
} }
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mReceiving = true; aControl.mReceiving = true;
aControl.mTransmitting = true; aControl.mTransmitting = true;
}); });
@@ -2362,7 +2362,7 @@ TEST_F(VideoConduitTest, TestVideoConfigurationH264) {
codecConfig.mEncodings.emplace_back(); codecConfig.mEncodings.emplace_back();
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
}); });
ASSERT_TRUE(Call()->mVideoSendEncoderConfig); ASSERT_TRUE(Call()->mVideoSendEncoderConfig);
@@ -2408,7 +2408,7 @@ TEST_F(VideoConduitTest, TestVideoConfigurationAV1) {
codecConfig.mEncodings.emplace_back(); codecConfig.mEncodings.emplace_back();
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
}); });
ASSERT_TRUE(Call()->mVideoSendEncoderConfig); ASSERT_TRUE(Call()->mVideoSendEncoderConfig);
@@ -2432,7 +2432,7 @@ TEST_F(VideoConduitTest, TestDegradationPreferences) {
codecConfig.mEncodings.emplace_back(); codecConfig.mEncodings.emplace_back();
aControl.mVideoSendCodec = Some(codecConfig); aControl.mVideoSendCodec = Some(codecConfig);
aControl.mVideoSendRtpRtcpConfig = aControl.mVideoSendRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mReceiving = true; aControl.mReceiving = true;
aControl.mTransmitting = true; aControl.mTransmitting = true;
}); });
@@ -2555,7 +2555,7 @@ TEST_F(VideoConduitTest, TestRemoteRtxSsrc) {
codecConfig.mRTXPayloadType = 121; codecConfig.mRTXPayloadType = 121;
aControl.mVideoRecvCodecs = {codecConfig}; aControl.mVideoRecvCodecs = {codecConfig};
aControl.mVideoRecvRtpRtcpConfig = aControl.mVideoRecvRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mReceiving = true; aControl.mReceiving = true;
aControl.mRemoteSsrc = 2; aControl.mRemoteSsrc = 2;
aControl.mRemoteVideoRtxSsrc = 43; aControl.mRemoteVideoRtxSsrc = 43;
@@ -2576,7 +2576,7 @@ TEST_F(VideoConduitTest, TestRemoteRtxSsrc) {
codecConfig264.mRTXPayloadType = 97; codecConfig264.mRTXPayloadType = 97;
aControl.mVideoRecvCodecs = {codecConfig, codecConfig264}; aControl.mVideoRecvCodecs = {codecConfig, codecConfig264};
aControl.mVideoRecvRtpRtcpConfig = aControl.mVideoRecvRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mReceiving = true; aControl.mReceiving = true;
aControl.mRemoteSsrc = 2; aControl.mRemoteSsrc = 2;
aControl.mRemoteVideoRtxSsrc = 43; aControl.mRemoteVideoRtxSsrc = 43;
@@ -2594,7 +2594,7 @@ TEST_F(VideoConduitTest, TestRemoteRtxSsrc) {
codecConfig.mEncodings.emplace_back(); codecConfig.mEncodings.emplace_back();
aControl.mVideoRecvCodecs = {codecConfig, codecConfig264}; aControl.mVideoRecvCodecs = {codecConfig, codecConfig264};
aControl.mVideoRecvRtpRtcpConfig = aControl.mVideoRecvRtpRtcpConfig =
Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound)); Some(RtpRtcpConfig(webrtc::RtcpMode::kCompound, true));
aControl.mReceiving = true; aControl.mReceiving = true;
aControl.mRemoteSsrc = 2; aControl.mRemoteSsrc = 2;
aControl.mRemoteVideoRtxSsrc = 43; aControl.mRemoteVideoRtxSsrc = 43;

View File

@@ -196,6 +196,7 @@ typedef enum {
SDP_ATTR_MAXMESSAGESIZE, SDP_ATTR_MAXMESSAGESIZE,
SDP_ATTR_SSRC_GROUP, SDP_ATTR_SSRC_GROUP,
SDP_ATTR_RTCP_RSIZE, SDP_ATTR_RTCP_RSIZE,
SDP_ATTR_EXTMAP_ALLOW_MIXED,
SDP_MAX_ATTR_TYPES, SDP_MAX_ATTR_TYPES,
SDP_ATTR_INVALID SDP_ATTR_INVALID
} sdp_attr_e; } sdp_attr_e;

View File

@@ -210,6 +210,8 @@ const sdp_attrarray_t sdp_attr[SDP_MAX_ATTR_TYPES] =
sdp_build_attr_ssrc_group}, sdp_build_attr_ssrc_group},
{"rtcp-rsize", sizeof("rtcp-rsize"), {"rtcp-rsize", sizeof("rtcp-rsize"),
sdp_parse_attr_simple_flag, sdp_build_attr_simple_flag}, sdp_parse_attr_simple_flag, sdp_build_attr_simple_flag},
{"extmap-allow-mixed", sizeof("extmap-allow-mixed"),
sdp_parse_attr_simple_flag, sdp_build_attr_simple_flag},
}; };
/* Note: These *must* be in the same order as the enum types. */ /* Note: These *must* be in the same order as the enum types. */