Use picture_Release() directly.
*/
/* Video output callbacks
- * XXX use decoder_NewPicture/decoder_DeletePicture
- * and decoder_UnlinkPicture */
+ * XXX use decoder_NewPicture */
int (*pf_vout_format_update)( decoder_t * );
picture_t *(*pf_vout_buffer_new)( decoder_t * );
- void (*pf_vout_buffer_del)( decoder_t *, picture_t * );
- void (*pf_picture_unlink) ( decoder_t *, picture_t * );
/**
* Number of extra (ie in addition to the DPB) picture buffers
/**
* This function will return a new picture usable by a decoder as an output
- * buffer. You have to release it using decoder_DeletePicture or by returning
+ * buffer. You have to release it using picture_Release() or by returning
* it to the caller as a pf_decode_video return value.
*/
VLC_API picture_t * decoder_NewPicture( decoder_t * ) VLC_USED;
-/**
- * This function will release a picture create by decoder_NewPicture.
- */
-VLC_API void decoder_DeletePicture( decoder_t *, picture_t *p_picture );
-
-/**
- * This function will decrease the picture reference count.
- * (picture_Release is not usable.)
- */
-VLC_API void decoder_UnlinkPicture( decoder_t *, picture_t * );
-
/**
* This function notifies the audio output pipeline of a new audio output
* format (fmt_out.audio). If there is currently no audio output or if the
}
else
{
- decoder_DeletePicture( p_dec, p_pic );
+ picture_Release( p_pic );
}
}
{
lavc_pic_ref_t *ref = opaque;
- decoder_UnlinkPicture(ref->decoder, ref->picture);
+ picture_Release(ref->picture);
free(ref);
(void) data;
}
goto error;
}
}
- decoder_UnlinkPicture(dec, pic);
+ picture_Release(pic);
(void) flags;
return pic;
error:
for (unsigned i = 0; frame->buf[i] != NULL; i++)
av_buffer_unref(&frame->buf[i]);
no_dr:
- decoder_DeletePicture(dec, pic);
+ picture_Release(pic);
return NULL;
}
no_dr:
if (p_pic)
- decoder_DeletePicture( p_dec, p_pic );
+ picture_Release( p_pic );
return NULL;
}
if( p_sys->p_va )
vlc_va_Release( p_sys->p_va, p_ff_pic->opaque, p_ff_pic->data[0] );
else if( p_ff_pic->opaque )
- decoder_UnlinkPicture( p_dec, (picture_t*)p_ff_pic->opaque);
+ picture_Release( (picture_t*)p_ff_pic->opaque);
else if( p_ff_pic->type == FF_BUFFER_TYPE_INTERNAL )
/* We can end up here without the AVFrame being allocated by
* avcodec_default_get_buffer() if VA is used and the frame is
break;
}
if( p_pic )
- decoder_DeletePicture( p_dec, p_pic );
+ picture_Release( p_pic );
return NULL;
}
if( !p->p_picture )
continue;
if( p->b_linked )
- decoder_UnlinkPicture( p_dec, p->p_picture );
+ picture_Release( p->p_picture );
if( !p->b_displayed )
- decoder_DeletePicture( p_dec, p->p_picture );
+ picture_Release( p->p_picture );
p->p_picture = NULL;
}
assert( p && p->b_linked );
- decoder_UnlinkPicture( p_dec, p->p_picture );
+ picture_Release( p->p_picture );
p->b_linked = false;
if( !p->b_displayed )
- decoder_DeletePicture( p_dec, p->p_picture );
+ picture_Release( p->p_picture );
p->p_picture = NULL;
}
/**
}
if (p_sys->error_state) {
if (p_pic)
- decoder_DeletePicture(p_dec, p_pic);
+ picture_Release(p_pic);
jni_detach_thread();
return NULL;
}
if( p_buffer )
{
if (p_buffer->pAppPrivate != NULL)
- decoder_DeletePicture( p_dec, p_buffer->pAppPrivate );
+ picture_Release( p_buffer->pAppPrivate );
omx_error = OMX_FreeBuffer( p_port->omx_handle,
p_port->i_port_index, p_buffer );
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_codec.h> /* decoder_DeletePicture */
+#include <vlc_codec.h>
#include <schroedinger/schro.h>
if( !p_free )
return;
- decoder_DeletePicture( p_free->p_dec, p_free->p_pic );
+ picture_Release( p_free->p_pic );
free(p_free);
(void)frame;
}
msg_Err(dec, "Failed to send buffer to output port (status=%"PRIx32" %s)",
status, mmal_status_to_string(status));
mmal_buffer_header_release(buffer);
- decoder_DeletePicture(dec, picture);
+ picture_Release(picture);
ret = -1;
goto out;
}
fill_output_port(dec);
} else {
picture = (picture_t *)buffer->user_data;
- decoder_DeletePicture(dec, picture);
+ picture_Release(picture);
buffer->user_data = NULL;
buffer->alloc_size = 0;
buffer->data = NULL;
static int Del ( sout_stream_t *, sout_stream_id_sys_t * );
static int Send( sout_stream_t *, sout_stream_id_sys_t *, block_t * );
-inline static void video_del_buffer_decoder( decoder_t *, picture_t * );
-
inline static int video_update_format_decoder( decoder_t *p_dec );
inline static picture_t *video_new_buffer_decoder( decoder_t * );
inline static picture_t *video_new_buffer_filter( filter_t * );
static int video_update_format( vlc_object_t *, decoder_owner_sys_t *,
es_format_t * );
-static void video_unlink_picture_decoder( decoder_t *, picture_t * );
-
static int HeightCallback( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
static int WidthCallback( vlc_object_t *, char const *,
p_sys->p_decoder->pf_decode_video = 0;
p_sys->p_decoder->pf_vout_format_update = video_update_format_decoder;
p_sys->p_decoder->pf_vout_buffer_new = video_new_buffer_decoder;
- p_sys->p_decoder->pf_vout_buffer_del = video_del_buffer_decoder;
- p_sys->p_decoder->pf_picture_unlink = video_unlink_picture_decoder;
p_sys->p_decoder->p_owner = malloc( sizeof(decoder_owner_sys_t) );
if( !p_sys->p_decoder->p_owner )
{
return 0;
}
-inline static void video_del_buffer_decoder( decoder_t *p_this,
- picture_t *p_pic )
-{
- VLC_UNUSED(p_this);
- picture_Release( p_pic );
-}
-
-static void video_unlink_picture_decoder( decoder_t *p_dec, picture_t *p_pic )
-{
- VLC_UNUSED(p_dec);
- picture_Release( p_pic );
-}
-
-
/**********************************************************************
* Callback to update (some) params on the fly
**********************************************************************/
sout_stream_sys_t *p_sys;
};
-static void video_del_buffer_decoder( decoder_t *p_decoder, picture_t *p_pic )
-{
- VLC_UNUSED(p_decoder);
- picture_Release( p_pic );
-}
-
-static void video_unlink_picture_decoder( decoder_t *p_dec, picture_t *p_pic )
-{
- VLC_UNUSED(p_dec);
- picture_Release( p_pic );
-}
-
static int video_update_format_decoder( decoder_t *p_dec )
{
p_dec->fmt_out.video.i_chroma = p_dec->fmt_out.i_codec;
id->p_decoder->pf_get_cc = 0;
id->p_decoder->pf_vout_format_update = video_update_format_decoder;
id->p_decoder->pf_vout_buffer_new = video_new_buffer_decoder;
- id->p_decoder->pf_vout_buffer_del = video_del_buffer_decoder;
- id->p_decoder->pf_picture_unlink = video_unlink_picture_decoder;
id->p_decoder->p_owner = malloc( sizeof(decoder_owner_sys_t) );
if( !id->p_decoder->p_owner )
return VLC_EGENERIC;
/* Buffers allocation callbacks for the decoders */
static int vout_update_format( decoder_t * );
static picture_t *vout_new_buffer( decoder_t * );
-static void vout_del_buffer( decoder_t *, picture_t * );
-static void vout_unlink_picture( decoder_t *, picture_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 * );
msg_Warn( p_decoder, "can't get output picture" );
return p_picture;
}
-void decoder_DeletePicture( decoder_t *p_decoder, picture_t *p_picture )
-{
- p_decoder->pf_vout_buffer_del( p_decoder, p_picture );
-}
-void decoder_UnlinkPicture( decoder_t *p_decoder, picture_t *p_picture )
-{
- p_decoder->pf_picture_unlink( p_decoder, p_picture );
-}
block_t *decoder_NewAudioBuffer( decoder_t *dec, int samples )
{
p_dec->pf_aout_format_update = aout_update_format;
p_dec->pf_vout_format_update = vout_update_format;
p_dec->pf_vout_buffer_new = vout_new_buffer;
- p_dec->pf_vout_buffer_del = vout_del_buffer;
- p_dec->pf_picture_unlink = vout_unlink_picture;
p_dec->pf_spu_buffer_new = spu_new_buffer;
p_dec->pf_spu_buffer_del = spu_del_buffer;
/* */
}
}
-static void vout_del_buffer( decoder_t *p_dec, picture_t *p_pic )
-{
- picture_Release( p_pic );
-}
-
-static void vout_unlink_picture( decoder_t *p_dec, picture_t *p_pic )
-{
- picture_Release( p_pic );
-}
-
static subpicture_t *spu_new_buffer( decoder_t *p_dec,
const subpicture_updater_t *p_updater )
{
date_Init
date_Move
date_Set
-decoder_DeletePicture
decoder_DeleteSubpicture
decoder_GetDisplayDate
decoder_GetDisplayRate
decoder_SynchroRelease
decoder_SynchroReset
decoder_SynchroTrash
-decoder_UnlinkPicture
decode_URI
decode_URI_duplicate
demux_GetParentInput
return picture_NewFromFormat( &p_dec->fmt_out.video );
}
-static void video_del_buffer( decoder_t *p_dec, picture_t *p_pic )
-{
- (void)p_dec;
- picture_Release( p_pic );
-}
-
-static void video_unlink_picture( decoder_t *p_dec, picture_t *p_pic )
-{
- (void)p_dec;
- picture_Release( p_pic );
-}
-
static decoder_t *CreateDecoder( vlc_object_t *p_this, video_format_t *fmt )
{
decoder_t *p_dec;
p_dec->pf_vout_format_update = video_update_format;
p_dec->pf_vout_buffer_new = video_new_buffer;
- p_dec->pf_vout_buffer_del = video_del_buffer;
- p_dec->pf_picture_unlink = video_unlink_picture;
/* Find a suitable decoder module */
p_dec->p_module = module_need( p_dec, "decoder", "$codec", false );