diff mbox series

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

Message ID 20200528051318.34538-1-rcombs@rcombs.me
State Superseded
Headers show
Series [FFmpeg-devel,1/4] lavf: matroska subtitle muxer
Related show

Checks

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

Commit Message

rcombs May 28, 2020, 5:13 a.m. UTC
---
 configure                 |  1 +
 libavformat/allformats.c  |  1 +
 libavformat/matroskaenc.c | 30 ++++++++++++++++++++++++++++++
 libavformat/version.h     |  2 +-
 4 files changed, 33 insertions(+), 1 deletion(-)

Comments

Nicolas George May 28, 2020, 8:26 a.m. UTC | #1
rcombs (12020-05-28):
> ---
>  configure                 |  1 +
>  libavformat/allformats.c  |  1 +
>  libavformat/matroskaenc.c | 30 ++++++++++++++++++++++++++++++
>  libavformat/version.h     |  2 +-
>  4 files changed, 33 insertions(+), 1 deletion(-)

Was this not rejected two months ago as doing nothing useful?

Regards,
rcombs May 28, 2020, 8:29 a.m. UTC | #2
> On May 28, 2020, at 03:26, Nicolas George <george@nsup.org> wrote:
> 
> rcombs (12020-05-28):
>> ---
>> configure                 |  1 +
>> libavformat/allformats.c  |  1 +
>> libavformat/matroskaenc.c | 30 ++++++++++++++++++++++++++++++
>> libavformat/version.h     |  2 +-
>> 4 files changed, 33 insertions(+), 1 deletion(-)
> 
> Was this not rejected two months ago as doing nothing useful?

Dunno; I added it because an output file named .mks wasn't autoselecting the matroska muxer, and it seemed like if we're going to have an mka muxer (rather than just an additional extension on the main one) we might as well have an mks muxer as well. If we don't think it's useful, it might make sense to get rid of the mka muxer as well and just add all the extensions (including mk3d) to the mkv one; I don't feel strongly either way.

> 
> Regards,
> 
> -- 
>  Nicolas George
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

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