From patchwork Thu May 28 05:13:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: rcombs X-Patchwork-Id: 19923 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id DCEF6449BA4 for ; Thu, 28 May 2020 08:13:45 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C19FF68AB65; Thu, 28 May 2020 08:13:45 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from so254-54.mailgun.net (so254-54.mailgun.net [198.61.254.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8A6F26880CC for ; Thu, 28 May 2020 08:13:38 +0300 (EEST) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=rcombs.me; q=dns/txt; s=mx; t=1590642820; h=Content-Transfer-Encoding: MIME-Version: Message-Id: Date: Subject: To: From: Sender; bh=vNd+jQHU+FyT2sUOBLELSQrwUFb1dgbFWOi6U6rOsng=; b=gKONatSLr/TpHStlmB4KxtXWpxLXy5JKB8NTuDcimSgBC7M2rZ4a/vFavwhoUciTkOzHag1/ MtRdVwC8NFE/tpXmdMy3Z/dj4Jw/WvEkuvGadDbzW6+oAU077Zawdyd+waHzSZATaPRxw5W2 qzMeMOpGZwpeZHycq8eX0v6u0pY= X-Mailgun-Sending-Ip: 198.61.254.54 X-Mailgun-Sid: WyJiZDU1MSIsICJmZm1wZWctZGV2ZWxAZmZtcGVnLm9yZyIsICJiMGJhIl0= Received: from rcombs-mbp.localdomain ( [24.14.135.13]) by smtp-out-n04.prod.us-west-2.postgun.com with SMTP id 5ecf4871c6d4683243832584 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 28 May 2020 05:13:21 GMT From: rcombs To: ffmpeg-devel@ffmpeg.org Date: Thu, 28 May 2020 00:13:15 -0500 Message-Id: <20200528051318.34538-1-rcombs@rcombs.me> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/4] lavf: matroska subtitle muxer X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- configure | 1 + libavformat/allformats.c | 1 + libavformat/matroskaenc.c | 30 ++++++++++++++++++++++++++++++ libavformat/version.h | 2 +- 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 8569a60bf8..9929c29006 100755 --- a/configure +++ b/configure @@ -3305,6 +3305,7 @@ ismv_muxer_select="mov_muxer" ivf_muxer_select="av1_metadata_bsf vp9_superframe_bsf" latm_muxer_select="aac_adtstoasc_bsf" matroska_audio_muxer_select="matroska_muxer" +matroska_subtitle_muxer_select="matroska_muxer" matroska_demuxer_select="iso_media riffdec" matroska_demuxer_suggest="bzlib lzo zlib" matroska_muxer_select="iso_media riffenc vp9_superframe_bsf aac_adtstoasc_bsf" diff --git a/libavformat/allformats.c b/libavformat/allformats.c index 3919c9e4c1..1bae208195 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -233,6 +233,7 @@ extern AVOutputFormat ff_md5_muxer; extern AVInputFormat ff_matroska_demuxer; extern AVOutputFormat ff_matroska_muxer; extern AVOutputFormat ff_matroska_audio_muxer; +extern AVOutputFormat ff_matroska_subtitle_muxer; extern AVInputFormat ff_mgsts_demuxer; extern AVInputFormat ff_microdvd_demuxer; extern AVOutputFormat ff_microdvd_muxer; diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index 1c1ea71f59..1f7a9528de 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -2891,3 +2891,33 @@ AVOutputFormat ff_matroska_audio_muxer = { .priv_class = &mka_class, }; #endif + +#if CONFIG_MATROSKA_SUBTITLE_MUXER +static const AVClass mks_class = { + .class_name = "matroska subtitle muxer", + .item_name = av_default_item_name, + .option = options, + .version = LIBAVUTIL_VERSION_INT, +}; +AVOutputFormat ff_matroska_subtitle_muxer = { + .name = "matroska", + .long_name = NULL_IF_CONFIG_SMALL("Matroska Subtitle"), + .extensions = "mks", + .priv_data_size = sizeof(MatroskaMuxContext), + .audio_codec = AV_CODEC_ID_NONE, + .video_codec = AV_CODEC_ID_NONE, + .subtitle_codec = AV_CODEC_ID_ASS, + .init = mkv_init, + .deinit = mkv_deinit, + .write_header = mkv_write_header, + .write_packet = mkv_write_flush_packet, + .write_trailer = mkv_write_trailer, + .check_bitstream = mkv_check_bitstream, + .flags = AVFMT_GLOBALHEADER | AVFMT_TS_NONSTRICT | + AVFMT_ALLOW_FLUSH, + .codec_tag = (const AVCodecTag* const []){ + additional_subtitle_tags, 0 + }, + .priv_class = &mks_class, +}; +#endif diff --git a/libavformat/version.h b/libavformat/version.h index 493a0b337f..e0135fc7d3 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -32,7 +32,7 @@ // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium) // Also please add any ticket numbers that you believe might be affected here #define LIBAVFORMAT_VERSION_MAJOR 58 -#define LIBAVFORMAT_VERSION_MINOR 43 +#define LIBAVFORMAT_VERSION_MINOR 44 #define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \