Tracking "cache" value

This forum is about all development around libVLC.
Claupacius
Blank Cone
Blank Cone
Posts: 12
Joined: 01 Dec 2011 18:08

Tracking "cache" value

Postby Claupacius » 07 Jun 2012 18:35

Hi,
Tracking stream cache issue was raised a number of times on this forum, but the ultimate answer was that there is no API for knowing level of cache buffer.

We want to implement some kind of proprietary HTTP adaptive streaming ( not HLS/DASH, supported by VLC ).
In order to give feedback to the streaming server the client should know a dynamics of buffer size change.

I started digging inside the code ( es_out.c and decoder.c ) and found a named variable "cache", that I can query using

Code: Select all

float f_newCache = var_GetFloat ( p_input, "cache" );
However, this variable is updated nicely when initial buffering occurs, but if bitrate is too high, this value immediately drops to 0 and starts increasing again.

I found the event, which sets "cache" value to 0 occurs in switch block of EsOutControlLocked function with value :

case ES_OUT_RESET_PCR:

This case calls EsOutChangePosition routine and inside this function "cache"value is set to 0 :

input_SendEventCache( p_sys->p_input, 0.0 );

After this event playback is paused and buffering start again.

My question is, if there an option to know buffer level before it drops to 0 ?
Probably, the "cache" variable is a wrong point to look at.

The only place that variable "cache" is updated with actual level is function EsOutDecodersStopBuffering.

Thank you in advance for the help.

Claupacius
Blank Cone
Blank Cone
Posts: 12
Joined: 01 Dec 2011 18:08

Re: Tracking "cache" value

Postby Claupacius » 17 Jun 2012 22:36

May anybody tell me where can I see the actual value of buffer ( input or demux ) during play ?
Thanks !


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 10 guests