Commit acb1a3ac authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

input: Add an event manager to the input.

Currently libvlc uses "state" callback to notice input state changes, and the playlist notice input state change via direct call from the input.
playlist can't use the "state" variable as it is also used by the playlist to ask the input to do a certain action.

The event approach is much more clear here.
parent a779588f
......@@ -166,6 +166,10 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
p_input->b_preparsing = b_quick;
p_input->psz_header = psz_header ? strdup( psz_header ) : NULL;
/* Init events */
vlc_event_manager_init_with_vlc_object(
&p_input->p->event_manager, p_input );
/* Init Common fields */
p_input->b_eof = false;
p_input->b_can_pace_control = true;
......@@ -309,6 +313,8 @@ static void Destructor( input_thread_t * p_input )
{
input_thread_private_t *priv = p_input->p;
vlc_event_manager_fini( &p_input->p->event_manager );
stats_TimerDump( p_input, STATS_TIMER_INPUT_LAUNCHING );
stats_TimerClean( p_input, STATS_TIMER_INPUT_LAUNCHING );
#ifdef ENABLE_SOUT
......
......@@ -76,6 +76,9 @@ typedef struct
/** Private input fields */
struct input_thread_private_t
{
/* Object's event manager */
vlc_event_manager_t event_manager;
/* Global properties */
bool b_can_pause;
bool b_can_rate_control;
......
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