diff options
author | Clément Bœsch <ubitux@gmail.com> | 2012-12-29 00:04:44 +0100 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2012-12-31 00:01:58 +0100 |
commit | faa94061dd7236cbaabd483e7b2df148cdbefb7f (patch) | |
tree | 350748d569b55a6cd312a494f6d1bfbe81708cc5 /libavcodec | |
parent | 7b43402724b21cca805c8afac6ec33a211d52b85 (diff) | |
download | ffmpeg-faa94061dd7236cbaabd483e7b2df148cdbefb7f.tar.gz |
Add SubViewer v1 subtitles demuxer and decoder.
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/Makefile | 1 | ||||
-rw-r--r-- | libavcodec/allcodecs.c | 1 | ||||
-rw-r--r-- | libavcodec/avcodec.h | 1 | ||||
-rw-r--r-- | libavcodec/codec_desc.c | 6 | ||||
-rw-r--r-- | libavcodec/textdec.c | 18 | ||||
-rw-r--r-- | libavcodec/version.h | 2 |
6 files changed, 27 insertions, 2 deletions
diff --git a/libavcodec/Makefile b/libavcodec/Makefile index f8dd081097..27c9a1139b 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -402,6 +402,7 @@ OBJS-$(CONFIG_SRT_DECODER) += srtdec.o ass.o OBJS-$(CONFIG_SRT_ENCODER) += srtenc.o ass_split.o OBJS-$(CONFIG_SUBRIP_DECODER) += srtdec.o ass.o OBJS-$(CONFIG_SUBRIP_ENCODER) += srtenc.o ass_split.o +OBJS-$(CONFIG_SUBVIEWER1_DECODER) += textdec.o ass.o OBJS-$(CONFIG_SUBVIEWER_DECODER) += subviewerdec.o ass.o OBJS-$(CONFIG_SUNRAST_DECODER) += sunrast.o OBJS-$(CONFIG_SUNRAST_ENCODER) += sunrastenc.o diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index d519a3e977..987b87723c 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -456,6 +456,7 @@ void avcodec_register_all(void) REGISTER_ENCDEC (SRT, srt); REGISTER_ENCDEC (SUBRIP, subrip); REGISTER_DECODER(SUBVIEWER, subviewer); + REGISTER_DECODER(SUBVIEWER1, subviewer1); REGISTER_DECODER(TEXT, text); REGISTER_DECODER(VPLAYER, vplayer); REGISTER_DECODER(WEBVTT, webvtt); diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 782b46b6ce..012a31c7e7 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -463,6 +463,7 @@ enum AVCodecID { AV_CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'), AV_CODEC_ID_SAMI = MKBETAG('S','A','M','I'), AV_CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'), + AV_CODEC_ID_SUBVIEWER1 = MKBETAG('S','b','V','1'), AV_CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'), AV_CODEC_ID_SUBRIP = MKBETAG('S','R','i','p'), AV_CODEC_ID_WEBVTT = MKBETAG('W','V','T','T'), diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c index 13ebcecef6..d721780218 100644 --- a/libavcodec/codec_desc.c +++ b/libavcodec/codec_desc.c @@ -2441,6 +2441,12 @@ static const AVCodecDescriptor codec_descriptors[] = { .long_name = NULL_IF_CONFIG_SMALL("RealText subtitle"), }, { + .id = AV_CODEC_ID_SUBVIEWER1, + .type = AVMEDIA_TYPE_SUBTITLE, + .name = "subviewer1", + .long_name = NULL_IF_CONFIG_SMALL("SubViewer v1 subtitle"), + }, + { .id = AV_CODEC_ID_SUBVIEWER, .type = AVMEDIA_TYPE_SUBTITLE, .name = "subviewer", diff --git a/libavcodec/textdec.c b/libavcodec/textdec.c index 32af644150..9b97bacabd 100644 --- a/libavcodec/textdec.c +++ b/libavcodec/textdec.c @@ -128,7 +128,7 @@ AVCodec ff_text_decoder = { }; #endif -#if CONFIG_VPLAYER_DECODER || CONFIG_PJS_DECODER +#if CONFIG_VPLAYER_DECODER || CONFIG_PJS_DECODER || CONFIG_TEXT_DECODER static int linebreak_init(AVCodecContext *avctx) { @@ -169,4 +169,20 @@ AVCodec ff_pjs_decoder = { }; #endif +#if CONFIG_SUBVIEWER1_DECODER +#define subviewer1_options options +DECLARE_CLASS(subviewer1); + +AVCodec ff_subviewer1_decoder = { + .name = "subviewer1", + .priv_data_size = sizeof(TextContext), + .long_name = NULL_IF_CONFIG_SMALL("SubViewer1 subtitle"), + .type = AVMEDIA_TYPE_SUBTITLE, + .id = AV_CODEC_ID_SUBVIEWER1, + .decode = text_decode_frame, + .init = linebreak_init, + .priv_class = &subviewer1_decoder_class, +}; +#endif + #endif /* text subtitles with '|' line break */ diff --git a/libavcodec/version.h b/libavcodec/version.h index bdd94b4e56..af58490975 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,7 +29,7 @@ #include "libavutil/avutil.h" #define LIBAVCODEC_VERSION_MAJOR 54 -#define LIBAVCODEC_VERSION_MINOR 83 +#define LIBAVCODEC_VERSION_MINOR 84 #define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ |