Bug 1274340 - Call SetReceiveCodec for RED and ULPFEC when FEC is enabled; r=jesup
We need to call SetReceiveCodec for RED and ULPFEC so we know how to handle
those packets when received.
MozReview-Commit-ID: A9EluM7p2NH
--- a/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
+++ b/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
@@ -978,16 +978,34 @@ WebrtcVideoConduit::ConfigureRecvMediaCo
uint8_t payload_type_ulpfec = INVALID_RTP_PAYLOAD;
if (!DetermineREDAndULPFECPayloadTypes(payload_type_red, payload_type_ulpfec)) {
CSFLogError(logTag, "%s Unable to set FEC status: could not determine"
"payload type: red %u ulpfec %u",
__FUNCTION__, payload_type_red, payload_type_ulpfec);
return kMediaConduitFECStatusError;
}
+ // We also need to call SetReceiveCodec for RED and ULPFEC codecs
+ for(int idx=0; idx < mPtrViECodec->NumberOfCodecs(); idx++) {
+ webrtc::VideoCodec video_codec;
+ if(mPtrViECodec->GetCodec(idx, video_codec) == 0) {
+ payloadName = video_codec.plName;
+ if(video_codec.codecType == webrtc::VideoCodecType::kVideoCodecRED ||
+ video_codec.codecType == webrtc::VideoCodecType::kVideoCodecULPFEC) {
+ if(mPtrViECodec->SetReceiveCodec(mChannel,video_codec) == -1) {
+ CSFLogError(logTag, "%s Invalid Receive Codec %d ", __FUNCTION__,
+ mPtrViEBase->LastError());
+ } else {
+ CSFLogDebug(logTag, "%s Successfully Set the codec %s", __FUNCTION__,
+ video_codec.plName);
+ }
+ }
+ }
+ }
+
if (use_nack_basic) {
CSFLogDebug(logTag, "Enabling NACK/FEC (recv) for video stream\n");
if (mPtrRTP->SetHybridNACKFECStatus(mChannel, true,
payload_type_red,
payload_type_ulpfec) != 0) {
CSFLogError(logTag, "%s SetHybridNACKFECStatus Failed %d ",
__FUNCTION__, mPtrViEBase->LastError());
return kMediaConduitNACKStatusError;