Commit 0df4762f authored by Thomas Guillem's avatar Thomas Guillem

dec: move all callbacks handling in vlc_codec.h

parent 3a8ae5e9
......@@ -385,27 +385,57 @@ VLC_API block_t * decoder_NewAudioBuffer( decoder_t *, int i_nb_samples ) VLC_US
* buffer. You have to release it using subpicture_Delete() or by returning
* it to the caller as a decoder_QueueSub parameter.
*/
VLC_API subpicture_t * decoder_NewSubpicture( decoder_t *, const subpicture_updater_t * ) VLC_USED;
VLC_USED
static inline subpicture_t *decoder_NewSubpicture( decoder_t *dec,
const subpicture_updater_t *p_dyn )
{
subpicture_t *p_subpicture = dec->pf_spu_buffer_new( dec, p_dyn );
if( !p_subpicture )
msg_Warn( dec, "can't get output subpicture" );
return p_subpicture;
}
/**
* This function gives all input attachments at once.
*
* You MUST release the returned values
*/
VLC_API int decoder_GetInputAttachments( decoder_t *, input_attachment_t ***ppp_attachment, int *pi_attachment );
static inline int decoder_GetInputAttachments( decoder_t *dec,
input_attachment_t ***ppp_attachment,
int *pi_attachment )
{
if( !dec->pf_get_attachments )
return VLC_EGENERIC;
return dec->pf_get_attachments( dec, ppp_attachment, pi_attachment );
}
/**
* This function converts a decoder timestamp into a display date comparable
* to mdate().
* You MUST use it *only* for gathering statistics about speed.
*/
VLC_API mtime_t decoder_GetDisplayDate( decoder_t *, mtime_t ) VLC_USED;
VLC_USED
static inline mtime_t decoder_GetDisplayDate( decoder_t *dec, mtime_t i_ts )
{
if( !dec->pf_get_display_date )
return VLC_TS_INVALID;
return dec->pf_get_display_date( dec, i_ts );
}
/**
* This function returns the current input rate.
* You MUST use it *only* for gathering statistics about speed.
*/
VLC_API int decoder_GetDisplayRate( decoder_t * ) VLC_USED;
VLC_USED
static inline int decoder_GetDisplayRate( decoder_t *dec )
{
if( !dec->pf_get_display_rate )
return 1000 /* XXX: INPUT_RATE_DEFAULT */;
return dec->pf_get_display_rate( dec );
}
/** @} */
/** @} */
......
......@@ -665,15 +665,6 @@ block_t *decoder_NewAudioBuffer( decoder_t *dec, int samples )
return block;
}
subpicture_t *decoder_NewSubpicture( decoder_t *p_decoder,
const subpicture_updater_t *p_dyn )
{
subpicture_t *p_subpicture = p_decoder->pf_spu_buffer_new( p_decoder, p_dyn );
if( !p_subpicture )
msg_Warn( p_decoder, "can't get output subpicture" );
return p_subpicture;
}
static void RequestReload( decoder_t * p_dec )
{
decoder_owner_sys_t *p_owner = p_dec->p_owner;
......@@ -682,36 +673,6 @@ static void RequestReload( decoder_t * p_dec )
atomic_compare_exchange_strong( &p_owner->reload, &expected, RELOAD_DECODER );
}
/* decoder_GetInputAttachments:
*/
int decoder_GetInputAttachments( decoder_t *p_dec,
input_attachment_t ***ppp_attachment,
int *pi_attachment )
{
if( !p_dec->pf_get_attachments )
return VLC_EGENERIC;
return p_dec->pf_get_attachments( p_dec, ppp_attachment, pi_attachment );
}
/* decoder_GetDisplayDate:
*/
mtime_t decoder_GetDisplayDate( decoder_t *p_dec, mtime_t i_ts )
{
if( !p_dec->pf_get_display_date )
return VLC_TS_INVALID;
return p_dec->pf_get_display_date( p_dec, i_ts );
}
/* decoder_GetDisplayRate:
*/
int decoder_GetDisplayRate( decoder_t *p_dec )
{
if( !p_dec->pf_get_display_rate )
return INPUT_RATE_DEFAULT;
return p_dec->pf_get_display_rate( p_dec );
}
void decoder_AbortPictures( decoder_t *p_dec, bool b_abort )
{
decoder_owner_sys_t *p_owner = p_dec->p_owner;
......
......@@ -72,11 +72,7 @@ date_Decrement
date_Increment
date_Init
decoder_AbortPictures
decoder_GetDisplayDate
decoder_GetDisplayRate
decoder_GetInputAttachments
decoder_NewAudioBuffer
decoder_NewSubpicture
demux_PacketizerDestroy
demux_PacketizerNew
demux_New
......
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