arturoc / gstreamer1.0-rs

Idiomatic bindings for Gstreamer on Rust.
MIT License
36 stars 14 forks source link

Setting caps on link #30

Closed superlou closed 7 years ago

superlou commented 7 years ago

Is there a way to set the caps when linking two elements? There is an example for query_caps, but I'm not having any luck figuring out how to set the caps on a linked pad.

arturoc commented 7 years ago

Hi, sorry for the late reply. There isn't a way to set the caps without directly using the ffi at the moment.

you can get the GstPad using gst_pad_mut() on the gst::Pad and use unsafe ffi functions to set it. if you can put a small example of what you are trying to do i might be able to add this functionality

superlou commented 7 years ago

Ideally, I'm looking to implement the link_filtered method available in the Python GObject introspection bindings to port an existing Python project I was developing to Rust.

I don't have the Rust version online yet (or working), but I can push what I have tonight.

arturoc commented 7 years ago

Just added link_filtered in Element which should be the same functionality you are using in python but let me know if it doesn't work as expected

superlou commented 7 years ago

It compiled no problem and seems to run without errors. I'm having some issues getting output, but I think that's app specific on my end. Thanks for the patch!