-struct picture_t
-{
- /**
- * The properties of the picture
- */
- video_frame_format_t format;
-
- /** Picture data - data can always be freely modified, but p_data may
- * NEVER be modified. A direct buffer can be handled as the plugin
- * wishes, it can even swap p_pixels buffers. */
- uint8_t *p_data;
- void *p_data_orig; /**< pointer before memalign */
- plane_t p[ VOUT_MAX_PLANES ]; /**< description of the planes */
- int i_planes; /**< number of allocated planes */
-
- /** \name Type and flags
- * Should NOT be modified except by the vout thread
- * @{*/
- int i_status; /**< picture flags */
- int i_type; /**< is picture a direct buffer ? */
- bool b_slow; /**< is picture in slow memory ? */
- int i_matrix_coefficients; /**< in YUV type, encoding type */
- /**@}*/
-
- /** \name Picture management properties
- * These properties can be modified using the video output thread API,
- * but should never be written directly */
- /**@{*/
- unsigned i_refcount; /**< link reference counter */
- mtime_t date; /**< display date */
- bool b_force;
- /**@}*/
-
- /** \name Picture dynamic properties
- * Those properties can be changed by the decoder
- * @{
- */
- bool b_progressive; /**< is it a progressive frame ? */
- unsigned int i_nb_fields; /**< # of displayed fields */
- bool b_top_field_first; /**< which field is first */
- /**@}*/
-
- /** The picture heap we are attached to */
- picture_heap_t* p_heap;
-
- /* Some vouts require the picture to be locked before it can be modified */
- int (* pf_lock) ( vout_thread_t *, picture_t * );
- int (* pf_unlock) ( vout_thread_t *, picture_t * );
-
- /** Private data - the video output plugin might want to put stuff here to
- * keep track of the picture */
- picture_sys_t * p_sys;
-
- /** This way the picture_Release can be overloaded */
- void (*pf_release)( picture_t * );
-
- /** 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_Yield and picture_Release. This default management will release
- * picture_sys_t *p_sys field if non NULL.
- */
-VLC_EXPORT( picture_t *, picture_New, ( vlc_fourcc_t i_chroma, int i_width, int i_height, int i_aspect ) );
-
-/**
- * This function will force the destruction a picture.
- * The value of the picture reference count should be 0 before entering this
- * function.
- * Unless used for reimplementing pf_release, you should not use this
- * function but picture_Release.
- */
-VLC_EXPORT( void, picture_Delete, ( picture_t * ) );
-
-/**
- * This function will increase the picture reference count.
- * It will not have any effect on picture obtained from vout
- */
-static inline void picture_Yield( picture_t *p_picture )
-{
- if( p_picture->pf_release )
- p_picture->i_refcount++;
-}
-/**
- * This function will release a picture.
- * It will not have any effect on picture obtained from vout
- */
-static inline void picture_Release( picture_t *p_picture )
-{
- /* FIXME why do we let pf_release handle the i_refcount ? */
- if( p_picture->pf_release )
- p_picture->pf_release( p_picture );
-}
-
-/**
- * This function will copy all picture dynamic properties.
- */
-static inline void picture_CopyProperties( picture_t *p_dst, const picture_t *p_src )
-{
- p_dst->date = p_src->date;
- p_dst->b_force = p_src->b_force;
-
- p_dst->b_progressive = p_src->b_progressive;
- p_dst->i_nb_fields = p_src->i_nb_fields;
- p_dst->b_top_field_first = p_src->b_top_field_first;
-}
-
-/**
- * This function will copy the picture pixels.
- * You can safely copy between pictures that do not have the same size,
- * only the compatible(smaller) part will be copied.
- */
-VLC_EXPORT( void, picture_CopyPixels, ( picture_t *p_dst, const picture_t *p_src ) );
-
-/**
- * This function will copy both picture dynamic properties and pixels.
- * You have to notice that sometime a simple picture_Yield may do what
- * you want without the copy overhead.
- * Provided for convenience.
- */
-static inline void picture_Copy( picture_t *p_dst, const picture_t *p_src )
-{
- picture_CopyPixels( p_dst, p_src );
- picture_CopyProperties( p_dst, p_src );
-}
-
-/**
- * Video picture heap, either render (to store pictures used
- * by the decoder) or output (to store pictures displayed by the vout plugin)
- */
-struct picture_heap_t
-{
- int i_pictures; /**< current heap size */
-
- /* \name Picture static properties
- * Those properties are fixed at initialization and should NOT be modified
- * @{
- */
- unsigned int i_width; /**< picture width */
- unsigned int i_height; /**< picture height */
- vlc_fourcc_t i_chroma; /**< picture chroma */
- unsigned int i_aspect; /**< aspect ratio */
- /**@}*/
-
- /* Real pictures */
- picture_t* pp_picture[VOUT_MAX_PICTURES]; /**< pictures */
- int i_last_used_pic; /**< last used pic in heap */
- bool b_allow_modify_pics;
-
- /* Stuff used for truecolor RGB planes */
- uint32_t i_rmask; int i_rrshift, i_lrshift;
- uint32_t i_gmask; int i_rgshift, i_lgshift;
- uint32_t i_bmask; int i_rbshift, i_lbshift;
-
- /** Stuff used for palettized RGB planes */
- void (* pf_setpalette) ( vout_thread_t *, uint16_t *, uint16_t *, uint16_t * );
-};
-
-/*****************************************************************************
- * Flags used to describe the status of a picture
- *****************************************************************************/
-
-/* Picture type */
-#define EMPTY_PICTURE 0 /* empty buffer */
-#define MEMORY_PICTURE 100 /* heap-allocated buffer */
-#define DIRECT_PICTURE 200 /* direct buffer */
-
-/* Picture status */
-#define FREE_PICTURE 0 /* free and not allocated */
-#define RESERVED_PICTURE 1 /* allocated and reserved */
-#define RESERVED_DATED_PICTURE 2 /* waiting for DisplayPicture */
-#define RESERVED_DISP_PICTURE 3 /* waiting for a DatePicture */
-#define READY_PICTURE 4 /* ready for display */
-#define DISPLAYED_PICTURE 5 /* been displayed but is linked */
-#define DESTROYED_PICTURE 6 /* allocated but no more used */
-
-/*****************************************************************************
- * Shortcuts to access image components
- *****************************************************************************/
-
-/* Plane indices */
-#define Y_PLANE 0
-#define U_PLANE 1
-#define V_PLANE 2
-#define A_PLANE 3
-
-/* Shortcuts */
-#define Y_PIXELS p[Y_PLANE].p_pixels
-#define Y_PITCH p[Y_PLANE].i_pitch
-#define U_PIXELS p[U_PLANE].p_pixels
-#define U_PITCH p[U_PLANE].i_pitch
-#define V_PIXELS p[V_PLANE].p_pixels
-#define V_PITCH p[V_PLANE].i_pitch
-#define A_PIXELS p[A_PLANE].p_pixels
-#define A_PITCH p[A_PLANE].i_pitch
-
-/**
- * \defgroup subpicture Video Subpictures
- * Subpictures are pictures that should be displayed on top of the video, like
- * subtitles and OSD
- * \ingroup video_output
- * @{
- */
-
-/**
- * Video subtitle region
- *
- * A subtitle region is defined by a picture (graphic) and its rendering
- * coordinates.
- * Subtitles contain a list of regions.
- */
-struct subpicture_region_t
-{
- video_format_t fmt; /**< format of the picture */
- picture_t picture; /**< picture comprising this region */
-
- int i_x; /**< position of region */
- int i_y; /**< position of region */
- int i_align; /**< alignment within a region */
- int i_alpha; /**< transparency */
-
- char *psz_text; /**< text string comprising this region */
- char *psz_html; /**< HTML version of subtitle (NULL = use psz_text) */
- text_style_t *p_style; /**< a description of the text style formatting */
-
- subpicture_region_t *p_next; /**< next region in the list */
- subpicture_region_t *p_cache; /**< modified version of this region */
-};