aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/movenc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-09-26 00:40:29 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-10-03 01:45:46 +0200
commitdd48e49d5476178db2478598dbcccccf84923d13 (patch)
treedab4d3fac643c0dd6191b73841555272e03e7921 /libavformat/movenc.c
parent0d596776c63a33887526b416dbf0353bc3821437 (diff)
downloadffmpeg-dd48e49d5476178db2478598dbcccccf84923d13.tar.gz
avformat/avformat: Deprecate AVFMT_ALLOW_FLUSH
It is of no value to the user, because every muxer can always be flushed with a NULL packet. As its documentation shows ("If not set, the muxer will not receive a NULL packet in the write_packet function") it is actually an internal flag that has been publically exposed because there was no internal flags field for output formats for a long time. But now there is and so use it by replacing the public flag with a private one. Reviewed-by: James Almer <jamrial@gmail.com> Reviewed-by: Anton Khirnov <anton@khirnov.net> Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r--libavformat/movenc.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 7e96e7435f..a394ff8ddf 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -7932,12 +7932,17 @@ const FFOutputFormat ff_mov_muxer = {
.write_packet = mov_write_packet,
.write_trailer = mov_write_trailer,
.deinit = mov_free,
+#if FF_API_ALLOW_FLUSH
.p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
+#else
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE,
+#endif
.p.codec_tag = (const AVCodecTag* const []){
ff_codec_movvideo_tags, ff_codec_movaudio_tags, ff_codec_movsubtitle_tags, 0
},
.check_bitstream = mov_check_bitstream,
.p.priv_class = &mov_isobmff_muxer_class,
+ .flags_internal = FF_FMT_ALLOW_FLUSH,
};
#endif
#if CONFIG_TGP_MUXER
@@ -7953,10 +7958,15 @@ const FFOutputFormat ff_tgp_muxer = {
.write_packet = mov_write_packet,
.write_trailer = mov_write_trailer,
.deinit = mov_free,
+#if FF_API_ALLOW_FLUSH
.p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
+#else
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE,
+#endif
.p.codec_tag = codec_3gp_tags_list,
.check_bitstream = mov_check_bitstream,
.p.priv_class = &mov_isobmff_muxer_class,
+ .flags_internal = FF_FMT_ALLOW_FLUSH,
};
#endif
#if CONFIG_MP4_MUXER
@@ -7974,10 +7984,15 @@ const FFOutputFormat ff_mp4_muxer = {
.write_packet = mov_write_packet,
.write_trailer = mov_write_trailer,
.deinit = mov_free,
+#if FF_API_ALLOW_FLUSH
.p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
+#else
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE,
+#endif
.p.codec_tag = mp4_codec_tags_list,
.check_bitstream = mov_check_bitstream,
.p.priv_class = &mov_isobmff_muxer_class,
+ .flags_internal = FF_FMT_ALLOW_FLUSH,
};
#endif
#if CONFIG_PSP_MUXER
@@ -7994,10 +8009,15 @@ const FFOutputFormat ff_psp_muxer = {
.write_packet = mov_write_packet,
.write_trailer = mov_write_trailer,
.deinit = mov_free,
+#if FF_API_ALLOW_FLUSH
.p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
+#else
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE,
+#endif
.p.codec_tag = mp4_codec_tags_list,
.check_bitstream = mov_check_bitstream,
.p.priv_class = &mov_isobmff_muxer_class,
+ .flags_internal = FF_FMT_ALLOW_FLUSH,
};
#endif
#if CONFIG_TG2_MUXER
@@ -8013,10 +8033,15 @@ const FFOutputFormat ff_tg2_muxer = {
.write_packet = mov_write_packet,
.write_trailer = mov_write_trailer,
.deinit = mov_free,
+#if FF_API_ALLOW_FLUSH
.p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
+#else
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE,
+#endif
.p.codec_tag = codec_3gp_tags_list,
.check_bitstream = mov_check_bitstream,
.p.priv_class = &mov_isobmff_muxer_class,
+ .flags_internal = FF_FMT_ALLOW_FLUSH,
};
#endif
#if CONFIG_IPOD_MUXER
@@ -8033,10 +8058,15 @@ const FFOutputFormat ff_ipod_muxer = {
.write_packet = mov_write_packet,
.write_trailer = mov_write_trailer,
.deinit = mov_free,
+#if FF_API_ALLOW_FLUSH
.p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
+#else
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE,
+#endif
.p.codec_tag = (const AVCodecTag* const []){ codec_ipod_tags, 0 },
.check_bitstream = mov_check_bitstream,
.p.priv_class = &mov_isobmff_muxer_class,
+ .flags_internal = FF_FMT_ALLOW_FLUSH,
};
#endif
#if CONFIG_ISMV_MUXER
@@ -8053,11 +8083,16 @@ const FFOutputFormat ff_ismv_muxer = {
.write_packet = mov_write_packet,
.write_trailer = mov_write_trailer,
.deinit = mov_free,
+#if FF_API_ALLOW_FLUSH
.p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
+#else
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE,
+#endif
.p.codec_tag = (const AVCodecTag* const []){
codec_mp4_tags, codec_ism_tags, 0 },
.check_bitstream = mov_check_bitstream,
.p.priv_class = &mov_isobmff_muxer_class,
+ .flags_internal = FF_FMT_ALLOW_FLUSH,
};
#endif
#if CONFIG_F4V_MUXER
@@ -8074,10 +8109,15 @@ const FFOutputFormat ff_f4v_muxer = {
.write_packet = mov_write_packet,
.write_trailer = mov_write_trailer,
.deinit = mov_free,
+#if FF_API_ALLOW_FLUSH
.p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH,
+#else
+ .p.flags = AVFMT_GLOBALHEADER,
+#endif
.p.codec_tag = (const AVCodecTag* const []){ codec_f4v_tags, 0 },
.check_bitstream = mov_check_bitstream,
.p.priv_class = &mov_isobmff_muxer_class,
+ .flags_internal = FF_FMT_ALLOW_FLUSH,
};
#endif
#if CONFIG_AVIF_MUXER
@@ -8093,8 +8133,13 @@ const FFOutputFormat ff_avif_muxer = {
.write_packet = mov_write_packet,
.write_trailer = avif_write_trailer,
.deinit = mov_free,
+#if FF_API_ALLOW_FLUSH
.p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH,
+#else
+ .p.flags = AVFMT_GLOBALHEADER,
+#endif
.p.codec_tag = codec_avif_tags_list,
.p.priv_class = &mov_avif_muxer_class,
+ .flags_internal = FF_FMT_ALLOW_FLUSH,
};
#endif