Using buffering info in gstreamer 0.10

Pawel Kapica p.kapica at samsung.com
Wed Mar 16 15:38:45 UTC 2016


-----Original Message-----
From: gstreamer-devel [mailto:gstreamer-devel-bounces at lists.freedesktop.org] On Behalf Of Sebastian Dröge
Sent: Wednesday, March 16, 2016 3:19 PM
To: Discussion of the development of and with GStreamer
Subject: Re: Using buffering info in gstreamer 0.10

On Mi, 2016-03-16 at 15:07 +0100, Pawel Kapica wrote:
> Hi!
>  
> I am using GStreamer 0.10.38 (I have to use this version) for playing 
> video from network streams (e.g youtube) and I found a problem that I 
> need to solve.
> My application for video playing (using uridecodebin or playbin2) 
> should show user buffering progress. To be precise, if current 
> position (being played) is inside buffered area I need to show 
> buffering progress from current position to the end of its buffered 
> area. Using sample application (http://docs.gstreamer.com/plugins/vie
> wsource/viewpagesrc.action?pageId=327808 with ring -buffer limited to
> 2MB) I observe that current position may not be inside any reported 
> buffered area. In this example I can assume that data is buffered and 
> being processed inside the pipeline. The problem starts when user can 
> seek (multiple times) through the video.
> Can you please give me any clues if there is any way (API calls) to 
> learn if current position is inside next buffered area?
>  
> BR,
> Pawel
>  
> PS. To be precise, I observe that in my pipeline element that 
> responses for buffering queries is queue2. However this element shows 
> only state of its buffers. More data may be already push into pipeline 
> (for example to multiqueue). I think this is the reason why current 
> position may be outside buffers reported by queries. This knowledge 
> however does not give me the solution for a problem of determination 
> if current position is inside buffered area.

The buffering query also contains the already buffered ranges in addition to what it buffers currently. So you can get all the areas that were previously buffered from there with
  gst_query_get_n_buffering_ranges() and
  gst_query_parse_nth_buffering_range()

Not sure if this was already implemented in 0.10 though, you should consider upgrading to 1.x in any case. 0.10 is no longer maintained and supported since 3+ years.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com

I use both API functions you named. The problem is that when buffer in queue2 is limited, then old data (already pushed further into pipeline) is erased. As a result I can observe following situation:
1) before start: buffer is empty and video is stopped
2) I play video, buffer is being filled (from 0%)
3) When buffer is full, then used data in it is overwritten. 
4) After some time situation may be (example data): video playback progress is at 50%, and GStreamer reports one buffering range from 52% to 70% (buffer is full). The data from 50% to 52% are not reported in buffering query, because it is already pushed from queue2 to pipeline (it may be kept for example in multiqueue)

The problem I have is that I can’t tell during video playback if current position is inside buffered range or no.



More information about the gstreamer-devel mailing list