<html><head></head><body><div>Hi!</div><div><br></div><div>On Wed, 2022-12-28 at 00:14 -0800, Guru Govindan via gstreamer-devel wrote:</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div dir="ltr"><div>I am trying to set some clockoverlay/textoverlay on my video in rust in a dynamic pipeline.</div><div>I am having issues setting the property of the element specifically valignment and halignment.</div><div><br></div><div>It seems to not like either string (which is what we set in a command line pipeline) or as an integer.</div><div><br></div><div>I get the following error</div><div><br></div><div>```</div><div>thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: BoolError { message: "property 'valignment' of type 'GstClockOverlay' can't be set from the given type (expected: 'GstBaseTextOverlayVAlign', got: 'gchararray')", filename: "/home/ggovindan/.cargo/git/checkouts/gtk-rs-core-7be42ca38bd6361c/0afcb34/glib/src/<a href="http://object.rs" target="_blank">object.rs</a>", function: "glib::object", line: 3475 }', /home/ggovindan/.cargo/git/checkouts/gtk-rs-core-7be42ca38bd6361c/0afcb34/glib/src/object.rs:2372:53<br>note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace<br></div><div>```</div></div></blockquote><div><br></div><div>As the error suggests, the property is not of a string type ("gchararray") but a specific enum.</div><div>You can use e.g.</div><div><font face="monospace">  <span style="font-size: 14.666667px;">clockoverlay.set_property_from_str("valignment", "bottom")</span></font></div><div><span style="font-size: 14.666667px;">or make use of the glib <font face="monospace">EnumClass</font> API.</span></div><div><br></div><div>Also in your code the `to_string()` calls are not needed.</div><div><br></div><div><span><pre>-- <br></pre><div><div><span style="font-family: Calibri, sans-serif; font-size: 14.666667px;">Sebastian Dröge, Centricular Ltd · </span><a href="https://www.centricular.com/" title="Click to open https://www.centricular.com/" style="color: rgb(0, 0, 238); font-family: Calibri, sans-serif; font-size: 14.666667px;">https://www.centricular.com</a></div></div></span></div></body></html>