/* PCR handling, DTS/PTS will be automatically computed using thoses PCR
* XXX: SET_PCR(_GROUP) are in charge of the pace control. They will wait
* to slow down the demuxer so that it reads at the right speed.
- * XXX: if you want PREROLL just call ES_OUT_SET_NEXT_DISPLAY_TIME and send$
+ * XXX: if you want PREROLL just call ES_OUT_SET_NEXT_DISPLAY_TIME and send
* as you would normally do.
*/
ES_OUT_SET_PCR, /* arg1=int64_t i_pcr(microsecond!) (using default group 0)*/
/* Set epg for group (dynamic) */
ES_OUT_SET_GROUP_EPG, /* arg1=int i_group arg2=vlc_epg_t */
/* */
- ES_OUT_DEL_GROUP /* arg1=int i_group */
+ ES_OUT_DEL_GROUP, /* arg1=int i_group */
+
+ /* First value usable for private control */
+ ES_OUT_PRIVATE_START = 0x10000,
};
struct es_out_t
int (*pf_send) ( es_out_t *, es_out_id_t *, block_t * );
void (*pf_del) ( es_out_t *, es_out_id_t * );
int (*pf_control)( es_out_t *, int i_query, va_list );
- bool b_sout;
+ void (*pf_destroy)( es_out_t * );
+
+ bool b_sout;
es_out_sys_t *p_sys;
};
return i_result;
}
+static inline void es_out_Delete( es_out_t *p_out )
+{
+ p_out->pf_destroy( p_out );
+}
+
/**
* @}
*/
static es_out_id_t *EsOutAdd ( es_out_t *, es_format_t * );
static int EsOutSend ( es_out_t *, es_out_id_t *, block_t * );
static void EsOutDel ( es_out_t *, es_out_id_t * );
-static void EsOutSelect( es_out_t *out, es_out_id_t *es, bool b_force );
static int EsOutControl( es_out_t *, int i_query, va_list );
+static void EsOutDelete ( es_out_t *out );
+static void EsOutSelect( es_out_t *out, es_out_id_t *es, bool b_force );
static void EsOutAddInfo( es_out_t *, es_out_id_t *es );
static bool EsIsSelected( es_out_id_t *es );
out->pf_send = EsOutSend;
out->pf_del = EsOutDel;
out->pf_control = EsOutControl;
+ out->pf_destroy = EsOutDelete;
out->p_sys = p_sys;
out->b_sout = p_input->p->p_sout != NULL;
return out;
}
-/*****************************************************************************
- * input_EsOutDelete:
- *****************************************************************************/
-void input_EsOutDelete( es_out_t *out )
-{
- es_out_sys_t *p_sys = out->p_sys;
- int i;
-
- if( p_sys->p_sout_record )
- input_EsOutSetRecord( out, false );
-
- for( i = 0; i < p_sys->i_es; i++ )
- {
- if( p_sys->es[i]->p_dec )
- input_DecoderDelete( p_sys->es[i]->p_dec );
-
- free( p_sys->es[i]->psz_language );
- free( p_sys->es[i]->psz_language_code );
- es_format_Clean( &p_sys->es[i]->fmt );
-
- free( p_sys->es[i] );
- }
- if( p_sys->ppsz_audio_language )
- {
- for( i = 0; p_sys->ppsz_audio_language[i]; i++ )
- free( p_sys->ppsz_audio_language[i] );
- free( p_sys->ppsz_audio_language );
- }
- if( p_sys->ppsz_sub_language )
- {
- for( i = 0; p_sys->ppsz_sub_language[i]; i++ )
- free( p_sys->ppsz_sub_language[i] );
- free( p_sys->ppsz_sub_language );
- }
- free( p_sys->es );
-
- /* FIXME duplicate work EsOutProgramDel (but we cannot use it) add a EsOutProgramClean ? */
- for( i = 0; i < p_sys->i_pgrm; i++ )
- {
- es_out_pgrm_t *p_pgrm = p_sys->pgrm[i];
- input_clock_Delete( p_pgrm->p_clock );
- free( p_pgrm->psz_now_playing );
- free( p_pgrm->psz_publisher );
- free( p_pgrm->psz_name );
- if( p_pgrm->p_epg )
- vlc_epg_Delete( p_pgrm->p_epg );
-
- free( p_pgrm );
- }
- TAB_CLEAN( p_sys->i_pgrm, p_sys->pgrm );
- vlc_mutex_destroy( &p_sys->lock );
-
- free( p_sys );
- free( out );
-}
-
es_out_id_t *input_EsOutGetFromID( es_out_t *out, int i_id )
{
int i;
/*****************************************************************************
*
*****************************************************************************/
+static void EsOutDelete( es_out_t *out )
+{
+ es_out_sys_t *p_sys = out->p_sys;
+ int i;
+
+ if( p_sys->p_sout_record )
+ input_EsOutSetRecord( out, false );
+
+ for( i = 0; i < p_sys->i_es; i++ )
+ {
+ if( p_sys->es[i]->p_dec )
+ input_DecoderDelete( p_sys->es[i]->p_dec );
+
+ free( p_sys->es[i]->psz_language );
+ free( p_sys->es[i]->psz_language_code );
+ es_format_Clean( &p_sys->es[i]->fmt );
+
+ free( p_sys->es[i] );
+ }
+ if( p_sys->ppsz_audio_language )
+ {
+ for( i = 0; p_sys->ppsz_audio_language[i]; i++ )
+ free( p_sys->ppsz_audio_language[i] );
+ free( p_sys->ppsz_audio_language );
+ }
+ if( p_sys->ppsz_sub_language )
+ {
+ for( i = 0; p_sys->ppsz_sub_language[i]; i++ )
+ free( p_sys->ppsz_sub_language[i] );
+ free( p_sys->ppsz_sub_language );
+ }
+ free( p_sys->es );
+
+ /* FIXME duplicate work EsOutProgramDel (but we cannot use it) add a EsOutProgramClean ? */
+ for( i = 0; i < p_sys->i_pgrm; i++ )
+ {
+ es_out_pgrm_t *p_pgrm = p_sys->pgrm[i];
+ input_clock_Delete( p_pgrm->p_clock );
+ free( p_pgrm->psz_now_playing );
+ free( p_pgrm->psz_publisher );
+ free( p_pgrm->psz_name );
+ if( p_pgrm->p_epg )
+ vlc_epg_Delete( p_pgrm->p_epg );
+
+ free( p_pgrm );
+ }
+ TAB_CLEAN( p_sys->i_pgrm, p_sys->pgrm );
+ vlc_mutex_destroy( &p_sys->lock );
+
+ free( p_sys );
+ free( out );
+}
+
+
static void EsOutDecodersStopBuffering( es_out_t *out, bool b_forced )
{
es_out_sys_t *p_sys = out->p_sys;