Cannot create a gst step event
Hi. I am trying the gstreamer example # 13 that uses keyboard events to create pipeline events to change playback speed, skip a single frame and play/pause the stream. The C Code example creates a step event and propagates it to the sink in the following manner :
gst_element_send_event (data->video_sink, gst_event_new_step (GST_FORMAT_BUFFERS, 1, ABS (data->rate), TRUE, FALSE));
Trying to replicate this in Rust, gst::Event::new_step()
has been deprecated and the compiler suggests using gst::event::Step::new()
.
The function signature is :
pub fn new<V: Into<GenericFormattedValue>>( amount: V, rate: f64, flush: bool, intermediate: bool ) -> Event
However, I am unable to create the event by using amount as gst::Format::Buffers
and I cannot understand how to resolve the compiler output error message:
This is what I have written :
gst::event::Step::new(gst::Format::Buffers), 1.0, true, false)
I cannot understand how or why the trait bound in question is not satisfied and what I have to do to get past the error.
Any help on resolving this would be greatly appreciated. Furthermore, I apologize in advance if opening an issue is not appropriate or if my question seems naive. I am new to gstreamer and Rust and trying my best to learn. Thanks