get data rate at eos

Jan Schmidt jan at widgetgrove.com.au
Sat Jan 13 03:32:44 UTC 2024


Hi,

gst_element_seek_simple() is just a wrapper around a call to:

|gst_element_seek (element, 1.0, format, seek_flags, GST_SEEK_TYPE_SET, 
seek_pos, GST_SEEK_TYPE_SET, GST_CLOCK_TIME_NONE);|

Use the full version, and you can replace the hard-coded 1.0 rate with 
the current rate (you’ll need to store that based on the rate you last 
requested). I assume you’re already using the full seek function 
elsewhere, or you wouldn’t have been able to modify the playback rate in 
the first place.

Cheers,

Jan.

On 8/1/24 06:45, Kenneth Feingold via gstreamer-devel wrote:

> I am trying to grab the speed at which video is playing at the moment 
> it reaches the end (or start, if playing in reverse) of a video 
> stream, I have implemented the ability to have the stream jump to 
> where I want it to go (here, 1 second from the start) when it reaches 
> the end or start of the stream, but no matter what the playback rate 
> is at the moment it reaches the eos the rate resets to normal forward. 
> I am working in C.
>
> static void eos_cb (GstBus *bus, GstMessage *msg, CustomData *data) {
> g_print ("End-Of-Stream reached.\n");
> gst_element_seek_simple (data->playbin, GST_FORMAT_TIME,
> GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT, 1 * GST_SECOND);
> send_seek_event (data);
> }
> Thanks for any advice.

​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20240113/5041e2af/attachment-0001.htm>


More information about the gstreamer-devel mailing list