dav1ddec: Require correct alignment and stream format when running with GStreamer 1.20

This commit is contained in:
Sebastian Dröge 2022-02-02 17:10:30 +02:00 committed by Sebastian Dröge
parent 772fbaa073
commit 2c511fca50

View file

@ -461,7 +461,14 @@ impl ElementImpl for Dav1dDec {
fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| {
let sink_caps = gst::Caps::builder("video/x-av1").build();
let sink_caps = if gst::version() >= (1, 19, 0, 0) {
gst::Caps::builder("video/x-av1")
.field("stream-format", "obu-stream")
.field("alignment", gst::List::new(["frame", "tu"]))
.build()
} else {
gst::Caps::builder("video/x-av1").build()
};
let sink_pad_template = gst::PadTemplate::new(
"sink",
gst::PadDirection::Sink,