|
VLC
2.1.0-git
|
This file defines picture structures and functions in vlc. More...

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_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. | |
| picture_t * | picture_NewFromFormat (const video_format_t *p_fmt) |
| This function will create a new picture using the given format. | |
| picture_t * | picture_NewFromResource (const video_format_t *, const picture_resource_t *) |
| This function will create a new picture using the provided resource. | |
| picture_t * | picture_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. | |
This file defines picture structures and functions in vlc.
| #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 struct picture_gc_sys_t picture_gc_sys_t |
A private definition to help overloading picture release.
| 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:
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().
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.
| p_dst | pointer to the destination picture. |
| p_src | pointer to the source picture. |
References picture_CopyPixels(), and picture_CopyProperties().
Referenced by ImageConvert(), ThreadDisplayRenderPicture(), and vout_snapshot_Set().
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().
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:
< 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().
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 * | |||
| ) |
This function will create a new picture using the provided resource.
If the resource is NULL then a plain picture_NewFromFormat is returned.
References AllocatePicture(), picture_t::format, picture_t::gc, video_format_t::i_chroma, video_format_t::i_height, plane_t::i_lines, picture_resource_t::i_lines, plane_t::i_pitch, picture_resource_t::i_pitch, picture_t::i_planes, video_format_t::i_sar_den, video_format_t::i_sar_num, video_format_t::i_visible_height, video_format_t::i_visible_width, video_format_t::i_width, video_format_t::i_x_offset, video_format_t::i_y_offset, picture_t::p, picture_resource_t::p, plane_t::p_pixels, picture_resource_t::p_pixels, picture_t::p_sys, picture_resource_t::p_sys, picture_t::pf_destroy, picture_Setup(), PictureDestroy(), picture_t::refcount, video_format_CopyCrop(), video_format_Setup(), and vlc_atomic_set().
Referenced by picture_NewFromFormat().
| void picture_Release | ( | picture_t * | p_picture | ) |
This function will release a picture.
It will not have any effect on picture obtained from vout
References picture_t::gc, picture_t::pf_destroy, picture_t::refcount, and vlc_atomic_dec().
Referenced by ImageConvert(), ImageRead(), picture_fifo_Flush(), picture_pool_Delete(), picture_pool_NewFromFormat(), SplitterDisplay(), SplitterPictureDel(), SplitterPictureNew(), SplitterPrepare(), spu_del_video_buffer(), SpuRenderRegion(), subpicture_NewFromPicture(), subpicture_region_Delete(), subpicture_region_private_Delete(), ThreadDisplayPicture(), ThreadDisplayPreparePicture(), ThreadDisplayRenderPicture(), ThreadFilterFlush(), ThreadFlush(), video_del_buffer(), video_unlink_picture(), VideoBufferDelete(), vout_FilterDisplay(), vout_FixLeaks(), vout_GetSnapshot(), vout_IsEmpty(), vout_ReleasePicture(), vout_snapshot_Clean(), VoutSaveSnapshot(), and VoutVideoFilterDelPicture().
| 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().
References plane_t::i_pitch, plane_t::i_visible_lines, plane_t::i_visible_pitch, and plane_t::p_pixels.
Referenced by picture_CopyPixels().
1.8.1.2