gst_element_query_position problem

Sebastian Dröge sebastian at centricular.com
Fri Nov 29 05:59:50 PST 2013


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 966 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20131129/3f42184e/attachment.pgp>


More information about the gstreamer-devel mailing list