Commit fccbbf97 authored by Laurent Aimar's avatar Laurent Aimar

Convert remaining input_EsOut* to es_out_Control.

parent 2c73cfb4
This diff is collapsed.
...@@ -47,11 +47,29 @@ enum es_out_query_private_e ...@@ -47,11 +47,29 @@ enum es_out_query_private_e
/* Check if es_out has still data to play */ /* Check if es_out has still data to play */
ES_OUT_GET_EMPTY, /* arg1=bool* res=cannot fail */ ES_OUT_GET_EMPTY, /* arg1=bool* res=cannot fail */
/* */ /* Set delay for a ES category */
ES_OUT_SET_DELAY, /* arg1=es_category_e, res=can fail */ ES_OUT_SET_DELAY, /* arg1=es_category_e, res=can fail */
/* */ /* Set record state */
ES_OUT_SET_RECORD_STATE, /* arg1=bool res=can fail */ ES_OUT_SET_RECORD_STATE, /* arg1=bool res=can fail */
/* Set pause state */
ES_OUT_SET_PAUSE_STATE, /* arg1=bool arg2=mtime_t res=can fail */
/* Set rate */
ES_OUT_SET_RATE, /* arg1=int i_rate res=can fail */
/* Set a new time */
ES_OUT_SET_TIME, /* arg1=mtime_t res=can fail */
/* Set next frame */
ES_OUT_SET_FRAME_NEXT, /* res=can fail */
/* Lock/Unlock es_out
* XXX es_out is safe without them, but they ensure coherency between
* calls if needed (if es_out is called outside of the main thread) */
ES_OUT_LOCK, /* res=cannot fail */
ES_OUT_UNLOCK, /* res=cannot fail */
}; };
static inline mtime_t es_out_GetWakeup( es_out_t *p_out ) static inline mtime_t es_out_GetWakeup( es_out_t *p_out )
...@@ -86,15 +104,33 @@ static inline int es_out_SetRecordState( es_out_t *p_out, bool b_record ) ...@@ -86,15 +104,33 @@ static inline int es_out_SetRecordState( es_out_t *p_out, bool b_record )
{ {
return es_out_Control( p_out, ES_OUT_SET_RECORD_STATE, b_record ); return es_out_Control( p_out, ES_OUT_SET_RECORD_STATE, b_record );
} }
static inline int es_out_SetPauseState( es_out_t *p_out, bool b_paused, mtime_t i_date )
{
return es_out_Control( p_out, ES_OUT_SET_PAUSE_STATE, b_paused, i_date );
}
static inline int es_out_SetRate( es_out_t *p_out, int i_rate )
{
return es_out_Control( p_out, ES_OUT_SET_RATE, i_rate );
}
static inline int es_out_SetTime( es_out_t *p_out, mtime_t i_date )
{
return es_out_Control( p_out, ES_OUT_SET_TIME, i_date );
}
static inline int es_out_SetFrameNext( es_out_t *p_out )
{
return es_out_Control( p_out, ES_OUT_SET_FRAME_NEXT );
}
static inline void es_out_Lock( es_out_t *p_out )
{
int i_ret = es_out_Control( p_out, ES_OUT_LOCK );
assert( !i_ret );
}
static inline void es_out_Unlock( es_out_t *p_out )
{
int i_ret = es_out_Control( p_out, ES_OUT_UNLOCK );
assert( !i_ret );
}
es_out_t *input_EsOutNew( input_thread_t *, int i_rate ); es_out_t *input_EsOutNew( input_thread_t *, int i_rate );
void input_EsOutChangeRate( es_out_t *, int );
void input_EsOutChangePause( es_out_t *, bool b_paused, mtime_t i_date );
void input_EsOutChangePosition( es_out_t * );
void input_EsOutFrameNext( es_out_t * );
void input_EsOutLock( es_out_t * );
void input_EsOutUnlock( es_out_t * );
#endif #endif
...@@ -1511,7 +1511,7 @@ static void ControlPause( input_thread_t *p_input, mtime_t i_control_date ) ...@@ -1511,7 +1511,7 @@ static void ControlPause( input_thread_t *p_input, mtime_t i_control_date )
/* */ /* */
if( !i_ret ) if( !i_ret )
input_EsOutChangePause( p_input->p->p_es_out, true, i_control_date ); es_out_SetPauseState( p_input->p->p_es_out, true, i_control_date );
} }
static void ControlUnpause( input_thread_t *p_input, mtime_t i_control_date ) static void ControlUnpause( input_thread_t *p_input, mtime_t i_control_date )
{ {
...@@ -1537,7 +1537,7 @@ static void ControlUnpause( input_thread_t *p_input, mtime_t i_control_date ) ...@@ -1537,7 +1537,7 @@ static void ControlUnpause( input_thread_t *p_input, mtime_t i_control_date )
/* */ /* */
if( !i_ret ) if( !i_ret )
input_EsOutChangePause( p_input->p->p_es_out, false, i_control_date ); es_out_SetPauseState( p_input->p->p_es_out, false, i_control_date );
} }
static bool Control( input_thread_t *p_input, int i_type, static bool Control( input_thread_t *p_input, int i_type,
...@@ -1549,7 +1549,7 @@ static bool Control( input_thread_t *p_input, int i_type, ...@@ -1549,7 +1549,7 @@ static bool Control( input_thread_t *p_input, int i_type,
if( !p_input ) if( !p_input )
return b_force_update; return b_force_update;
input_EsOutLock( p_input->p->p_es_out ); es_out_Lock( p_input->p->p_es_out );
switch( i_type ) switch( i_type )
{ {
...@@ -1584,7 +1584,7 @@ static bool Control( input_thread_t *p_input, int i_type, ...@@ -1584,7 +1584,7 @@ static bool Control( input_thread_t *p_input, int i_type,
if( f_pos < 0.0 ) f_pos = 0.0; if( f_pos < 0.0 ) f_pos = 0.0;
if( f_pos > 1.0 ) f_pos = 1.0; if( f_pos > 1.0 ) f_pos = 1.0;
/* Reset the decoders states and clock sync (before calling the demuxer */ /* Reset the decoders states and clock sync (before calling the demuxer */
input_EsOutChangePosition( p_input->p->p_es_out ); es_out_SetTime( p_input->p->p_es_out, -1 );
if( demux_Control( p_input->p->input.p_demux, DEMUX_SET_POSITION, if( demux_Control( p_input->p->input.p_demux, DEMUX_SET_POSITION,
f_pos ) ) f_pos ) )
{ {
...@@ -1628,7 +1628,7 @@ static bool Control( input_thread_t *p_input, int i_type, ...@@ -1628,7 +1628,7 @@ static bool Control( input_thread_t *p_input, int i_type,
if( i_time < 0 ) i_time = 0; if( i_time < 0 ) i_time = 0;
/* Reset the decoders states and clock sync (before calling the demuxer */ /* Reset the decoders states and clock sync (before calling the demuxer */
input_EsOutChangePosition( p_input->p->p_es_out ); es_out_SetTime( p_input->p->p_es_out, -1 );
i_ret = demux_Control( p_input->p->input.p_demux, i_ret = demux_Control( p_input->p->input.p_demux,
DEMUX_SET_TIME, i_time ); DEMUX_SET_TIME, i_time );
...@@ -1787,7 +1787,7 @@ static bool Control( input_thread_t *p_input, int i_type, ...@@ -1787,7 +1787,7 @@ static bool Control( input_thread_t *p_input, int i_type,
/* FIXME do we need a RESET_PCR when !p_input->p->input.b_rescale_ts ? */ /* FIXME do we need a RESET_PCR when !p_input->p->input.b_rescale_ts ? */
if( p_input->p->input.b_rescale_ts ) if( p_input->p->input.b_rescale_ts )
input_EsOutChangeRate( p_input->p->p_es_out, i_rate ); es_out_SetRate( p_input->p->p_es_out, i_rate );
b_force_update = true; b_force_update = true;
} }
...@@ -1847,7 +1847,7 @@ static bool Control( input_thread_t *p_input, int i_type, ...@@ -1847,7 +1847,7 @@ static bool Control( input_thread_t *p_input, int i_type,
if( i_title >= 0 && i_title < p_input->p->input.i_title ) if( i_title >= 0 && i_title < p_input->p->input.i_title )
{ {
input_EsOutChangePosition( p_input->p->p_es_out ); es_out_SetTime( p_input->p->p_es_out, -1 );
demux_Control( p_demux, DEMUX_SET_TITLE, i_title ); demux_Control( p_demux, DEMUX_SET_TITLE, i_title );
input_ControlVarTitle( p_input, i_title ); input_ControlVarTitle( p_input, i_title );
...@@ -1867,7 +1867,7 @@ static bool Control( input_thread_t *p_input, int i_type, ...@@ -1867,7 +1867,7 @@ static bool Control( input_thread_t *p_input, int i_type,
if( i_title >= 0 && i_title < p_input->p->input.i_title ) if( i_title >= 0 && i_title < p_input->p->input.i_title )
{ {
input_EsOutChangePosition( p_input->p->p_es_out ); es_out_SetTime( p_input->p->p_es_out, -1 );
access_Control( p_access, ACCESS_SET_TITLE, i_title ); access_Control( p_access, ACCESS_SET_TITLE, i_title );
stream_AccessReset( p_input->p->input.p_stream ); stream_AccessReset( p_input->p->input.p_stream );
...@@ -1914,7 +1914,7 @@ static bool Control( input_thread_t *p_input, int i_type, ...@@ -1914,7 +1914,7 @@ static bool Control( input_thread_t *p_input, int i_type,
p_input->p->input.title[p_demux->info.i_title]->i_seekpoint ) p_input->p->input.title[p_demux->info.i_title]->i_seekpoint )
{ {
input_EsOutChangePosition( p_input->p->p_es_out ); es_out_SetTime( p_input->p->p_es_out, -1 );
demux_Control( p_demux, DEMUX_SET_SEEKPOINT, i_seekpoint ); demux_Control( p_demux, DEMUX_SET_SEEKPOINT, i_seekpoint );
} }
...@@ -1949,7 +1949,7 @@ static bool Control( input_thread_t *p_input, int i_type, ...@@ -1949,7 +1949,7 @@ static bool Control( input_thread_t *p_input, int i_type,
if( i_seekpoint >= 0 && i_seekpoint < if( i_seekpoint >= 0 && i_seekpoint <
p_input->p->input.title[p_access->info.i_title]->i_seekpoint ) p_input->p->input.title[p_access->info.i_title]->i_seekpoint )
{ {
input_EsOutChangePosition( p_input->p->p_es_out ); es_out_SetTime( p_input->p->p_es_out, -1 );
access_Control( p_access, ACCESS_SET_SEEKPOINT, access_Control( p_access, ACCESS_SET_SEEKPOINT,
i_seekpoint ); i_seekpoint );
...@@ -2046,7 +2046,7 @@ static bool Control( input_thread_t *p_input, int i_type, ...@@ -2046,7 +2046,7 @@ static bool Control( input_thread_t *p_input, int i_type,
if( p_input->i_state == PAUSE_S ) if( p_input->i_state == PAUSE_S )
{ {
input_EsOutFrameNext( p_input->p->p_es_out ); es_out_SetFrameNext( p_input->p->p_es_out );
} }
else if( p_input->i_state == PLAYING_S ) else if( p_input->i_state == PLAYING_S )
{ {
...@@ -2065,7 +2065,7 @@ static bool Control( input_thread_t *p_input, int i_type, ...@@ -2065,7 +2065,7 @@ static bool Control( input_thread_t *p_input, int i_type,
break; break;
} }
input_EsOutUnlock( p_input->p->p_es_out ); es_out_Unlock( p_input->p->p_es_out );
return b_force_update; return b_force_update;
} }
......
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