Use predefined SdpVideoFormats when returning supported formats
The predefined SdpVideoFormats were not used everywhere, which caused a discrepancy between send/receive capabilities for AV1. This CL solves the immediate problems by making sure send/receive capabilities for AV1 are reported the same way. Fixed: chromium:331565934 Change-Id: I073091b7b5f987c7f434c17276fd84047ec723c2 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/344681 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Johannes Kron <kron@webrtc.org> Cr-Commit-Position: refs/heads/main@{#41991}
This commit is contained in:
parent
71566bc802
commit
82598402e0
@ -138,6 +138,13 @@ SdpVideoFormat::SdpVideoFormat(
|
|||||||
parameters(parameters),
|
parameters(parameters),
|
||||||
scalability_modes(scalability_modes) {}
|
scalability_modes(scalability_modes) {}
|
||||||
|
|
||||||
|
SdpVideoFormat::SdpVideoFormat(
|
||||||
|
const SdpVideoFormat& format,
|
||||||
|
const absl::InlinedVector<ScalabilityMode, kScalabilityModeCount>& modes)
|
||||||
|
: SdpVideoFormat(format) {
|
||||||
|
scalability_modes = modes;
|
||||||
|
}
|
||||||
|
|
||||||
SdpVideoFormat::SdpVideoFormat(const SdpVideoFormat&) = default;
|
SdpVideoFormat::SdpVideoFormat(const SdpVideoFormat&) = default;
|
||||||
SdpVideoFormat::SdpVideoFormat(SdpVideoFormat&&) = default;
|
SdpVideoFormat::SdpVideoFormat(SdpVideoFormat&&) = default;
|
||||||
SdpVideoFormat& SdpVideoFormat::operator=(const SdpVideoFormat&) = default;
|
SdpVideoFormat& SdpVideoFormat::operator=(const SdpVideoFormat&) = default;
|
||||||
|
|||||||
@ -36,6 +36,14 @@ struct RTC_EXPORT SdpVideoFormat {
|
|||||||
const CodecParameterMap& parameters,
|
const CodecParameterMap& parameters,
|
||||||
const absl::InlinedVector<ScalabilityMode, kScalabilityModeCount>&
|
const absl::InlinedVector<ScalabilityMode, kScalabilityModeCount>&
|
||||||
scalability_modes);
|
scalability_modes);
|
||||||
|
// Creates a new SdpVideoFormat object identical to the supplied
|
||||||
|
// SdpVideoFormat except the scalability_modes that are set to be the same as
|
||||||
|
// the supplied scalability modes.
|
||||||
|
SdpVideoFormat(
|
||||||
|
const SdpVideoFormat& format,
|
||||||
|
const absl::InlinedVector<ScalabilityMode, kScalabilityModeCount>&
|
||||||
|
scalability_modes);
|
||||||
|
|
||||||
SdpVideoFormat(const SdpVideoFormat&);
|
SdpVideoFormat(const SdpVideoFormat&);
|
||||||
SdpVideoFormat(SdpVideoFormat&&);
|
SdpVideoFormat(SdpVideoFormat&&);
|
||||||
SdpVideoFormat& operator=(const SdpVideoFormat&);
|
SdpVideoFormat& operator=(const SdpVideoFormat&);
|
||||||
|
|||||||
@ -21,10 +21,7 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
struct Dav1dDecoderTemplateAdapter {
|
struct Dav1dDecoderTemplateAdapter {
|
||||||
static std::vector<SdpVideoFormat> SupportedFormats() {
|
static std::vector<SdpVideoFormat> SupportedFormats() {
|
||||||
return {SdpVideoFormat("AV1"),
|
return {SdpVideoFormat::AV1Profile0(), SdpVideoFormat::AV1Profile1()};
|
||||||
SdpVideoFormat(
|
|
||||||
"AV1", {{"profile",
|
|
||||||
AV1ProfileToString(AV1Profile::kProfile1).data()}})};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::unique_ptr<VideoDecoder> CreateDecoder(
|
static std::unique_ptr<VideoDecoder> CreateDecoder(
|
||||||
|
|||||||
@ -25,7 +25,7 @@ struct LibaomAv1EncoderTemplateAdapter {
|
|||||||
static std::vector<SdpVideoFormat> SupportedFormats() {
|
static std::vector<SdpVideoFormat> SupportedFormats() {
|
||||||
absl::InlinedVector<ScalabilityMode, kScalabilityModeCount>
|
absl::InlinedVector<ScalabilityMode, kScalabilityModeCount>
|
||||||
scalability_modes = LibaomAv1EncoderSupportedScalabilityModes();
|
scalability_modes = LibaomAv1EncoderSupportedScalabilityModes();
|
||||||
return {SdpVideoFormat("AV1", CodecParameterMap(), scalability_modes)};
|
return {SdpVideoFormat(SdpVideoFormat::AV1Profile0(), scalability_modes)};
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::unique_ptr<VideoEncoder> CreateEncoder(
|
static std::unique_ptr<VideoEncoder> CreateEncoder(
|
||||||
|
|||||||
@ -29,7 +29,7 @@ struct LibvpxVp8EncoderTemplateAdapter {
|
|||||||
scalability_modes.push_back(scalability_mode);
|
scalability_modes.push_back(scalability_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {SdpVideoFormat("VP8", CodecParameterMap(), scalability_modes)};
|
return {SdpVideoFormat(SdpVideoFormat::VP8(), scalability_modes)};
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::unique_ptr<VideoEncoder> CreateEncoder(
|
static std::unique_ptr<VideoEncoder> CreateEncoder(
|
||||||
|
|||||||
@ -178,7 +178,9 @@ SdpVideoFormat CreateSdpVideoFormat(
|
|||||||
|
|
||||||
return SdpVideoFormat(config.codec_name, codec_params);
|
return SdpVideoFormat(config.codec_name, codec_params);
|
||||||
} else if (config.codec_settings.codecType == kVideoCodecVP9) {
|
} else if (config.codec_settings.codecType == kVideoCodecVP9) {
|
||||||
return SdpVideoFormat(config.codec_name, {{"profile-id", "0"}});
|
return SdpVideoFormat::VP9Profile0();
|
||||||
|
} else if (config.codec_settings.codecType == kVideoCodecAV1) {
|
||||||
|
return SdpVideoFormat::AV1Profile0();
|
||||||
}
|
}
|
||||||
|
|
||||||
return SdpVideoFormat(config.codec_name);
|
return SdpVideoFormat(config.codec_name);
|
||||||
|
|||||||
@ -46,15 +46,11 @@ std::vector<SdpVideoFormat> SupportedVP9Codecs(bool add_scalability_modes) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::vector<SdpVideoFormat> supported_formats{SdpVideoFormat(
|
std::vector<SdpVideoFormat> supported_formats{
|
||||||
cricket::kVp9CodecName,
|
SdpVideoFormat(SdpVideoFormat::VP9Profile0(), scalability_modes)};
|
||||||
{{kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}},
|
|
||||||
scalability_modes)};
|
|
||||||
if (vpx_supports_high_bit_depth) {
|
if (vpx_supports_high_bit_depth) {
|
||||||
supported_formats.push_back(SdpVideoFormat(
|
supported_formats.push_back(
|
||||||
cricket::kVp9CodecName,
|
SdpVideoFormat(SdpVideoFormat::VP9Profile2(), scalability_modes));
|
||||||
{{kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile2)}},
|
|
||||||
scalability_modes));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return supported_formats;
|
return supported_formats;
|
||||||
@ -69,12 +65,8 @@ std::vector<SdpVideoFormat> SupportedVP9DecoderCodecs() {
|
|||||||
// The WebRTC internal decoder supports VP9 profile 1 and 3. However, there's
|
// The WebRTC internal decoder supports VP9 profile 1 and 3. However, there's
|
||||||
// currently no way of sending VP9 profile 1 or 3 using the internal encoder.
|
// currently no way of sending VP9 profile 1 or 3 using the internal encoder.
|
||||||
// It would require extended support for I444, I422, and I440 buffers.
|
// It would require extended support for I444, I422, and I440 buffers.
|
||||||
supported_formats.push_back(SdpVideoFormat(
|
supported_formats.push_back(SdpVideoFormat::VP9Profile1());
|
||||||
cricket::kVp9CodecName,
|
supported_formats.push_back(SdpVideoFormat::VP9Profile3());
|
||||||
{{kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile1)}}));
|
|
||||||
supported_formats.push_back(SdpVideoFormat(
|
|
||||||
cricket::kVp9CodecName,
|
|
||||||
{{kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile3)}}));
|
|
||||||
return supported_formats;
|
return supported_formats;
|
||||||
#else
|
#else
|
||||||
return std::vector<SdpVideoFormat>();
|
return std::vector<SdpVideoFormat>();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user