From 2c77c90684e24ef16f7e7c4462e011434cee6a98 Mon Sep 17 00:00:00 2001 From: Aurelien Jacobs Date: Tue, 28 Dec 2010 23:52:53 +0000 Subject: add SubRip decoder Originally committed as revision 26119 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/ass.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'libavcodec/ass.h') diff --git a/libavcodec/ass.h b/libavcodec/ass.h index 1c847f169b..e04b4cc747 100644 --- a/libavcodec/ass.h +++ b/libavcodec/ass.h @@ -24,6 +24,51 @@ #include "avcodec.h" +/** + * Default values for ASS style. + * @defgroup ass_default + * @{ + */ +#define ASS_DEFAULT_FONT "Arial" +#define ASS_DEFAULT_FONT_SIZE 16 +#define ASS_DEFAULT_COLOR 0xffffff +#define ASS_DEFAULT_BACK_COLOR 0 +#define ASS_DEFAULT_BOLD 0 +#define ASS_DEFAULT_ITALIC 0 +#define ASS_DEFAULT_UNDERLINE 0 +#define ASS_DEFAULT_ALIGNMENT 2 +/** @} */ + +/** + * Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS. + * + * @param avctx pointer to the AVCodecContext + * @param font name of the default font face to use + * @param font_size default font size to use + * @param color default text color to use (ABGR) + * @param back_color default background color to use (ABGR) + * @param bold 1 for bold text, 0 for normal text + * @param italic 1 for italic text, 0 for normal text + * @param underline 1 for underline text, 0 for normal text + * @param alignment position of the text (left, center, top...), defined after + * the layout of the numpad (1-3 sub, 4-6 mid, 7-9 top) + * @return >= 0 on success otherwise an error code <0 + */ +int ff_ass_subtitle_header(AVCodecContext *avctx, + const char *font, int font_size, + int color, int back_color, + int bold, int italic, int underline, + int alignment); + +/** + * Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS + * with default style. + * + * @param avctx pointer to the AVCodecContext + * @return >= 0 on success otherwise an error code <0 + */ +int ff_ass_subtitle_header_default(AVCodecContext *avctx); + /** * Initialize an AVSubtitle structure for use with ff_ass_add_rect(). * -- cgit v1.2.3