VLC  2.1.0-git
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
vlc_picture.h File Reference

This file defines picture structures and functions in vlc. More...

Include dependency graph for vlc_picture.h:

Go to the source code of this file.

Data Structures

struct  plane_t
 Description of a planar graphic field. More...
struct  picture_t
 Video picture. More...
struct  picture_resource_t
 Resource for a picture. More...

Macros

#define PICTURE_PLANE_MAX   (VOUT_MAX_PLANES)
 Maximum number of plane for a picture.
#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
 Description of a planar graphic field.
typedef struct picture_gc_sys_t picture_gc_sys_t
 A private definition to help overloading picture release.

Enumerations

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

Functions

picture_tpicture_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.
picture_tpicture_NewFromFormat (const video_format_t *p_fmt)
 This function will create a new picture using the given format.
picture_tpicture_NewFromResource (const video_format_t *, const picture_resource_t *)
 This function will create a new picture using the provided resource.
picture_tpicture_Hold (picture_t *p_picture)
 This function will increase the picture reference count.
void picture_Release (picture_t *p_picture)
 This function will release a picture.
bool picture_IsReferenced (picture_t *p_picture)
 This function will return true if you are not the only owner of the picture.
void picture_CopyProperties (picture_t *p_dst, const picture_t *p_src)
 This function will copy all picture dynamic properties.
void picture_Reset (picture_t *)
 This function will reset a picture information (properties and quantizers).
void picture_CopyPixels (picture_t *p_dst, const picture_t *p_src)
 This function will copy the picture pixels.
void plane_CopyPixels (plane_t *p_dst, const plane_t *p_src)
void picture_Copy (picture_t *p_dst, const picture_t *p_src)
 This function will copy both picture dynamic properties and pixels.
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.
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.
void picture_BlendSubpicture (picture_t *, filter_t *p_blend, subpicture_t *)
 This function will blend a given subpicture onto a picture.

Detailed Description

This file defines picture structures and functions in vlc.

Macro Definition Documentation

#define A_PITCH   p[A_PLANE].i_pitch
#define A_PIXELS   p[A_PLANE].p_pixels
#define PICTURE_PLANE_MAX   (VOUT_MAX_PLANES)

Maximum number of plane for a picture.

#define U_PITCH   p[U_PLANE].i_pitch
#define U_PIXELS   p[U_PLANE].p_pixels
#define V_PITCH   p[V_PLANE].i_pitch
#define V_PIXELS   p[V_PLANE].p_pixels
#define Y_PITCH   p[Y_PLANE].i_pitch
#define Y_PIXELS   p[Y_PLANE].p_pixels

Typedef Documentation

A private definition to help overloading picture release.

typedef struct plane_t plane_t

Description of a planar graphic field.

Enumeration Type Documentation

anonymous enum
Enumerator:
Y_PLANE 
U_PLANE 
V_PLANE 
A_PLANE 

Function Documentation

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).

References subpicture_t::b_absolute, subpicture_t::b_fade, filter_Blend(), filter_ConfigureBlend(), filter_t::fmt_in, filter_t::fmt_out, picture_t::format, subpicture_t::i_alpha, video_format_t::i_chroma, video_format_t::i_height, video_format_t::i_width, msg_Err, subpicture_region_t::p_next, subpicture_t::p_region, and es_format_t::video.

Referenced by ThreadDisplayRenderPicture().

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.

References picture_CopyPixels(), and picture_CopyProperties().

Referenced by ImageConvert(), ThreadDisplayRenderPicture(), and vout_snapshot_Set().

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.

References picture_t::i_planes, picture_t::p, and plane_CopyPixels().

Referenced by picture_Copy().

void picture_CopyProperties ( picture_t p_dst,
const picture_t p_src 
)

This function will copy all picture dynamic properties.

References picture_t::b_force, picture_t::b_progressive, picture_t::b_top_field_first, picture_t::date, and picture_t::i_nb_fields.

Referenced by picture_Copy().

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.

< Unspecified error

< No error

References picture_t::date, picture_t::format, video_format_t::i_chroma, block_t::i_dts, video_format_t::i_height, block_t::i_pts, video_format_t::i_sar_den, video_format_t::i_sar_num, video_format_t::i_width, image_HandlerCreate, image_HandlerDelete(), image_Write, VLC_EGENERIC, and VLC_SUCCESS.

Referenced by vout_GetSnapshot().

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.

References picture_t::gc, picture_t::refcount, and vlc_atomic_inc().

Referenced by ImageConvert(), ImageFilter(), ImageWrite(), picture_fifo_Peek(), picture_pool_Get(), SplitterPrepare(), SpuRenderRegion(), ThreadDisplayPreparePicture(), ThreadDisplayRenderPicture(), video_link_picture(), and vout_HoldPicture().

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.

References picture_t::gc, picture_t::refcount, and vlc_atomic_get().

Referenced by picture_pool_NewExtended().

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.

References picture_NewFromFormat(), and video_format_Setup().

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.

References picture_NewFromResource().

Referenced by picture_New(), picture_pool_NewFromFormat(), SplitterPictureNew(), spu_new_video_buffer(), subpicture_region_New(), video_new_buffer(), VideoBufferNew(), vout_snapshot_Set(), and VoutVideoFilterStaticNewPicture().

picture_t* picture_NewFromResource ( const video_format_t ,
const picture_resource_t  
)
void picture_Release ( picture_t p_picture)
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).

References picture_t::b_force, picture_t::b_progressive, picture_t::b_top_field_first, picture_t::date, picture_t::i_nb_fields, and VLC_TS_INVALID.

Referenced by vout_GetPicture(), and VoutVideoFilterInteractiveNewPicture().

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.

< Unspecified error

< No error

References picture_t::format, picture_t::gc, vlc_chroma_description_t::h, video_format_t::i_chroma, plane_t::i_lines, picture_t::i_nb_fields, plane_t::i_pitch, plane_t::i_pixel_pitch, picture_t::i_planes, plane_t::i_visible_lines, plane_t::i_visible_pitch, LCM(), picture_t::p, vlc_chroma_description_t::p, plane_t::p_pixels, picture_t::p_sys, picture_t::pf_destroy, vlc_chroma_description_t::pixel_size, vlc_chroma_description_t::plane_count, picture_t::refcount, video_format_Setup(), vlc_atomic_set(), VLC_EGENERIC, vlc_fourcc_GetChromaDescription(), VLC_SUCCESS, VOUT_MAX_PLANES, and vlc_chroma_description_t::w.

Referenced by AllocatePicture(), and picture_NewFromResource().

void plane_CopyPixels ( plane_t p_dst,
const plane_t p_src 
)