closedcaption: Put framerates into the src pad template caps of sccparse/mccparse

We're always providing a framerate on the output and without this it's
not possible to link the parsers to ccconvert while having it convert to
CEA708 CDP.
This commit is contained in:
Sebastian Dröge 2020-01-02 16:44:38 +02:00
parent cbb1912e99
commit 9cade5bbe0
2 changed files with 10 additions and 0 deletions

View file

@ -1205,14 +1205,20 @@ impl ObjectSubclass for MccParse {
let mut caps = gst::Caps::new_empty();
{
let caps = caps.get_mut().unwrap();
let framerate = gst::FractionRange::new(
gst::Fraction::new(1, std::i32::MAX),
gst::Fraction::new(std::i32::MAX, 1),
);
let s = gst::Structure::builder("closedcaption/x-cea-708")
.field("format", &"cdp")
.field("framerate", &framerate)
.build();
caps.append_structure(s);
let s = gst::Structure::builder("closedcaption/x-cea-608")
.field("format", &"s334-1a")
.field("framerate", &framerate)
.build();
caps.append_structure(s);
}

View file

@ -498,6 +498,10 @@ impl ObjectSubclass for SccParse {
let caps = gst::Caps::builder("closedcaption/x-cea-608")
.field("format", &"raw")
.field(
"framerate",
&gst::List::new(&[&gst::Fraction::new(30000, 1001), &gst::Fraction::new(30, 1)]),
)
.build();
let src_pad_template = gst::PadTemplate::new(
"src",