From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Subject: [FFmpeg-devel] [PATCH 03/13] avformat/mux: Rename FF_FMT_ALLOW_FLUSH->FF_OFMT_FLAG_ALLOW_FLUSH Date: Wed, 20 Mar 2024 03:12:46 +0100 Message-ID: <AS8P250MB0744A902C5DB51ABC6FD9CBA8F332@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw) In-Reply-To: <AS8P250MB07447D5624C9B5EA91D18ED18F332@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> It better reflects that this is a muxer-only flag. Also document the flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavdevice/pulse_audio_enc.c | 2 +- libavformat/fifo.c | 2 +- libavformat/hlsenc.c | 2 +- libavformat/matroskaenc.c | 6 +++--- libavformat/movenc.c | 18 +++++++++--------- libavformat/mpegtsenc.c | 2 +- libavformat/mux.c | 4 ++-- libavformat/mux.h | 14 +++++++++++--- libavformat/oggenc.c | 10 +++++----- libavformat/tee.c | 2 +- libavformat/tests/fifo_muxer.c | 2 +- 11 files changed, 36 insertions(+), 28 deletions(-) diff --git a/libavdevice/pulse_audio_enc.c b/libavdevice/pulse_audio_enc.c index 4955b3b884..3e2cc91f69 100644 --- a/libavdevice/pulse_audio_enc.c +++ b/libavdevice/pulse_audio_enc.c @@ -801,5 +801,5 @@ const FFOutputFormat ff_pulse_muxer = { .p.flags = AVFMT_NOFILE, #endif .p.priv_class = &pulse_muxer_class, - .flags_internal = FF_FMT_ALLOW_FLUSH, + .flags_internal = FF_OFMT_FLAG_ALLOW_FLUSH, }; diff --git a/libavformat/fifo.c b/libavformat/fifo.c index 2a2673f4d8..23e4149ad6 100644 --- a/libavformat/fifo.c +++ b/libavformat/fifo.c @@ -728,5 +728,5 @@ const FFOutputFormat ff_fifo_muxer = { .write_packet = fifo_write_packet, .write_trailer = fifo_write_trailer, .deinit = fifo_deinit, - .flags_internal = FF_FMT_ALLOW_FLUSH, + .flags_internal = FF_OFMT_FLAG_ALLOW_FLUSH, }; diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index e5350323b1..2202ce64e4 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -3205,7 +3205,7 @@ const FFOutputFormat ff_hls_muxer = { .p.flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER | AVFMT_NODIMENSIONS, #endif .p.priv_class = &hls_class, - .flags_internal = FF_FMT_ALLOW_FLUSH, + .flags_internal = FF_OFMT_FLAG_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 db41d3d1c2..0de4ec1dc0 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -3569,7 +3569,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, + .flags_internal = FF_OFMT_FLAG_ALLOW_FLUSH, }; #endif @@ -3606,7 +3606,7 @@ const FFOutputFormat ff_webm_muxer = { AVFMT_TS_NONSTRICT, #endif .p.priv_class = &matroska_webm_class, - .flags_internal = FF_FMT_ALLOW_FLUSH, + .flags_internal = FF_OFMT_FLAG_ALLOW_FLUSH, }; #endif @@ -3636,6 +3636,6 @@ const FFOutputFormat ff_matroska_audio_muxer = { ff_codec_wav_tags, additional_audio_tags, 0 }, .p.priv_class = &matroska_webm_class, - .flags_internal = FF_FMT_ALLOW_FLUSH, + .flags_internal = FF_OFMT_FLAG_ALLOW_FLUSH, }; #endif diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 724a1eb673..127673a9e6 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -8239,7 +8239,7 @@ const FFOutputFormat ff_mov_muxer = { }, .check_bitstream = mov_check_bitstream, .p.priv_class = &mov_isobmff_muxer_class, - .flags_internal = FF_FMT_ALLOW_FLUSH, + .flags_internal = FF_OFMT_FLAG_ALLOW_FLUSH, }; #endif #if CONFIG_TGP_MUXER @@ -8263,7 +8263,7 @@ const FFOutputFormat ff_tgp_muxer = { .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, + .flags_internal = FF_OFMT_FLAG_ALLOW_FLUSH, }; #endif #if CONFIG_MP4_MUXER @@ -8289,7 +8289,7 @@ const FFOutputFormat ff_mp4_muxer = { .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, + .flags_internal = FF_OFMT_FLAG_ALLOW_FLUSH, }; #endif #if CONFIG_PSP_MUXER @@ -8314,7 +8314,7 @@ const FFOutputFormat ff_psp_muxer = { .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, + .flags_internal = FF_OFMT_FLAG_ALLOW_FLUSH, }; #endif #if CONFIG_TG2_MUXER @@ -8338,7 +8338,7 @@ const FFOutputFormat ff_tg2_muxer = { .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, + .flags_internal = FF_OFMT_FLAG_ALLOW_FLUSH, }; #endif #if CONFIG_IPOD_MUXER @@ -8363,7 +8363,7 @@ const FFOutputFormat ff_ipod_muxer = { .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, + .flags_internal = FF_OFMT_FLAG_ALLOW_FLUSH, }; #endif #if CONFIG_ISMV_MUXER @@ -8389,7 +8389,7 @@ const FFOutputFormat ff_ismv_muxer = { 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, + .flags_internal = FF_OFMT_FLAG_ALLOW_FLUSH, }; #endif #if CONFIG_F4V_MUXER @@ -8414,7 +8414,7 @@ const FFOutputFormat ff_f4v_muxer = { .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, + .flags_internal = FF_OFMT_FLAG_ALLOW_FLUSH, }; #endif #if CONFIG_AVIF_MUXER @@ -8437,6 +8437,6 @@ const FFOutputFormat ff_avif_muxer = { #endif .p.codec_tag = codec_avif_tags_list, .p.priv_class = &mov_avif_muxer_class, - .flags_internal = FF_FMT_ALLOW_FLUSH, + .flags_internal = FF_OFMT_FLAG_ALLOW_FLUSH, }; #endif diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index b8efc535a7..d8c148bd3c 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -2415,6 +2415,6 @@ const FFOutputFormat ff_mpegts_muxer = { #else .p.flags = AVFMT_VARIABLE_FPS | AVFMT_NODIMENSIONS, #endif - .flags_internal = FF_FMT_ALLOW_FLUSH, + .flags_internal = FF_OFMT_FLAG_ALLOW_FLUSH, .p.priv_class = &mpegts_muxer_class, }; diff --git a/libavformat/mux.c b/libavformat/mux.c index 772f300f16..a2cae97397 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -1208,10 +1208,10 @@ int av_write_frame(AVFormatContext *s, AVPacket *in) 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. + // so we can't switch the check to FF_OFMT_FLAG_ALLOW_FLUSH immediately. if (s->oformat->flags & AVFMT_ALLOW_FLUSH) { #else - if (ffofmt(s->oformat)->flags_internal & FF_FMT_ALLOW_FLUSH) { + if (ffofmt(s->oformat)->flags_internal & FF_OFMT_FLAG_ALLOW_FLUSH) { #endif ret = ffofmt(s->oformat)->write_packet(s, NULL); flush_if_needed(s); diff --git a/libavformat/mux.h b/libavformat/mux.h index b9ec75641d..bd3eb53380 100644 --- a/libavformat/mux.h +++ b/libavformat/mux.h @@ -27,7 +27,15 @@ struct AVDeviceInfoList; -#define FF_FMT_ALLOW_FLUSH (1 << 1) +/** + * This flag indicates that the muxer stores data internally + * and supports flushing it. Flushing is signalled by sending + * a NULL packet to the muxer's write_packet callback; + * without this flag, a muxer never receives NULL packets. + * So the documentation of write_packet below for the semantics + * of the return value in case of flushing. + */ +#define FF_OFMT_FLAG_ALLOW_FLUSH (1 << 1) typedef struct FFOutputFormat { /** @@ -40,13 +48,13 @@ typedef struct FFOutputFormat { int priv_data_size; /** - * Internal flags. See FF_FMT_* in internal.h and mux.h. + * Internal flags. See FF_OFMT_FLAG_* above and FF_FMT_FLAG_* in internal.h. */ int flags_internal; int (*write_header)(AVFormatContext *); /** - * Write a packet. If FF_FMT_ALLOW_FLUSH is set in flags_internal, + * Write a packet. If FF_OFMT_FLAG_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 69a66f586d..bdd19530ce 100644 --- a/libavformat/oggenc.c +++ b/libavformat/oggenc.c @@ -777,7 +777,7 @@ const FFOutputFormat ff_ogg_muxer = { .p.flags = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT, #endif .p.priv_class = &ogg_muxer_class, - .flags_internal = FF_FMT_ALLOW_FLUSH, + .flags_internal = FF_OFMT_FLAG_ALLOW_FLUSH, }; #endif @@ -800,7 +800,7 @@ const FFOutputFormat ff_oga_muxer = { .p.flags = AVFMT_TS_NEGATIVE, #endif .p.priv_class = &ogg_muxer_class, - .flags_internal = FF_FMT_ALLOW_FLUSH, + .flags_internal = FF_OFMT_FLAG_ALLOW_FLUSH, }; #endif @@ -826,7 +826,7 @@ const FFOutputFormat ff_ogv_muxer = { .p.flags = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT, #endif .p.priv_class = &ogg_muxer_class, - .flags_internal = FF_FMT_ALLOW_FLUSH, + .flags_internal = FF_OFMT_FLAG_ALLOW_FLUSH, }; #endif @@ -849,7 +849,7 @@ const FFOutputFormat ff_spx_muxer = { .p.flags = AVFMT_TS_NEGATIVE, #endif .p.priv_class = &ogg_muxer_class, - .flags_internal = FF_FMT_ALLOW_FLUSH, + .flags_internal = FF_OFMT_FLAG_ALLOW_FLUSH, }; #endif @@ -872,6 +872,6 @@ const FFOutputFormat ff_opus_muxer = { .p.flags = AVFMT_TS_NEGATIVE, #endif .p.priv_class = &ogg_muxer_class, - .flags_internal = FF_FMT_ALLOW_FLUSH, + .flags_internal = FF_OFMT_FLAG_ALLOW_FLUSH, }; #endif diff --git a/libavformat/tee.c b/libavformat/tee.c index a101fede5b..9597137ec2 100644 --- a/libavformat/tee.c +++ b/libavformat/tee.c @@ -614,5 +614,5 @@ const FFOutputFormat ff_tee_muxer = { #else .p.flags = AVFMT_NOFILE | AVFMT_TS_NEGATIVE, #endif - .flags_internal = FF_FMT_ALLOW_FLUSH, + .flags_internal = FF_OFMT_FLAG_ALLOW_FLUSH, }; diff --git a/libavformat/tests/fifo_muxer.c b/libavformat/tests/fifo_muxer.c index 032af07dc9..222761fed3 100644 --- a/libavformat/tests/fifo_muxer.c +++ b/libavformat/tests/fifo_muxer.c @@ -159,7 +159,7 @@ const FFOutputFormat ff_fifo_test_muxer = { #else .p.flags = AVFMT_NOFILE, #endif - .flags_internal = FF_FMT_ALLOW_FLUSH, + .flags_internal = FF_OFMT_FLAG_ALLOW_FLUSH, }; -- 2.40.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".
next prev parent reply other threads:[~2024-03-20 2:13 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-03-20 2:07 [FFmpeg-devel] [PATCH 01/13] avformat/mp3enc: Improve query_codec Andreas Rheinhardt 2024-03-20 2:12 ` [FFmpeg-devel] [PATCH 02/13] libavformat/westwood_audenc: Use proper logcontext Andreas Rheinhardt 2024-03-20 2:12 ` Andreas Rheinhardt [this message] 2024-03-20 2:12 ` [FFmpeg-devel] [PATCH 04/13] avformat/codec2: Don't allocate Codec2Context for muxer Andreas Rheinhardt 2024-03-20 11:23 ` Tomas Härdin 2024-03-20 2:12 ` [FFmpeg-devel] [PATCH 05/13] avformat/amr: Move write_header closer to muxer definition Andreas Rheinhardt 2024-03-20 2:12 ` [FFmpeg-devel] [PATCH 06/13] avformat/mux_utils: Don't report that AV_CODEC_ID_NONE can be muxed Andreas Rheinhardt 2024-03-20 2:12 ` [FFmpeg-devel] [PATCH 07/13] fate/filter-audio: Don't use pcm output for channelsplit test Andreas Rheinhardt 2024-03-20 2:12 ` [FFmpeg-devel] [PATCH 08/13] avformat/mux: Add flag for "not more than one stream of each type" Andreas Rheinhardt 2024-03-20 2:12 ` [FFmpeg-devel] [PATCH 09/13] avformat: Enforce one-stream limit where appropriate Andreas Rheinhardt 2024-03-20 2:12 ` [FFmpeg-devel] [PATCH 10/13] avformat/mux: Add flag for "only default codecs allowed" Andreas Rheinhardt 2024-03-20 2:12 ` [FFmpeg-devel] [PATCH 11/13] avformat/ttmlenc: Avoid unnecessary block Andreas Rheinhardt 2024-03-20 2:12 ` [FFmpeg-devel] [PATCH 12/13] avformat: Enforce codec_id where appropriate Andreas Rheinhardt 2024-03-20 2:12 ` [FFmpeg-devel] [PATCH 13/13] avformat: Make init function out of write_header functions if possible Andreas Rheinhardt 2024-03-22 12:13 ` [FFmpeg-devel] [PATCH 01/13] avformat/mp3enc: Improve query_codec Andreas Rheinhardt
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=AS8P250MB0744A902C5DB51ABC6FD9CBA8F332@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \ --to=andreas.rheinhardt@outlook.com \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
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