From patchwork Thu Jun 18 00:47:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: rcombs X-Patchwork-Id: 20448 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 A3CA044AC29 for ; Thu, 18 Jun 2020 03:48:16 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 90FEB68B626; Thu, 18 Jun 2020 03:48:16 +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 43DB968B5D7 for ; Thu, 18 Jun 2020 03:48:10 +0300 (EEST) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=rcombs.me; q=dns/txt; s=mx; t=1592441292; h=Content-Transfer-Encoding: MIME-Version: Message-Id: Date: Subject: To: From: Sender; bh=P+jQZOvcqyFdfKNmlyKaodON41CHqqYcfLYQwVCTjm8=; b=v5d85lvYXKQuO7pXFAnB4lCAwnk5BUmHbMUn61wDFlpbM+BPGefUcs0vJjjIhDjS8t0GTCZh ifb6h7051bCHi1D3Ddn70Z5NgMYiKR1mN3QDwJujGvAnj+fmMmkos8OsW7vJ1B8vhcl9B1EF XEeFu0IebB402O78GGdlr3OsrwA= X-Mailgun-Sending-Ip: 198.61.254.54 X-Mailgun-Sid: WyJiZDU1MSIsICJmZm1wZWctZGV2ZWxAZmZtcGVnLm9yZyIsICJiMGJhIl0= Received: from rcombs-mbp.localdomain ( [24.14.135.13]) by smtp-out-n07.prod.us-east-1.postgun.com with SMTP id 5eeab9b2c4bb4f886d7af01b (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 18 Jun 2020 00:47:46 GMT From: rcombs To: ffmpeg-devel@ffmpeg.org Date: Wed, 17 Jun 2020 19:47:39 -0500 Message-Id: <20200618004743.95896-1-rcombs@rcombs.me> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/5] 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 | 4 ++-- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 7495f35faa..28686ce2e8 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 a7c5c9db89..9d6f6c2ad5 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -234,6 +234,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 eaed02bc92..63d6b50e6a 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -2893,3 +2893,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 59151a71a0..3c1957b00c 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -32,8 +32,8 @@ // 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 46 -#define LIBAVFORMAT_VERSION_MICRO 101 +#define LIBAVFORMAT_VERSION_MINOR 47 +#define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ LIBAVFORMAT_VERSION_MINOR, \