History

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.

Andreas Rheinhardt committed 3 years ago

Commit dd48e491 parent 0d5967715 files · +135 −5Browse files

Unified · Split

15 files
  1. doc/APIchanges +4 −0
  2. libavdevice/pulse_audio_enc.c +5 −0
  3. libavformat/avformat.h +4 −2
  4. libavformat/fifo.c +5 −0
  5. libavformat/fifo_test.c +5 −0
  6. libavformat/hlsenc.c +5 −0
  7. libavformat/matroskaenc.c +15 −0
  8. libavformat/movenc.c +45 −0
  9. libavformat/mpegtsenc.c +5 −0
  10. libavformat/mux.c +6 −0
  11. libavformat/mux.h +4 −2
  12. libavformat/oggenc.c +25 −0
  13. libavformat/tee.c +5 −0
  14. libavformat/version.h +1 −1
  15. libavformat/version_major.h +1 −0
doc/APIchanges+4−0
@@ -2,6 +2,10 @@ The last version increases of all libraries were on 2023-02-09 · 1 unmodified line
2 2
3API changes, most recent first:3API changes, most recent first:
4 4
52023-10-03 - xxxxxxxxxx - lavf 60.14.100 - avformat.h
6 Deprecate AVFMT_ALLOW_FLUSH without replacement. Users can always
7 flush any muxer by sending a NULL packet.
8
52023-09-28 - xxxxxxxxxx - lavu 58.27.100 - pixfmt.h92023-09-28 - xxxxxxxxxx - lavu 58.27.100 - pixfmt.h
6 Add AV_PIX_FMT_GBRAP14BE, AV_PIX_FMT_GBRAP14LE pixel formats.10 Add AV_PIX_FMT_GBRAP14BE, AV_PIX_FMT_GBRAP14LE pixel formats.
7 11
libavdevice/pulse_audio_enc.c+5−0
@@ -802,6 +802,11 @@ const FFOutputFormat ff_pulse_muxer = { · 801 unmodified lines
802 .get_output_timestamp = pulse_get_output_timestamp,802 .get_output_timestamp = pulse_get_output_timestamp,
803 .get_device_list = pulse_get_device_list,803 .get_device_list = pulse_get_device_list,
804 .control_message = pulse_control_message,804 .control_message = pulse_control_message,
805#if FF_API_ALLOW_FLUSH
805 .p.flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH,806 .p.flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH,
807#else
808 .p.flags = AVFMT_NOFILE,
809#endif
806 .p.priv_class = &pulse_muxer_class,810 .p.priv_class = &pulse_muxer_class,
811 .flags_internal = FF_FMT_ALLOW_FLUSH,
807};812};
libavformat/avformat.h+4−2
@@ -486,7 +486,9 @@ typedef struct AVProbeData { · 485 unmodified lines
486#define AVFMT_NOBINSEARCH 0x2000 /**< Format does not allow to fall back on binary search via read_timestamp */486#define AVFMT_NOBINSEARCH 0x2000 /**< Format does not allow to fall back on binary search via read_timestamp */
487#define AVFMT_NOGENSEARCH 0x4000 /**< Format does not allow to fall back on generic search */487#define AVFMT_NOGENSEARCH 0x4000 /**< Format does not allow to fall back on generic search */
488#define AVFMT_NO_BYTE_SEEK 0x8000 /**< Format does not allow seeking by bytes */488#define AVFMT_NO_BYTE_SEEK 0x8000 /**< Format does not allow seeking by bytes */
489#define AVFMT_ALLOW_FLUSH 0x10000 /**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. */489#if FF_API_ALLOW_FLUSH
490#define AVFMT_ALLOW_FLUSH 0x10000 /**< @deprecated: Just send a NULL packet if you want to flush a muxer. */
491#endif
490#define AVFMT_TS_NONSTRICT 0x20000 /**< Format does not require strictly492#define AVFMT_TS_NONSTRICT 0x20000 /**< Format does not require strictly
491 increasing timestamps, but they must493 increasing timestamps, but they must
492 still be monotonic */494 still be monotonic */
@@ -522,7 +524,7 @@ typedef struct AVOutputFormat { · 29 unmodified lines
522 /**524 /**
523 * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER,525 * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER,
524 * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS,526 * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS,
525 * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH,527 * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS,
526 * AVFMT_TS_NONSTRICT, AVFMT_TS_NEGATIVE528 * AVFMT_TS_NONSTRICT, AVFMT_TS_NEGATIVE
527 */529 */
528 int flags;530 int flags;
libavformat/fifo.c+5−0
@@ -715,11 +715,16 @@ const FFOutputFormat ff_fifo_muxer = { · 714 unmodified lines
715 .p.name = "fifo",715 .p.name = "fifo",
716 .p.long_name = NULL_IF_CONFIG_SMALL("FIFO queue pseudo-muxer"),716 .p.long_name = NULL_IF_CONFIG_SMALL("FIFO queue pseudo-muxer"),
717 .p.priv_class = &fifo_muxer_class,717 .p.priv_class = &fifo_muxer_class,
718#if FF_API_ALLOW_FLUSH
718 .p.flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,719 .p.flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
720#else
721 .p.flags = AVFMT_NOFILE | AVFMT_TS_NEGATIVE,
722#endif
719 .priv_data_size = sizeof(FifoContext),723 .priv_data_size = sizeof(FifoContext),
720 .init = fifo_init,724 .init = fifo_init,
721 .write_header = fifo_write_header,725 .write_header = fifo_write_header,
722 .write_packet = fifo_write_packet,726 .write_packet = fifo_write_packet,
723 .write_trailer = fifo_write_trailer,727 .write_trailer = fifo_write_trailer,
724 .deinit = fifo_deinit,728 .deinit = fifo_deinit,
729 .flags_internal = FF_FMT_ALLOW_FLUSH,
725};730};
libavformat/fifo_test.c+5−0
@@ -147,6 +147,11 @@ const FFOutputFormat ff_fifo_test_muxer = { · 146 unmodified lines
147 .write_trailer = failing_write_trailer,147 .write_trailer = failing_write_trailer,
148 .deinit = failing_deinit,148 .deinit = failing_deinit,
149 .p.priv_class = &failing_muxer_class,149 .p.priv_class = &failing_muxer_class,
150#if FF_API_ALLOW_FLUSH
150 .p.flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH,151 .p.flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH,
152#else
153 .p.flags = AVFMT_NOFILE,
154#endif
155 .flags_internal = FF_FMT_ALLOW_FLUSH,
151};156};
152 157
libavformat/hlsenc.c+5−0
@@ -3184,8 +3184,13 @@ const FFOutputFormat ff_hls_muxer = { · 3183 unmodified lines
3184 .p.audio_codec = AV_CODEC_ID_AAC,3184 .p.audio_codec = AV_CODEC_ID_AAC,
3185 .p.video_codec = AV_CODEC_ID_H264,3185 .p.video_codec = AV_CODEC_ID_H264,
3186 .p.subtitle_codec = AV_CODEC_ID_WEBVTT,3186 .p.subtitle_codec = AV_CODEC_ID_WEBVTT,
3187#if FF_API_ALLOW_FLUSH
3187 .p.flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_NODIMENSIONS,3188 .p.flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_NODIMENSIONS,
3189#else
3190 .p.flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER | AVFMT_NODIMENSIONS,
3191#endif
3188 .p.priv_class = &hls_class,3192 .p.priv_class = &hls_class,
3193 .flags_internal = FF_FMT_ALLOW_FLUSH,
3189 .priv_data_size = sizeof(HLSContext),3194 .priv_data_size = sizeof(HLSContext),
3190 .init = hls_init,3195 .init = hls_init,
3191 .write_header = hls_write_header,3196 .write_header = hls_write_header,
libavformat/matroskaenc.c+15−0
@@ -3539,7 +3539,11 @@ const FFOutputFormat ff_matroska_muxer = { · 3538 unmodified lines
3539 .write_packet = mkv_write_flush_packet,3539 .write_packet = mkv_write_flush_packet,
3540 .write_trailer = mkv_write_trailer,3540 .write_trailer = mkv_write_trailer,
3541 .p.flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |3541 .p.flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
3542#if FF_API_ALLOW_FLUSH
3542 AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,3543 AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
3544#else
3545 AVFMT_TS_NONSTRICT,
3546#endif
3543 .p.codec_tag = (const AVCodecTag* const []){3547 .p.codec_tag = (const AVCodecTag* const []){
3544 ff_codec_bmp_tags, ff_codec_wav_tags,3548 ff_codec_bmp_tags, ff_codec_wav_tags,
3545 additional_audio_tags, additional_subtitle_tags, 03549 additional_audio_tags, additional_subtitle_tags, 0
@@ -3548,6 +3552,7 @@ const FFOutputFormat ff_matroska_muxer = { · 2 unmodified lines
3548 .query_codec = mkv_query_codec,3552 .query_codec = mkv_query_codec,
3549 .check_bitstream = mkv_check_bitstream,3553 .check_bitstream = mkv_check_bitstream,
3550 .p.priv_class = &matroska_webm_class,3554 .p.priv_class = &matroska_webm_class,
3555 .flags_internal = FF_FMT_ALLOW_FLUSH,
3551};3556};
3552#endif3557#endif
3553 3558
@@ -3578,8 +3583,13 @@ const FFOutputFormat ff_webm_muxer = { · 24 unmodified lines
3578 .query_codec = webm_query_codec,3583 .query_codec = webm_query_codec,
3579 .check_bitstream = mkv_check_bitstream,3584 .check_bitstream = mkv_check_bitstream,
3580 .p.flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |3585 .p.flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
3586#if FF_API_ALLOW_FLUSH
3581 AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,3587 AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
3588#else
3589 AVFMT_TS_NONSTRICT,
3590#endif
3582 .p.priv_class = &matroska_webm_class,3591 .p.priv_class = &matroska_webm_class,
3592 .flags_internal = FF_FMT_ALLOW_FLUSH,
3583};3593};
3584#endif3594#endif
3585 3595
@@ -3599,11 +3609,16 @@ const FFOutputFormat ff_matroska_audio_muxer = { · 13 unmodified lines
3599 .write_packet = mkv_write_flush_packet,3609 .write_packet = mkv_write_flush_packet,
3600 .write_trailer = mkv_write_trailer,3610 .write_trailer = mkv_write_trailer,
3601 .check_bitstream = mkv_check_bitstream,3611 .check_bitstream = mkv_check_bitstream,
3612#if FF_API_ALLOW_FLUSH
3602 .p.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NONSTRICT |3613 .p.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NONSTRICT |
3603 AVFMT_ALLOW_FLUSH,3614 AVFMT_ALLOW_FLUSH,
3615#else
3616 .p.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NONSTRICT,
3617#endif
3604 .p.codec_tag = (const AVCodecTag* const []){3618 .p.codec_tag = (const AVCodecTag* const []){
3605 ff_codec_wav_tags, additional_audio_tags, 03619 ff_codec_wav_tags, additional_audio_tags, 0
3606 },3620 },
3607 .p.priv_class = &matroska_webm_class,3621 .p.priv_class = &matroska_webm_class,
3622 .flags_internal = FF_FMT_ALLOW_FLUSH,
3608};3623};
3609#endif3624#endif
libavformat/movenc.c+45−0
@@ -7932,12 +7932,17 @@ const FFOutputFormat ff_mov_muxer = { · 7931 unmodified lines
7932 .write_packet = mov_write_packet,7932 .write_packet = mov_write_packet,
7933 .write_trailer = mov_write_trailer,7933 .write_trailer = mov_write_trailer,
7934 .deinit = mov_free,7934 .deinit = mov_free,
7935#if FF_API_ALLOW_FLUSH
7935 .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,7936 .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
7937#else
7938 .p.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE,
7939#endif
7936 .p.codec_tag = (const AVCodecTag* const []){7940 .p.codec_tag = (const AVCodecTag* const []){
7937 ff_codec_movvideo_tags, ff_codec_movaudio_tags, ff_codec_movsubtitle_tags, 07941 ff_codec_movvideo_tags, ff_codec_movaudio_tags, ff_codec_movsubtitle_tags, 0
7938 },7942 },
7939 .check_bitstream = mov_check_bitstream,7943 .check_bitstream = mov_check_bitstream,
7940 .p.priv_class = &mov_isobmff_muxer_class,7944 .p.priv_class = &mov_isobmff_muxer_class,
7945 .flags_internal = FF_FMT_ALLOW_FLUSH,
7941};7946};
7942#endif7947#endif
7943#if CONFIG_TGP_MUXER7948#if CONFIG_TGP_MUXER
@@ -7953,10 +7958,15 @@ const FFOutputFormat ff_tgp_muxer = { · 9 unmodified lines
7953 .write_packet = mov_write_packet,7958 .write_packet = mov_write_packet,
7954 .write_trailer = mov_write_trailer,7959 .write_trailer = mov_write_trailer,
7955 .deinit = mov_free,7960 .deinit = mov_free,
7961#if FF_API_ALLOW_FLUSH
7956 .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,7962 .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
7963#else
7964 .p.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE,
7965#endif
7957 .p.codec_tag = codec_3gp_tags_list,7966 .p.codec_tag = codec_3gp_tags_list,
7958 .check_bitstream = mov_check_bitstream,7967 .check_bitstream = mov_check_bitstream,
7959 .p.priv_class = &mov_isobmff_muxer_class,7968 .p.priv_class = &mov_isobmff_muxer_class,
7969 .flags_internal = FF_FMT_ALLOW_FLUSH,
7960};7970};
7961#endif7971#endif
7962#if CONFIG_MP4_MUXER7972#if CONFIG_MP4_MUXER
@@ -7974,10 +7984,15 @@ const FFOutputFormat ff_mp4_muxer = { · 11 unmodified lines
7974 .write_packet = mov_write_packet,7984 .write_packet = mov_write_packet,
7975 .write_trailer = mov_write_trailer,7985 .write_trailer = mov_write_trailer,
7976 .deinit = mov_free,7986 .deinit = mov_free,
7987#if FF_API_ALLOW_FLUSH
7977 .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,7988 .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
7989#else
7990 .p.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE,
7991#endif
7978 .p.codec_tag = mp4_codec_tags_list,7992 .p.codec_tag = mp4_codec_tags_list,
7979 .check_bitstream = mov_check_bitstream,7993 .check_bitstream = mov_check_bitstream,
7980 .p.priv_class = &mov_isobmff_muxer_class,7994 .p.priv_class = &mov_isobmff_muxer_class,
7995 .flags_internal = FF_FMT_ALLOW_FLUSH,
7981};7996};
7982#endif7997#endif
7983#if CONFIG_PSP_MUXER7998#if CONFIG_PSP_MUXER
@@ -7994,10 +8009,15 @@ const FFOutputFormat ff_psp_muxer = { · 10 unmodified lines
7994 .write_packet = mov_write_packet,8009 .write_packet = mov_write_packet,
7995 .write_trailer = mov_write_trailer,8010 .write_trailer = mov_write_trailer,
7996 .deinit = mov_free,8011 .deinit = mov_free,
8012#if FF_API_ALLOW_FLUSH
7997 .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,8013 .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
8014#else
8015 .p.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE,
8016#endif
7998 .p.codec_tag = mp4_codec_tags_list,8017 .p.codec_tag = mp4_codec_tags_list,
7999 .check_bitstream = mov_check_bitstream,8018 .check_bitstream = mov_check_bitstream,
8000 .p.priv_class = &mov_isobmff_muxer_class,8019 .p.priv_class = &mov_isobmff_muxer_class,
8020 .flags_internal = FF_FMT_ALLOW_FLUSH,
8001};8021};
8002#endif8022#endif
8003#if CONFIG_TG2_MUXER8023#if CONFIG_TG2_MUXER
@@ -8013,10 +8033,15 @@ const FFOutputFormat ff_tg2_muxer = { · 9 unmodified lines
8013 .write_packet = mov_write_packet,8033 .write_packet = mov_write_packet,
8014 .write_trailer = mov_write_trailer,8034 .write_trailer = mov_write_trailer,
8015 .deinit = mov_free,8035 .deinit = mov_free,
8036#if FF_API_ALLOW_FLUSH
8016 .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,8037 .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
8038#else
8039 .p.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE,
8040#endif
8017 .p.codec_tag = codec_3gp_tags_list,8041 .p.codec_tag = codec_3gp_tags_list,
8018 .check_bitstream = mov_check_bitstream,8042 .check_bitstream = mov_check_bitstream,
8019 .p.priv_class = &mov_isobmff_muxer_class,8043 .p.priv_class = &mov_isobmff_muxer_class,
8044 .flags_internal = FF_FMT_ALLOW_FLUSH,
8020};8045};
8021#endif8046#endif
8022#if CONFIG_IPOD_MUXER8047#if CONFIG_IPOD_MUXER
@@ -8033,10 +8058,15 @@ const FFOutputFormat ff_ipod_muxer = { · 10 unmodified lines
8033 .write_packet = mov_write_packet,8058 .write_packet = mov_write_packet,
8034 .write_trailer = mov_write_trailer,8059 .write_trailer = mov_write_trailer,
8035 .deinit = mov_free,8060 .deinit = mov_free,
8061#if FF_API_ALLOW_FLUSH
8036 .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,8062 .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
8063#else
8064 .p.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE,
8065#endif
8037 .p.codec_tag = (const AVCodecTag* const []){ codec_ipod_tags, 0 },8066 .p.codec_tag = (const AVCodecTag* const []){ codec_ipod_tags, 0 },
8038 .check_bitstream = mov_check_bitstream,8067 .check_bitstream = mov_check_bitstream,
8039 .p.priv_class = &mov_isobmff_muxer_class,8068 .p.priv_class = &mov_isobmff_muxer_class,
8069 .flags_internal = FF_FMT_ALLOW_FLUSH,
8040};8070};
8041#endif8071#endif
8042#if CONFIG_ISMV_MUXER8072#if CONFIG_ISMV_MUXER
@@ -8053,11 +8083,16 @@ const FFOutputFormat ff_ismv_muxer = { · 10 unmodified lines
8053 .write_packet = mov_write_packet,8083 .write_packet = mov_write_packet,
8054 .write_trailer = mov_write_trailer,8084 .write_trailer = mov_write_trailer,
8055 .deinit = mov_free,8085 .deinit = mov_free,
8086#if FF_API_ALLOW_FLUSH
8056 .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,8087 .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
8088#else
8089 .p.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE,
8090#endif
8057 .p.codec_tag = (const AVCodecTag* const []){8091 .p.codec_tag = (const AVCodecTag* const []){
8058 codec_mp4_tags, codec_ism_tags, 0 },8092 codec_mp4_tags, codec_ism_tags, 0 },
8059 .check_bitstream = mov_check_bitstream,8093 .check_bitstream = mov_check_bitstream,
8060 .p.priv_class = &mov_isobmff_muxer_class,8094 .p.priv_class = &mov_isobmff_muxer_class,
8095 .flags_internal = FF_FMT_ALLOW_FLUSH,
8061};8096};
8062#endif8097#endif
8063#if CONFIG_F4V_MUXER8098#if CONFIG_F4V_MUXER
@@ -8074,10 +8109,15 @@ const FFOutputFormat ff_f4v_muxer = { · 10 unmodified lines
8074 .write_packet = mov_write_packet,8109 .write_packet = mov_write_packet,
8075 .write_trailer = mov_write_trailer,8110 .write_trailer = mov_write_trailer,
8076 .deinit = mov_free,8111 .deinit = mov_free,
8112#if FF_API_ALLOW_FLUSH
8077 .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH,8113 .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH,
8114#else
8115 .p.flags = AVFMT_GLOBALHEADER,
8116#endif
8078 .p.codec_tag = (const AVCodecTag* const []){ codec_f4v_tags, 0 },8117 .p.codec_tag = (const AVCodecTag* const []){ codec_f4v_tags, 0 },
8079 .check_bitstream = mov_check_bitstream,8118 .check_bitstream = mov_check_bitstream,
8080 .p.priv_class = &mov_isobmff_muxer_class,8119 .p.priv_class = &mov_isobmff_muxer_class,
8120 .flags_internal = FF_FMT_ALLOW_FLUSH,
8081};8121};
8082#endif8122#endif
8083#if CONFIG_AVIF_MUXER8123#if CONFIG_AVIF_MUXER
@@ -8093,8 +8133,13 @@ const FFOutputFormat ff_avif_muxer = { · 9 unmodified lines
8093 .write_packet = mov_write_packet,8133 .write_packet = mov_write_packet,
8094 .write_trailer = avif_write_trailer,8134 .write_trailer = avif_write_trailer,
8095 .deinit = mov_free,8135 .deinit = mov_free,
8136#if FF_API_ALLOW_FLUSH
8096 .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH,8137 .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH,
8138#else
8139 .p.flags = AVFMT_GLOBALHEADER,
8140#endif
8097 .p.codec_tag = codec_avif_tags_list,8141 .p.codec_tag = codec_avif_tags_list,
8098 .p.priv_class = &mov_avif_muxer_class,8142 .p.priv_class = &mov_avif_muxer_class,
8143 .flags_internal = FF_FMT_ALLOW_FLUSH,
8099};8144};
8100#endif8145#endif
libavformat/mpegtsenc.c+5−0
@@ -2361,6 +2361,11 @@ const FFOutputFormat ff_mpegts_muxer = { · 2360 unmodified lines
2361 .write_trailer = mpegts_write_end,2361 .write_trailer = mpegts_write_end,
2362 .deinit = mpegts_deinit,2362 .deinit = mpegts_deinit,
2363 .check_bitstream = mpegts_check_bitstream,2363 .check_bitstream = mpegts_check_bitstream,
2364#if FF_API_ALLOW_FLUSH
2364 .p.flags = AVFMT_ALLOW_FLUSH | AVFMT_VARIABLE_FPS | AVFMT_NODIMENSIONS,2365 .p.flags = AVFMT_ALLOW_FLUSH | AVFMT_VARIABLE_FPS | AVFMT_NODIMENSIONS,
2366#else
2367 .p.flags = AVFMT_VARIABLE_FPS | AVFMT_NODIMENSIONS,
2368#endif
2369 .flags_internal = FF_FMT_ALLOW_FLUSH,
2365 .p.priv_class = &mpegts_muxer_class,2370 .p.priv_class = &mpegts_muxer_class,
2366};2371};
libavformat/mux.c+6−0
@@ -1206,7 +1206,13 @@ int av_write_frame(AVFormatContext *s, AVPacket *in) · 1205 unmodified lines
1206 int ret;1206 int ret;
1207 1207
1208 if (!in) {1208 if (!in) {
1209#if FF_API_ALLOW_FLUSH || LIBAVFORMAT_VERSION_MAJOR >= 61
1210 // Hint: The pulse audio output device has this set,
1211 // so we can't switch the check to FF_FMT_ALLOW_FLUSH immediately.
1209 if (s->oformat->flags & AVFMT_ALLOW_FLUSH) {1212 if (s->oformat->flags & AVFMT_ALLOW_FLUSH) {
1213#else
1214 if (ffofmt(s->oformat)->flags_internal & FF_FMT_ALLOW_FLUSH) {
1215#endif
1210 ret = ffofmt(s->oformat)->write_packet(s, NULL);1216 ret = ffofmt(s->oformat)->write_packet(s, NULL);
1211 flush_if_needed(s);1217 flush_if_needed(s);
1212 if (ret >= 0 && s->pb && s->pb->error < 0)1218 if (ret >= 0 && s->pb && s->pb->error < 0)
libavformat/mux.h+4−2
@@ -27,6 +27,8 @@ · 26 unmodified lines
27 27
28struct AVDeviceInfoList;28struct AVDeviceInfoList;
29 29
30#define FF_FMT_ALLOW_FLUSH (1 << 1)
31
30typedef struct FFOutputFormat {32typedef struct FFOutputFormat {
31 /**33 /**
32 * The public AVOutputFormat. See avformat.h for it.34 * The public AVOutputFormat. See avformat.h for it.
@@ -38,13 +40,13 @@ typedef struct FFOutputFormat { · 5 unmodified lines
38 int priv_data_size;40 int priv_data_size;
39 41
40 /**42 /**
41 * Internal flags. See FF_FMT_FLAG_* in internal.h.43 * Internal flags. See FF_FMT_* in internal.h and mux.h.
42 */44 */
43 int flags_internal;45 int flags_internal;
44 46
45 int (*write_header)(AVFormatContext *);47 int (*write_header)(AVFormatContext *);
46 /**48 /**
47 * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags,49 * Write a packet. If FF_FMT_ALLOW_FLUSH is set in flags_internal,
48 * pkt can be NULL in order to flush data buffered in the muxer.50 * pkt can be NULL in order to flush data buffered in the muxer.
49 * When flushing, return 0 if there still is more data to flush,51 * When flushing, return 0 if there still is more data to flush,
50 * or 1 if everything was flushed and there is no more buffered52 * or 1 if everything was flushed and there is no more buffered
libavformat/oggenc.c+25−0
@@ -771,8 +771,13 @@ const FFOutputFormat ff_ogg_muxer = { · 770 unmodified lines
771 .write_packet = ogg_write_packet,771 .write_packet = ogg_write_packet,
772 .write_trailer = ogg_write_trailer,772 .write_trailer = ogg_write_trailer,
773 .deinit = ogg_free,773 .deinit = ogg_free,
774#if FF_API_ALLOW_FLUSH
774 .p.flags = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,775 .p.flags = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
776#else
777 .p.flags = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT,
778#endif
775 .p.priv_class = &ogg_muxer_class,779 .p.priv_class = &ogg_muxer_class,
780 .flags_internal = FF_FMT_ALLOW_FLUSH,
776};781};
777#endif782#endif
778 783
@@ -789,8 +794,13 @@ const FFOutputFormat ff_oga_muxer = { · 10 unmodified lines
789 .write_packet = ogg_write_packet,794 .write_packet = ogg_write_packet,
790 .write_trailer = ogg_write_trailer,795 .write_trailer = ogg_write_trailer,
791 .deinit = ogg_free,796 .deinit = ogg_free,
797#if FF_API_ALLOW_FLUSH
792 .p.flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,798 .p.flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
799#else
800 .p.flags = AVFMT_TS_NEGATIVE,
801#endif
793 .p.priv_class = &ogg_muxer_class,802 .p.priv_class = &ogg_muxer_class,
803 .flags_internal = FF_FMT_ALLOW_FLUSH,
794};804};
795#endif805#endif
796 806
@@ -810,8 +820,13 @@ const FFOutputFormat ff_ogv_muxer = { · 13 unmodified lines
810 .write_packet = ogg_write_packet,820 .write_packet = ogg_write_packet,
811 .write_trailer = ogg_write_trailer,821 .write_trailer = ogg_write_trailer,
812 .deinit = ogg_free,822 .deinit = ogg_free,
823#if FF_API_ALLOW_FLUSH
813 .p.flags = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,824 .p.flags = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
825#else
826 .p.flags = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT,
827#endif
814 .p.priv_class = &ogg_muxer_class,828 .p.priv_class = &ogg_muxer_class,
829 .flags_internal = FF_FMT_ALLOW_FLUSH,
815};830};
816#endif831#endif
817 832
@@ -828,8 +843,13 @@ const FFOutputFormat ff_spx_muxer = { · 10 unmodified lines
828 .write_packet = ogg_write_packet,843 .write_packet = ogg_write_packet,
829 .write_trailer = ogg_write_trailer,844 .write_trailer = ogg_write_trailer,
830 .deinit = ogg_free,845 .deinit = ogg_free,
846#if FF_API_ALLOW_FLUSH
831 .p.flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,847 .p.flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
848#else
849 .p.flags = AVFMT_TS_NEGATIVE,
850#endif
832 .p.priv_class = &ogg_muxer_class,851 .p.priv_class = &ogg_muxer_class,
852 .flags_internal = FF_FMT_ALLOW_FLUSH,
833};853};
834#endif854#endif
835 855
@@ -846,7 +866,12 @@ const FFOutputFormat ff_opus_muxer = { · 10 unmodified lines
846 .write_packet = ogg_write_packet,866 .write_packet = ogg_write_packet,
847 .write_trailer = ogg_write_trailer,867 .write_trailer = ogg_write_trailer,
848 .deinit = ogg_free,868 .deinit = ogg_free,
869#if FF_API_ALLOW_FLUSH
849 .p.flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,870 .p.flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
871#else
872 .p.flags = AVFMT_TS_NEGATIVE,
873#endif
850 .p.priv_class = &ogg_muxer_class,874 .p.priv_class = &ogg_muxer_class,
875 .flags_internal = FF_FMT_ALLOW_FLUSH,
851};876};
852#endif877#endif
libavformat/tee.c+5−0
@@ -614,5 +614,10 @@ const FFOutputFormat ff_tee_muxer = { · 613 unmodified lines
614 .write_trailer = tee_write_trailer,614 .write_trailer = tee_write_trailer,
615 .write_packet = tee_write_packet,615 .write_packet = tee_write_packet,
616 .p.priv_class = &tee_muxer_class,616 .p.priv_class = &tee_muxer_class,
617#if FF_API_ALLOW_FLUSH
617 .p.flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,618 .p.flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
619#else
620 .p.flags = AVFMT_NOFILE | AVFMT_TS_NEGATIVE,
621#endif
622 .flags_internal = FF_FMT_ALLOW_FLUSH,
618};623};
libavformat/version.h+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
31 31
32#include "version_major.h"32#include "version_major.h"
33 33
34#define LIBAVFORMAT_VERSION_MINOR 1334#define LIBAVFORMAT_VERSION_MINOR 14
35#define LIBAVFORMAT_VERSION_MICRO 10035#define LIBAVFORMAT_VERSION_MICRO 100
36 36
37#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \37#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
libavformat/version_major.h+1−0
@@ -47,6 +47,7 @@ · 46 unmodified lines
47#define FF_API_AVFORMAT_IO_CLOSE (LIBAVFORMAT_VERSION_MAJOR < 61)47#define FF_API_AVFORMAT_IO_CLOSE (LIBAVFORMAT_VERSION_MAJOR < 61)
48#define FF_API_AVIO_WRITE_NONCONST (LIBAVFORMAT_VERSION_MAJOR < 61)48#define FF_API_AVIO_WRITE_NONCONST (LIBAVFORMAT_VERSION_MAJOR < 61)
49#define FF_API_LAVF_SHORTEST (LIBAVFORMAT_VERSION_MAJOR < 61)49#define FF_API_LAVF_SHORTEST (LIBAVFORMAT_VERSION_MAJOR < 61)
50#define FF_API_ALLOW_FLUSH (LIBAVFORMAT_VERSION_MAJOR < 61)
50 51
51 52
52#define FF_API_R_FRAME_RATE 153#define FF_API_R_FRAME_RATE 1

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t