From 0e572be6c0a4455b51ecbbfc257fa2eee656cd39 Mon Sep 17 00:00:00 2001 From: Rafael Caricio Date: Wed, 29 Dec 2021 18:19:29 +0100 Subject: [PATCH] First kinda working --- src/main.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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();