QVisu
Qt-based visualization for smart homes
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
vlc_picture.h File Reference
#include <vlc_es.h>
#include <vlc_atomic.h>

Go to the source code of this file.

Classes

struct  plane_t
 
struct  picture_t
 
struct  picture_resource_t
 

Macros

#define PICTURE_PLANE_MAX   (VOUT_MAX_PLANES)
 
#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
 

Typedefs

typedef struct plane_t plane_t
 
typedef struct picture_gc_sys_t picture_gc_sys_t
 

Enumerations

enum  { Y_PLANE = 0, U_PLANE = 1, V_PLANE = 2, A_PLANE = 3 }
 

Functions

VLC_API picture_tpicture_New (vlc_fourcc_t i_chroma, int i_width, int i_height, int i_sar_num, int i_sar_den) VLC_USED
 
VLC_API picture_tpicture_NewFromFormat (const video_format_t *p_fmt) VLC_USED
 
VLC_API picture_tpicture_NewFromResource (const video_format_t *, const picture_resource_t *) VLC_USED
 
VLC_API picture_tpicture_Hold (picture_t *p_picture)
 
VLC_API void picture_Release (picture_t *p_picture)
 
VLC_API bool picture_IsReferenced (picture_t *p_picture)
 
VLC_API void picture_CopyProperties (picture_t *p_dst, const picture_t *p_src)
 
VLC_API void picture_Reset (picture_t *)
 
VLC_API void picture_CopyPixels (picture_t *p_dst, const picture_t *p_src)
 
VLC_API void plane_CopyPixels (plane_t *p_dst, const plane_t *p_src)
 
VLC_API void picture_Copy (picture_t *p_dst, const picture_t *p_src)
 
VLC_API int picture_Export (vlc_object_t *p_obj, block_t **pp_image, video_format_t *p_fmt, picture_t *p_picture, vlc_fourcc_t i_format, int i_override_width, int i_override_height)
 
VLC_API int picture_Setup (picture_t *, vlc_fourcc_t i_chroma, int i_width, int i_height, int i_sar_num, int i_sar_den)
 
VLC_API void picture_BlendSubpicture (picture_t *, filter_t *p_blend, subpicture_t *)
 

Detailed Description

This file defines picture structures and functions in vlc

Macro Definition Documentation

#define PICTURE_PLANE_MAX   (VOUT_MAX_PLANES)

Maximum number of plane for a picture

Typedef Documentation

A private definition to help overloading picture release

typedef struct plane_t plane_t

Description of a planar graphic field

Function Documentation

VLC_API void picture_BlendSubpicture ( picture_t ,
filter_t p_blend,
subpicture_t  
)

This function will blend a given subpicture onto a picture.

The subpicture and all its region must:

  • be absolute.
  • not be ephemere.
  • not have the fade flag.
  • contains only picture (no text rendering).
VLC_API void picture_Copy ( 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_Hold may do what you want without the copy overhead. Provided for convenience.

Parameters
p_dstpointer to the destination picture.
p_srcpointer to the source picture.
VLC_API void picture_CopyPixels ( picture_t p_dst,
const picture_t p_src 
)

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_API void picture_CopyProperties ( picture_t p_dst,
const picture_t p_src 
)

This function will copy all picture dynamic properties.

VLC_API int picture_Export ( vlc_object_t p_obj,
block_t **  pp_image,
video_format_t p_fmt,
picture_t p_picture,
vlc_fourcc_t  i_format,
int  i_override_width,
int  i_override_height 
)

This function will export a picture to an encoded bitstream.

pp_image will contain the encoded bitstream in psz_format format.

p_fmt can be NULL otherwise it will be set with the format used for the picture before encoding.

i_override_width/height allow to override the width and/or the height of the picture to be encoded:

  • if strictly lower than 0, the original dimension will be used.
  • if equal to 0, it will be deduced from the other dimension which must be different to 0.
  • if strictly higher than 0, it will override the dimension. If at most one of them is > 0 then the picture aspect ratio will be kept.
VLC_API picture_t* picture_Hold ( picture_t p_picture)

This function will increase the picture reference count. It will not have any effect on picture obtained from vout

It returns the given picture for convenience.

VLC_API bool picture_IsReferenced ( picture_t 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.

VLC_API picture_t* picture_New ( vlc_fourcc_t  i_chroma,
int  i_width,
int  i_height,
int  i_sar_num,
int  i_sar_den 
)

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 p_sys, gc.p_sys fields if non NULL.

VLC_API picture_t* picture_NewFromFormat ( const video_format_t p_fmt)

This function will create a new picture using the given format.

When possible, it is preferred to use this function over picture_New as more information about the format is kept.

VLC_API picture_t* picture_NewFromResource ( const video_format_t ,
const picture_resource_t  
)

This function will create a new picture using the provided resource.

If the resource is NULL then a plain picture_NewFromFormat is returned.

VLC_API void picture_Release ( picture_t p_picture)

This function will release a picture. It will not have any effect on picture obtained from vout

VLC_API void picture_Reset ( picture_t )

This function will reset a picture information (properties and quantizers). It is sometimes useful for reusing pictures (like from a pool).

VLC_API int picture_Setup ( picture_t ,
vlc_fourcc_t  i_chroma,
int  i_width,
int  i_height,
int  i_sar_num,
int  i_sar_den 
)

This function will setup all fields of a picture_t without allocating any memory. XXX The memory must already be initialized. It does not need to be released.

It will return VLC_EGENERIC if the core does not understand the requested format.

It can be useful to get the properties of planes.