gst_element_query_position problem

Deepak Jain jain1982 at gmail.com
Fri Nov 29 06:27:07 PST 2013


Hi Sebastian,

Thanks for your quick reply.

Do I need to create this new segment always while doing a position query?

I am updating my application's timer and progress bar by calling a
g_timeout_add of 250 ms on the pipeline and in the callback function, I am
querying for the position.

Also, are you referring to using the functions like :

gst_segment_set_running_time
<https://developer.gnome.org/gstreamer/0.10/gstreamer-GstSegment.html#gst-segment-set-running-time>
 and gst_segment_to_stream_time
<https://developer.gnome.org/gstreamer/0.10/gstreamer-GstSegment.html#gst-segment-to-stream-time>


It will be really helpful to me if you point me to some code position/link
that I can refer to.

Thanks Again.
Deepak Jain





On Fri, Nov 29, 2013 at 7:29 PM, Sebastian Dröge
<sebastian at centricular.com>wrote:

> On Fr, 2013-11-29 at 19:11 +0530, Deepak Jain wrote:
> > Hi,
> >
> > I am working with Gstreamer 0.10.
> > I am working on a Video on Demand application where-in users can watch
> the
> > videos by streaming from their servers with adaptive streaming.
> >
> > User can PLAY a video, can return BACK in the middle of movie playback
> and
> > can get back to that movie later. Instead of the usual PLAY option, user
> > also gets Resume PLAYBACk option wherein he can start from the same
> > position at where he stopped earlier.
> >
> > My situation is similar. I am resuming playback.
> >
> > Say, I am resuming from 120sec, but my pipeline will start from the
> > beginning, all things starts fresh, but data starts coming from 120sec.
> >
> > My pipeline is appsrc->h264parse-ffdec_h264->xvimagesink.
> >
> > While pushing buffers in the appsrc, I am also setting
> GST_BUFFER_TIMESTAMP.
> >
> > Now, my problem is when I query pipeline for the position of the playback
> > using gst_element_query_position(), it always starts from zero, and due
> to
> > this, even though my playback starts from 120sec, my progress bar and
> timer
> > always starts from zero.
> >
> > What could be the the cause of this problem ? and what should be the
> proper
> > solution ?
> >
> > Please help me as i dont know how to fix it. I assume that
> > gst_element_query_position() should always return the timestamp of the
> > playing buffer, but its not.
>
> gst_element_query_position() always returns the position in stream time,
> which by what you're doing is equal to the running time and going from 0
> to the end of file.
>
> You'll need to create adapted new-segment events in your source to a)
> make the stream time start from the time you want, while b) making the
> running time go from 0 to the end of the file.
>
> See gstreamer/docs/design/part-synchronization for an explanation of how
> the different times in GStreamer work together. This will also be easier
> to achieve with GStreamer 1.x as the segment handling was improved a
> lot.
>
> --
> Sebastian Dröge <sebastian at centricular.com>
> Centricular Ltd - http://www.centricular.com
> Expertise, Straight from the Source
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20131129/76a4b7cb/attachment.html>


More information about the gstreamer-devel mailing list