Commit e5ed591a authored by Laurent Aimar's avatar Laurent Aimar

Implemented buffering manipulation at the es_out level.

It allows faster seek and start up time when the access pace can be controlled.
parent 2b9d0814
......@@ -361,6 +361,42 @@ int input_clock_GetRate( input_clock_t *cl )
return i_rate;
}
int input_clock_GetState( input_clock_t *cl,
mtime_t *pi_stream_start, mtime_t *pi_system_start,
mtime_t *pi_stream_duration, mtime_t *pi_system_duration )
{
vlc_mutex_lock( &cl->lock );
if( !cl->b_has_reference )
{
vlc_mutex_unlock( &cl->lock );
return VLC_EGENERIC;
}
*pi_stream_start = cl->ref.i_stream;
*pi_system_start = cl->ref.i_system;
*pi_stream_duration = cl->last.i_stream - cl->ref.i_stream;
*pi_system_duration = cl->last.i_system - cl->ref.i_system;
vlc_mutex_unlock( &cl->lock );
return VLC_SUCCESS;
}
void input_clock_ChangeSystemOrigin( input_clock_t *cl, mtime_t i_system )
{
vlc_mutex_lock( &cl->lock );
assert( cl->b_has_reference );
const mtime_t i_offset = i_system - cl->ref.i_system;
cl->ref.i_system += i_offset;
cl->last.i_system += i_offset;
vlc_mutex_unlock( &cl->lock );
}
/*****************************************************************************
* ClockStreamToSystem: converts a movie clock to system date
*****************************************************************************/
......
This diff is collapsed.
This diff is collapsed.
......@@ -75,6 +75,13 @@ void input_clock_ChangeRate( input_clock_t *, int i_rate );
*/
void input_clock_ChangePause( input_clock_t *, bool b_paused, mtime_t i_date );
/**
* This function allows to rebase the original system value date.
* It can be called only imediatly after a input_clock_Update call.
* FIXME ugly
*/
void input_clock_ChangeSystemOrigin( input_clock_t *, mtime_t i_system );
/**
* This function converts a timestamp from stream clock to system clock.
*
......@@ -88,5 +95,13 @@ mtime_t input_clock_GetTS( input_clock_t *, int *pi_rate, mtime_t i_pts_delay, m
*/
int input_clock_GetRate( input_clock_t * );
/**
* This function returns current clock state or VLC_EGENERIC if there is not a
* reference point.
*/
int input_clock_GetState( input_clock_t *,
mtime_t *pi_stream_start, mtime_t *pi_system_start,
mtime_t *pi_stream_duration, mtime_t *pi_system_duration );
#endif
......@@ -51,6 +51,11 @@ void input_DecoderChangeDelay( decoder_t *, mtime_t i_delay );
*/
void input_DecoderStartBuffering( decoder_t * );
/**
* This function waits for the decoder to have buffered sufficient data.
*/
void input_DecoderWaitBuffering( decoder_t * );
/**
* This function stops the buffering mode.
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment