* [FFmpeg-devel] [PATCH v2 1/3] avformat/avformat: Deprecate AVFMT_ALLOW_FLUSH
@ 2023-09-25 23:54 Andreas Rheinhardt
2023-09-25 23:55 ` [FFmpeg-devel] [PATCH 2/3] avcodec/codec_par: Move enum AVFieldOrder to defs.h Andreas Rheinhardt
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Andreas Rheinhardt @ 2023-09-25 23:54 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: James Almer, Andreas Rheinhardt
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>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
doc/APIchanges | 4 ++++
libavdevice/pulse_audio_enc.c | 5 ++++
libavformat/avformat.h | 6 +++--
libavformat/fifo.c | 5 ++++
libavformat/fifo_test.c | 5 ++++
libavformat/hlsenc.c | 5 ++++
libavformat/matroskaenc.c | 15 ++++++++++++
libavformat/movenc.c | 45 +++++++++++++++++++++++++++++++++++
libavformat/mpegtsenc.c | 5 ++++
libavformat/mux.c | 6 +++++
libavformat/mux.h | 6 +++--
libavformat/oggenc.c | 25 +++++++++++++++++++
libavformat/tee.c | 5 ++++
libavformat/version_major.h | 1 +
14 files changed, 134 insertions(+), 4 deletions(-)
diff --git a/doc/APIchanges b/doc/APIchanges
index f333ff5b24..ca7ffbb97e 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,10 @@ The last version increases of all libraries were on 2023-02-09
API changes, most recent first:
+2023-09-26 - xxxxxxxxxx - lavf 60.xx.100 - avformat.h
+ Deprecate AVFMT_ALLOW_FLUSH without replacement. Users can always
+ flush any muxer by sending a NULL packet.
+
2023-09-19 - xxxxxxxxxx - lavu 58.25.100 - avutil.h
Make AV_TIME_BASE_Q compatible with C++.
diff --git a/libavdevice/pulse_audio_enc.c b/libavdevice/pulse_audio_enc.c
index 9e594c6424..5acbf798ef 100644
--- a/libavdevice/pulse_audio_enc.c
+++ b/libavdevice/pulse_audio_enc.c
@@ -802,6 +802,11 @@ const FFOutputFormat ff_pulse_muxer = {
.get_output_timestamp = pulse_get_output_timestamp,
.get_device_list = pulse_get_device_list,
.control_message = pulse_control_message,
+#if FF_API_ALLOW_FLUSH
.p.flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH,
+#else
+ .p.flags = AVFMT_NOFILE,
+#endif
.p.priv_class = &pulse_muxer_class,
+ .flags_internal = FF_FMT_ALLOW_FLUSH,
};
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 43175ba332..a8e245000f 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -486,7 +486,9 @@ typedef struct AVProbeData {
#define AVFMT_NOBINSEARCH 0x2000 /**< Format does not allow to fall back on binary search via read_timestamp */
#define AVFMT_NOGENSEARCH 0x4000 /**< Format does not allow to fall back on generic search */
#define AVFMT_NO_BYTE_SEEK 0x8000 /**< Format does not allow seeking by bytes */
-#define AVFMT_ALLOW_FLUSH 0x10000 /**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. */
+#if FF_API_ALLOW_FLUSH
+#define AVFMT_ALLOW_FLUSH 0x10000 /**< @deprecated: Just send a NULL packet if you want to flush a muxer. */
+#endif
#define AVFMT_TS_NONSTRICT 0x20000 /**< Format does not require strictly
increasing timestamps, but they must
still be monotonic */
@@ -522,7 +524,7 @@ typedef struct AVOutputFormat {
/**
* can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER,
* AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS,
- * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH,
+ * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS,
* AVFMT_TS_NONSTRICT, AVFMT_TS_NEGATIVE
*/
int flags;
diff --git a/libavformat/fifo.c b/libavformat/fifo.c
index 9a3a23729c..8fb4975a5c 100644
--- a/libavformat/fifo.c
+++ b/libavformat/fifo.c
@@ -715,11 +715,16 @@ const FFOutputFormat ff_fifo_muxer = {
.p.name = "fifo",
.p.long_name = NULL_IF_CONFIG_SMALL("FIFO queue pseudo-muxer"),
.p.priv_class = &fifo_muxer_class,
+#if FF_API_ALLOW_FLUSH
.p.flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
+#else
+ .p.flags = AVFMT_NOFILE | AVFMT_TS_NEGATIVE,
+#endif
.priv_data_size = sizeof(FifoContext),
.init = fifo_init,
.write_header = fifo_write_header,
.write_packet = fifo_write_packet,
.write_trailer = fifo_write_trailer,
.deinit = fifo_deinit,
+ .flags_internal = FF_FMT_ALLOW_FLUSH,
};
diff --git a/libavformat/fifo_test.c b/libavformat/fifo_test.c
index 0f12d88b0f..3861c4aee4 100644
--- a/libavformat/fifo_test.c
+++ b/libavformat/fifo_test.c
@@ -147,6 +147,11 @@ const FFOutputFormat ff_fifo_test_muxer = {
.write_trailer = failing_write_trailer,
.deinit = failing_deinit,
.p.priv_class = &failing_muxer_class,
+#if FF_API_ALLOW_FLUSH
.p.flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH,
+#else
+ .p.flags = AVFMT_NOFILE,
+#endif
+ .flags_internal = FF_FMT_ALLOW_FLUSH,
};
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 08f3746ce7..999fc0de75 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -3184,8 +3184,13 @@ const FFOutputFormat ff_hls_muxer = {
.p.audio_codec = AV_CODEC_ID_AAC,
.p.video_codec = AV_CODEC_ID_H264,
.p.subtitle_codec = AV_CODEC_ID_WEBVTT,
+#if FF_API_ALLOW_FLUSH
.p.flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_NODIMENSIONS,
+#else
+ .p.flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER | AVFMT_NODIMENSIONS,
+#endif
.p.priv_class = &hls_class,
+ .flags_internal = FF_FMT_ALLOW_FLUSH,
.priv_data_size = sizeof(HLSContext),
.init = hls_init,
.write_header = hls_write_header,
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index ba54f5f98e..c1a4425eb7 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -3512,7 +3512,11 @@ const FFOutputFormat ff_matroska_muxer = {
.write_packet = mkv_write_flush_packet,
.write_trailer = mkv_write_trailer,
.p.flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
+#if FF_API_ALLOW_FLUSH
AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
+#else
+ AVFMT_TS_NONSTRICT,
+#endif
.p.codec_tag = (const AVCodecTag* const []){
ff_codec_bmp_tags, ff_codec_wav_tags,
additional_audio_tags, additional_subtitle_tags, 0
@@ -3521,6 +3525,7 @@ const FFOutputFormat ff_matroska_muxer = {
.query_codec = mkv_query_codec,
.check_bitstream = mkv_check_bitstream,
.p.priv_class = &matroska_webm_class,
+ .flags_internal = FF_FMT_ALLOW_FLUSH,
};
#endif
@@ -3551,8 +3556,13 @@ const FFOutputFormat ff_webm_muxer = {
.query_codec = webm_query_codec,
.check_bitstream = mkv_check_bitstream,
.p.flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
+#if FF_API_ALLOW_FLUSH
AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
+#else
+ AVFMT_TS_NONSTRICT,
+#endif
.p.priv_class = &matroska_webm_class,
+ .flags_internal = FF_FMT_ALLOW_FLUSH,
};
#endif
@@ -3572,11 +3582,16 @@ const FFOutputFormat ff_matroska_audio_muxer = {
.write_packet = mkv_write_flush_packet,
.write_trailer = mkv_write_trailer,
.check_bitstream = mkv_check_bitstream,
+#if FF_API_ALLOW_FLUSH
.p.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NONSTRICT |
AVFMT_ALLOW_FLUSH,
+#else
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NONSTRICT,
+#endif
.p.codec_tag = (const AVCodecTag* const []){
ff_codec_wav_tags, additional_audio_tags, 0
},
.p.priv_class = &matroska_webm_class,
+ .flags_internal = FF_FMT_ALLOW_FLUSH,
};
#endif
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
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 46ed16985f..84edd418f0 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -2361,6 +2361,11 @@ const FFOutputFormat ff_mpegts_muxer = {
.write_trailer = mpegts_write_end,
.deinit = mpegts_deinit,
.check_bitstream = mpegts_check_bitstream,
+#if FF_API_ALLOW_FLUSH
.p.flags = AVFMT_ALLOW_FLUSH | AVFMT_VARIABLE_FPS | AVFMT_NODIMENSIONS,
+#else
+ .p.flags = AVFMT_VARIABLE_FPS | AVFMT_NODIMENSIONS,
+#endif
+ .flags_internal = FF_FMT_ALLOW_FLUSH,
.p.priv_class = &mpegts_muxer_class,
};
diff --git a/libavformat/mux.c b/libavformat/mux.c
index d3779202f0..5a1d6e41cb 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -1206,7 +1206,13 @@ int av_write_frame(AVFormatContext *s, AVPacket *in)
int ret;
if (!in) {
+#if FF_API_ALLOW_FLUSH || LIBAVFORMAT_VERSION_MAJOR >= 61
+ // Hint: The pulse audio output device has this set,
+ // so we can't switch the check to FF_FMT_ALLOW_FLUSH immediately.
if (s->oformat->flags & AVFMT_ALLOW_FLUSH) {
+#else
+ if (ffofmt(s->oformat)->flags_internal & FF_FMT_ALLOW_FLUSH) {
+#endif
ret = ffofmt(s->oformat)->write_packet(s, NULL);
flush_if_needed(s);
if (ret >= 0 && s->pb && s->pb->error < 0)
diff --git a/libavformat/mux.h b/libavformat/mux.h
index 9de5c2852a..b9ec75641d 100644
--- a/libavformat/mux.h
+++ b/libavformat/mux.h
@@ -27,6 +27,8 @@
struct AVDeviceInfoList;
+#define FF_FMT_ALLOW_FLUSH (1 << 1)
+
typedef struct FFOutputFormat {
/**
* The public AVOutputFormat. See avformat.h for it.
@@ -38,13 +40,13 @@ typedef struct FFOutputFormat {
int priv_data_size;
/**
- * Internal flags. See FF_FMT_FLAG_* in internal.h.
+ * Internal flags. See FF_FMT_* in internal.h and mux.h.
*/
int flags_internal;
int (*write_header)(AVFormatContext *);
/**
- * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags,
+ * Write a packet. If FF_FMT_ALLOW_FLUSH is set in flags_internal,
* pkt can be NULL in order to flush data buffered in the muxer.
* When flushing, return 0 if there still is more data to flush,
* or 1 if everything was flushed and there is no more buffered
diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c
index c669aea25a..69a66f586d 100644
--- a/libavformat/oggenc.c
+++ b/libavformat/oggenc.c
@@ -771,8 +771,13 @@ const FFOutputFormat ff_ogg_muxer = {
.write_packet = ogg_write_packet,
.write_trailer = ogg_write_trailer,
.deinit = ogg_free,
+#if FF_API_ALLOW_FLUSH
.p.flags = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
+#else
+ .p.flags = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT,
+#endif
.p.priv_class = &ogg_muxer_class,
+ .flags_internal = FF_FMT_ALLOW_FLUSH,
};
#endif
@@ -789,8 +794,13 @@ const FFOutputFormat ff_oga_muxer = {
.write_packet = ogg_write_packet,
.write_trailer = ogg_write_trailer,
.deinit = ogg_free,
+#if FF_API_ALLOW_FLUSH
.p.flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
+#else
+ .p.flags = AVFMT_TS_NEGATIVE,
+#endif
.p.priv_class = &ogg_muxer_class,
+ .flags_internal = FF_FMT_ALLOW_FLUSH,
};
#endif
@@ -810,8 +820,13 @@ const FFOutputFormat ff_ogv_muxer = {
.write_packet = ogg_write_packet,
.write_trailer = ogg_write_trailer,
.deinit = ogg_free,
+#if FF_API_ALLOW_FLUSH
.p.flags = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
+#else
+ .p.flags = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT,
+#endif
.p.priv_class = &ogg_muxer_class,
+ .flags_internal = FF_FMT_ALLOW_FLUSH,
};
#endif
@@ -828,8 +843,13 @@ const FFOutputFormat ff_spx_muxer = {
.write_packet = ogg_write_packet,
.write_trailer = ogg_write_trailer,
.deinit = ogg_free,
+#if FF_API_ALLOW_FLUSH
.p.flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
+#else
+ .p.flags = AVFMT_TS_NEGATIVE,
+#endif
.p.priv_class = &ogg_muxer_class,
+ .flags_internal = FF_FMT_ALLOW_FLUSH,
};
#endif
@@ -846,7 +866,12 @@ const FFOutputFormat ff_opus_muxer = {
.write_packet = ogg_write_packet,
.write_trailer = ogg_write_trailer,
.deinit = ogg_free,
+#if FF_API_ALLOW_FLUSH
.p.flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
+#else
+ .p.flags = AVFMT_TS_NEGATIVE,
+#endif
.p.priv_class = &ogg_muxer_class,
+ .flags_internal = FF_FMT_ALLOW_FLUSH,
};
#endif
diff --git a/libavformat/tee.c b/libavformat/tee.c
index cb555f52fd..cfa8346bc9 100644
--- a/libavformat/tee.c
+++ b/libavformat/tee.c
@@ -614,5 +614,10 @@ const FFOutputFormat ff_tee_muxer = {
.write_trailer = tee_write_trailer,
.write_packet = tee_write_packet,
.p.priv_class = &tee_muxer_class,
+#if FF_API_ALLOW_FLUSH
.p.flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
+#else
+ .p.flags = AVFMT_NOFILE | AVFMT_TS_NEGATIVE,
+#endif
+ .flags_internal = FF_FMT_ALLOW_FLUSH,
};
diff --git a/libavformat/version_major.h b/libavformat/version_major.h
index d1d6f95b15..ca9dccc94d 100644
--- a/libavformat/version_major.h
+++ b/libavformat/version_major.h
@@ -47,6 +47,7 @@
#define FF_API_AVFORMAT_IO_CLOSE (LIBAVFORMAT_VERSION_MAJOR < 61)
#define FF_API_AVIO_WRITE_NONCONST (LIBAVFORMAT_VERSION_MAJOR < 61)
#define FF_API_LAVF_SHORTEST (LIBAVFORMAT_VERSION_MAJOR < 61)
+#define FF_API_ALLOW_FLUSH (LIBAVFORMAT_VERSION_MAJOR < 61)
#define FF_API_R_FRAME_RATE 1
--
2.34.1
_______________________________________________
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".
^ permalink raw reply [flat|nested] 11+ messages in thread
* [FFmpeg-devel] [PATCH 2/3] avcodec/codec_par: Move enum AVFieldOrder to defs.h
2023-09-25 23:54 [FFmpeg-devel] [PATCH v2 1/3] avformat/avformat: Deprecate AVFMT_ALLOW_FLUSH Andreas Rheinhardt
@ 2023-09-25 23:55 ` Andreas Rheinhardt
2023-09-26 0:35 ` James Almer
2023-09-25 23:55 ` [FFmpeg-devel] [PATCH 3/3] avcodec/avcodec: Avoid codec_desc.h, codec_par.h inclusions Andreas Rheinhardt
2023-09-26 10:49 ` [FFmpeg-devel] [PATCH v2 1/3] avformat/avformat: Deprecate AVFMT_ALLOW_FLUSH Anton Khirnov
2 siblings, 1 reply; 11+ messages in thread
From: Andreas Rheinhardt @ 2023-09-25 23:55 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
It is also used by AVCodecContext.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
doc/APIchanges | 3 +++
libavcodec/codec_par.h | 10 +---------
libavcodec/defs.h | 8 ++++++++
3 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/doc/APIchanges b/doc/APIchanges
index ca7ffbb97e..c1ea3b7dc1 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2023-02-09
API changes, most recent first:
+2023-09-26 - xxxxxxxxxx - lavc 60.xx.100 - codec_par.h defs.h
+ Move the definition of enum AVFieldOrder from codec_par.h to defs.h.
+
2023-09-26 - xxxxxxxxxx - lavf 60.xx.100 - avformat.h
Deprecate AVFMT_ALLOW_FLUSH without replacement. Users can always
flush any muxer by sending a NULL packet.
diff --git a/libavcodec/codec_par.h b/libavcodec/codec_par.h
index add90fdb1e..c1679ea042 100644
--- a/libavcodec/codec_par.h
+++ b/libavcodec/codec_par.h
@@ -29,21 +29,13 @@
#include "libavutil/pixfmt.h"
#include "codec_id.h"
+#include "defs.h"
/**
* @addtogroup lavc_core
* @{
*/
-enum AVFieldOrder {
- AV_FIELD_UNKNOWN,
- AV_FIELD_PROGRESSIVE,
- AV_FIELD_TT, ///< Top coded_first, top displayed first
- AV_FIELD_BB, ///< Bottom coded first, bottom displayed first
- AV_FIELD_TB, ///< Top coded first, bottom displayed first
- AV_FIELD_BT, ///< Bottom coded first, top displayed first
-};
-
/**
* This struct describes the properties of an encoded stream.
*
diff --git a/libavcodec/defs.h b/libavcodec/defs.h
index ceed8d5e16..00d840ec19 100644
--- a/libavcodec/defs.h
+++ b/libavcodec/defs.h
@@ -195,6 +195,14 @@
#define AV_LEVEL_UNKNOWN -99
+enum AVFieldOrder {
+ AV_FIELD_UNKNOWN,
+ AV_FIELD_PROGRESSIVE,
+ AV_FIELD_TT, ///< Top coded_first, top displayed first
+ AV_FIELD_BB, ///< Bottom coded first, bottom displayed first
+ AV_FIELD_TB, ///< Top coded first, bottom displayed first
+ AV_FIELD_BT, ///< Bottom coded first, top displayed first
+};
/**
* @ingroup lavc_decoding
--
2.34.1
_______________________________________________
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".
^ permalink raw reply [flat|nested] 11+ messages in thread
* [FFmpeg-devel] [PATCH 3/3] avcodec/avcodec: Avoid codec_desc.h, codec_par.h inclusions
2023-09-25 23:54 [FFmpeg-devel] [PATCH v2 1/3] avformat/avformat: Deprecate AVFMT_ALLOW_FLUSH Andreas Rheinhardt
2023-09-25 23:55 ` [FFmpeg-devel] [PATCH 2/3] avcodec/codec_par: Move enum AVFieldOrder to defs.h Andreas Rheinhardt
@ 2023-09-25 23:55 ` Andreas Rheinhardt
2023-09-26 10:49 ` [FFmpeg-devel] [PATCH v2 1/3] avformat/avformat: Deprecate AVFMT_ALLOW_FLUSH Anton Khirnov
2 siblings, 0 replies; 11+ messages in thread
From: Andreas Rheinhardt @ 2023-09-25 23:55 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Instead, use forward declarations; and in order not to affect
any user include these headers for them, but not internally.
This has the advantage of removing implicit inclusions of these
headers from almost all files providing codecs.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/avcodec.c | 1 +
libavcodec/avcodec.h | 14 +++++++++-----
libavcodec/decode.c | 1 +
libavcodec/encode.c | 1 +
libavcodec/nvenc.c | 1 +
libavcodec/tests/codec_desc.c | 2 +-
libavcodec/utils.c | 2 ++
libavcodec/vaapi_decode.c | 1 +
libavfilter/vf_subtitles.c | 1 +
9 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c
index 131834b6de..f2dc7b0edd 100644
--- a/libavcodec/avcodec.c
+++ b/libavcodec/avcodec.c
@@ -37,6 +37,7 @@
#include "avcodec.h"
#include "avcodec_internal.h"
#include "bsf.h"
+#include "codec_desc.h"
#include "codec_internal.h"
#include "decode.h"
#include "encode.h"
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index da3c5234a0..09400b97b0 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -31,6 +31,7 @@
#include "libavutil/attributes.h"
#include "libavutil/avutil.h"
#include "libavutil/buffer.h"
+#include "libavutil/channel_layout.h"
#include "libavutil/dict.h"
#include "libavutil/frame.h"
#include "libavutil/log.h"
@@ -38,8 +39,6 @@
#include "libavutil/rational.h"
#include "codec.h"
-#include "codec_desc.h"
-#include "codec_par.h"
#include "codec_id.h"
#include "defs.h"
#include "packet.h"
@@ -49,8 +48,13 @@
* to avoid unnecessary rebuilds. When included externally, keep including
* the full version information. */
#include "version.h"
+
+#include "codec_desc.h"
+#include "codec_par.h"
#endif
+struct AVCodecParameters;
+
/**
* @defgroup libavc libavcodec
* Encoding/Decoding Library
@@ -1815,7 +1819,7 @@ typedef struct AVCodecContext {
* - encoding: unused.
* - decoding: set by libavcodec.
*/
- const AVCodecDescriptor *codec_descriptor;
+ const struct AVCodecDescriptor *codec_descriptor;
/**
* Current statistics for PTS correction.
@@ -2328,7 +2332,7 @@ const AVClass *avcodec_get_subtitle_rect_class(void);
*
* @return >= 0 on success, a negative AVERROR code on failure
*/
-int avcodec_parameters_from_context(AVCodecParameters *par,
+int avcodec_parameters_from_context(struct AVCodecParameters *par,
const AVCodecContext *codec);
/**
@@ -2340,7 +2344,7 @@ int avcodec_parameters_from_context(AVCodecParameters *par,
* @return >= 0 on success, a negative AVERROR code on failure.
*/
int avcodec_parameters_to_context(AVCodecContext *codec,
- const AVCodecParameters *par);
+ const struct AVCodecParameters *par);
/**
* Initialize the AVCodecContext to use the given AVCodec. Prior to using this
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 466c393c1e..9b23a6717c 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -45,6 +45,7 @@
#include "avcodec_internal.h"
#include "bytestream.h"
#include "bsf.h"
+#include "codec_desc.h"
#include "codec_internal.h"
#include "decode.h"
#include "hwaccel_internal.h"
diff --git a/libavcodec/encode.c b/libavcodec/encode.c
index 7cd3213b73..a436be2657 100644
--- a/libavcodec/encode.c
+++ b/libavcodec/encode.c
@@ -30,6 +30,7 @@
#include "avcodec.h"
#include "avcodec_internal.h"
+#include "codec_desc.h"
#include "codec_internal.h"
#include "encode.h"
#include "frame_thread_encoder.h"
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 65b96d6cf6..02486c2043 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -36,6 +36,7 @@
#include "libavutil/pixdesc.h"
#include "libavutil/mathematics.h"
#include "atsc_a53.h"
+#include "codec_desc.h"
#include "encode.h"
#include "internal.h"
#include "packet_internal.h"
diff --git a/libavcodec/tests/codec_desc.c b/libavcodec/tests/codec_desc.c
index c9b3497343..bceb91a32a 100644
--- a/libavcodec/tests/codec_desc.c
+++ b/libavcodec/tests/codec_desc.c
@@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "libavcodec/avcodec.h"
+#include "libavcodec/codec_desc.h"
int main(int argc, char **argv)
{
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 3cb3828228..8807a8c2b6 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -35,7 +35,9 @@
#include "libavutil/pixfmt.h"
#include "avcodec.h"
#include "codec.h"
+#include "codec_desc.h"
#include "codec_internal.h"
+#include "codec_par.h"
#include "decode.h"
#include "hwconfig.h"
#include "thread.h"
diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
index 10b4284db0..ceac769c52 100644
--- a/libavcodec/vaapi_decode.c
+++ b/libavcodec/vaapi_decode.c
@@ -23,6 +23,7 @@
#include "libavutil/pixdesc.h"
#include "avcodec.h"
+#include "codec_desc.h"
#include "decode.h"
#include "internal.h"
#include "vaapi_decode.h"
diff --git a/libavfilter/vf_subtitles.c b/libavfilter/vf_subtitles.c
index e2857e90c0..ef5f9cd866 100644
--- a/libavfilter/vf_subtitles.c
+++ b/libavfilter/vf_subtitles.c
@@ -33,6 +33,7 @@
#include "config_components.h"
#if CONFIG_SUBTITLES_FILTER
# include "libavcodec/avcodec.h"
+# include "libavcodec/codec_desc.h"
# include "libavformat/avformat.h"
#endif
#include "libavutil/avstring.h"
--
2.34.1
_______________________________________________
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".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH 2/3] avcodec/codec_par: Move enum AVFieldOrder to defs.h
2023-09-25 23:55 ` [FFmpeg-devel] [PATCH 2/3] avcodec/codec_par: Move enum AVFieldOrder to defs.h Andreas Rheinhardt
@ 2023-09-26 0:35 ` James Almer
2023-09-26 9:17 ` Andreas Rheinhardt
0 siblings, 1 reply; 11+ messages in thread
From: James Almer @ 2023-09-26 0:35 UTC (permalink / raw)
To: ffmpeg-devel
On 9/25/2023 8:55 PM, Andreas Rheinhardt wrote:
> It is also used by AVCodecContext.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> doc/APIchanges | 3 +++
> libavcodec/codec_par.h | 10 +---------
> libavcodec/defs.h | 8 ++++++++
> 3 files changed, 12 insertions(+), 9 deletions(-)
>
> diff --git a/doc/APIchanges b/doc/APIchanges
> index ca7ffbb97e..c1ea3b7dc1 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -2,6 +2,9 @@ The last version increases of all libraries were on 2023-02-09
>
> API changes, most recent first:
>
> +2023-09-26 - xxxxxxxxxx - lavc 60.xx.100 - codec_par.h defs.h
> + Move the definition of enum AVFieldOrder from codec_par.h to defs.h.
Does this need an entry? If codec_par.h includes defs.h, it's basically
transparent for the API user.
> +
> 2023-09-26 - xxxxxxxxxx - lavf 60.xx.100 - avformat.h
> Deprecate AVFMT_ALLOW_FLUSH without replacement. Users can always
> flush any muxer by sending a NULL packet.
> diff --git a/libavcodec/codec_par.h b/libavcodec/codec_par.h
> index add90fdb1e..c1679ea042 100644
> --- a/libavcodec/codec_par.h
> +++ b/libavcodec/codec_par.h
> @@ -29,21 +29,13 @@
> #include "libavutil/pixfmt.h"
>
> #include "codec_id.h"
> +#include "defs.h"
>
> /**
> * @addtogroup lavc_core
> * @{
> */
>
> -enum AVFieldOrder {
> - AV_FIELD_UNKNOWN,
> - AV_FIELD_PROGRESSIVE,
> - AV_FIELD_TT, ///< Top coded_first, top displayed first
> - AV_FIELD_BB, ///< Bottom coded first, bottom displayed first
> - AV_FIELD_TB, ///< Top coded first, bottom displayed first
> - AV_FIELD_BT, ///< Bottom coded first, top displayed first
> -};
> -
> /**
> * This struct describes the properties of an encoded stream.
> *
> diff --git a/libavcodec/defs.h b/libavcodec/defs.h
> index ceed8d5e16..00d840ec19 100644
> --- a/libavcodec/defs.h
> +++ b/libavcodec/defs.h
> @@ -195,6 +195,14 @@
>
> #define AV_LEVEL_UNKNOWN -99
>
> +enum AVFieldOrder {
> + AV_FIELD_UNKNOWN,
> + AV_FIELD_PROGRESSIVE,
> + AV_FIELD_TT, ///< Top coded_first, top displayed first
> + AV_FIELD_BB, ///< Bottom coded first, bottom displayed first
> + AV_FIELD_TB, ///< Top coded first, bottom displayed first
> + AV_FIELD_BT, ///< Bottom coded first, top displayed first
> +};
>
> /**
> * @ingroup lavc_decoding
_______________________________________________
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".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH 2/3] avcodec/codec_par: Move enum AVFieldOrder to defs.h
2023-09-26 0:35 ` James Almer
@ 2023-09-26 9:17 ` Andreas Rheinhardt
2023-09-28 10:17 ` Anton Khirnov
0 siblings, 1 reply; 11+ messages in thread
From: Andreas Rheinhardt @ 2023-09-26 9:17 UTC (permalink / raw)
To: ffmpeg-devel
James Almer:
> On 9/25/2023 8:55 PM, Andreas Rheinhardt wrote:
>> It is also used by AVCodecContext.
>>
>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
>> ---
>> doc/APIchanges | 3 +++
>> libavcodec/codec_par.h | 10 +---------
>> libavcodec/defs.h | 8 ++++++++
>> 3 files changed, 12 insertions(+), 9 deletions(-)
>>
>> diff --git a/doc/APIchanges b/doc/APIchanges
>> index ca7ffbb97e..c1ea3b7dc1 100644
>> --- a/doc/APIchanges
>> +++ b/doc/APIchanges
>> @@ -2,6 +2,9 @@ The last version increases of all libraries were on
>> 2023-02-09
>> API changes, most recent first:
>> +2023-09-26 - xxxxxxxxxx - lavc 60.xx.100 - codec_par.h defs.h
>> + Move the definition of enum AVFieldOrder from codec_par.h to defs.h.
>
> Does this need an entry? If codec_par.h includes defs.h, it's basically
> transparent for the API user.
>
It does not break existing users, but existing users may take advantage
of it. Probably not in this case, but for moving stuff in general and
therefore we add these APIchanges entries.
But if you insist, I can omit it.
- Andreas
_______________________________________________
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".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2 1/3] avformat/avformat: Deprecate AVFMT_ALLOW_FLUSH
2023-09-25 23:54 [FFmpeg-devel] [PATCH v2 1/3] avformat/avformat: Deprecate AVFMT_ALLOW_FLUSH Andreas Rheinhardt
2023-09-25 23:55 ` [FFmpeg-devel] [PATCH 2/3] avcodec/codec_par: Move enum AVFieldOrder to defs.h Andreas Rheinhardt
2023-09-25 23:55 ` [FFmpeg-devel] [PATCH 3/3] avcodec/avcodec: Avoid codec_desc.h, codec_par.h inclusions Andreas Rheinhardt
@ 2023-09-26 10:49 ` Anton Khirnov
2023-09-26 11:08 ` Martin Storsjö
2 siblings, 1 reply; 11+ messages in thread
From: Anton Khirnov @ 2023-09-26 10:49 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Cc: Martin Storsjö, James Almer, Andreas Rheinhardt
Quoting Andreas Rheinhardt (2023-09-26 01:54:30)
> 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.
Is there any value for the callers in knowing whether flushing is a
no-op or actually does something?
Martin, any thoughts?
--
Anton Khirnov
_______________________________________________
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".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2 1/3] avformat/avformat: Deprecate AVFMT_ALLOW_FLUSH
2023-09-26 10:49 ` [FFmpeg-devel] [PATCH v2 1/3] avformat/avformat: Deprecate AVFMT_ALLOW_FLUSH Anton Khirnov
@ 2023-09-26 11:08 ` Martin Storsjö
2023-09-26 14:51 ` Andreas Rheinhardt
0 siblings, 1 reply; 11+ messages in thread
From: Martin Storsjö @ 2023-09-26 11:08 UTC (permalink / raw)
To: FFmpeg development discussions and patches, James Almer,
Andreas Rheinhardt
On Tue, 26 Sep 2023, Anton Khirnov wrote:
> Quoting Andreas Rheinhardt (2023-09-26 01:54:30)
>> 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.
>
> Is there any value for the callers in knowing whether flushing is a
> no-op or actually does something?
Hypthetically, in theory, I guess one could make a case for that. But most
of the codepaths where one use this anyway, one is pretty closely tied to
the specific muxer one is using (usually mov/mp4 or maybe mkv), so in
practice I don't think that's needed.
I don't remember there being a specific demand for that back when this was
added, it was only a case of us not having internal flags at the time.
Conversely, I guess we could google for AVFMT_ALLOW_FLUSH and see if
there's any public third party code that shows uses of the flag. A quick
googling didn't find any uses outside of ffmpeg itself, except for one
example on stackoverflow where the flag seems to be used in an invalid
way.
// Martin
_______________________________________________
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".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2 1/3] avformat/avformat: Deprecate AVFMT_ALLOW_FLUSH
2023-09-26 11:08 ` Martin Storsjö
@ 2023-09-26 14:51 ` Andreas Rheinhardt
2023-09-27 8:51 ` Martin Storsjö
0 siblings, 1 reply; 11+ messages in thread
From: Andreas Rheinhardt @ 2023-09-26 14:51 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Martin Storsjö:
> On Tue, 26 Sep 2023, Anton Khirnov wrote:
>
>> Quoting Andreas Rheinhardt (2023-09-26 01:54:30)
>>> 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.
>>
>> Is there any value for the callers in knowing whether flushing is a
>> no-op or actually does something?
>
> Hypthetically, in theory, I guess one could make a case for that. But
> most of the codepaths where one use this anyway, one is pretty closely
> tied to the specific muxer one is using (usually mov/mp4 or maybe mkv),
> so in practice I don't think that's needed.
>
> I don't remember there being a specific demand for that back when this
> was added, it was only a case of us not having internal flags at the time.
>
So if we had them back then, you would not have made the flag public?
- Andreas
_______________________________________________
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".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2 1/3] avformat/avformat: Deprecate AVFMT_ALLOW_FLUSH
2023-09-26 14:51 ` Andreas Rheinhardt
@ 2023-09-27 8:51 ` Martin Storsjö
2023-09-28 10:38 ` Andreas Rheinhardt
0 siblings, 1 reply; 11+ messages in thread
From: Martin Storsjö @ 2023-09-27 8:51 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Tue, 26 Sep 2023, Andreas Rheinhardt wrote:
> Martin Storsjö:
>> On Tue, 26 Sep 2023, Anton Khirnov wrote:
>>
>>> Quoting Andreas Rheinhardt (2023-09-26 01:54:30)
>>>> 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.
>>>
>>> Is there any value for the callers in knowing whether flushing is a
>>> no-op or actually does something?
>>
>> Hypthetically, in theory, I guess one could make a case for that. But
>> most of the codepaths where one use this anyway, one is pretty closely
>> tied to the specific muxer one is using (usually mov/mp4 or maybe mkv),
>> so in practice I don't think that's needed.
>>
>> I don't remember there being a specific demand for that back when this
>> was added, it was only a case of us not having internal flags at the time.
>>
>
> So if we had them back then, you would not have made the flag public?
Exactly; if we have had private muxer flags at the time, I would probably
not have made this a public flag.
So I think this patch is fine.
// Martin
_______________________________________________
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".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH 2/3] avcodec/codec_par: Move enum AVFieldOrder to defs.h
2023-09-26 9:17 ` Andreas Rheinhardt
@ 2023-09-28 10:17 ` Anton Khirnov
0 siblings, 0 replies; 11+ messages in thread
From: Anton Khirnov @ 2023-09-28 10:17 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Quoting Andreas Rheinhardt (2023-09-26 11:17:25)
> James Almer:
> > On 9/25/2023 8:55 PM, Andreas Rheinhardt wrote:
> >> It is also used by AVCodecContext.
> >>
> >> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> >> ---
> >> doc/APIchanges | 3 +++
> >> libavcodec/codec_par.h | 10 +---------
> >> libavcodec/defs.h | 8 ++++++++
> >> 3 files changed, 12 insertions(+), 9 deletions(-)
> >>
> >> diff --git a/doc/APIchanges b/doc/APIchanges
> >> index ca7ffbb97e..c1ea3b7dc1 100644
> >> --- a/doc/APIchanges
> >> +++ b/doc/APIchanges
> >> @@ -2,6 +2,9 @@ The last version increases of all libraries were on
> >> 2023-02-09
> >> API changes, most recent first:
> >> +2023-09-26 - xxxxxxxxxx - lavc 60.xx.100 - codec_par.h defs.h
> >> + Move the definition of enum AVFieldOrder from codec_par.h to defs.h.
> >
> > Does this need an entry? If codec_par.h includes defs.h, it's basically
> > transparent for the API user.
> >
>
> It does not break existing users, but existing users may take advantage
> of it. Probably not in this case, but for moving stuff in general and
> therefore we add these APIchanges entries.
> But if you insist, I can omit it.
I think it should be mentioned.
--
Anton Khirnov
_______________________________________________
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".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2 1/3] avformat/avformat: Deprecate AVFMT_ALLOW_FLUSH
2023-09-27 8:51 ` Martin Storsjö
@ 2023-09-28 10:38 ` Andreas Rheinhardt
0 siblings, 0 replies; 11+ messages in thread
From: Andreas Rheinhardt @ 2023-09-28 10:38 UTC (permalink / raw)
To: ffmpeg-devel
Martin Storsjö:
> On Tue, 26 Sep 2023, Andreas Rheinhardt wrote:
>
>> Martin Storsjö:
>>> On Tue, 26 Sep 2023, Anton Khirnov wrote:
>>>
>>>> Quoting Andreas Rheinhardt (2023-09-26 01:54:30)
>>>>> 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.
>>>>
>>>> Is there any value for the callers in knowing whether flushing is a
>>>> no-op or actually does something?
>>>
>>> Hypthetically, in theory, I guess one could make a case for that. But
>>> most of the codepaths where one use this anyway, one is pretty closely
>>> tied to the specific muxer one is using (usually mov/mp4 or maybe mkv),
>>> so in practice I don't think that's needed.
>>>
>>> I don't remember there being a specific demand for that back when this
>>> was added, it was only a case of us not having internal flags at the
>>> time.
>>>
>>
>> So if we had them back then, you would not have made the flag public?
>
> Exactly; if we have had private muxer flags at the time, I would
> probably not have made this a public flag.
>
> So I think this patch is fine.
>
Ok, will push this on October 3 then unless there are objections.
- Andreas
_______________________________________________
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".
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2023-09-28 10:37 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-25 23:54 [FFmpeg-devel] [PATCH v2 1/3] avformat/avformat: Deprecate AVFMT_ALLOW_FLUSH Andreas Rheinhardt
2023-09-25 23:55 ` [FFmpeg-devel] [PATCH 2/3] avcodec/codec_par: Move enum AVFieldOrder to defs.h Andreas Rheinhardt
2023-09-26 0:35 ` James Almer
2023-09-26 9:17 ` Andreas Rheinhardt
2023-09-28 10:17 ` Anton Khirnov
2023-09-25 23:55 ` [FFmpeg-devel] [PATCH 3/3] avcodec/avcodec: Avoid codec_desc.h, codec_par.h inclusions Andreas Rheinhardt
2023-09-26 10:49 ` [FFmpeg-devel] [PATCH v2 1/3] avformat/avformat: Deprecate AVFMT_ALLOW_FLUSH Anton Khirnov
2023-09-26 11:08 ` Martin Storsjö
2023-09-26 14:51 ` Andreas Rheinhardt
2023-09-27 8:51 ` Martin Storsjö
2023-09-28 10:38 ` Andreas Rheinhardt
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git