Bug 1341995 - Use negotiated values for RED and ULPFEC payload types; r=bwc

MozReview-Commit-ID: 33jkKWThcL2

--HG--
extra : rebase_source : 60a2c467bea46aec48fe2a1f73d260cb68b1a61d
This commit is contained in:
Dan Minor 2017-02-27 09:37:30 -05:00
Родитель ed2ee4c67e
Коммит fdcc85b73e
3 изменённых файлов: 21 добавлений и 6 удалений

Просмотреть файл

@ -264,13 +264,24 @@ class JsepVideoCodecDescription : public JsepCodecDescription {
}
virtual void
EnableFec() {
EnableFec(std::string redPayloadType, std::string ulpfecPayloadType) {
// Enabling FEC for video works a little differently than enabling
// REMB or TMMBR. Support for FEC is indicated by the presence of
// particular codes (red and ulpfec) instead of using rtcpfb
// attributes on a given codec. There is no rtcpfb to push for FEC
// as can be seen above when REMB or TMMBR are enabled.
// Ensure we have valid payload types. This returns zero on failure, which
// is a valid payload type.
uint16_t redPt, ulpfecPt;
if (!SdpHelper::GetPtAsInt(redPayloadType, &redPt) ||
!SdpHelper::GetPtAsInt(ulpfecPayloadType, &ulpfecPt)) {
return;
}
mFECEnabled = true;
mREDPayloadType = redPt;
mULPFECPayloadType = ulpfecPt;
}
void
@ -710,10 +721,8 @@ class JsepVideoCodecDescription : public JsepCodecDescription {
if (codec->mType == SdpMediaSection::kVideo &&
codec->mEnabled &&
codec->mName != "red") {
uint8_t pt = (uint8_t)strtoul(codec->mDefaultPt.c_str(), nullptr, 10);
// returns 0 if failed to convert, and since zero could
// be valid, check the defaultPt for 0
if (pt == 0 && codec->mDefaultPt != "0") {
uint16_t pt;
if (!SdpHelper::GetPtAsInt(codec->mDefaultPt, &pt)) {
continue;
}
mRedundantEncodings.push_back(pt);
@ -730,6 +739,8 @@ class JsepVideoCodecDescription : public JsepCodecDescription {
bool mTmmbrEnabled;
bool mRembEnabled;
bool mFECEnabled;
uint8_t mREDPayloadType;
uint8_t mULPFECPayloadType;
std::vector<uint8_t> mRedundantEncodings;
// H264-specific stuff

Просмотреть файл

@ -390,7 +390,7 @@ JsepTrack::NegotiateCodecs(
if (codec->mName != "red" && codec->mName != "ulpfec") {
JsepVideoCodecDescription* videoCodec =
static_cast<JsepVideoCodecDescription*>(codec);
videoCodec->EnableFec();
videoCodec->EnableFec(red->mDefaultPt, ulpfec->mDefaultPt);
}
}
}

Просмотреть файл

@ -135,6 +135,10 @@ JsepCodecDescToCodecConfig(const JsepCodecDescription& aCodec,
configRaw->mCcmFbTypes = desc.mCcmFbTypes;
configRaw->mRembFbSet = desc.RtcpFbRembIsSet();
configRaw->mFECFbSet = desc.mFECEnabled;
if (desc.mFECEnabled) {
configRaw->mREDPayloadType = desc.mREDPayloadType;
configRaw->mULPFECPayloadType = desc.mULPFECPayloadType;
}
*aConfig = configRaw;
return NS_OK;