diff mbox series

[FFmpeg-devel,1/5] lavf: matroska subtitle muxer

Message ID 20200618004743.95896-1-rcombs@rcombs.me
State New
Headers show
Series [FFmpeg-devel,1/5] lavf: matroska subtitle muxer | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

rcombs June 18, 2020, 12:47 a.m. UTC
---
 configure                 |  1 +
 libavformat/allformats.c  |  1 +
 libavformat/matroskaenc.c | 30 ++++++++++++++++++++++++++++++
 libavformat/version.h     |  4 ++--
 4 files changed, 34 insertions(+), 2 deletions(-)

Comments

Nicolas George June 20, 2020, 11:07 a.m. UTC | #1
rcombs (12020-06-17):
> ---
>  configure                 |  1 +
>  libavformat/allformats.c  |  1 +
>  libavformat/matroskaenc.c | 30 ++++++++++++++++++++++++++++++
>  libavformat/version.h     |  4 ++--
>  4 files changed, 34 insertions(+), 2 deletions(-)

Please take into account the comments that were made the first two times
this patch was proposed.

https://ffmpeg.org/pipermail/ffmpeg-devel/2020-April/259659.html
https://ffmpeg.org/pipermail/ffmpeg-devel/2020-April/259721.html
https://ffmpeg.org/pipermail/ffmpeg-devel/2020-April/259722.html

Regards,
diff mbox series

Patch

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, \