Commit ddcac444 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

picture: pointer for decoder-specified hardware context

parent 5f507b68
......@@ -91,6 +91,8 @@ struct picture_t
bool b_progressive; /**< is it a progressive frame ? */
bool b_top_field_first; /**< which field is first */
unsigned int i_nb_fields; /**< # of displayed fields */
void * context; /**< video format-specific data pointer,
* must point to a (void (*)(void*)) pointer to free the context */
/**@}*/
/** Private data - the video output plugin might want to put stuff here to
......
......@@ -85,6 +85,18 @@ static int AllocatePicture( picture_t *p_pic )
/*****************************************************************************
*
*****************************************************************************/
static void PictureDestroyContext( picture_t *p_picture )
{
void (**context)( void * ) = p_picture->context;
if( context != NULL )
{
void (*context_destroy)( void * ) = *context;
context_destroy( context );
p_picture->context = NULL;
}
}
static void PictureDestroy( picture_t *p_picture )
{
assert( p_picture &&
......@@ -106,6 +118,7 @@ void picture_Reset( picture_t *p_picture )
p_picture->b_progressive = false;
p_picture->i_nb_fields = 2;
p_picture->b_top_field_first = false;
PictureDestroyContext( p_picture );
}
/*****************************************************************************
......@@ -271,6 +284,7 @@ void picture_Release( picture_t *p_picture )
if( refs > 0 )
return;
PictureDestroyContext( p_picture );
if( p_picture->gc.pf_destroy != NULL )
p_picture->gc.pf_destroy( p_picture );
}
......
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