|
@@ -45,12 +45,11 @@ static const AVOption options[] = {
|
|
|
{ NULL }
|
|
{ NULL }
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-static int text_decode_frame(AVCodecContext *avctx, void *data,
|
|
|
|
|
|
|
+static int text_decode_frame(AVCodecContext *avctx, AVSubtitle *sub,
|
|
|
int *got_sub_ptr, AVPacket *avpkt)
|
|
int *got_sub_ptr, AVPacket *avpkt)
|
|
|
{
|
|
{
|
|
|
int ret = 0;
|
|
int ret = 0;
|
|
|
AVBPrint buf;
|
|
AVBPrint buf;
|
|
|
- AVSubtitle *sub = data;
|
|
|
|
|
const char *ptr = avpkt->data;
|
|
const char *ptr = avpkt->data;
|
|
|
TextContext *text = avctx->priv_data;
|
|
TextContext *text = avctx->priv_data;
|
|
|
|
|
|
|
@@ -87,7 +86,7 @@ const FFCodec ff_text_decoder = {
|
|
|
.priv_data_size = sizeof(TextContext),
|
|
.priv_data_size = sizeof(TextContext),
|
|
|
.p.type = AVMEDIA_TYPE_SUBTITLE,
|
|
.p.type = AVMEDIA_TYPE_SUBTITLE,
|
|
|
.p.id = AV_CODEC_ID_TEXT,
|
|
.p.id = AV_CODEC_ID_TEXT,
|
|
|
- .decode = text_decode_frame,
|
|
|
|
|
|
|
+ .decode_sub = text_decode_frame,
|
|
|
.init = ff_ass_subtitle_header_default,
|
|
.init = ff_ass_subtitle_header_default,
|
|
|
.p.priv_class = &textsub_decoder_class,
|
|
.p.priv_class = &textsub_decoder_class,
|
|
|
.flush = text_flush,
|
|
.flush = text_flush,
|
|
@@ -111,7 +110,7 @@ const FFCodec ff_vplayer_decoder = {
|
|
|
.priv_data_size = sizeof(TextContext),
|
|
.priv_data_size = sizeof(TextContext),
|
|
|
.p.type = AVMEDIA_TYPE_SUBTITLE,
|
|
.p.type = AVMEDIA_TYPE_SUBTITLE,
|
|
|
.p.id = AV_CODEC_ID_VPLAYER,
|
|
.p.id = AV_CODEC_ID_VPLAYER,
|
|
|
- .decode = text_decode_frame,
|
|
|
|
|
|
|
+ .decode_sub = text_decode_frame,
|
|
|
.init = linebreak_init,
|
|
.init = linebreak_init,
|
|
|
.p.priv_class = &textsub_decoder_class,
|
|
.p.priv_class = &textsub_decoder_class,
|
|
|
.flush = text_flush,
|
|
.flush = text_flush,
|
|
@@ -126,7 +125,7 @@ const FFCodec ff_stl_decoder = {
|
|
|
.priv_data_size = sizeof(TextContext),
|
|
.priv_data_size = sizeof(TextContext),
|
|
|
.p.type = AVMEDIA_TYPE_SUBTITLE,
|
|
.p.type = AVMEDIA_TYPE_SUBTITLE,
|
|
|
.p.id = AV_CODEC_ID_STL,
|
|
.p.id = AV_CODEC_ID_STL,
|
|
|
- .decode = text_decode_frame,
|
|
|
|
|
|
|
+ .decode_sub = text_decode_frame,
|
|
|
.init = linebreak_init,
|
|
.init = linebreak_init,
|
|
|
.p.priv_class = &textsub_decoder_class,
|
|
.p.priv_class = &textsub_decoder_class,
|
|
|
.flush = text_flush,
|
|
.flush = text_flush,
|
|
@@ -141,7 +140,7 @@ const FFCodec ff_pjs_decoder = {
|
|
|
.priv_data_size = sizeof(TextContext),
|
|
.priv_data_size = sizeof(TextContext),
|
|
|
.p.type = AVMEDIA_TYPE_SUBTITLE,
|
|
.p.type = AVMEDIA_TYPE_SUBTITLE,
|
|
|
.p.id = AV_CODEC_ID_PJS,
|
|
.p.id = AV_CODEC_ID_PJS,
|
|
|
- .decode = text_decode_frame,
|
|
|
|
|
|
|
+ .decode_sub = text_decode_frame,
|
|
|
.init = linebreak_init,
|
|
.init = linebreak_init,
|
|
|
.p.priv_class = &textsub_decoder_class,
|
|
.p.priv_class = &textsub_decoder_class,
|
|
|
.flush = text_flush,
|
|
.flush = text_flush,
|
|
@@ -156,7 +155,7 @@ const FFCodec ff_subviewer1_decoder = {
|
|
|
.priv_data_size = sizeof(TextContext),
|
|
.priv_data_size = sizeof(TextContext),
|
|
|
.p.type = AVMEDIA_TYPE_SUBTITLE,
|
|
.p.type = AVMEDIA_TYPE_SUBTITLE,
|
|
|
.p.id = AV_CODEC_ID_SUBVIEWER1,
|
|
.p.id = AV_CODEC_ID_SUBVIEWER1,
|
|
|
- .decode = text_decode_frame,
|
|
|
|
|
|
|
+ .decode_sub = text_decode_frame,
|
|
|
.init = linebreak_init,
|
|
.init = linebreak_init,
|
|
|
.p.priv_class = &textsub_decoder_class,
|
|
.p.priv_class = &textsub_decoder_class,
|
|
|
.flush = text_flush,
|
|
.flush = text_flush,
|