X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fvlc_subpicture.h;h=d914e30e4e2b587724081af96c2b7ce683f8367a;hb=470ce70b69e1530173950a8dfd6d274a70caa7bc;hp=23fdaaca18a8fd09d84122e4c2b9c048401f4188;hpb=8939e8f944fbac079dd9e2d04ca5189a8fed1407;p=vlc diff --git a/include/vlc_subpicture.h b/include/vlc_subpicture.h index 23fdaaca18..d914e30e4e 100644 --- a/include/vlc_subpicture.h +++ b/include/vlc_subpicture.h @@ -32,6 +32,7 @@ */ #include +#include /** * \defgroup subpicture Video Subpictures @@ -102,6 +103,26 @@ VLC_EXPORT( void, subpicture_region_Delete, ( subpicture_region_t *p_region ) ); */ VLC_EXPORT( void, subpicture_region_ChainDelete, ( subpicture_region_t *p_head ) ); +/** + * + */ +typedef struct subpicture_updater_sys_t subpicture_updater_sys_t; +typedef struct +{ + int (*pf_validate)( subpicture_t *, + bool has_src_changed, const video_format_t *p_fmt_src, + bool has_dst_changed, const video_format_t *p_fmt_dst, + mtime_t); + void (*pf_update) ( subpicture_t *, + const video_format_t *p_fmt_src, + const video_format_t *p_fmt_dst, + mtime_t ); + void (*pf_destroy) ( subpicture_t * ); + subpicture_updater_sys_t *p_sys; +} subpicture_updater_t; + +typedef struct subpicture_private_t subpicture_private_t; + /** * Video subtitle * @@ -147,25 +168,17 @@ struct subpicture_t int i_alpha; /**< transparency */ /**@}*/ - /** Pointer to function that cleans up the private data of this subtitle */ - void ( *pf_destroy ) ( subpicture_t * ); + subpicture_updater_t updater; - /** Pointer to function that update the regions before rendering (optionnal) */ - void (*pf_update_regions)( spu_t *, - subpicture_t *, const video_format_t *, mtime_t ); - - /** Private data - the subtitle plugin might want to put stuff here to - * keep track of the subpicture */ - subpicture_sys_t *p_sys; /* subpicture data */ + subpicture_private_t *p_private; /* Reserved to the core */ }; - /** * This function create a new empty subpicture. * * You must use subpicture_Delete to destroy it. */ -VLC_EXPORT( subpicture_t *, subpicture_New, ( void ) ); +VLC_EXPORT( subpicture_t *, subpicture_New, ( const subpicture_updater_t * ) ); /** * This function delete a subpicture created by subpicture_New. @@ -182,6 +195,12 @@ VLC_EXPORT( void, subpicture_Delete, ( subpicture_t *p_subpic ) ); */ VLC_EXPORT( subpicture_t *, subpicture_NewFromPicture, ( vlc_object_t *, picture_t *, vlc_fourcc_t i_chroma ) ); +/** + * This function will update the content of a subpicture created with + * a non NULL subpicture_updater_t. + */ +VLC_EXPORT( void, subpicture_Update, ( subpicture_t *, const video_format_t *src, const video_format_t *, mtime_t ) ); + /**@}*/ #endif /* _VLC_VIDEO_H */