forked from mirrors/gecko-dev
Bug 1900114 - Add signaling for Baseline H264.;r=bwc
Differential Revision: https://phabricator.services.mozilla.com/D212312
This commit is contained in:
parent
c5b740ac69
commit
6f56305f43
9 changed files with 175 additions and 186 deletions
|
|
@ -713,9 +713,13 @@ class ConfigureCodec {
|
|||
static_cast<JsepVideoCodecDescription&>(*codec);
|
||||
|
||||
if (videoCodec.mName == "H264") {
|
||||
// Override level
|
||||
videoCodec.mProfileLevelId &= 0xFFFF00;
|
||||
videoCodec.mProfileLevelId |= mH264Level;
|
||||
// Override level but not for the pure Baseline codec
|
||||
if (JsepVideoCodecDescription::GetSubprofile(
|
||||
videoCodec.mProfileLevelId) ==
|
||||
JsepVideoCodecDescription::kH264ConstrainedBaseline) {
|
||||
videoCodec.mProfileLevelId &= 0xFFFF00;
|
||||
videoCodec.mProfileLevelId |= mH264Level;
|
||||
}
|
||||
|
||||
videoCodec.mConstraints.maxBr = mH264MaxBr;
|
||||
|
||||
|
|
@ -2246,6 +2250,8 @@ void PeerConnectionImpl::SendWarningToConsole(const nsCString& aWarning) {
|
|||
void PeerConnectionImpl::GetDefaultVideoCodecs(
|
||||
std::vector<UniquePtr<JsepCodecDescription>>& aSupportedCodecs,
|
||||
bool aUseRtx) {
|
||||
const bool disableBaseline = Preferences::GetBool(
|
||||
"media.navigator.video.disable_h264_baseline", false);
|
||||
// Supported video codecs.
|
||||
// Note: order here implies priority for building offers!
|
||||
aSupportedCodecs.emplace_back(
|
||||
|
|
@ -2256,6 +2262,15 @@ void PeerConnectionImpl::GetDefaultVideoCodecs(
|
|||
JsepVideoCodecDescription::CreateDefaultH264_1(aUseRtx));
|
||||
aSupportedCodecs.emplace_back(
|
||||
JsepVideoCodecDescription::CreateDefaultH264_0(aUseRtx));
|
||||
|
||||
// Only add Baseline if it hasn't been disabled.
|
||||
if (!disableBaseline) {
|
||||
aSupportedCodecs.emplace_back(
|
||||
JsepVideoCodecDescription::CreateDefaultH264Baseline_1(aUseRtx));
|
||||
aSupportedCodecs.emplace_back(
|
||||
JsepVideoCodecDescription::CreateDefaultH264Baseline_0(aUseRtx));
|
||||
}
|
||||
|
||||
aSupportedCodecs.emplace_back(
|
||||
JsepVideoCodecDescription::CreateDefaultUlpFec());
|
||||
aSupportedCodecs.emplace_back(
|
||||
|
|
|
|||
|
|
@ -441,6 +441,30 @@ class JsepVideoCodecDescription : public JsepCodecDescription {
|
|||
return codec;
|
||||
}
|
||||
|
||||
static UniquePtr<JsepVideoCodecDescription> CreateDefaultH264Baseline_0(
|
||||
bool aUseRtx) {
|
||||
auto codec = MakeUnique<JsepVideoCodecDescription>("103", "H264", 90000);
|
||||
codec->mPacketizationMode = 0;
|
||||
// Defaults for mandatory params
|
||||
codec->mProfileLevelId = 0x42001F;
|
||||
if (aUseRtx) {
|
||||
codec->EnableRtx("104");
|
||||
}
|
||||
return codec;
|
||||
}
|
||||
|
||||
static UniquePtr<JsepVideoCodecDescription> CreateDefaultH264Baseline_1(
|
||||
bool aUseRtx) {
|
||||
auto codec = MakeUnique<JsepVideoCodecDescription>("105", "H264", 90000);
|
||||
codec->mPacketizationMode = 1;
|
||||
// Defaults for mandatory params
|
||||
codec->mProfileLevelId = 0x42001F;
|
||||
if (aUseRtx) {
|
||||
codec->EnableRtx("106");
|
||||
}
|
||||
return codec;
|
||||
}
|
||||
|
||||
static UniquePtr<JsepVideoCodecDescription> CreateDefaultUlpFec() {
|
||||
return MakeUnique<JsepVideoCodecDescription>(
|
||||
"123", // payload type
|
||||
|
|
@ -1165,7 +1189,7 @@ class JsepApplicationCodecDescription : public JsepCodecDescription {
|
|||
}
|
||||
|
||||
void ApplyConfigToFmtp(
|
||||
UniquePtr<SdpFmtpAttributeList::Parameters>& aFmtp) const override{};
|
||||
UniquePtr<SdpFmtpAttributeList::Parameters>& aFmtp) const override {};
|
||||
|
||||
uint16_t mLocalPort;
|
||||
uint32_t mLocalMaxMessageSize;
|
||||
|
|
|
|||
|
|
@ -358,7 +358,9 @@ var sdputils = {
|
|||
if (testOptions.h264) {
|
||||
ok(
|
||||
desc.sdp.includes("a=rtpmap:126 H264/90000") ||
|
||||
desc.sdp.includes("a=rtpmap:97 H264/90000"),
|
||||
desc.sdp.includes("a=rtpmap:97 H264/90000") ||
|
||||
desc.sdp.includes("a=rtpmap:103 H264/90000") ||
|
||||
desc.sdp.includes("a=rtpmap:105 H264/90000"),
|
||||
"H.264 codec is present in SDP"
|
||||
);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1121,8 +1121,11 @@ function pedanticChecks(report) {
|
|||
break;
|
||||
case "video/H264":
|
||||
ok(
|
||||
stat.payloadType == 97 || stat.payloadType == 126,
|
||||
`codec.payloadType for H264 was ${stat.payloadType}, exp. 97 or 126`
|
||||
stat.payloadType == 97 ||
|
||||
stat.payloadType == 126 ||
|
||||
stat.payloadType == 103 ||
|
||||
stat.payloadType == 105,
|
||||
`codec.payloadType for H264 was ${stat.payloadType}, exp. 97, 126, 103, or 105`
|
||||
);
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
async function testScreenshare(payloadType) {
|
||||
const options = {};
|
||||
options.h264 = payloadType == 97 || payloadType == 126;
|
||||
options.h264 = payloadType == 97 || payloadType == 126 || payloadType == 103 || payloadType == 105;
|
||||
const test = new PeerConnectionTest(options);
|
||||
const constraints = {
|
||||
video: { mediaSource: "screen" },
|
||||
|
|
@ -43,9 +43,11 @@
|
|||
ok(pts.includes("120"), "VP8 is supported");
|
||||
ok(pts.includes("121"), "VP9 is supported");
|
||||
if (pts.length > 2) {
|
||||
is(pts.length, 6, "Expected VP8, VP9, two variants of H264, ULPFEC, and RED");
|
||||
is(pts.length, 8, "Expected VP8, VP9, four variants of H264, ULPFEC, and RED");
|
||||
ok(pts.includes("97"), "H264 with no packetization-mode is supported");
|
||||
ok(pts.includes("126"), "H264 with packetization-mode=1 is supported");
|
||||
ok(pts.includes("103"), "H264 Baseline with no packetization-mode is supported");
|
||||
ok(pts.includes("105"), "H264 Baseline with packetization-mode=1 is supported");
|
||||
ok(pts.includes("122"), "RED is supported");
|
||||
ok(pts.includes("123"), "ULPFEC is supported");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3290,7 +3290,7 @@ TEST_F(JsepSessionTest, ValidateOfferedVideoCodecParams) {
|
|||
const auto& video_attrs = video_section.GetAttributeList();
|
||||
ASSERT_EQ(SdpDirectionAttribute::kSendrecv, video_attrs.GetDirection());
|
||||
|
||||
ASSERT_EQ(11U, video_section.GetFormats().size());
|
||||
ASSERT_EQ(15U, video_section.GetFormats().size());
|
||||
ASSERT_EQ("120", video_section.GetFormats()[0]);
|
||||
ASSERT_EQ("124", video_section.GetFormats()[1]);
|
||||
ASSERT_EQ("121", video_section.GetFormats()[2]);
|
||||
|
|
@ -3299,9 +3299,13 @@ TEST_F(JsepSessionTest, ValidateOfferedVideoCodecParams) {
|
|||
ASSERT_EQ("127", video_section.GetFormats()[5]);
|
||||
ASSERT_EQ("97", video_section.GetFormats()[6]);
|
||||
ASSERT_EQ("98", video_section.GetFormats()[7]);
|
||||
ASSERT_EQ("123", video_section.GetFormats()[8]);
|
||||
ASSERT_EQ("122", video_section.GetFormats()[9]);
|
||||
ASSERT_EQ("119", video_section.GetFormats()[10]);
|
||||
ASSERT_EQ("105", video_section.GetFormats()[8]);
|
||||
ASSERT_EQ("106", video_section.GetFormats()[9]);
|
||||
ASSERT_EQ("103", video_section.GetFormats()[10]);
|
||||
ASSERT_EQ("104", video_section.GetFormats()[11]);
|
||||
ASSERT_EQ("123", video_section.GetFormats()[12]);
|
||||
ASSERT_EQ("122", video_section.GetFormats()[13]);
|
||||
ASSERT_EQ("119", video_section.GetFormats()[14]);
|
||||
|
||||
// Validate rtpmap
|
||||
ASSERT_TRUE(video_attrs.HasAttribute(SdpAttribute::kRtpmapAttribute));
|
||||
|
|
@ -3312,6 +3316,10 @@ TEST_F(JsepSessionTest, ValidateOfferedVideoCodecParams) {
|
|||
ASSERT_TRUE(rtpmaps.HasEntry("125"));
|
||||
ASSERT_TRUE(rtpmaps.HasEntry("126"));
|
||||
ASSERT_TRUE(rtpmaps.HasEntry("127"));
|
||||
ASSERT_TRUE(rtpmaps.HasEntry("105"));
|
||||
ASSERT_TRUE(rtpmaps.HasEntry("106"));
|
||||
ASSERT_TRUE(rtpmaps.HasEntry("103"));
|
||||
ASSERT_TRUE(rtpmaps.HasEntry("104"));
|
||||
ASSERT_TRUE(rtpmaps.HasEntry("97"));
|
||||
ASSERT_TRUE(rtpmaps.HasEntry("98"));
|
||||
ASSERT_TRUE(rtpmaps.HasEntry("123"));
|
||||
|
|
@ -3326,6 +3334,10 @@ TEST_F(JsepSessionTest, ValidateOfferedVideoCodecParams) {
|
|||
const auto& h264_1_rtx_entry = rtpmaps.GetEntry("127");
|
||||
const auto& h264_0_entry = rtpmaps.GetEntry("97");
|
||||
const auto& h264_0_rtx_entry = rtpmaps.GetEntry("98");
|
||||
const auto& h264_baseline_1_entry = rtpmaps.GetEntry("105");
|
||||
const auto& h264_baseline_1_rtx_entry = rtpmaps.GetEntry("106");
|
||||
const auto& h264_baseline_0_entry = rtpmaps.GetEntry("103");
|
||||
const auto& h264_baseline_0_rtx_entry = rtpmaps.GetEntry("104");
|
||||
const auto& ulpfec_0_entry = rtpmaps.GetEntry("123");
|
||||
const auto& red_0_entry = rtpmaps.GetEntry("122");
|
||||
const auto& red_0_rtx_entry = rtpmaps.GetEntry("119");
|
||||
|
|
@ -3338,6 +3350,10 @@ TEST_F(JsepSessionTest, ValidateOfferedVideoCodecParams) {
|
|||
ASSERT_EQ("rtx", h264_1_rtx_entry.name);
|
||||
ASSERT_EQ("H264", h264_0_entry.name);
|
||||
ASSERT_EQ("rtx", h264_0_rtx_entry.name);
|
||||
ASSERT_EQ("H264", h264_baseline_1_entry.name);
|
||||
ASSERT_EQ("rtx", h264_baseline_1_rtx_entry.name);
|
||||
ASSERT_EQ("H264", h264_baseline_0_entry.name);
|
||||
ASSERT_EQ("rtx", h264_baseline_0_rtx_entry.name);
|
||||
ASSERT_EQ("red", red_0_entry.name);
|
||||
ASSERT_EQ("ulpfec", ulpfec_0_entry.name);
|
||||
ASSERT_EQ("rtx", red_0_rtx_entry.name);
|
||||
|
|
@ -3346,7 +3362,7 @@ TEST_F(JsepSessionTest, ValidateOfferedVideoCodecParams) {
|
|||
ASSERT_TRUE(video_attrs.HasAttribute(SdpAttribute::kFmtpAttribute));
|
||||
auto& fmtps = video_attrs.GetFmtp().mFmtps;
|
||||
|
||||
ASSERT_EQ(9U, fmtps.size());
|
||||
ASSERT_EQ(13U, fmtps.size());
|
||||
|
||||
// VP8
|
||||
const SdpFmtpAttributeList::Parameters* vp8_params =
|
||||
|
|
@ -3443,6 +3459,60 @@ TEST_F(JsepSessionTest, ValidateOfferedVideoCodecParams) {
|
|||
|
||||
ASSERT_EQ((uint32_t)97, parsed_h264_0_rtx_params.apt);
|
||||
|
||||
// H264 Baseline packetization mode 1
|
||||
const SdpFmtpAttributeList::Parameters* h264_baseline_1_params =
|
||||
video_section.FindFmtp("105");
|
||||
ASSERT_TRUE(h264_baseline_1_params);
|
||||
ASSERT_EQ(SdpRtpmapAttributeList::kH264, h264_baseline_1_params->codec_type);
|
||||
|
||||
const auto& parsed_h264_baseline_1_params =
|
||||
*static_cast<const SdpFmtpAttributeList::H264Parameters*>(
|
||||
h264_baseline_1_params);
|
||||
|
||||
ASSERT_EQ((uint32_t)0x42001f, parsed_h264_baseline_1_params.profile_level_id);
|
||||
ASSERT_TRUE(parsed_h264_baseline_1_params.level_asymmetry_allowed);
|
||||
ASSERT_EQ(1U, parsed_h264_baseline_1_params.packetization_mode);
|
||||
|
||||
// H264 Baseline packetization mode 1 RTX
|
||||
const SdpFmtpAttributeList::Parameters* h264_baseline_1_rtx_params =
|
||||
video_section.FindFmtp("106");
|
||||
ASSERT_TRUE(h264_baseline_1_rtx_params);
|
||||
ASSERT_EQ(SdpRtpmapAttributeList::kRtx,
|
||||
h264_baseline_1_rtx_params->codec_type);
|
||||
|
||||
const auto& parsed_h264__baseline_1_rtx_params =
|
||||
*static_cast<const SdpFmtpAttributeList::RtxParameters*>(
|
||||
h264_baseline_1_rtx_params);
|
||||
|
||||
ASSERT_EQ((uint32_t)105, parsed_h264__baseline_1_rtx_params.apt);
|
||||
|
||||
// H264 Baseline packetization mode 0
|
||||
const SdpFmtpAttributeList::Parameters* h264_baseline_0_params =
|
||||
video_section.FindFmtp("103");
|
||||
ASSERT_TRUE(h264_baseline_0_params);
|
||||
ASSERT_EQ(SdpRtpmapAttributeList::kH264, h264_baseline_0_params->codec_type);
|
||||
|
||||
const auto& parsed_h264_baseline_0_params =
|
||||
*static_cast<const SdpFmtpAttributeList::H264Parameters*>(
|
||||
h264_baseline_0_params);
|
||||
|
||||
ASSERT_EQ((uint32_t)0x42001f, parsed_h264_baseline_0_params.profile_level_id);
|
||||
ASSERT_TRUE(parsed_h264_baseline_0_params.level_asymmetry_allowed);
|
||||
ASSERT_EQ(0U, parsed_h264_baseline_0_params.packetization_mode);
|
||||
|
||||
// H264 Baseline packetization mode 0 RTX
|
||||
const SdpFmtpAttributeList::Parameters* h264__baseline_0_rtx_params =
|
||||
video_section.FindFmtp("104");
|
||||
ASSERT_TRUE(h264__baseline_0_rtx_params);
|
||||
ASSERT_EQ(SdpRtpmapAttributeList::kRtx,
|
||||
h264__baseline_0_rtx_params->codec_type);
|
||||
|
||||
const auto& parsed_h264_baseline_0_rtx_params =
|
||||
*static_cast<const SdpFmtpAttributeList::RtxParameters*>(
|
||||
h264__baseline_0_rtx_params);
|
||||
|
||||
ASSERT_EQ((uint32_t)103, parsed_h264_baseline_0_rtx_params.apt);
|
||||
|
||||
// red RTX
|
||||
const SdpFmtpAttributeList::Parameters* red_rtx_params =
|
||||
video_section.FindFmtp("119");
|
||||
|
|
@ -3572,7 +3642,7 @@ TEST_F(JsepSessionTest, ValidateNoFmtpLineForRedInOfferAndAnswer) {
|
|||
auto& video_attrs = video_section.GetAttributeList();
|
||||
ASSERT_EQ(SdpDirectionAttribute::kSendrecv, video_attrs.GetDirection());
|
||||
|
||||
ASSERT_EQ(11U, video_section.GetFormats().size());
|
||||
ASSERT_EQ(15U, video_section.GetFormats().size());
|
||||
ASSERT_EQ("120", video_section.GetFormats()[0]);
|
||||
ASSERT_EQ("124", video_section.GetFormats()[1]);
|
||||
ASSERT_EQ("121", video_section.GetFormats()[2]);
|
||||
|
|
@ -3581,9 +3651,13 @@ TEST_F(JsepSessionTest, ValidateNoFmtpLineForRedInOfferAndAnswer) {
|
|||
ASSERT_EQ("127", video_section.GetFormats()[5]);
|
||||
ASSERT_EQ("97", video_section.GetFormats()[6]);
|
||||
ASSERT_EQ("98", video_section.GetFormats()[7]);
|
||||
ASSERT_EQ("123", video_section.GetFormats()[8]);
|
||||
ASSERT_EQ("122", video_section.GetFormats()[9]);
|
||||
ASSERT_EQ("119", video_section.GetFormats()[10]);
|
||||
ASSERT_EQ("105", video_section.GetFormats()[8]);
|
||||
ASSERT_EQ("106", video_section.GetFormats()[9]);
|
||||
ASSERT_EQ("103", video_section.GetFormats()[10]);
|
||||
ASSERT_EQ("104", video_section.GetFormats()[11]);
|
||||
ASSERT_EQ("123", video_section.GetFormats()[12]);
|
||||
ASSERT_EQ("122", video_section.GetFormats()[13]);
|
||||
ASSERT_EQ("119", video_section.GetFormats()[14]);
|
||||
|
||||
// Validate rtpmap
|
||||
ASSERT_TRUE(video_attrs.HasAttribute(SdpAttribute::kRtpmapAttribute));
|
||||
|
|
@ -3596,6 +3670,10 @@ TEST_F(JsepSessionTest, ValidateNoFmtpLineForRedInOfferAndAnswer) {
|
|||
ASSERT_TRUE(rtpmaps.HasEntry("127"));
|
||||
ASSERT_TRUE(rtpmaps.HasEntry("97"));
|
||||
ASSERT_TRUE(rtpmaps.HasEntry("98"));
|
||||
ASSERT_TRUE(rtpmaps.HasEntry("105"));
|
||||
ASSERT_TRUE(rtpmaps.HasEntry("106"));
|
||||
ASSERT_TRUE(rtpmaps.HasEntry("103"));
|
||||
ASSERT_TRUE(rtpmaps.HasEntry("104"));
|
||||
ASSERT_TRUE(rtpmaps.HasEntry("123"));
|
||||
ASSERT_TRUE(rtpmaps.HasEntry("122"));
|
||||
ASSERT_TRUE(rtpmaps.HasEntry("119"));
|
||||
|
|
@ -3604,16 +3682,20 @@ TEST_F(JsepSessionTest, ValidateNoFmtpLineForRedInOfferAndAnswer) {
|
|||
ASSERT_TRUE(video_attrs.HasAttribute(SdpAttribute::kFmtpAttribute));
|
||||
auto& fmtps = video_attrs.GetFmtp().mFmtps;
|
||||
|
||||
ASSERT_EQ(9U, fmtps.size());
|
||||
ASSERT_EQ(13U, fmtps.size());
|
||||
ASSERT_EQ("126", fmtps[0].format);
|
||||
ASSERT_EQ("97", fmtps[1].format);
|
||||
ASSERT_EQ("120", fmtps[2].format);
|
||||
ASSERT_EQ("124", fmtps[3].format);
|
||||
ASSERT_EQ("121", fmtps[4].format);
|
||||
ASSERT_EQ("125", fmtps[5].format);
|
||||
ASSERT_EQ("127", fmtps[6].format);
|
||||
ASSERT_EQ("98", fmtps[7].format);
|
||||
ASSERT_EQ("119", fmtps[8].format);
|
||||
ASSERT_EQ("105", fmtps[2].format);
|
||||
ASSERT_EQ("103", fmtps[3].format);
|
||||
ASSERT_EQ("120", fmtps[4].format);
|
||||
ASSERT_EQ("124", fmtps[5].format);
|
||||
ASSERT_EQ("121", fmtps[6].format);
|
||||
ASSERT_EQ("125", fmtps[7].format);
|
||||
ASSERT_EQ("127", fmtps[8].format);
|
||||
ASSERT_EQ("98", fmtps[9].format);
|
||||
ASSERT_EQ("106", fmtps[10].format);
|
||||
ASSERT_EQ("104", fmtps[11].format);
|
||||
ASSERT_EQ("119", fmtps[12].format);
|
||||
|
||||
SetLocalAnswer(answer);
|
||||
SetRemoteAnswer(answer);
|
||||
|
|
@ -3624,12 +3706,12 @@ TEST_F(JsepSessionTest, ValidateNoFmtpLineForRedInOfferAndAnswer) {
|
|||
ASSERT_FALSE(IsNull(offerTransceivers[1].mRecvTrack));
|
||||
ASSERT_TRUE(offerTransceivers[1].mSendTrack.GetNegotiatedDetails());
|
||||
ASSERT_TRUE(offerTransceivers[1].mRecvTrack.GetNegotiatedDetails());
|
||||
ASSERT_EQ(6U, offerTransceivers[1]
|
||||
ASSERT_EQ(8U, offerTransceivers[1]
|
||||
.mSendTrack.GetNegotiatedDetails()
|
||||
->GetEncoding(0)
|
||||
.GetCodecs()
|
||||
.size());
|
||||
ASSERT_EQ(6U, offerTransceivers[1]
|
||||
ASSERT_EQ(8U, offerTransceivers[1]
|
||||
.mRecvTrack.GetNegotiatedDetails()
|
||||
->GetEncoding(0)
|
||||
.GetCodecs()
|
||||
|
|
@ -3641,174 +3723,18 @@ TEST_F(JsepSessionTest, ValidateNoFmtpLineForRedInOfferAndAnswer) {
|
|||
ASSERT_FALSE(IsNull(answerTransceivers[1].mRecvTrack));
|
||||
ASSERT_TRUE(answerTransceivers[1].mSendTrack.GetNegotiatedDetails());
|
||||
ASSERT_TRUE(answerTransceivers[1].mRecvTrack.GetNegotiatedDetails());
|
||||
ASSERT_EQ(6U, answerTransceivers[1]
|
||||
ASSERT_EQ(8U, answerTransceivers[1]
|
||||
.mSendTrack.GetNegotiatedDetails()
|
||||
->GetEncoding(0)
|
||||
.GetCodecs()
|
||||
.size());
|
||||
ASSERT_EQ(6U, answerTransceivers[1]
|
||||
ASSERT_EQ(8U, answerTransceivers[1]
|
||||
.mRecvTrack.GetNegotiatedDetails()
|
||||
->GetEncoding(0)
|
||||
.GetCodecs()
|
||||
.size());
|
||||
}
|
||||
|
||||
TEST_F(JsepSessionTest, ValidateAnsweredCodecParamsNoRed) {
|
||||
// TODO(bug 1099351): Once fixed, we can allow red in this offer,
|
||||
// which will also cause multiple codecs in answer. For now,
|
||||
// red/ulpfec for video are behind a pref to mitigate potential for
|
||||
// errors.
|
||||
SetCodecEnabled(*mSessionOff, "red", false);
|
||||
for (auto& codec : mSessionAns->Codecs()) {
|
||||
if (codec->mName == "H264") {
|
||||
JsepVideoCodecDescription* h264 =
|
||||
static_cast<JsepVideoCodecDescription*>(codec.get());
|
||||
h264->mProfileLevelId = 0x42a00d;
|
||||
// Switch up the pts
|
||||
if (h264->mDefaultPt == "126") {
|
||||
h264->mDefaultPt = "97";
|
||||
} else {
|
||||
h264->mDefaultPt = "126";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
types.push_back(SdpMediaSection::kAudio);
|
||||
types.push_back(SdpMediaSection::kVideo);
|
||||
|
||||
AddTracksToStream(*mSessionOff, "offerer_stream", "audio,video");
|
||||
|
||||
std::string offer = CreateOffer();
|
||||
SetLocalOffer(offer);
|
||||
SetRemoteOffer(offer);
|
||||
|
||||
AddTracksToStream(*mSessionAns, "answerer_stream", "audio,video");
|
||||
|
||||
std::string answer = CreateAnswer();
|
||||
|
||||
UniquePtr<Sdp> outputSdp(Parse(answer));
|
||||
ASSERT_TRUE(!!outputSdp);
|
||||
|
||||
ASSERT_EQ(2U, outputSdp->GetMediaSectionCount());
|
||||
auto& video_section = outputSdp->GetMediaSection(1);
|
||||
ASSERT_EQ(SdpMediaSection::kVideo, video_section.GetMediaType());
|
||||
auto& video_attrs = video_section.GetAttributeList();
|
||||
ASSERT_EQ(SdpDirectionAttribute::kSendrecv, video_attrs.GetDirection());
|
||||
|
||||
ASSERT_EQ(4U, video_section.GetFormats().size());
|
||||
ASSERT_EQ("120", video_section.GetFormats()[0]);
|
||||
ASSERT_EQ("124", video_section.GetFormats()[1]);
|
||||
ASSERT_EQ("121", video_section.GetFormats()[2]);
|
||||
ASSERT_EQ("125", video_section.GetFormats()[3]);
|
||||
|
||||
// Validate rtpmap
|
||||
ASSERT_TRUE(video_attrs.HasAttribute(SdpAttribute::kRtpmapAttribute));
|
||||
auto& rtpmaps = video_attrs.GetRtpmap();
|
||||
ASSERT_TRUE(rtpmaps.HasEntry("120"));
|
||||
ASSERT_TRUE(rtpmaps.HasEntry("121"));
|
||||
|
||||
auto& vp8_entry = rtpmaps.GetEntry("120");
|
||||
auto& vp9_entry = rtpmaps.GetEntry("121");
|
||||
|
||||
ASSERT_EQ("VP8", vp8_entry.name);
|
||||
ASSERT_EQ("VP9", vp9_entry.name);
|
||||
|
||||
// Validate fmtps
|
||||
ASSERT_TRUE(video_attrs.HasAttribute(SdpAttribute::kFmtpAttribute));
|
||||
auto& fmtps = video_attrs.GetFmtp().mFmtps;
|
||||
|
||||
ASSERT_EQ(4U, fmtps.size());
|
||||
|
||||
// VP8
|
||||
ASSERT_EQ("120", fmtps[0].format);
|
||||
ASSERT_TRUE(!!fmtps[0].parameters);
|
||||
ASSERT_EQ(SdpRtpmapAttributeList::kVP8, fmtps[0].parameters->codec_type);
|
||||
|
||||
auto& parsed_vp8_params =
|
||||
*static_cast<const SdpFmtpAttributeList::VP8Parameters*>(
|
||||
fmtps[0].parameters.get());
|
||||
|
||||
ASSERT_EQ((uint32_t)12288, parsed_vp8_params.max_fs);
|
||||
ASSERT_EQ((uint32_t)60, parsed_vp8_params.max_fr);
|
||||
|
||||
// VP9
|
||||
ASSERT_EQ("121", fmtps[2].format);
|
||||
ASSERT_TRUE(!!fmtps[2].parameters);
|
||||
ASSERT_EQ(SdpRtpmapAttributeList::kVP9, fmtps[2].parameters->codec_type);
|
||||
|
||||
auto& parsed_vp9_params =
|
||||
*static_cast<const SdpFmtpAttributeList::VP8Parameters*>(
|
||||
fmtps[2].parameters.get());
|
||||
|
||||
ASSERT_EQ((uint32_t)12288, parsed_vp9_params.max_fs);
|
||||
ASSERT_EQ((uint32_t)60, parsed_vp9_params.max_fr);
|
||||
|
||||
SetLocalAnswer(answer);
|
||||
SetRemoteAnswer(answer);
|
||||
|
||||
auto offerTransceivers = GetTransceivers(*mSessionOff);
|
||||
ASSERT_EQ(2U, offerTransceivers.size());
|
||||
ASSERT_FALSE(IsNull(offerTransceivers[1].mSendTrack));
|
||||
ASSERT_FALSE(IsNull(offerTransceivers[1].mRecvTrack));
|
||||
ASSERT_TRUE(offerTransceivers[1].mSendTrack.GetNegotiatedDetails());
|
||||
ASSERT_TRUE(offerTransceivers[1].mRecvTrack.GetNegotiatedDetails());
|
||||
ASSERT_EQ(2U, offerTransceivers[1]
|
||||
.mSendTrack.GetNegotiatedDetails()
|
||||
->GetEncoding(0)
|
||||
.GetCodecs()
|
||||
.size());
|
||||
ASSERT_EQ(4U, offerTransceivers[1]
|
||||
.mRecvTrack.GetNegotiatedDetails()
|
||||
->GetEncoding(0)
|
||||
.GetCodecs()
|
||||
.size());
|
||||
|
||||
auto answerTransceivers = GetTransceivers(*mSessionAns);
|
||||
ASSERT_EQ(2U, answerTransceivers.size());
|
||||
ASSERT_FALSE(IsNull(answerTransceivers[1].mSendTrack));
|
||||
ASSERT_FALSE(IsNull(answerTransceivers[1].mRecvTrack));
|
||||
ASSERT_TRUE(answerTransceivers[1].mSendTrack.GetNegotiatedDetails());
|
||||
ASSERT_TRUE(answerTransceivers[1].mRecvTrack.GetNegotiatedDetails());
|
||||
ASSERT_EQ(2U, answerTransceivers[1]
|
||||
.mSendTrack.GetNegotiatedDetails()
|
||||
->GetEncoding(0)
|
||||
.GetCodecs()
|
||||
.size());
|
||||
ASSERT_EQ(2U, answerTransceivers[1]
|
||||
.mRecvTrack.GetNegotiatedDetails()
|
||||
->GetEncoding(0)
|
||||
.GetCodecs()
|
||||
.size());
|
||||
|
||||
#if 0
|
||||
// H264 packetization mode 1
|
||||
ASSERT_EQ("126", fmtps[1].format);
|
||||
ASSERT_TRUE(fmtps[1].parameters);
|
||||
ASSERT_EQ(SdpRtpmapAttributeList::kH264, fmtps[1].parameters->codec_type);
|
||||
|
||||
auto& parsed_h264_1_params =
|
||||
*static_cast<const SdpFmtpAttributeList::H264Parameters*>(
|
||||
fmtps[1].parameters.get());
|
||||
|
||||
ASSERT_EQ((uint32_t)0x42a00d, parsed_h264_1_params.profile_level_id);
|
||||
ASSERT_TRUE(parsed_h264_1_params.level_asymmetry_allowed);
|
||||
ASSERT_EQ(1U, parsed_h264_1_params.packetization_mode);
|
||||
|
||||
// H264 packetization mode 0
|
||||
ASSERT_EQ("97", fmtps[2].format);
|
||||
ASSERT_TRUE(fmtps[2].parameters);
|
||||
ASSERT_EQ(SdpRtpmapAttributeList::kH264, fmtps[2].parameters->codec_type);
|
||||
|
||||
auto& parsed_h264_0_params =
|
||||
*static_cast<const SdpFmtpAttributeList::H264Parameters*>(
|
||||
fmtps[2].parameters.get());
|
||||
|
||||
ASSERT_EQ((uint32_t)0x42a00d, parsed_h264_0_params.profile_level_id);
|
||||
ASSERT_TRUE(parsed_h264_0_params.level_asymmetry_allowed);
|
||||
ASSERT_EQ(0U, parsed_h264_0_params.packetization_mode);
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST_F(JsepSessionTest, OfferWithBundleGroupNoTags) {
|
||||
AddTracks(*mSessionOff, "audio,video");
|
||||
AddTracks(*mSessionAns, "audio,video");
|
||||
|
|
|
|||
|
|
@ -286,6 +286,7 @@ pref("media.videocontrols.keyboard-tab-to-all-controls", true);
|
|||
pref("media.navigator.video.default_height",0); // adaptive default
|
||||
pref("media.navigator.video.max_fs", 12288); // Enough for 2048x1536
|
||||
pref("media.navigator.video.max_fr", 60);
|
||||
pref("media.navigator.video.disable_h264_baseline", false);
|
||||
pref("media.navigator.video.h264.level", 31); // 0x42E01f - level 3.1
|
||||
pref("media.navigator.video.h264.max_br", 0);
|
||||
pref("media.navigator.video.h264.max_mbps", 0);
|
||||
|
|
|
|||
|
|
@ -39,3 +39,11 @@
|
|||
[Test that decodingInfo returns supported true for the codec video/H264; profile-level-id=42e01f;level-asymmetry-allowed=1 returned by RTCRtpReceiver.getCapabilities()]
|
||||
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1825286
|
||||
expected: FAIL
|
||||
|
||||
[Test that decodingInfo returns supported true for the codec video/H264; profile-level-id=42001f;level-asymmetry-allowed=1;packetization-mode=1 returned by RTCRtpReceiver.getCapabilities()]
|
||||
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1825286
|
||||
expected: FAIL
|
||||
|
||||
[Test that decodingInfo returns supported true for the codec video/H264; profile-level-id=42001f;level-asymmetry-allowed=1 returned by RTCRtpReceiver.getCapabilities()]
|
||||
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1825286
|
||||
expected: FAIL
|
||||
|
|
|
|||
|
|
@ -41,3 +41,11 @@
|
|||
[Test that encodingInfo returns supported true for the codec video/H264; profile-level-id=42e01f;level-asymmetry-allowed=1 returned by RTCRtpSender.getCapabilities()]
|
||||
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1825286
|
||||
expected: FAIL
|
||||
|
||||
[Test that encodingInfo returns supported true for the codec video/H264; profile-level-id=42001f;level-asymmetry-allowed=1;packetization-mode=1 returned by RTCRtpSender.getCapabilities()]
|
||||
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1825286
|
||||
expected: FAIL
|
||||
|
||||
[Test that encodingInfo returns supported true for the codec video/H264; profile-level-id=42001f;level-asymmetry-allowed=1 returned by RTCRtpSender.getCapabilities()]
|
||||
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1825286
|
||||
expected: FAIL
|
||||
|
|
|
|||
Loading…
Reference in a new issue