This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit c0e8b139fd32fc1a547d546042be6bc2b03d5b73 Author: Sahitya Chandra <[email protected]> AuthorDate: Sun Sep 20 23:23:59 2026 +0530 Commit: Kacper Michajłow <[email protected]> CommitDate: Thu Sep 24 12:35:59 2026 +0000 tests/api: cover mov_text fallback font table size Print the serialized sample descriptions for ASS headers without styles and with an explicit Serif style, and compare them with a FATE reference. Signed-off-by: Sahitya Chandra <[email protected]> Assisted-by: Fairy --- tests/api/Makefile | 1 + tests/api/api-movtext-test.c | 76 ++++++++++++++++++++++++++++++++++++++++++++ tests/fate/api.mak | 4 +++ tests/ref/fate/api-movtext | 6 ++++ 4 files changed, 87 insertions(+) diff --git a/tests/api/Makefile b/tests/api/Makefile index 953325f89d..f2738d4cba 100644 --- a/tests/api/Makefile +++ b/tests/api/Makefile @@ -3,6 +3,7 @@ APITESTPROGS-$(call ENCDEC, FLAC, FLAC) += api-flac APITESTPROGS-$(call DEMDEC, H264, H264) += api-h264 APITESTPROGS-$(call DEMDEC, H264, H264) += api-h264-slice APITESTPROGS-$(CONFIG_MOV_MUXER) += api-movenc +APITESTPROGS-$(CONFIG_MOVTEXT_ENCODER) += api-movtext APITESTPROGS-yes += api-seek api-dump-stream-meta APITESTPROGS-$(call DEMDEC, H263, H263) += api-band APITESTPROGS-$(HAVE_THREADS) += api-threadmessage diff --git a/tests/api/api-movtext-test.c b/tests/api/api-movtext-test.c new file mode 100644 index 0000000000..2a3c80dba3 --- /dev/null +++ b/tests/api/api-movtext-test.c @@ -0,0 +1,76 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <stdio.h> +#include <string.h> + +#include "libavcodec/avcodec.h" +#include "libavutil/mem.h" + +/** + * Print the sample description for comparison with the FATE reference. + */ +static int dump_sample_description(const AVCodec *codec, const char *header) +{ + AVCodecContext *ctx = avcodec_alloc_context3(codec); + int ret = 1; + + if (!ctx) + return 1; + + ctx->subtitle_header = (uint8_t *)av_strdup(header); + if (!ctx->subtitle_header) + goto end; + ctx->subtitle_header_size = strlen(header); + ctx->time_base = (AVRational){ 1, 1000 }; + + if (avcodec_open2(ctx, codec, NULL) < 0) + goto end; + + printf("extradata_size: %d\n", ctx->extradata_size); + for (int i = 0; i < ctx->extradata_size; i++) + printf("%02x", ctx->extradata[i]); + printf("\n"); + + ret = 0; +end: + avcodec_free_context(&ctx); + return ret; +} + +int main(void) +{ + const AVCodec *codec = avcodec_find_encoder(AV_CODEC_ID_MOV_TEXT); + int ret; + + if (!codec) + return 1; + + printf("Fallback font\n"); + ret = dump_sample_description(codec, + "[Script Info]\n" + "ScriptType: v4.00+\n"); + printf("Explicit Serif style\n"); + ret |= dump_sample_description(codec, + "[Script Info]\n" + "ScriptType: v4.00+\n" + "[V4+ Styles]\n" + "Format: Name, Fontname, Fontsize\n" + "Style: Default,Serif,18\n"); + return ret; +} diff --git a/tests/fate/api.mak b/tests/fate/api.mak index a740db1f0a..a10edfe4da 100644 --- a/tests/fate/api.mak +++ b/tests/fate/api.mak @@ -7,6 +7,10 @@ fate-api-flac: $(APITESTSDIR)/api-flac-test$(EXESUF) fate-api-flac: CMD = run $(APITESTSDIR)/api-flac-test$(EXESUF) fate-api-flac: CMP = null +FATE_API_LIBAVCODEC-$(CONFIG_MOVTEXT_ENCODER) += fate-api-movtext +fate-api-movtext: $(APITESTSDIR)/api-movtext-test$(EXESUF) +fate-api-movtext: CMD = run $(APITESTSDIR)/api-movtext-test$(EXESUF) + FATE_API_LIBAVCODEC-$(call ALLYES, H261_ENCODER H261_PARSER) += fate-api-enc-parser fate-api-enc-parser-cif fate-api-enc-parser: $(APITESTSDIR)/api-enc-parser-test$(EXESUF) fate-api-enc-parser: CMD = run $(APITESTSDIR)/api-enc-parser-test$(EXESUF) h261 176 144 diff --git a/tests/ref/fate/api-movtext b/tests/ref/fate/api-movtext new file mode 100644 index 0000000000..df62fecf47 --- /dev/null +++ b/tests/ref/fate/api-movtext @@ -0,0 +1,6 @@ +Fallback font +extradata_size: 48 +0000000001ff0000000000000000000000000000000000010012ffffffff000000126674616200010001055365726966 +Explicit Serif style +extradata_size: 48 +0000000001ff000000ff00000000000000000000000000010012000000ff000000126674616200010001055365726966 -- To stop receiving notification emails like this one, please contact [email protected]. _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
