Remove FlexFEC feedback params from internal encoder factory

I want to move away from the old encoder factory interface
cricket::WebRtcEncoderFactory to the new webrtc::VideoEncoderFactory. I
created a new webrtc::SdpVideoFormat that essentially is a subset of the
cricket::VideoCodec variables. E.g. the encoder factories shouldn't have
to assign payload types to the codecs, so the payload is not part of
webrtc::SdpVideoFormat. I also didn't add the "feedback_params" that is
used in cricket::VideoCodec to webrtc::SdpVideoFormat. This is causing
problems now, because the internal encoder factory is adding flexfec
feedback params. To avoid this problem, I add these feedback params in
WebRtcVideoEngine instead, like we do for the other codecs.

Bug: webrtc:7925
Change-Id: I7c6ae8d1e1f47f3631c4804c223ec21da8d73685
Reviewed-on: https://webrtc-review.googlesource.com/15223
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20444}
This commit is contained in:
Magnus Jedvert 2017-10-25 17:08:04 +02:00 committed by Commit Bot
parent d2817d80b5
commit ef20795a46
2 changed files with 10 additions and 11 deletions

View File

@ -51,10 +51,6 @@ InternalEncoderFactory::InternalEncoderFactory() {
// we never use the actual value anywhere in our code however. // we never use the actual value anywhere in our code however.
// TODO(brandtr): Consider honouring this value in the sender and receiver. // TODO(brandtr): Consider honouring this value in the sender and receiver.
flexfec_codec.SetParam(kFlexfecFmtpRepairWindow, "10000000"); flexfec_codec.SetParam(kFlexfecFmtpRepairWindow, "10000000");
flexfec_codec.AddFeedbackParam(
FeedbackParam(kRtcpFbParamTransportCc, kParamValueEmpty));
flexfec_codec.AddFeedbackParam(
FeedbackParam(kRtcpFbParamRemb, kParamValueEmpty));
supported_codecs_.push_back(flexfec_codec); supported_codecs_.push_back(flexfec_codec);
} }
} }

View File

@ -192,12 +192,18 @@ bool IsFlexfecAdvertisedFieldTrialEnabled() {
} }
void AddDefaultFeedbackParams(VideoCodec* codec) { void AddDefaultFeedbackParams(VideoCodec* codec) {
codec->AddFeedbackParam(FeedbackParam(kRtcpFbParamCcm, kRtcpFbCcmParamFir)); // Don't add any feedback params for RED and ULPFEC.
codec->AddFeedbackParam(FeedbackParam(kRtcpFbParamNack, kParamValueEmpty)); if (codec->name == kRedCodecName || codec->name == kUlpfecCodecName)
codec->AddFeedbackParam(FeedbackParam(kRtcpFbParamNack, kRtcpFbNackParamPli)); return;
codec->AddFeedbackParam(FeedbackParam(kRtcpFbParamRemb, kParamValueEmpty)); codec->AddFeedbackParam(FeedbackParam(kRtcpFbParamRemb, kParamValueEmpty));
codec->AddFeedbackParam( codec->AddFeedbackParam(
FeedbackParam(kRtcpFbParamTransportCc, kParamValueEmpty)); FeedbackParam(kRtcpFbParamTransportCc, kParamValueEmpty));
// Don't add any more feedback params for FLEXFEC.
if (codec->name == kFlexfecCodecName)
return;
codec->AddFeedbackParam(FeedbackParam(kRtcpFbParamCcm, kRtcpFbCcmParamFir));
codec->AddFeedbackParam(FeedbackParam(kRtcpFbParamNack, kParamValueEmpty));
codec->AddFeedbackParam(FeedbackParam(kRtcpFbParamNack, kRtcpFbNackParamPli));
} }
static std::string CodecVectorToString(const std::vector<VideoCodec>& codecs) { static std::string CodecVectorToString(const std::vector<VideoCodec>& codecs) {
@ -515,10 +521,7 @@ std::vector<VideoCodec> AssignPayloadTypesAndAddAssociatedRtxCodecs(
std::vector<VideoCodec> output_codecs; std::vector<VideoCodec> output_codecs;
for (VideoCodec codec : input_codecs) { for (VideoCodec codec : input_codecs) {
codec.id = payload_type; codec.id = payload_type;
if (codec.name != kRedCodecName && codec.name != kUlpfecCodecName && AddDefaultFeedbackParams(&codec);
codec.name != kFlexfecCodecName) {
AddDefaultFeedbackParams(&codec);
}
output_codecs.push_back(codec); output_codecs.push_back(codec);
// Increment payload type. // Increment payload type.