The input event vout now warns about every vout creation/destruction
due to a decoder.
audio_date_t end_date;
};
audio_date_t end_date;
};
+/* */
+typedef struct
+{
+ vout_thread_t *(*pf_request_vout)( void *,
+ vout_thread_t *, video_format_t * );
+ void *p_private;
+} aout_request_vout_t;
+
/** audio output filter */
typedef struct aout_filter_owner_sys_t aout_filter_owner_sys_t;
typedef struct aout_filter_sys_t aout_filter_sys_t;
/** audio output filter */
typedef struct aout_filter_owner_sys_t aout_filter_owner_sys_t;
typedef struct aout_filter_sys_t aout_filter_sys_t;
/* Vout callback
* XXX use aout_filter_RequestVout */
/* Vout callback
* XXX use aout_filter_RequestVout */
- vout_thread_t *(*pf_request_vout)( aout_filter_t *,
- vout_thread_t *, video_format_t * );
+ aout_request_vout_t request_vout;
/* Private structure for the owner of the filter */
aout_filter_owner_sys_t *p_owner;
/* Private structure for the owner of the filter */
aout_filter_owner_sys_t *p_owner;
/* */
bool b_paused;
mtime_t i_pause_date;
/* */
bool b_paused;
mtime_t i_pause_date;
+
+ /* */
+ aout_request_vout_t request_vout;
};
/** an output stream for the audio output */
};
/** an output stream for the audio output */
* - "seekable (if you can seek, it doesn't say if 'bar display' has be shown FIXME rename can-seek
* or not, for that check position != 0.0)
* - "can-pause"
* - "seekable (if you can seek, it doesn't say if 'bar display' has be shown FIXME rename can-seek
* or not, for that check position != 0.0)
* - "can-pause"
* - "can-rewind"
* - "can-record" (if a stream can be recorded while playing)
* - "teletext-es" to get the index of spu track that is teletext --1 if no teletext)
* - "can-rewind"
* - "can-record" (if a stream can be recorded while playing)
* - "teletext-es" to get the index of spu track that is teletext --1 if no teletext)
+ * - "signal-quality"
+ * - "signal-strength"
*
* The read-write variables are:
* - state (\see input_state_e)
* - rate, rate-slower, rate-faster
* - position, position-offset
* - time, time-offset
*
* The read-write variables are:
* - state (\see input_state_e)
* - rate, rate-slower, rate-faster
* - position, position-offset
* - time, time-offset
- * - title,title-next,title-prev
- * - chapter,chapter-next, chapter-prev
+ * - title, next-title, prev-title
+ * - chapter, next-chapter, next-chapter-prev
* - program, audio-es, video-es, spu-es
* - audio-delay, spu-delay
* - bookmark
* - program, audio-es, video-es, spu-es
* - audio-delay, spu-delay
* - bookmark
- * - TODO add special titles variables
+ * - record
+ * - frame-next
+ * - navigation (list of "title %2i")
+ * - "title %2i"
*
* The variable used for event is
* - intf-event (\see input_event_type_e)
*
* The variable used for event is
* - intf-event (\see input_event_type_e)
/* "record" has changed */
INPUT_EVENT_RECORD,
/* "record" has changed */
INPUT_EVENT_RECORD,
- /* A vout has been created/deleted by *the input*
- * FIXME some event are not detected yet (audio visualisation) */
+ /* A vout has been created/deleted by *the input* */
INPUT_EVENT_VOUT,
/* input_item_t media has changed */
INPUT_EVENT_VOUT,
/* input_item_t media has changed */
/****************************************************************************
* Prototypes
*****************************************************************************/
/****************************************************************************
* Prototypes
*****************************************************************************/
-int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input );
+int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input, const aout_request_vout_t * );
int aout_InputDelete( aout_instance_t * p_aout, aout_input_t * p_input );
int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input,
aout_buffer_t * p_buffer, int i_input_rate );
int aout_InputDelete( aout_instance_t * p_aout, aout_input_t * p_input );
int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input,
aout_buffer_t * p_buffer, int i_input_rate );
int aout_VolumeNoneInfos( aout_instance_t *, audio_volume_t * );
/* From dec.c */
int aout_VolumeNoneInfos( aout_instance_t *, audio_volume_t * );
/* From dec.c */
-#define aout_DecNew(a, b, c, d) __aout_DecNew(VLC_OBJECT(a), b, c, d)
-aout_input_t * __aout_DecNew( vlc_object_t *, aout_instance_t **, audio_sample_format_t *, const audio_replay_gain_t * );
+#define aout_DecNew(a, b, c, d, e) __aout_DecNew(VLC_OBJECT(a), b, c, d, e)
+aout_input_t * __aout_DecNew( vlc_object_t *, aout_instance_t **,
+ audio_sample_format_t *, const audio_replay_gain_t *,
+ const aout_request_vout_t * );
int aout_DecDelete ( aout_instance_t *, aout_input_t * );
aout_buffer_t * aout_DecNewBuffer( aout_input_t *, size_t );
void aout_DecDeleteBuffer( aout_instance_t *, aout_input_t *, aout_buffer_t * );
int aout_DecDelete ( aout_instance_t *, aout_input_t * );
aout_buffer_t * aout_DecNewBuffer( aout_input_t *, size_t );
void aout_DecDeleteBuffer( aout_instance_t *, aout_input_t *, aout_buffer_t * );
*****************************************************************************/
static aout_input_t * DecNew( vlc_object_t * p_this, aout_instance_t * p_aout,
audio_sample_format_t *p_format,
*****************************************************************************/
static aout_input_t * DecNew( vlc_object_t * p_this, aout_instance_t * p_aout,
audio_sample_format_t *p_format,
- const audio_replay_gain_t *p_replay_gain )
+ const audio_replay_gain_t *p_replay_gain,
+ const aout_request_vout_t *p_request_vout )
{
aout_input_t * p_input;
{
aout_input_t * p_input;
/* Create other input streams. */
for ( i = 0; i < p_aout->i_nb_inputs - 1; i++ )
{
/* Create other input streams. */
for ( i = 0; i < p_aout->i_nb_inputs - 1; i++ )
{
- aout_lock_input( p_aout, p_aout->pp_inputs[i] );
- aout_InputDelete( p_aout, p_aout->pp_inputs[i] );
- aout_InputNew( p_aout, p_aout->pp_inputs[i] );
- aout_unlock_input( p_aout, p_aout->pp_inputs[i] );
+ aout_input_t *p_input = p_aout->pp_inputs[i];
+
+ aout_lock_input( p_aout, p_input );
+ aout_InputDelete( p_aout, p_input );
+ aout_InputNew( p_aout, p_input, &p_input->request_vout );
+ aout_unlock_input( p_aout, p_input );
- aout_InputNew( p_aout, p_input );
+ aout_InputNew( p_aout, p_input, p_request_vout );
aout_unlock_input_fifos( p_aout );
aout_unlock_mixer( p_aout );
aout_unlock_input_fifos( p_aout );
aout_unlock_mixer( p_aout );
aout_input_t * __aout_DecNew( vlc_object_t * p_this,
aout_instance_t ** pp_aout,
audio_sample_format_t * p_format,
aout_input_t * __aout_DecNew( vlc_object_t * p_this,
aout_instance_t ** pp_aout,
audio_sample_format_t * p_format,
- const audio_replay_gain_t *p_replay_gain )
+ const audio_replay_gain_t *p_replay_gain,
+ const aout_request_vout_t *p_request_video )
{
aout_instance_t *p_aout = *pp_aout;
if ( p_aout == NULL )
{
aout_instance_t *p_aout = *pp_aout;
if ( p_aout == NULL )
- return DecNew( p_this, p_aout, p_format, p_replay_gain );
+ return DecNew( p_this, p_aout, p_format, p_replay_gain, p_request_video );
}
/*****************************************************************************
}
/*****************************************************************************
vout_thread_t *aout_filter_RequestVout( aout_filter_t *p_filter,
vout_thread_t *p_vout, video_format_t *p_fmt )
{
vout_thread_t *aout_filter_RequestVout( aout_filter_t *p_filter,
vout_thread_t *p_vout, video_format_t *p_fmt )
{
- if( !p_filter->pf_request_vout )
+ if( !p_filter->request_vout.pf_request_vout )
- return p_filter->pf_request_vout( p_filter, p_vout, p_fmt );
+ return p_filter->request_vout.pf_request_vout( p_filter->request_vout.p_private, p_vout, p_fmt );
vlc_value_t, vlc_value_t, void * );
static void ReplayGainSelect( aout_instance_t *, aout_input_t * );
vlc_value_t, vlc_value_t, void * );
static void ReplayGainSelect( aout_instance_t *, aout_input_t * );
-static vout_thread_t *RequestVout( aout_filter_t *,
+static vout_thread_t *RequestVout( void *,
vout_thread_t *, video_format_t * );
/*****************************************************************************
* aout_InputNew : allocate a new input and rework the filter pipeline
*****************************************************************************/
vout_thread_t *, video_format_t * );
/*****************************************************************************
* aout_InputNew : allocate a new input and rework the filter pipeline
*****************************************************************************/
-int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input )
+int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input, const aout_request_vout_t *p_request_vout )
{
audio_sample_format_t chain_input_format;
audio_sample_format_t chain_output_format;
{
audio_sample_format_t chain_input_format;
audio_sample_format_t chain_output_format;
aout_FifoInit( p_aout, &p_input->fifo, p_aout->mixer.mixer.i_rate );
p_input->p_first_byte_to_mix = NULL;
aout_FifoInit( p_aout, &p_input->fifo, p_aout->mixer.mixer.i_rate );
p_input->p_first_byte_to_mix = NULL;
+ /* */
+ if( p_request_vout )
+ {
+ p_input->request_vout = *p_request_vout;
+ }
+ else
+ {
+ p_input->request_vout.pf_request_vout = RequestVout;
+ p_input->request_vout.p_private = p_aout;
+ }
+
/* Prepare format structure */
memcpy( &chain_input_format, &p_input->input,
sizeof(audio_sample_format_t) );
/* Prepare format structure */
memcpy( &chain_input_format, &p_input->input,
sizeof(audio_sample_format_t) );
vlc_object_attach( p_filter , p_aout );
vlc_object_attach( p_filter , p_aout );
- p_filter->pf_request_vout = RequestVout;
+ p_filter->request_vout = p_input->request_vout;
p_filter->p_owner = malloc( sizeof(*p_filter->p_owner) );
p_filter->p_owner->p_aout = p_aout;
p_filter->p_owner->p_input = p_input;
p_filter->p_owner = malloc( sizeof(*p_filter->p_owner) );
p_filter->p_owner->p_aout = p_aout;
p_filter->p_owner->p_input = p_input;
aout_InputDelete( p_aout, p_input );
aout_InputDelete( p_aout, p_input );
- aout_InputNew( p_aout, p_input );
+ aout_InputNew( p_aout, p_input, &p_input->request_vout );
p_input->p_first_byte_to_mix = p_first_byte_to_mix;
p_input->fifo = fifo;
p_input->b_paused = b_paused;
p_input->p_first_byte_to_mix = p_first_byte_to_mix;
p_input->fifo = fifo;
p_input->b_paused = b_paused;
-static vout_thread_t *RequestVout( aout_filter_t *p_filter,
+static vout_thread_t *RequestVout( void *p_private,
vout_thread_t *p_vout, video_format_t *p_fmt )
{
vout_thread_t *p_vout, video_format_t *p_fmt )
{
- /* TODO */
- return vout_Request( p_filter, p_vout, p_fmt );
+ aout_instance_t *p_aout = p_private;
+ return vout_Request( p_aout, p_vout, p_fmt );
}
static int ChangeFiltersString( aout_instance_t * p_aout, const char* psz_variable,
}
static int ChangeFiltersString( aout_instance_t * p_aout, const char* psz_variable,
for ( i = 0; i < p_aout->i_nb_inputs; i++ )
{
aout_input_t * p_input = p_aout->pp_inputs[i];
for ( i = 0; i < p_aout->i_nb_inputs; i++ )
{
aout_input_t * p_input = p_aout->pp_inputs[i];
- b_error |= aout_InputNew( p_aout, p_input );
+ b_error |= aout_InputNew( p_aout, p_input, &p_input->request_vout );
p_input->b_changed = 1;
aout_unlock_input( p_aout, p_input );
}
p_input->b_changed = 1;
aout_unlock_input( p_aout, p_input );
}
/*****************************************************************************
* Buffers allocation callbacks for the decoders
*****************************************************************************/
/*****************************************************************************
* Buffers allocation callbacks for the decoders
*****************************************************************************/
+static vout_thread_t *aout_request_vout( void *p_private,
+ vout_thread_t *p_vout, video_format_t *p_fmt )
+{
+ decoder_t *p_dec = p_private;
+
+ p_vout = vout_Request( p_dec, p_vout, p_fmt );
+ input_SendEventVout( p_dec->p_owner->p_input );
+
+ return p_vout;
+}
+
static aout_buffer_t *aout_new_buffer( decoder_t *p_dec, int i_samples )
{
decoder_owner_sys_t *p_owner = p_dec->p_owner;
static aout_buffer_t *aout_new_buffer( decoder_t *p_dec, int i_samples )
{
decoder_owner_sys_t *p_owner = p_dec->p_owner;
audio_sample_format_t format;
aout_input_t *p_aout_input;
aout_instance_t *p_aout;
audio_sample_format_t format;
aout_input_t *p_aout_input;
aout_instance_t *p_aout;
+ aout_request_vout_t request_vout;
p_dec->fmt_out.audio.i_format = p_dec->fmt_out.i_codec;
p_owner->audio = p_dec->fmt_out.audio;
p_dec->fmt_out.audio.i_format = p_dec->fmt_out.i_codec;
p_owner->audio = p_dec->fmt_out.audio;
+ request_vout.pf_request_vout = aout_request_vout;
+ request_vout.p_private = p_dec;
+
p_aout = p_owner->p_aout;
p_aout_input = aout_DecNew( p_dec, &p_aout,
p_aout = p_owner->p_aout;
p_aout_input = aout_DecNew( p_dec, &p_aout,
- &format, &p_dec->fmt_out.audio_replay_gain );
+ &format, &p_dec->fmt_out.audio_replay_gain, &request_vout );
vlc_mutex_lock( &p_owner->lock );
p_owner->p_aout = p_aout;
vlc_mutex_lock( &p_owner->lock );
p_owner->p_aout = p_aout;