X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=include%2Fvlc_osd.h;h=06ac47f7909a563ad85dc302e7857b155b991803;hb=9dee7a82fa1a61ca457fa4d390f2df7a7881085b;hp=54625ff559a506b2abad4e07cb3b8dcd9e9719e5;hpb=894f901f69d1c8f51f3079ec02f0bbc86aba2bee;p=vlc diff --git a/include/vlc_osd.h b/include/vlc_osd.h index 54625ff559..06ac47f790 100644 --- a/include/vlc_osd.h +++ b/include/vlc_osd.h @@ -54,6 +54,11 @@ extern "C" { #include +typedef struct spu_private_t spu_private_t; + +/* Default subpicture channel ID */ +#define DEFAULT_CHAN 1 + /** * Subpicture unit descriptor */ @@ -61,25 +66,15 @@ struct spu_t { VLC_COMMON_MEMBERS - vlc_mutex_t subpicture_lock; /**< subpicture heap lock */ - subpicture_t p_subpicture[VOUT_MAX_SUBPICTURES]; /**< subpictures */ - int i_channel; /**< number of subpicture channels registered */ - - filter_t *p_blend; /**< alpha blending module */ - filter_t *p_text; /**< text renderer module */ - filter_t *p_scale_yuvp; /**< scaling module for YUVP */ - filter_t *p_scale; /**< scaling module (all but YUVP) */ - bool b_force_crop; /**< force cropping of subpicture */ - int i_crop_x, i_crop_y, i_crop_width, i_crop_height; /**< cropping */ + int (*pf_control)( spu_t *, int, va_list ); - int i_margin; /**< force position of a subpicture */ - bool b_force_palette; /**< force palette of subpicture */ - uint8_t palette[4][4]; /**< forced palette */ - - int ( *pf_control ) ( spu_t *, int, va_list ); + spu_private_t *p; +}; - /* Supciture filters */ - filter_chain_t *p_chain; +enum spu_query_e +{ + SPU_CHANNEL_REGISTER, /* arg1= int * res= */ + SPU_CHANNEL_CLEAR /* arg1= int res= */ }; static inline int spu_vaControl( spu_t *p_spu, int i_query, va_list args ) @@ -101,27 +96,26 @@ static inline int spu_Control( spu_t *p_spu, int i_query, ... ) return i_result; } -enum spu_query_e -{ - SPU_CHANNEL_REGISTER, /* arg1= int * res= */ - SPU_CHANNEL_CLEAR /* arg1= int res= */ -}; - #define spu_Create(a) __spu_Create(VLC_OBJECT(a)) VLC_EXPORT( spu_t *, __spu_Create, ( vlc_object_t * ) ); VLC_EXPORT( int, spu_Init, ( spu_t * ) ); VLC_EXPORT( void, spu_Destroy, ( spu_t * ) ); void spu_Attach( spu_t *, vlc_object_t *, bool ); -VLC_EXPORT( subpicture_t *, spu_CreateSubpicture, ( spu_t * ) ); -VLC_EXPORT( void, spu_DestroySubpicture, ( spu_t *, subpicture_t * ) ); +/** + * This function sends a subpicture to the spu_t core. + * + * You cannot use the provided subpicture anymore. The spu_t core + * will destroy it at its convenience. + */ VLC_EXPORT( void, spu_DisplaySubpicture, ( spu_t *, subpicture_t * ) ); -#define spu_CreateRegion(a,b) __spu_CreateRegion(VLC_OBJECT(a),b) -VLC_EXPORT( subpicture_region_t *,__spu_CreateRegion, ( vlc_object_t *, video_format_t * ) ); -#define spu_DestroyRegion(a,b) __spu_DestroyRegion(VLC_OBJECT(a),b) -VLC_EXPORT( void, __spu_DestroyRegion, ( vlc_object_t *, subpicture_region_t * ) ); -VLC_EXPORT( subpicture_t *, spu_SortSubpictures, ( spu_t *, mtime_t display_date, bool b_paused, bool b_subtitle_only ) ); +/** + * This function asks the spu_t core a list of subpictures to display. + * + * The returned list can only be used by spu_RenderSubpictures. + */ +VLC_EXPORT( subpicture_t *, spu_SortSubpictures, ( spu_t *, mtime_t render_subtitle_date, bool b_subtitle_only ) ); /** * This function renders a list of subpicture_t on the provided picture. @@ -129,7 +123,7 @@ VLC_EXPORT( subpicture_t *, spu_SortSubpictures, ( spu_t *, mtime_t display_date * \param p_fmt_dst is the format of the destination picture. * \param p_fmt_src is the format of the original(source) video. */ -VLC_EXPORT( void, spu_RenderSubpictures, ( spu_t *, picture_t *, const video_format_t *p_fmt_dst, subpicture_t *p_list, const video_format_t *p_fmt_src ) ); +VLC_EXPORT( void, spu_RenderSubpictures, ( spu_t *, picture_t *, const video_format_t *p_fmt_dst, subpicture_t *p_list, const video_format_t *p_fmt_src, mtime_t render_subtitle_date ) ); /** @}*/ @@ -274,8 +268,25 @@ struct text_style_t #define STYLE_UNDERLINE 32 #define STYLE_STRIKEOUT 64 -static const text_style_t default_text_style = { NULL, 22, 0xffffff, 0xff, STYLE_OUTLINE, - 0x000000, 0xff, 0x000000, 0xff, 0xffffff, 0x80, 0xffffff, 0xff, 1, 0, -1 }; +/** + * Create a default text style + */ +VLC_EXPORT( text_style_t *, text_style_New, ( void ) ); + +/** + * Copy a text style into another + */ +VLC_EXPORT( text_style_t *, text_style_Copy, ( text_style_t *, const text_style_t * ) ); + +/** + * Duplicate a text style + */ +VLC_EXPORT( text_style_t *, text_style_Duplicate, ( const text_style_t * ) ); + +/** + * Delete a text style created by text_style_New or text_style_Duplicate + */ +VLC_EXPORT( void, text_style_Delete, ( text_style_t * ) ); /** * OSD menu button states @@ -599,9 +610,9 @@ static inline void osd_SetMenuUpdate( osd_menu_t *p_osd, bool b_value ) * object. The types are declared in the include file include/vlc_osd.h * @see vlc_osd.h */ -VLC_EXPORT( int, osd_ShowTextRelative, ( spu_t *, int, char *, text_style_t *, int, int, int, mtime_t ) ); -VLC_EXPORT( int, osd_ShowTextAbsolute, ( spu_t *, int, char *, text_style_t *, int, int, int, mtime_t, mtime_t ) ); -VLC_EXPORT( void,osd_Message, ( spu_t *, int, char *, ... ) LIBVLC_FORMAT( 3, 4 ) ); +VLC_EXPORT( int, osd_ShowTextRelative, ( spu_t *, int, const char *, const text_style_t *, int, int, int, mtime_t ) ); +VLC_EXPORT( int, osd_ShowTextAbsolute, ( spu_t *, int, const char *, const text_style_t *, int, int, int, mtime_t, mtime_t ) ); +VLC_EXPORT( void, osd_Message, ( spu_t *, int, char *, ... ) LIBVLC_FORMAT( 3, 4 ) ); /** * Default feedback images @@ -620,34 +631,9 @@ VLC_EXPORT( int, osd_Icon, ( vlc_object_t *, spu_t *, int, int, int, int, int, s * Vout text and widget overlays **********************************************************************/ -/** - * Show text on the video for some time - * \param p_vout pointer to the vout the text is to be showed on - * \param i_channel Subpicture channel - * \param psz_string The text to be shown - * \param p_style Pointer to a struct with text style info - * \param i_flags flags for alignment and such - * \param i_hmargin horizontal margin in pixels - * \param i_vmargin vertical margin in pixels - * \param i_duration Amount of time the text is to be shown. - */ -VLC_EXPORT( int, vout_ShowTextRelative, ( vout_thread_t *, int, char *, text_style_t *, int, int, int, mtime_t ) ); +VLC_EXPORT( int, vout_ShowTextRelative, ( vout_thread_t *, int, char *, const text_style_t *, int, int, int, mtime_t ) ); -/** - * Show text on the video from a given start date to a given end date - * \param p_vout pointer to the vout the text is to be showed on - * \param i_channel Subpicture channel - * \param psz_string The text to be shown - * \param p_style Pointer to a struct with text style info - * \param i_flags flags for alignment and such - * \param i_hmargin horizontal margin in pixels - * \param i_vmargin vertical margin in pixels - * \param i_start the time when this string is to appear on the video - * \param i_stop the time when this string should stop to be displayed - * if this is 0 the string will be shown untill the next string - * is about to be shown - */ -VLC_EXPORT( int, vout_ShowTextAbsolute, ( vout_thread_t *, int, const char *, text_style_t *, int, int, int, mtime_t, mtime_t ) ); +VLC_EXPORT( int, vout_ShowTextAbsolute, ( vout_thread_t *, int, const char *, const text_style_t *, int, int, int, mtime_t, mtime_t ) ); /** * Write an informative message at the default location,