} plane_t;
+/**
+ * A private definition to help overloading picture release
+ */
+typedef struct picture_release_sys_t picture_release_sys_t;
+
/**
* Video picture
*
/** This way the picture_Release can be overloaded */
void (*pf_release)( picture_t * );
+ picture_release_sys_t *p_release_sys;
/** Next picture in a FIFO a pictures */
struct picture_t *p_next;
* This function will create a new picture.
* The picture created will implement a default release management compatible
* with picture_Hold and picture_Release. This default management will release
- * picture_sys_t *p_sys field if non NULL.
+ * p_sys, p_q, p_data_orig fields if non NULL.
*/
VLC_EXPORT( picture_t *, picture_New, ( vlc_fourcc_t i_chroma, int i_width, int i_height, int i_aspect ) );
p_picture->pf_release( p_picture );
}
+/**
+ * This function will return true if you are not the only owner of the
+ * picture.
+ *
+ * It is only valid if it is created using picture_New.
+ */
+static inline bool picture_IsReferenced( picture_t *p_picture )
+{
+ return p_picture->i_refcount > 1;
+}
+
/**
* Cleanup quantization matrix data and set to 0
*/
#include <vlc_filter.h>
#include <vlc_image.h>
#include <vlc_block.h>
+#include <vlc_picture_pool.h>
#include "vout_pictures.h"
#include "vout_internal.h"
}
p_picture->pf_release = NULL;
+ p_picture->p_release_sys = NULL;
p_picture->pf_lock = NULL;
p_picture->pf_unlock = NULL;
p_picture->i_refcount = 0;
void picture_Delete( picture_t *p_picture )
{
assert( p_picture && p_picture->i_refcount == 0 );
+ assert( p_picture->p_release_sys == NULL );
free( p_picture->p_q );
free( p_picture->p_data_orig );
/*****************************************************************************
*
*****************************************************************************/
-