diff --git a/src/main.rs b/src/main.rs index 77dd769..4993cfb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,13 +16,14 @@ fn main() -> Result<(), Error> { .downcast::() .expect("Expected a gst::Pipeline"); - let text_src = gst::ElementFactory::make("appsrc", Some("text-src")).unwrap(); - text_src.set_property("is-live", true); - text_src.set_property("caps", + let text_src = gst::ElementFactory::make("appsrc", Some("text-src")).unwrap().downcast::().unwrap(); + text_src.set_is_live(true); + text_src.set_format(gst::Format::Time); + text_src.set_caps(Some( &gst::Caps::builder("text/x-raw") .field("format", "utf8") .build(), - ); + )); pipeline.add(&text_src).expect("Failed to add elements to pipeline"); let converter = pipeline.by_name("converter").unwrap();