int (*pf_aout_format_update)( decoder_t * );
/* SPU output callbacks
- * XXX use decoder_NewSubpicture and decoder_DeleteSubpicture */
+ * XXX use decoder_NewSubpicture */
subpicture_t *(*pf_spu_buffer_new)( decoder_t *, const subpicture_updater_t * );
- void (*pf_spu_buffer_del)( decoder_t *, subpicture_t * );
/* Input attachments
* XXX use decoder_GetInputAttachments */
/**
* This function will return a new subpicture usable by a decoder as an output
- * buffer. You have to release it using decoder_DeleteSubpicture or by returning
+ * buffer. You have to release it using subpicture_Delete() or by returning
* it to the caller as a pf_decode_sub return value.
*/
VLC_API subpicture_t * decoder_NewSubpicture( decoder_t *, const subpicture_updater_t * ) VLC_USED;
-/**
- * This function will release a subpicture created by decoder_NewSubicture.
- */
-VLC_API void decoder_DeleteSubpicture( decoder_t *, subpicture_t *p_subpicture );
-
/**
* This function gives all input attachments at once.
*
if( !p_region )
{
msg_Err( p_dec, "cannot allocate SPU region" );
- decoder_DeleteSubpicture( p_dec, p_spu );
+ subpicture_Delete( p_spu );
return NULL;
}
if( !p_bitmap_region )
{
msg_Err( p_dec, "cannot allocate SPU region" );
- decoder_DeleteSubpicture( p_dec, p_spu );
+ subpicture_Delete( p_dec, p_spu );
return NULL;
}
msg_Err( p_dec, "cannot allocate SPU region" );
if( p_bitmap_region )
subpicture_region_Delete( p_bitmap_region );
- decoder_DeleteSubpicture( p_dec, p_spu );
+ subpicture_Delete( p_spu );
return NULL;
}
p_spu_sys->i_pts = p_block->i_pts;
if( !p_spu_sys->p_subs_data )
{
- decoder_DeleteSubpicture( p_dec, p_spu );
+ subpicture_Delete( p_spu );
block_Release( p_block );
return NULL;
}
if( ParseControlSeq( p_dec, p_spu, &spu_data, &spu_properties, p_sys->i_pts ) )
{
/* There was a parse error, delete the subpicture */
- decoder_DeleteSubpicture( p_dec, p_spu );
+ subpicture_Delete( p_spu );
return NULL;
}
if( ParseRLE( p_dec, &spu_data, &spu_properties ) )
{
/* There was a parse error, delete the subpicture */
- decoder_DeleteSubpicture( p_dec, p_spu );
+ subpicture_Delete( p_spu );
free( spu_data.p_data );
return NULL;
}
if( !p_region )
{
msg_Err( p_dec, "cannot allocate SVCD subtitle region" );
- decoder_DeleteSubpicture( p_dec, p_spu );
+ subpicture_Delete( p_spu );
return NULL;
}
error:
if ( p_spu != NULL )
{
- decoder_DeleteSubpicture( p_dec, p_spu );
+ subpicture_Delete( p_spu );
p_spu = NULL;
}
if( p_spu->p_region == NULL )
{
msg_Err( p_dec, "cannot allocate SPU region" );
- decoder_DeleteSubpicture( p_dec, p_spu );
+ subpicture_Delete( p_spu );
return NULL;
}
return p_subpicture;
}
-static void spu_del_buffer( decoder_t *p_dec, subpicture_t *p_subpic )
-{
- VLC_UNUSED( p_dec );
- subpicture_Delete( p_subpic );
-}
int transcode_spu_new( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
/* Initialization of decoder structures */
id->p_decoder->pf_decode_sub = NULL;
id->p_decoder->pf_spu_buffer_new = spu_new_buffer;
- id->p_decoder->pf_spu_buffer_del = spu_del_buffer;
id->p_decoder->p_owner = (decoder_owner_sys_t *)p_stream;
/* id->p_decoder->p_cfg = p_sys->p_spu_cfg; */
block_t *p_block;
p_block = id->p_encoder->pf_encode_sub( id->p_encoder, p_subpic );
- spu_del_buffer( id->p_decoder, p_subpic );
+ subpicture_Delete( p_subpic );
if( p_block )
{
block_ChainAppend( out, p_block );
static picture_t *vout_new_buffer( decoder_t * );
static int aout_update_format( decoder_t * );
static subpicture_t *spu_new_buffer( decoder_t *, const subpicture_updater_t * );
-static void spu_del_buffer( decoder_t *, subpicture_t * );
struct decoder_owner_sys_t
{
return p_subpicture;
}
-void decoder_DeleteSubpicture( decoder_t *p_decoder, subpicture_t *p_subpicture )
-{
- p_decoder->pf_spu_buffer_del( p_decoder, p_subpicture );
-}
-
/* decoder_GetInputAttachments:
*/
int decoder_GetInputAttachments( decoder_t *p_dec,
p_dec->pf_vout_format_update = vout_update_format;
p_dec->pf_vout_buffer_new = vout_new_buffer;
p_dec->pf_spu_buffer_new = spu_new_buffer;
- p_dec->pf_spu_buffer_del = spu_del_buffer;
/* */
p_dec->pf_get_attachments = DecoderGetInputAttachments;
p_dec->pf_get_display_date = DecoderGetDisplayDate;
return p_subpic;
}
-
-static void spu_del_buffer( decoder_t *p_dec, subpicture_t *p_subpic )
-{
- decoder_owner_sys_t *p_owner = p_dec->p_owner;
- vout_thread_t *p_vout = NULL;
-
- p_vout = input_resource_HoldVout( p_owner->p_resource );
- if( !p_vout || p_owner->p_spu_vout != p_vout )
- {
- if( p_vout )
- vlc_object_release( p_vout );
- msg_Warn( p_dec, "no vout found, leaking subpicture" );
- return;
- }
-
- subpicture_Delete( p_subpic );
-
- vlc_object_release( p_vout );
-}
date_Init
date_Move
date_Set
-decoder_DeleteSubpicture
decoder_GetDisplayDate
decoder_GetDisplayRate
decoder_GetInputAttachments