X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fvlc_vout.h;h=dde94956470082c46c253f411ba7d32180f0e19c;hb=a403be13cf0f5565cfa5ca27f845219bf13ab1af;hp=d5e74698c06328ce67accf8bbd459db13275a20e;hpb=c35618f7942c54336aa93282f8407175d330295c;p=vlc diff --git a/include/vlc_vout.h b/include/vlc_vout.h index d5e74698c0..dde9495647 100644 --- a/include/vlc_vout.h +++ b/include/vlc_vout.h @@ -23,8 +23,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#ifndef _VLC_VOUT_H_ -#define _VLC_VOUT_H_ 1 +#ifndef VLC_VOUT_H_ +#define VLC_VOUT_H_ 1 + +/** + * \file + * This file defines common video output structures and functions in vlc + */ #include #include @@ -95,6 +100,9 @@ struct picture_t 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 */ + uint8_t *p_q; /**< quantification table */ + int i_qstride; /**< quantification stride */ + int i_qtype; /**< quantification style */ /**@}*/ /** The picture heap we are attached to */ @@ -115,6 +123,23 @@ struct picture_t 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 @@ -135,6 +160,17 @@ static inline void picture_Release( picture_t *p_picture ) p_picture->pf_release( p_picture ); } +/** + * Cleanup quantization matrix data and set to 0 + */ +static inline void picture_CleanupQuant( picture_t *p_pic ) +{ + free( p_pic->p_q ); + p_pic->p_q = NULL; + p_pic->i_qstride = 0; + p_pic->i_qtype = 0; +} + /** * This function will copy all picture dynamic properties. */ @@ -146,6 +182,28 @@ static inline void picture_CopyProperties( picture_t *p_dst, const picture_t *p_ 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; + + /* FIXME: copy ->p_q and ->p_qstride */ +} + +/** + * 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 ) ); +VLC_EXPORT( void, plane_CopyPixels, ( plane_t *p_dst, const plane_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 ); } /** @@ -198,6 +256,11 @@ struct picture_heap_t #define DISPLAYED_PICTURE 5 /* been displayed but is linked */ #define DESTROYED_PICTURE 6 /* allocated but no more used */ +/* Quantification type */ +#define QTYPE_MPEG1 0 +#define QTYPE_MPEG2 1 +#define QTYPE_H264 2 + /***************************************************************************** * Shortcuts to access image components *****************************************************************************/ @@ -315,9 +378,9 @@ struct subpicture_t video_format_t *, picture_t * ); void ( *pf_destroy_region ) ( vlc_object_t *, subpicture_region_t * ); - void ( *pf_pre_render ) ( video_format_t *, spu_t *, subpicture_t *, mtime_t ); - subpicture_region_t * ( *pf_update_regions ) ( video_format_t *, spu_t *, - subpicture_t *, mtime_t ); + void ( *pf_pre_render ) ( video_format_t *, spu_t *, subpicture_t * ); + void ( *pf_update_regions ) ( video_format_t *, spu_t *, + subpicture_t *, mtime_t ); /** Private data - the subtitle plugin might want to put stuff here to * keep track of the subpicture */ @@ -626,9 +689,14 @@ VLC_EXPORT( void, vout_DatePicture, ( vout_thread_t *, picture_t * VLC_EXPORT( void, vout_LinkPicture, ( vout_thread_t *, picture_t * ) ); VLC_EXPORT( void, vout_UnlinkPicture, ( vout_thread_t *, picture_t * ) ); VLC_EXPORT( void, vout_PlacePicture, ( vout_thread_t *, unsigned int, unsigned int, unsigned int *, unsigned int *, unsigned int *, unsigned int * ) ); + +/* DO NOT use vout_RenderPicture unless you are in src/video_ouput */ picture_t * vout_RenderPicture ( vout_thread_t *, picture_t *, subpicture_t * ); +/* DO NOT use vout_CountPictureAvailable unless your are in src/input/dec.c (no exception) */ +int vout_CountPictureAvailable( vout_thread_t * ); + VLC_EXPORT( int, vout_vaControlDefault, ( vout_thread_t *, int, va_list ) ); VLC_EXPORT( void *, vout_RequestWindow, ( vout_thread_t *, int *, int *, unsigned int *, unsigned int * ) ); VLC_EXPORT( void, vout_ReleaseWindow, ( vout_thread_t *, void * ) );