They will allow interfaces to display the current buffering status.
* - "teletext-es" to get the index of spu track that is teletext -1 if no teletext)
* - "signal-quality"
* - "signal-strength"
* - "teletext-es" to get the index of spu track that is teletext -1 if no teletext)
* - "signal-quality"
* - "signal-strength"
+ * - "cache" (level of data cached [0 .. 1])
*
* The read-write variables are:
* - state (\see input_state_e)
*
* The read-write variables are:
* - state (\see input_state_e)
/* "bookmark" has changed */
INPUT_EVENT_BOOKMARK,
/* "bookmark" has changed */
INPUT_EVENT_BOOKMARK,
+ /* cache" has changed */
+ INPUT_EVENT_CACHE,
+
} input_event_type_e;
/** @}*/
} input_event_type_e;
/** @}*/
if( i_stream_duration <= i_buffering_duration && !b_forced )
{
if( i_stream_duration <= i_buffering_duration && !b_forced )
{
- msg_Dbg( p_sys->p_input, "Buffering %d%%",
- (int)(100 * i_stream_duration / i_buffering_duration ) );
+ const double f_level = (double)i_stream_duration / i_buffering_duration;
+ input_SendEventCache( p_sys->p_input, f_level );
+
+ msg_Dbg( p_sys->p_input, "Buffering %d%%", (int)(100 * f_level) );
+ input_SendEventCache( p_sys->p_input, 1.0 );
msg_Dbg( p_sys->p_input, "Stream buffering done (%d ms in %d ms)",
(int)(i_stream_duration/1000), (int)(i_system_duration/1000) );
msg_Dbg( p_sys->p_input, "Stream buffering done (%d ms in %d ms)",
(int)(i_stream_duration/1000), (int)(i_system_duration/1000) );
vlc_event_send( &p_input->p->event_manager, &event );
}
vlc_event_send( &p_input->p->event_manager, &event );
}
+void input_SendEventCache( input_thread_t *p_input, double f_level )
+{
+ vlc_value_t val;
+
+ val.f_float = f_level;
+ var_Change( p_input, "cache", VLC_VAR_SETVALUE, &val, NULL );
+
+ Trigger( p_input, INPUT_EVENT_CACHE );
+}
+
/* FIXME: review them because vlc_event_send might be
* moved inside input_item* functions.
*/
/* FIXME: review them because vlc_event_send might be
* moved inside input_item* functions.
*/
void input_SendEventSeekpoint( input_thread_t *p_input, int i_title, int i_seekpoint );
void input_SendEventSignal( input_thread_t *p_input, double f_quality, double f_strength );
void input_SendEventState( input_thread_t *p_input, int i_state );
void input_SendEventSeekpoint( input_thread_t *p_input, int i_title, int i_seekpoint );
void input_SendEventSignal( input_thread_t *p_input, double f_quality, double f_strength );
void input_SendEventState( input_thread_t *p_input, int i_state );
+void input_SendEventCache( input_thread_t *p_input, double f_level );
/* TODO rename Item* */
void input_SendEventMeta( input_thread_t *p_input );
/* TODO rename Item* */
void input_SendEventMeta( input_thread_t *p_input );
/* */
input_ChangeState( p_input, OPENING_S );
/* */
input_ChangeState( p_input, OPENING_S );
+ input_SendEventCache( p_input, 0.0 );
/* */
if( InputSourceInit( p_input, &p_input->p->input,
/* */
if( InputSourceInit( p_input, &p_input->p->input,
var_Create( p_input, "signal-strength", VLC_VAR_FLOAT );
var_SetFloat( p_input, "signal-strength", -1 );
var_Create( p_input, "signal-strength", VLC_VAR_FLOAT );
var_SetFloat( p_input, "signal-strength", -1 );
+ var_Create( p_input, "cache", VLC_VAR_FLOAT );
+ var_SetFloat( p_input, "cache", 0.0 );
+
/* */
var_Create( p_input, "access-filter", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
var_Create( p_input, "access", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
/* */
var_Create( p_input, "access-filter", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
var_Create( p_input, "access", VLC_VAR_STRING | VLC_VAR_DOINHERIT );