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

Defines

#define VLC_PICTURE_H   1
#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
picture_release_sys_t 
picture_release_sys_t
 A private definition to help overloading picture release.

Enumerations

enum  { EMPTY_PICTURE = 0, MEMORY_PICTURE = 100, DIRECT_PICTURE = 200 }
enum  {
  FREE_PICTURE, RESERVED_PICTURE, READY_PICTURE, DISPLAYED_PICTURE,
  DESTROYED_PICTURE
}
enum  { QTYPE_NONE, QTYPE_MPEG1, QTYPE_MPEG2, QTYPE_H264 }
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_aspect)
 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.
void picture_Delete (picture_t *)
 This function will force the destruction a picture.
static picture_tpicture_Hold (picture_t *p_picture)
 This function will increase the picture reference count.
static void picture_Release (picture_t *p_picture)
 This function will release a picture.
static bool picture_IsReferenced (picture_t *p_picture)
 This function will return true if you are not the only owner of the picture.
static void picture_CleanupQuant (picture_t *p_pic)
 Cleanup quantization matrix data and set to 0.
static 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 informations (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)
static 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_aspect)
 This function will setup all fields of a picture_t without allocating any memory.


Detailed Description

This file defines picture structures and functions in vlc.


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

Referenced by Direct3DCreatePool().

#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 VLC_PICTURE_H   1

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


Enumeration Type Documentation

anonymous enum

Enumerator:
EMPTY_PICTURE 
MEMORY_PICTURE 
DIRECT_PICTURE 

anonymous enum

Enumerator:
FREE_PICTURE 
RESERVED_PICTURE 
READY_PICTURE 
DISPLAYED_PICTURE 
DESTROYED_PICTURE 

anonymous enum

Enumerator:
QTYPE_NONE 
QTYPE_MPEG1 
QTYPE_MPEG2 
QTYPE_H264 

anonymous enum

Enumerator:
Y_PLANE 
U_PLANE 
V_PLANE 
A_PLANE 


Function Documentation

static void picture_CleanupQuant ( picture_t p_pic  )  [inline, static]

Cleanup quantization matrix data and set to 0.

References picture_t::i_qstride, picture_t::i_qtype, and picture_t::p_q.

Referenced by DestroyPicture(), and picture_Reset().

static void picture_Copy ( picture_t p_dst,
const picture_t p_src 
) [inline, static]

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_dst pointer to the destination picture.
p_src pointer to the source picture.

References picture_CopyPixels(), and picture_CopyProperties().

Referenced by create_picture_region(), DecodeBlock(), Display(), Filter(), FilterPacked(), FilterSub(), FilterVideo(), ImageConvert(), Render(), RenderText(), RenderYadif(), Send(), SnapshotRatio(), transcode_video_process(), vout_RenderPicture(), 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 i, picture_t::i_planes, picture_t::p, and plane_CopyPixels().

Referenced by Filter(), LoadEmbeddedImage(), picture_Copy(), and PostprocPict().

static void picture_CopyProperties ( picture_t p_dst,
const picture_t p_src 
) [inline, static]

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 CopyInfoAndRelease(), Deinterlace(), Filter(), and picture_Copy().

void picture_Delete ( picture_t  ) 

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.

References picture_t::i_refcount, picture_t::p_data_orig, picture_t::p_q, picture_t::p_release_sys, and picture_t::p_sys.

Referenced by PictureReleaseCallback(), and video_del_buffer().

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.

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

static picture_t* picture_Hold ( picture_t p_picture  )  [inline, static]

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::i_refcount, and picture_t::pf_release.

Referenced by Display(), ImageConvert(), ImageFilter(), ImageWrite(), picture_fifo_Peek(), picture_pool_Get(), SpuRenderRegion(), video_link_picture(), and video_link_picture_decoder().

static bool picture_IsReferenced ( picture_t p_picture  )  [inline, static]

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::i_refcount.

Referenced by Display(), and transcode_video_process().

picture_t* picture_New ( vlc_fourcc_t  i_chroma,
int  i_width,
int  i_height,
int  i_aspect 
)

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, p_q, p_data_orig fields if non NULL.

References picture_NewFromFormat(), and video_format_Setup().

Referenced by AllocatePicture(), Create(), Get(), Render(), RenderYUVA(), Send(), SnapshotRatio(), spu_new_video_buffer(), subpicture_region_New(), video_new_buffer(), VideoBufferNew(), and vnc_worker_thread().

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 prefered to use this function over picture_New as more information about the format is kept.

References picture_NewFromResource().

Referenced by Get(), picture_New(), picture_pool_NewFromFormat(), RenderYadif(), and vout_snapshot_Set().

picture_t* picture_NewFromResource ( const video_format_t ,
const picture_resource_t  
)

static void picture_Release ( picture_t p_picture  )  [inline, static]

void picture_Reset ( picture_t  ) 

This function will reset a picture informations (properties and quantizers).

It is sometimes usefull 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, picture_CleanupQuant(), and VLC_TS_INVALID.

int picture_Setup ( picture_t ,
vlc_fourcc_t  i_chroma,
int  i_width,
int  i_height,
int  i_aspect 
)

void plane_CopyPixels ( plane_t p_dst,
const plane_t p_src 
)


Generated on Sun Nov 22 08:05:26 2009 for VLC by  doxygen 1.5.6