video_engine: allow allocating h264/yuv444 in lower payload type range
BUG=webrtc:12194,chromium:1251096 Change-Id: I71a8e85f0582fc724b9ebb9284936626c6aa08dc Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235211 Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Philipp Hancke <phancke@nvidia.com> Cr-Commit-Position: refs/heads/main@{#35222}
This commit is contained in:
parent
3b18208f13
commit
c5d3c24439
@ -110,6 +110,23 @@ void AddDefaultFeedbackParams(VideoCodec* codec,
|
||||
}
|
||||
}
|
||||
|
||||
// Helper function to determine whether a codec should use the [35, 63] range.
|
||||
// Should be used when adding new codecs (or variants).
|
||||
bool IsCodecValidForLowerRange(const VideoCodec& codec) {
|
||||
if (absl::EqualsIgnoreCase(codec.name, kFlexfecCodecName) ||
|
||||
absl::EqualsIgnoreCase(codec.name, kAv1CodecName) ||
|
||||
absl::EqualsIgnoreCase(codec.name, kAv1xCodecName)) {
|
||||
return true;
|
||||
} else if (absl::EqualsIgnoreCase(codec.name, kH264CodecName)) {
|
||||
std::string profileLevelId;
|
||||
// H264 with YUV444.
|
||||
if (codec.GetParam(kH264FmtpProfileLevelId, &profileLevelId)) {
|
||||
return absl::StartsWithIgnoreCase(profileLevelId, "f400");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// This function will assign dynamic payload types (in the range [96, 127]
|
||||
// and then [35, 63]) to the input codecs, and also add ULPFEC, RED, FlexFEC,
|
||||
// and associated RTX codecs for recognized codecs (VP8, VP9, H264, and RED).
|
||||
@ -170,10 +187,6 @@ std::vector<VideoCodec> GetPayloadTypesAndDefaultCodecs(
|
||||
std::vector<VideoCodec> output_codecs;
|
||||
for (const webrtc::SdpVideoFormat& format : supported_formats) {
|
||||
VideoCodec codec(format);
|
||||
bool isCodecValidForLowerRange =
|
||||
absl::EqualsIgnoreCase(codec.name, kFlexfecCodecName) ||
|
||||
absl::EqualsIgnoreCase(codec.name, kAv1CodecName) ||
|
||||
absl::EqualsIgnoreCase(codec.name, kAv1xCodecName);
|
||||
bool isFecCodec = absl::EqualsIgnoreCase(codec.name, kUlpfecCodecName) ||
|
||||
absl::EqualsIgnoreCase(codec.name, kFlexfecCodecName);
|
||||
|
||||
@ -189,7 +202,7 @@ std::vector<VideoCodec> GetPayloadTypesAndDefaultCodecs(
|
||||
|
||||
// Lower range gets used for "new" codecs or when running out of payload
|
||||
// types in the upper range.
|
||||
if (isCodecValidForLowerRange ||
|
||||
if (IsCodecValidForLowerRange(codec) ||
|
||||
payload_type_upper >= kLastDynamicPayloadTypeUpperRange) {
|
||||
codec.id = payload_type_lower++;
|
||||
} else {
|
||||
@ -209,7 +222,7 @@ std::vector<VideoCodec> GetPayloadTypesAndDefaultCodecs(
|
||||
RTC_DCHECK_EQ(payload_type_upper, kLastDynamicPayloadTypeUpperRange);
|
||||
break;
|
||||
}
|
||||
if (isCodecValidForLowerRange ||
|
||||
if (IsCodecValidForLowerRange(codec) ||
|
||||
payload_type_upper >= kLastDynamicPayloadTypeUpperRange) {
|
||||
output_codecs.push_back(
|
||||
VideoCodec::CreateRtxCodec(payload_type_lower++, codec.id));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user