* [FFmpeg-devel] [PATCH v2] Major library version bump
@ 2023-02-04 10:41 Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 01/33] avformat/avformat: Remove AVOutputFormat.data_codec Anton Khirnov
` (32 more replies)
0 siblings, 33 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
Hi,
James is on vacation, so I'm continuing his work on the bump, with his
agreement.
The consensus from the previous thread was that we do NOT want any
instability period - this set is pushed all at once and the tree is
considered stable immediately after.
I've integrated all the patches submitted to the previous thread, except
for:
* my fifo patches, which as Andreas pointed out do not actually break
ABI and thus do not need a bump
* the HDR vivid patches which break the API without a deprecation period
If nobody has further comments, I would like to push this soon.
Thanks,
--
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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 01/33] avformat/avformat: Remove AVOutputFormat.data_codec
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 02/33] avformat/avformat: Move codecpar up in AVStream Anton Khirnov
` (31 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
No AVOutputFormat has this set.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
---
libavformat/avformat.h | 1 -
libavformat/format.c | 2 --
libavformat/mux_utils.c | 3 +--
3 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 1d97d56ac58..53bbc0063f0 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -614,7 +614,6 @@ typedef struct AVOutputFormat {
* @see avdevice_list_devices() for more details.
*/
int (*get_device_list)(struct AVFormatContext *s, struct AVDeviceInfoList *device_list);
- enum AVCodecID data_codec; /**< default data codec */
/**
* Initialize format. May allocate data here, and set any AVFormatContext or
* AVStream parameters that need to be set before packets are sent.
diff --git a/libavformat/format.c b/libavformat/format.c
index 4b1f3c2986e..76f25ab5a67 100644
--- a/libavformat/format.c
+++ b/libavformat/format.c
@@ -111,8 +111,6 @@ enum AVCodecID av_guess_codec(const AVOutputFormat *fmt, const char *short_name,
return fmt->audio_codec;
else if (type == AVMEDIA_TYPE_SUBTITLE)
return fmt->subtitle_codec;
- else if (type == AVMEDIA_TYPE_DATA)
- return fmt->data_codec;
else
return AV_CODEC_ID_NONE;
}
diff --git a/libavformat/mux_utils.c b/libavformat/mux_utils.c
index 764c834fa2c..55e58ae9d68 100644
--- a/libavformat/mux_utils.c
+++ b/libavformat/mux_utils.c
@@ -51,8 +51,7 @@ int avformat_query_codec(const AVOutputFormat *ofmt, enum AVCodecID codec_id,
return !!av_codec_get_tag2(ofmt->codec_tag, codec_id, &codec_tag);
else if (codec_id == ofmt->video_codec ||
codec_id == ofmt->audio_codec ||
- codec_id == ofmt->subtitle_codec ||
- codec_id == ofmt->data_codec)
+ codec_id == ofmt->subtitle_codec)
return 1;
}
return AVERROR_PATCHWELCOME;
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 02/33] avformat/avformat: Move codecpar up in AVStream
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 01/33] avformat/avformat: Remove AVOutputFormat.data_codec Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 03/33] avcodec: Make avcodec_decode_subtitle2 accept a const AVPacket* Anton Khirnov
` (30 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
It is the most commonly used field and moving it to the start
e.g. allows to encode the offset in a pointer+offset addressing
mode on one byte on x86.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
---
libavformat/avformat.h | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 53bbc0063f0..a69ee1c575c 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -962,6 +962,17 @@ typedef struct AVStream {
*/
int id;
+ /**
+ * Codec parameters associated with this stream. Allocated and freed by
+ * libavformat in avformat_new_stream() and avformat_free_context()
+ * respectively.
+ *
+ * - demuxing: filled by libavformat on stream creation or in
+ * avformat_find_stream_info()
+ * - muxing: filled by the caller before avformat_write_header()
+ */
+ AVCodecParameters *codecpar;
+
void *priv_data;
/**
@@ -1097,17 +1108,6 @@ typedef struct AVStream {
*/
AVRational r_frame_rate;
- /**
- * Codec parameters associated with this stream. Allocated and freed by
- * libavformat in avformat_new_stream() and avformat_free_context()
- * respectively.
- *
- * - demuxing: filled by libavformat on stream creation or in
- * avformat_find_stream_info()
- * - muxing: filled by the caller before avformat_write_header()
- */
- AVCodecParameters *codecpar;
-
/**
* Number of bits in timestamps. Used for wrapping control.
*
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 03/33] avcodec: Make avcodec_decode_subtitle2 accept a const AVPacket*
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 01/33] avformat/avformat: Remove AVOutputFormat.data_codec Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 02/33] avformat/avformat: Move codecpar up in AVStream Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 04/33] avformat/demux: Avoid stack packet when decoding frame Anton Khirnov
` (29 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
---
doc/APIchanges | 3 +++
fftools/ffmpeg.c | 4 ++--
fftools/ffprobe.c | 2 +-
libavcodec/avcodec.h | 3 +--
libavcodec/decode.c | 9 ++++-----
tools/target_dec_fuzzer.c | 4 ++--
6 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/doc/APIchanges b/doc/APIchanges
index bc52a079644..b1181ec60a3 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -14,6 +14,9 @@ libavutil: 2021-04-27
API changes, most recent first:
+2023-02-xx - xxxxxxxxxx - lavc 60.0.100 - avcodec.h
+ avcodec_decode_subtitle2() now accepts const AVPacket*.
+
2023-01-29 - xxxxxxxxxx - lavc 59.59.100 - avcodec.h
Add AV_CODEC_FLAG_COPY_OPAQUE and AV_CODEC_FLAG_FRAME_DURATION.
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 92fd61f3158..257f319550c 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2296,8 +2296,8 @@ fail:
return err < 0 ? err : ret;
}
-static int transcode_subtitles(InputStream *ist, AVPacket *pkt, int *got_output,
- int *decode_failed)
+static int transcode_subtitles(InputStream *ist, const AVPacket *pkt,
+ int *got_output, int *decode_failed)
{
AVSubtitle subtitle;
int free_sub = 1;
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index dfa7ff1b241..5beaece094f 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -2733,7 +2733,7 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
static av_always_inline int process_frame(WriterContext *w,
InputFile *ifile,
- AVFrame *frame, AVPacket *pkt,
+ AVFrame *frame, const AVPacket *pkt,
int *packet_new)
{
AVFormatContext *fmt_ctx = ifile->fmt_ctx;
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 90b437ccbe2..b9bd69a2ec7 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2601,8 +2601,7 @@ enum AVChromaLocation avcodec_chroma_pos_to_enum(int xpos, int ypos);
* @param[in] avpkt The input AVPacket containing the input buffer.
*/
int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
- int *got_sub_ptr,
- AVPacket *avpkt);
+ int *got_sub_ptr, const AVPacket *avpkt);
/**
* Supply raw packet data as input to a decoder.
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 0abc88737b2..45c1f085792 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -780,8 +780,8 @@ static void get_subtitle_defaults(AVSubtitle *sub)
}
#define UTF8_MAX_BYTES 4 /* 5 and 6 bytes sequences should not be used */
-static int recode_subtitle(AVCodecContext *avctx, AVPacket **outpkt,
- AVPacket *inpkt, AVPacket *buf_pkt)
+static int recode_subtitle(AVCodecContext *avctx, const AVPacket **outpkt,
+ const AVPacket *inpkt, AVPacket *buf_pkt)
{
#if CONFIG_ICONV
iconv_t cd = (iconv_t)-1;
@@ -861,8 +861,7 @@ static int utf8_check(const uint8_t *str)
}
int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
- int *got_sub_ptr,
- AVPacket *avpkt)
+ int *got_sub_ptr, const AVPacket *avpkt)
{
int ret = 0;
@@ -882,7 +881,7 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
if ((avctx->codec->capabilities & AV_CODEC_CAP_DELAY) || avpkt->size) {
AVCodecInternal *avci = avctx->internal;
- AVPacket *pkt;
+ const AVPacket *pkt;
ret = recode_subtitle(avctx, &pkt, avpkt, avci->buffer_pkt);
if (ret < 0)
diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index a20345db5c6..8e89b613c07 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -81,8 +81,8 @@ static const FFCodec *AVCodecInitialize(enum AVCodecID codec_id)
return ffcodec(res);
}
-static int subtitle_handler(AVCodecContext *avctx, void *frame,
- int *got_sub_ptr, AVPacket *avpkt)
+static int subtitle_handler(AVCodecContext *avctx, AVFrame *unused,
+ int *got_sub_ptr, const AVPacket *avpkt)
{
AVSubtitle sub;
int ret = avcodec_decode_subtitle2(avctx, &sub, got_sub_ptr, avpkt);
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 04/33] avformat/demux: Avoid stack packet when decoding frame
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (2 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 03/33] avcodec: Make avcodec_decode_subtitle2 accept a const AVPacket* Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 05/33] avformat/avformat: Move AVOutputFormat internals out of public header Anton Khirnov
` (28 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Possible now that avcodec_decode_subtitle2() accepts a const AVPacket*.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
---
libavformat/demux.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/libavformat/demux.c b/libavformat/demux.c
index 2dfd82a63ca..ba2991750bc 100644
--- a/libavformat/demux.c
+++ b/libavformat/demux.c
@@ -1984,7 +1984,7 @@ static int has_codec_parameters(const AVStream *st, const char **errmsg_ptr)
/* returns 1 or 0 if or if not decoded data was returned, or a negative error */
static int try_decode_frame(AVFormatContext *s, AVStream *st,
- const AVPacket *avpkt, AVDictionary **options)
+ const AVPacket *pkt, AVDictionary **options)
{
FFStream *const sti = ffstream(st);
AVCodecContext *const avctx = sti->avctx;
@@ -1992,9 +1992,9 @@ static int try_decode_frame(AVFormatContext *s, AVStream *st,
int got_picture = 1, ret = 0;
AVFrame *frame = av_frame_alloc();
AVSubtitle subtitle;
- AVPacket pkt = *avpkt;
int do_skip_frame = 0;
enum AVDiscard skip_frame;
+ int pkt_to_send = pkt->size > 0;
if (!frame)
return AVERROR(ENOMEM);
@@ -2043,7 +2043,7 @@ static int try_decode_frame(AVFormatContext *s, AVStream *st,
avctx->skip_frame = AVDISCARD_ALL;
}
- while ((pkt.size > 0 || (!pkt.data && got_picture)) &&
+ while ((pkt_to_send || (!pkt->data && got_picture)) &&
ret >= 0 &&
(!has_codec_parameters(st, NULL) || !has_decode_delay_been_guessed(st) ||
(!sti->codec_info_nb_frames &&
@@ -2051,11 +2051,11 @@ static int try_decode_frame(AVFormatContext *s, AVStream *st,
got_picture = 0;
if (avctx->codec_type == AVMEDIA_TYPE_VIDEO ||
avctx->codec_type == AVMEDIA_TYPE_AUDIO) {
- ret = avcodec_send_packet(avctx, &pkt);
+ ret = avcodec_send_packet(avctx, pkt);
if (ret < 0 && ret != AVERROR(EAGAIN) && ret != AVERROR_EOF)
break;
if (ret >= 0)
- pkt.size = 0;
+ pkt_to_send = 0;
ret = avcodec_receive_frame(avctx, frame);
if (ret >= 0)
got_picture = 1;
@@ -2063,11 +2063,11 @@ static int try_decode_frame(AVFormatContext *s, AVStream *st,
ret = 0;
} else if (avctx->codec_type == AVMEDIA_TYPE_SUBTITLE) {
ret = avcodec_decode_subtitle2(avctx, &subtitle,
- &got_picture, &pkt);
+ &got_picture, pkt);
if (got_picture)
avsubtitle_free(&subtitle);
if (ret >= 0)
- pkt.size = 0;
+ pkt_to_send = 0;
}
if (ret >= 0) {
if (got_picture)
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 05/33] avformat/avformat: Move AVOutputFormat internals out of public header
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (3 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 04/33] avformat/demux: Avoid stack packet when decoding frame Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 06/33] avcodec/avcodec: Remove AV_CODEC_FLAG2_DROP_FRAME_TIMECODE Anton Khirnov
` (27 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit does for AVOutputFormat what commit
20f972701806be20a77f808db332d9489343bb78 did for AVCodec:
It adds a new type FFOutputFormat, moves all the internals
of AVOutputFormat to it and adds a now reduced AVOutputFormat
as first member.
This does not affect/improve extensibility of both public
or private fields for muxers (it is still a mess due to lavd).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
---
configure | 8 +-
libavdevice/alldevices.c | 31 +-
libavdevice/alsa_enc.c | 14 +-
libavdevice/audiotoolbox.m | 15 +-
libavdevice/avdevice.c | 9 +-
libavdevice/caca.c | 15 +-
libavdevice/decklink_enc_c.c | 17 +-
libavdevice/fbdev_enc.c | 15 +-
libavdevice/opengl_enc.c | 14 +-
libavdevice/oss_enc.c | 15 +-
libavdevice/pulse_audio_enc.c | 14 +-
libavdevice/sdl2.c | 15 +-
libavdevice/sndio_enc.c | 15 +-
libavdevice/v4l2enc.c | 15 +-
libavdevice/xv.c | 14 +-
libavformat/a64.c | 11 +-
libavformat/adtsenc.c | 19 +-
libavformat/aiffenc.c | 19 +-
libavformat/allformats.c | 363 +++++++++++------------
libavformat/alp.c | 15 +-
libavformat/amr.c | 17 +-
libavformat/amvenc.c | 15 +-
libavformat/apm.c | 13 +-
libavformat/apngenc.c | 19 +-
libavformat/argo_asf.c | 15 +-
libavformat/argo_cvg.c | 15 +-
libavformat/asfenc.c | 40 +--
libavformat/assenc.c | 17 +-
libavformat/astenc.c | 17 +-
libavformat/au.c | 19 +-
libavformat/avformat.c | 5 +-
libavformat/avformat.h | 109 -------
libavformat/avienc.c | 19 +-
libavformat/bit.c | 15 +-
libavformat/cafenc.c | 16 +-
libavformat/chromaprint.c | 13 +-
libavformat/codec2.c | 15 +-
libavformat/crcenc.c | 13 +-
libavformat/dashenc.c | 20 +-
libavformat/daudenc.c | 15 +-
libavformat/dvenc.c | 12 +-
libavformat/ffmetaenc.c | 11 +-
libavformat/fifo.c | 10 +-
libavformat/fifo_test.c | 11 +-
libavformat/filmstripenc.c | 13 +-
libavformat/fitsenc.c | 13 +-
libavformat/flacenc.c | 19 +-
libavformat/flvenc.c | 20 +-
libavformat/framecrcenc.c | 13 +-
libavformat/gif.c | 19 +-
libavformat/gxfenc.c | 12 +-
libavformat/hashenc.c | 71 ++---
libavformat/hdsenc.c | 14 +-
libavformat/hlsenc.c | 18 +-
libavformat/icoenc.c | 17 +-
libavformat/idroqenc.c | 13 +-
libavformat/ilbc.c | 15 +-
libavformat/img2enc.c | 25 +-
libavformat/internal.h | 3 +-
libavformat/ircamenc.c | 15 +-
libavformat/ivfenc.c | 14 +-
libavformat/jacosubenc.c | 15 +-
libavformat/kvag.c | 13 +-
libavformat/latmenc.c | 18 +-
libavformat/lrcenc.c | 14 +-
libavformat/matroskaenc.c | 62 ++--
libavformat/microdvdenc.c | 15 +-
libavformat/mkvtimestamp_v2.c | 11 +-
libavformat/mmf.c | 15 +-
libavformat/movenc.c | 170 +++++------
libavformat/mp3enc.c | 19 +-
libavformat/mpegenc.c | 99 +++----
libavformat/mpegtsenc.c | 18 +-
libavformat/mpjpeg.c | 19 +-
libavformat/mux.c | 77 ++---
libavformat/mux.h | 113 +++++++
libavformat/mux_utils.c | 4 +-
libavformat/mxfenc.c | 120 ++++----
libavformat/nullenc.c | 12 +-
libavformat/nutenc.c | 20 +-
libavformat/oggenc.c | 85 +++---
libavformat/omaenc.c | 17 +-
libavformat/pcmenc.c | 15 +-
libavformat/rawenc.c | 486 +++++++++++++++----------------
libavformat/rmenc.c | 17 +-
libavformat/rsoenc.c | 17 +-
libavformat/rtpenc.c | 15 +-
libavformat/rtpenc_mpegts.c | 13 +-
libavformat/rtspenc.c | 14 +-
libavformat/sapenc.c | 12 +-
libavformat/sccenc.c | 13 +-
libavformat/segafilmenc.c | 12 +-
libavformat/segment.c | 29 +-
libavformat/smjpegenc.c | 14 +-
libavformat/smoothstreamingenc.c | 14 +-
libavformat/soxenc.c | 15 +-
libavformat/spdifenc.c | 17 +-
libavformat/srtenc.c | 15 +-
libavformat/supenc.c | 15 +-
libavformat/swfenc.c | 31 +-
libavformat/tee.c | 10 +-
libavformat/ttaenc.c | 15 +-
libavformat/ttmlenc.c | 15 +-
libavformat/uncodedframecrcenc.c | 14 +-
libavformat/vc1testenc.c | 13 +-
libavformat/vocenc.c | 19 +-
libavformat/wavenc.c | 37 +--
libavformat/webm_chunk.c | 14 +-
libavformat/webmdashenc.c | 13 +-
libavformat/webpenc.c | 15 +-
libavformat/webvttenc.c | 15 +-
libavformat/westwood_audenc.c | 13 +-
libavformat/wtvenc.c | 14 +-
libavformat/wvenc.c | 17 +-
libavformat/yuv4mpegenc.c | 13 +-
115 files changed, 1731 insertions(+), 1644 deletions(-)
diff --git a/configure b/configure
index 47790d10f57..ceb563310f3 100755
--- a/configure
+++ b/configure
@@ -4008,9 +4008,9 @@ find_filters_extern(){
}
FILTER_LIST=$(find_filters_extern libavfilter/allfilters.c)
-OUTDEV_LIST=$(find_things_extern muxer AVOutputFormat libavdevice/alldevices.c outdev)
+OUTDEV_LIST=$(find_things_extern muxer FFOutputFormat libavdevice/alldevices.c outdev)
INDEV_LIST=$(find_things_extern demuxer AVInputFormat libavdevice/alldevices.c indev)
-MUXER_LIST=$(find_things_extern muxer AVOutputFormat libavformat/allformats.c)
+MUXER_LIST=$(find_things_extern muxer FFOutputFormat libavformat/allformats.c)
DEMUXER_LIST=$(find_things_extern demuxer AVInputFormat libavformat/allformats.c)
ENCODER_LIST=$(find_things_extern encoder FFCodec libavcodec/allcodecs.c)
DECODER_LIST=$(find_things_extern decoder FFCodec libavcodec/allcodecs.c)
@@ -7956,9 +7956,9 @@ print_enabled_components libavcodec/codec_list.c FFCodec codec_list $CODEC_LIST
print_enabled_components libavcodec/parser_list.c AVCodecParser parser_list $PARSER_LIST
print_enabled_components libavcodec/bsf_list.c FFBitStreamFilter bitstream_filters $BSF_LIST
print_enabled_components libavformat/demuxer_list.c AVInputFormat demuxer_list $DEMUXER_LIST
-print_enabled_components libavformat/muxer_list.c AVOutputFormat muxer_list $MUXER_LIST
+print_enabled_components libavformat/muxer_list.c FFOutputFormat muxer_list $MUXER_LIST
print_enabled_components libavdevice/indev_list.c AVInputFormat indev_list $INDEV_LIST
-print_enabled_components libavdevice/outdev_list.c AVOutputFormat outdev_list $OUTDEV_LIST
+print_enabled_components libavdevice/outdev_list.c FFOutputFormat outdev_list $OUTDEV_LIST
print_enabled_components libavformat/protocol_list.c URLProtocol url_protocols $PROTOCOL_LIST
# Settings for pkg-config files
diff --git a/libavdevice/alldevices.c b/libavdevice/alldevices.c
index 22323a0a44a..8a90fcb5d78 100644
--- a/libavdevice/alldevices.c
+++ b/libavdevice/alldevices.c
@@ -19,40 +19,41 @@
*/
#include "libavformat/internal.h"
+#include "libavformat/mux.h"
#include "avdevice.h"
/* devices */
extern const AVInputFormat ff_alsa_demuxer;
-extern const AVOutputFormat ff_alsa_muxer;
+extern const FFOutputFormat ff_alsa_muxer;
extern const AVInputFormat ff_android_camera_demuxer;
-extern const AVOutputFormat ff_audiotoolbox_muxer;
+extern const FFOutputFormat ff_audiotoolbox_muxer;
extern const AVInputFormat ff_avfoundation_demuxer;
extern const AVInputFormat ff_bktr_demuxer;
-extern const AVOutputFormat ff_caca_muxer;
+extern const FFOutputFormat ff_caca_muxer;
extern const AVInputFormat ff_decklink_demuxer;
-extern const AVOutputFormat ff_decklink_muxer;
+extern const FFOutputFormat ff_decklink_muxer;
extern const AVInputFormat ff_dshow_demuxer;
extern const AVInputFormat ff_fbdev_demuxer;
-extern const AVOutputFormat ff_fbdev_muxer;
+extern const FFOutputFormat ff_fbdev_muxer;
extern const AVInputFormat ff_gdigrab_demuxer;
extern const AVInputFormat ff_iec61883_demuxer;
extern const AVInputFormat ff_jack_demuxer;
extern const AVInputFormat ff_kmsgrab_demuxer;
extern const AVInputFormat ff_lavfi_demuxer;
extern const AVInputFormat ff_openal_demuxer;
-extern const AVOutputFormat ff_opengl_muxer;
+extern const FFOutputFormat ff_opengl_muxer;
extern const AVInputFormat ff_oss_demuxer;
-extern const AVOutputFormat ff_oss_muxer;
+extern const FFOutputFormat ff_oss_muxer;
extern const AVInputFormat ff_pulse_demuxer;
-extern const AVOutputFormat ff_pulse_muxer;
-extern const AVOutputFormat ff_sdl2_muxer;
+extern const FFOutputFormat ff_pulse_muxer;
+extern const FFOutputFormat ff_sdl2_muxer;
extern const AVInputFormat ff_sndio_demuxer;
-extern const AVOutputFormat ff_sndio_muxer;
+extern const FFOutputFormat ff_sndio_muxer;
extern const AVInputFormat ff_v4l2_demuxer;
-extern const AVOutputFormat ff_v4l2_muxer;
+extern const FFOutputFormat ff_v4l2_muxer;
extern const AVInputFormat ff_vfwcap_demuxer;
extern const AVInputFormat ff_xcbgrab_demuxer;
-extern const AVOutputFormat ff_xv_muxer;
+extern const FFOutputFormat ff_xv_muxer;
/* external libraries */
extern const AVInputFormat ff_libcdio_demuxer;
@@ -97,12 +98,12 @@ static const void *next_output(const AVOutputFormat *prev, AVClassCategory c2)
const AVClass *pc;
const AVClassCategory c1 = AV_CLASS_CATEGORY_DEVICE_OUTPUT;
AVClassCategory category = AV_CLASS_CATEGORY_NA;
- const AVOutputFormat *fmt = NULL;
+ const FFOutputFormat *fmt = NULL;
int i = 0;
while (prev && (fmt = outdev_list[i])) {
i++;
- if (prev == fmt)
+ if (prev == &fmt->p)
break;
}
@@ -110,7 +111,7 @@ static const void *next_output(const AVOutputFormat *prev, AVClassCategory c2)
fmt = outdev_list[i++];
if (!fmt)
break;
- pc = fmt->priv_class;
+ pc = fmt->p.priv_class;
if (!pc)
continue;
category = pc->category;
diff --git a/libavdevice/alsa_enc.c b/libavdevice/alsa_enc.c
index e461829d03b..62a20c7ba48 100644
--- a/libavdevice/alsa_enc.c
+++ b/libavdevice/alsa_enc.c
@@ -165,18 +165,18 @@ static const AVClass alsa_muxer_class = {
.category = AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT,
};
-const AVOutputFormat ff_alsa_muxer = {
- .name = "alsa",
- .long_name = NULL_IF_CONFIG_SMALL("ALSA audio output"),
+const FFOutputFormat ff_alsa_muxer = {
+ .p.name = "alsa",
+ .p.long_name = NULL_IF_CONFIG_SMALL("ALSA audio output"),
.priv_data_size = sizeof(AlsaData),
- .audio_codec = DEFAULT_CODEC_ID,
- .video_codec = AV_CODEC_ID_NONE,
+ .p.audio_codec = DEFAULT_CODEC_ID,
+ .p.video_codec = AV_CODEC_ID_NONE,
.write_header = audio_write_header,
.write_packet = audio_write_packet,
.write_trailer = ff_alsa_close,
.write_uncoded_frame = audio_write_frame,
.get_device_list = audio_get_device_list,
.get_output_timestamp = audio_get_output_timestamp,
- .flags = AVFMT_NOFILE,
- .priv_class = &alsa_muxer_class,
+ .p.flags = AVFMT_NOFILE,
+ .p.priv_class = &alsa_muxer_class,
};
diff --git a/libavdevice/audiotoolbox.m b/libavdevice/audiotoolbox.m
index 27a1fd4a78c..aa49e2c992a 100644
--- a/libavdevice/audiotoolbox.m
+++ b/libavdevice/audiotoolbox.m
@@ -30,6 +30,7 @@
#include "libavutil/opt.h"
#include "libavformat/internal.h"
+#include "libavformat/mux.h"
#include "libavutil/internal.h"
#include "avdevice.h"
@@ -294,15 +295,15 @@ static const AVClass at_class = {
.category = AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT,
};
-const AVOutputFormat ff_audiotoolbox_muxer = {
- .name = "audiotoolbox",
- .long_name = NULL_IF_CONFIG_SMALL("AudioToolbox output device"),
+const FFOutputFormat ff_audiotoolbox_muxer = {
+ .p.name = "audiotoolbox",
+ .p.long_name = NULL_IF_CONFIG_SMALL("AudioToolbox output device"),
.priv_data_size = sizeof(ATContext),
- .audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
- .video_codec = AV_CODEC_ID_NONE,
+ .p.audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
+ .p.video_codec = AV_CODEC_ID_NONE,
.write_header = at_write_header,
.write_packet = at_write_packet,
.write_trailer = at_write_trailer,
- .flags = AVFMT_NOFILE,
- .priv_class = &at_class,
+ .p.flags = AVFMT_NOFILE,
+ .p.priv_class = &at_class,
};
diff --git a/libavdevice/avdevice.c b/libavdevice/avdevice.c
index 58996404b3b..b47f89c4bf2 100644
--- a/libavdevice/avdevice.c
+++ b/libavdevice/avdevice.c
@@ -19,6 +19,7 @@
#include "libavutil/avassert.h"
#include "avdevice.h"
#include "internal.h"
+#include "libavformat/mux.h"
#if FF_API_DEVICE_CAPABILITIES
const AVOption av_device_capabilities[] = {
@@ -29,9 +30,9 @@ const AVOption av_device_capabilities[] = {
int avdevice_app_to_dev_control_message(struct AVFormatContext *s, enum AVAppToDevMessageType type,
void *data, size_t data_size)
{
- if (!s->oformat || !s->oformat->control_message)
+ if (!s->oformat || !ffofmt(s->oformat)->control_message)
return AVERROR(ENOSYS);
- return s->oformat->control_message(s, type, data, data_size);
+ return ffofmt(s->oformat)->control_message(s, type, data, data_size);
}
int avdevice_dev_to_app_control_message(struct AVFormatContext *s, enum AVDevToAppMessageType type,
@@ -61,7 +62,7 @@ int avdevice_list_devices(AVFormatContext *s, AVDeviceInfoList **device_list)
av_assert0(s);
av_assert0(device_list);
av_assert0(s->oformat || s->iformat);
- if ((s->oformat && !s->oformat->get_device_list) ||
+ if ((s->oformat && !ffofmt(s->oformat)->get_device_list) ||
(s->iformat && !s->iformat->get_device_list)) {
*device_list = NULL;
return AVERROR(ENOSYS);
@@ -72,7 +73,7 @@ int avdevice_list_devices(AVFormatContext *s, AVDeviceInfoList **device_list)
/* no default device by default */
(*device_list)->default_device = -1;
if (s->oformat)
- ret = s->oformat->get_device_list(s, *device_list);
+ ret = ffofmt(s->oformat)->get_device_list(s, *device_list);
else
ret = s->iformat->get_device_list(s, *device_list);
if (ret < 0) {
diff --git a/libavdevice/caca.c b/libavdevice/caca.c
index 5536fd036ed..6af1649137e 100644
--- a/libavdevice/caca.c
+++ b/libavdevice/caca.c
@@ -21,6 +21,7 @@
#include <caca.h>
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
+#include "libavformat/mux.h"
#include "avdevice.h"
typedef struct CACAContext {
@@ -220,15 +221,15 @@ static const AVClass caca_class = {
.category = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT,
};
-const AVOutputFormat ff_caca_muxer = {
- .name = "caca",
- .long_name = NULL_IF_CONFIG_SMALL("caca (color ASCII art) output device"),
+const FFOutputFormat ff_caca_muxer = {
+ .p.name = "caca",
+ .p.long_name = NULL_IF_CONFIG_SMALL("caca (color ASCII art) output device"),
.priv_data_size = sizeof(CACAContext),
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_RAWVIDEO,
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_RAWVIDEO,
.write_header = caca_write_header,
.write_packet = caca_write_packet,
.deinit = caca_deinit,
- .flags = AVFMT_NOFILE,
- .priv_class = &caca_class,
+ .p.flags = AVFMT_NOFILE,
+ .p.priv_class = &caca_class,
};
diff --git a/libavdevice/decklink_enc_c.c b/libavdevice/decklink_enc_c.c
index 990fbb81684..f7e315057fc 100644
--- a/libavdevice/decklink_enc_c.c
+++ b/libavdevice/decklink_enc_c.c
@@ -20,6 +20,7 @@
*/
#include "libavformat/avformat.h"
+#include "libavformat/mux.h"
#include "libavutil/opt.h"
#include "decklink_common_c.h"
@@ -71,15 +72,15 @@ static const AVClass decklink_muxer_class = {
.category = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT,
};
-const AVOutputFormat ff_decklink_muxer = {
- .name = "decklink",
- .long_name = NULL_IF_CONFIG_SMALL("Blackmagic DeckLink output"),
- .audio_codec = AV_CODEC_ID_PCM_S16LE,
- .video_codec = AV_CODEC_ID_WRAPPED_AVFRAME,
- .subtitle_codec = AV_CODEC_ID_NONE,
- .flags = AVFMT_NOFILE,
+const FFOutputFormat ff_decklink_muxer = {
+ .p.name = "decklink",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Blackmagic DeckLink output"),
+ .p.audio_codec = AV_CODEC_ID_PCM_S16LE,
+ .p.video_codec = AV_CODEC_ID_WRAPPED_AVFRAME,
+ .p.subtitle_codec = AV_CODEC_ID_NONE,
+ .p.flags = AVFMT_NOFILE,
+ .p.priv_class = &decklink_muxer_class,
.get_device_list = ff_decklink_list_output_devices,
- .priv_class = &decklink_muxer_class,
.priv_data_size = sizeof(struct decklink_cctx),
.write_header = ff_decklink_write_header,
.write_packet = ff_decklink_write_packet,
diff --git a/libavdevice/fbdev_enc.c b/libavdevice/fbdev_enc.c
index 77233880e7d..7f3e8e5935f 100644
--- a/libavdevice/fbdev_enc.c
+++ b/libavdevice/fbdev_enc.c
@@ -28,6 +28,7 @@
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "libavformat/avformat.h"
+#include "libavformat/mux.h"
#include "fbdev_common.h"
#include "avdevice.h"
@@ -206,16 +207,16 @@ static const AVClass fbdev_class = {
.category = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT,
};
-const AVOutputFormat ff_fbdev_muxer = {
- .name = "fbdev",
- .long_name = NULL_IF_CONFIG_SMALL("Linux framebuffer"),
+const FFOutputFormat ff_fbdev_muxer = {
+ .p.name = "fbdev",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Linux framebuffer"),
.priv_data_size = sizeof(FBDevContext),
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_RAWVIDEO,
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_RAWVIDEO,
.write_header = fbdev_write_header,
.write_packet = fbdev_write_packet,
.write_trailer = fbdev_write_trailer,
.get_device_list = fbdev_get_device_list,
- .flags = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS,
- .priv_class = &fbdev_class,
+ .p.flags = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS,
+ .p.priv_class = &fbdev_class,
};
diff --git a/libavdevice/opengl_enc.c b/libavdevice/opengl_enc.c
index b2140c80be5..06750bbba1e 100644
--- a/libavdevice/opengl_enc.c
+++ b/libavdevice/opengl_enc.c
@@ -1292,17 +1292,17 @@ static const AVClass opengl_class = {
.category = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT,
};
-const AVOutputFormat ff_opengl_muxer = {
- .name = "opengl",
- .long_name = NULL_IF_CONFIG_SMALL("OpenGL output"),
+const FFOutputFormat ff_opengl_muxer = {
+ .p.name = "opengl",
+ .p.long_name = NULL_IF_CONFIG_SMALL("OpenGL output"),
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_WRAPPED_AVFRAME,
+ .p.flags = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS,
+ .p.priv_class = &opengl_class,
.priv_data_size = sizeof(OpenGLContext),
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_WRAPPED_AVFRAME,
.write_header = opengl_write_header,
.write_packet = opengl_write_packet,
.write_uncoded_frame = opengl_write_frame,
.write_trailer = opengl_write_trailer,
.control_message = opengl_control_message,
- .flags = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS,
- .priv_class = &opengl_class,
};
diff --git a/libavdevice/oss_enc.c b/libavdevice/oss_enc.c
index 704f434c53a..c125e6c0e9f 100644
--- a/libavdevice/oss_enc.c
+++ b/libavdevice/oss_enc.c
@@ -32,6 +32,7 @@
#include "avdevice.h"
#include "libavformat/internal.h"
+#include "libavformat/mux.h"
#include "oss.h"
@@ -94,18 +95,18 @@ static const AVClass oss_muxer_class = {
.category = AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT,
};
-const AVOutputFormat ff_oss_muxer = {
- .name = "oss",
- .long_name = NULL_IF_CONFIG_SMALL("OSS (Open Sound System) playback"),
+const FFOutputFormat ff_oss_muxer = {
+ .p.name = "oss",
+ .p.long_name = NULL_IF_CONFIG_SMALL("OSS (Open Sound System) playback"),
.priv_data_size = sizeof(OSSAudioData),
/* XXX: we make the assumption that the soundcard accepts this format */
/* XXX: find better solution with "preinit" method, needed also in
other formats */
- .audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
- .video_codec = AV_CODEC_ID_NONE,
+ .p.audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
+ .p.video_codec = AV_CODEC_ID_NONE,
.write_header = audio_write_header,
.write_packet = audio_write_packet,
.write_trailer = audio_write_trailer,
- .flags = AVFMT_NOFILE,
- .priv_class = &oss_muxer_class,
+ .p.flags = AVFMT_NOFILE,
+ .p.priv_class = &oss_muxer_class,
};
diff --git a/libavdevice/pulse_audio_enc.c b/libavdevice/pulse_audio_enc.c
index 038401c680c..3d8323233f7 100644
--- a/libavdevice/pulse_audio_enc.c
+++ b/libavdevice/pulse_audio_enc.c
@@ -788,12 +788,12 @@ static const AVClass pulse_muxer_class = {
.category = AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT,
};
-const AVOutputFormat ff_pulse_muxer = {
- .name = "pulse",
- .long_name = NULL_IF_CONFIG_SMALL("Pulse audio output"),
+const FFOutputFormat ff_pulse_muxer = {
+ .p.name = "pulse",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Pulse audio output"),
.priv_data_size = sizeof(PulseData),
- .audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
- .video_codec = AV_CODEC_ID_NONE,
+ .p.audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
+ .p.video_codec = AV_CODEC_ID_NONE,
.write_header = pulse_write_header,
.write_packet = pulse_write_packet,
.write_uncoded_frame = pulse_write_frame,
@@ -801,6 +801,6 @@ const AVOutputFormat ff_pulse_muxer = {
.get_output_timestamp = pulse_get_output_timestamp,
.get_device_list = pulse_get_device_list,
.control_message = pulse_control_message,
- .flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH,
- .priv_class = &pulse_muxer_class,
+ .p.flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH,
+ .p.priv_class = &pulse_muxer_class,
};
diff --git a/libavdevice/sdl2.c b/libavdevice/sdl2.c
index a9023153f13..342a253dc09 100644
--- a/libavdevice/sdl2.c
+++ b/libavdevice/sdl2.c
@@ -33,6 +33,7 @@
#include "libavutil/pixdesc.h"
#include "libavutil/time.h"
#include "avdevice.h"
+#include "libavformat/mux.h"
typedef struct {
AVClass *class;
@@ -355,15 +356,15 @@ static const AVClass sdl2_class = {
.category = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT,
};
-const AVOutputFormat ff_sdl2_muxer = {
- .name = "sdl,sdl2",
- .long_name = NULL_IF_CONFIG_SMALL("SDL2 output device"),
+const FFOutputFormat ff_sdl2_muxer = {
+ .p.name = "sdl,sdl2",
+ .p.long_name = NULL_IF_CONFIG_SMALL("SDL2 output device"),
.priv_data_size = sizeof(SDLContext),
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_RAWVIDEO,
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_RAWVIDEO,
.write_header = sdl2_write_header,
.write_packet = sdl2_write_packet,
.write_trailer = sdl2_write_trailer,
- .flags = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS,
- .priv_class = &sdl2_class,
+ .p.flags = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS,
+ .p.priv_class = &sdl2_class,
};
diff --git a/libavdevice/sndio_enc.c b/libavdevice/sndio_enc.c
index 0cf58fdc6ab..578e287a41f 100644
--- a/libavdevice/sndio_enc.c
+++ b/libavdevice/sndio_enc.c
@@ -24,6 +24,7 @@
#include "libavutil/internal.h"
+#include "libavformat/mux.h"
#include "libavdevice/avdevice.h"
#include "libavdevice/sndio.h"
@@ -86,18 +87,18 @@ static const AVClass sndio_muxer_class = {
.category = AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT,
};
-const AVOutputFormat ff_sndio_muxer = {
- .name = "sndio",
- .long_name = NULL_IF_CONFIG_SMALL("sndio audio playback"),
+const FFOutputFormat ff_sndio_muxer = {
+ .p.name = "sndio",
+ .p.long_name = NULL_IF_CONFIG_SMALL("sndio audio playback"),
.priv_data_size = sizeof(SndioData),
/* XXX: we make the assumption that the soundcard accepts this format */
/* XXX: find better solution with "preinit" method, needed also in
other formats */
- .audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
- .video_codec = AV_CODEC_ID_NONE,
+ .p.audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
+ .p.video_codec = AV_CODEC_ID_NONE,
.write_header = audio_write_header,
.write_packet = audio_write_packet,
.write_trailer = audio_write_trailer,
- .flags = AVFMT_NOFILE,
- .priv_class = &sndio_muxer_class,
+ .p.flags = AVFMT_NOFILE,
+ .p.priv_class = &sndio_muxer_class,
};
diff --git a/libavdevice/v4l2enc.c b/libavdevice/v4l2enc.c
index b1006461b7a..8e8f911996c 100644
--- a/libavdevice/v4l2enc.c
+++ b/libavdevice/v4l2enc.c
@@ -21,6 +21,7 @@
#include "libavutil/imgutils.h"
#include "libavutil/pixdesc.h"
#include "libavformat/avformat.h"
+#include "libavformat/mux.h"
#include "v4l2-common.h"
typedef struct {
@@ -111,15 +112,15 @@ static const AVClass v4l2_class = {
.category = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT,
};
-const AVOutputFormat ff_v4l2_muxer = {
- .name = "video4linux2,v4l2",
- .long_name = NULL_IF_CONFIG_SMALL("Video4Linux2 output device"),
+const FFOutputFormat ff_v4l2_muxer = {
+ .p.name = "video4linux2,v4l2",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Video4Linux2 output device"),
.priv_data_size = sizeof(V4L2Context),
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_RAWVIDEO,
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_RAWVIDEO,
.write_header = write_header,
.write_packet = write_packet,
.write_trailer = write_trailer,
- .flags = AVFMT_NOFILE,
- .priv_class = &v4l2_class,
+ .p.flags = AVFMT_NOFILE,
+ .p.priv_class = &v4l2_class,
};
diff --git a/libavdevice/xv.c b/libavdevice/xv.c
index 348c289beae..441f8541218 100644
--- a/libavdevice/xv.c
+++ b/libavdevice/xv.c
@@ -376,17 +376,17 @@ static const AVClass xv_class = {
.category = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT,
};
-const AVOutputFormat ff_xv_muxer = {
- .name = "xv",
- .long_name = NULL_IF_CONFIG_SMALL("XV (XVideo) output device"),
+const FFOutputFormat ff_xv_muxer = {
+ .p.name = "xv",
+ .p.long_name = NULL_IF_CONFIG_SMALL("XV (XVideo) output device"),
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_WRAPPED_AVFRAME,
+ .p.flags = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS,
+ .p.priv_class = &xv_class,
.priv_data_size = sizeof(XVContext),
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_WRAPPED_AVFRAME,
.write_header = xv_write_header,
.write_packet = xv_write_packet,
.write_uncoded_frame = xv_write_frame,
.write_trailer = xv_write_trailer,
.control_message = xv_control_message,
- .flags = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS,
- .priv_class = &xv_class,
};
diff --git a/libavformat/a64.c b/libavformat/a64.c
index a66f2542b7e..23b20fc8b79 100644
--- a/libavformat/a64.c
+++ b/libavformat/a64.c
@@ -23,6 +23,7 @@
#include "libavcodec/codec_id.h"
#include "libavcodec/codec_par.h"
#include "avformat.h"
+#include "mux.h"
#include "rawenc.h"
static int a64_write_header(AVFormatContext *s)
@@ -59,11 +60,11 @@ static int a64_write_header(AVFormatContext *s)
return 0;
}
-const AVOutputFormat ff_a64_muxer = {
- .name = "a64",
- .long_name = NULL_IF_CONFIG_SMALL("a64 - video for Commodore 64"),
- .extensions = "a64, A64",
- .video_codec = AV_CODEC_ID_A64_MULTI,
+const FFOutputFormat ff_a64_muxer = {
+ .p.name = "a64",
+ .p.long_name = NULL_IF_CONFIG_SMALL("a64 - video for Commodore 64"),
+ .p.extensions = "a64, A64",
+ .p.video_codec = AV_CODEC_ID_A64_MULTI,
.write_header = a64_write_header,
.write_packet = ff_raw_write_packet,
};
diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c
index 5f2461cc6c6..b5e9640544b 100644
--- a/libavformat/adtsenc.c
+++ b/libavformat/adtsenc.c
@@ -31,6 +31,7 @@
#include "avformat.h"
#include "apetag.h"
#include "id3v2.h"
+#include "mux.h"
#define ADTS_HEADER_SIZE 7
@@ -232,18 +233,18 @@ static const AVClass adts_muxer_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVOutputFormat ff_adts_muxer = {
- .name = "adts",
- .long_name = NULL_IF_CONFIG_SMALL("ADTS AAC (Advanced Audio Coding)"),
- .mime_type = "audio/aac",
- .extensions = "aac,adts",
+const FFOutputFormat ff_adts_muxer = {
+ .p.name = "adts",
+ .p.long_name = NULL_IF_CONFIG_SMALL("ADTS AAC (Advanced Audio Coding)"),
+ .p.mime_type = "audio/aac",
+ .p.extensions = "aac,adts",
.priv_data_size = sizeof(ADTSContext),
- .audio_codec = AV_CODEC_ID_AAC,
- .video_codec = AV_CODEC_ID_NONE,
+ .p.audio_codec = AV_CODEC_ID_AAC,
+ .p.video_codec = AV_CODEC_ID_NONE,
.init = adts_init,
.write_header = adts_write_header,
.write_packet = adts_write_packet,
.write_trailer = adts_write_trailer,
- .priv_class = &adts_muxer_class,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.priv_class = &adts_muxer_class,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
diff --git a/libavformat/aiffenc.c b/libavformat/aiffenc.c
index bdaf5c2c3e4..11a5b18d573 100644
--- a/libavformat/aiffenc.c
+++ b/libavformat/aiffenc.c
@@ -30,6 +30,7 @@
#include "avio_internal.h"
#include "isom.h"
#include "id3v2.h"
+#include "mux.h"
typedef struct AIFFOutputContext {
const AVClass *class;
@@ -284,18 +285,18 @@ static const AVClass aiff_muxer_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVOutputFormat ff_aiff_muxer = {
- .name = "aiff",
- .long_name = NULL_IF_CONFIG_SMALL("Audio IFF"),
- .mime_type = "audio/aiff",
- .extensions = "aif,aiff,afc,aifc",
+const FFOutputFormat ff_aiff_muxer = {
+ .p.name = "aiff",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Audio IFF"),
+ .p.mime_type = "audio/aiff",
+ .p.extensions = "aif,aiff,afc,aifc",
.priv_data_size = sizeof(AIFFOutputContext),
- .audio_codec = AV_CODEC_ID_PCM_S16BE,
- .video_codec = AV_CODEC_ID_PNG,
+ .p.audio_codec = AV_CODEC_ID_PCM_S16BE,
+ .p.video_codec = AV_CODEC_ID_PNG,
.write_header = aiff_write_header,
.write_packet = aiff_write_packet,
.write_trailer = aiff_write_trailer,
.deinit = aiff_deinit,
- .codec_tag = ff_aiff_codec_tags_list,
- .priv_class = &aiff_muxer_class,
+ .p.codec_tag = ff_aiff_codec_tags_list,
+ .p.priv_class = &aiff_muxer_class,
};
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 2d31956fd57..54ecf82a043 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -25,82 +25,83 @@
#include "libavformat/internal.h"
#include "avformat.h"
+#include "mux.h"
/* (de)muxers */
-extern const AVOutputFormat ff_a64_muxer;
+extern const FFOutputFormat ff_a64_muxer;
extern const AVInputFormat ff_aa_demuxer;
extern const AVInputFormat ff_aac_demuxer;
extern const AVInputFormat ff_aax_demuxer;
extern const AVInputFormat ff_ac3_demuxer;
-extern const AVOutputFormat ff_ac3_muxer;
+extern const FFOutputFormat ff_ac3_muxer;
extern const AVInputFormat ff_ace_demuxer;
extern const AVInputFormat ff_acm_demuxer;
extern const AVInputFormat ff_act_demuxer;
extern const AVInputFormat ff_adf_demuxer;
extern const AVInputFormat ff_adp_demuxer;
extern const AVInputFormat ff_ads_demuxer;
-extern const AVOutputFormat ff_adts_muxer;
+extern const FFOutputFormat ff_adts_muxer;
extern const AVInputFormat ff_adx_demuxer;
-extern const AVOutputFormat ff_adx_muxer;
+extern const FFOutputFormat ff_adx_muxer;
extern const AVInputFormat ff_aea_demuxer;
extern const AVInputFormat ff_afc_demuxer;
extern const AVInputFormat ff_aiff_demuxer;
-extern const AVOutputFormat ff_aiff_muxer;
+extern const FFOutputFormat ff_aiff_muxer;
extern const AVInputFormat ff_aix_demuxer;
extern const AVInputFormat ff_alp_demuxer;
-extern const AVOutputFormat ff_alp_muxer;
+extern const FFOutputFormat ff_alp_muxer;
extern const AVInputFormat ff_amr_demuxer;
-extern const AVOutputFormat ff_amr_muxer;
+extern const FFOutputFormat ff_amr_muxer;
extern const AVInputFormat ff_amrnb_demuxer;
extern const AVInputFormat ff_amrwb_demuxer;
-extern const AVOutputFormat ff_amv_muxer;
+extern const FFOutputFormat ff_amv_muxer;
extern const AVInputFormat ff_anm_demuxer;
extern const AVInputFormat ff_apac_demuxer;
extern const AVInputFormat ff_apc_demuxer;
extern const AVInputFormat ff_ape_demuxer;
extern const AVInputFormat ff_apm_demuxer;
-extern const AVOutputFormat ff_apm_muxer;
+extern const FFOutputFormat ff_apm_muxer;
extern const AVInputFormat ff_apng_demuxer;
-extern const AVOutputFormat ff_apng_muxer;
+extern const FFOutputFormat ff_apng_muxer;
extern const AVInputFormat ff_aptx_demuxer;
-extern const AVOutputFormat ff_aptx_muxer;
+extern const FFOutputFormat ff_aptx_muxer;
extern const AVInputFormat ff_aptx_hd_demuxer;
-extern const AVOutputFormat ff_aptx_hd_muxer;
+extern const FFOutputFormat ff_aptx_hd_muxer;
extern const AVInputFormat ff_aqtitle_demuxer;
extern const AVInputFormat ff_argo_asf_demuxer;
-extern const AVOutputFormat ff_argo_asf_muxer;
+extern const FFOutputFormat ff_argo_asf_muxer;
extern const AVInputFormat ff_argo_brp_demuxer;
extern const AVInputFormat ff_argo_cvg_demuxer;
-extern const AVOutputFormat ff_argo_cvg_muxer;
+extern const FFOutputFormat ff_argo_cvg_muxer;
extern const AVInputFormat ff_asf_demuxer;
-extern const AVOutputFormat ff_asf_muxer;
+extern const FFOutputFormat ff_asf_muxer;
extern const AVInputFormat ff_asf_o_demuxer;
extern const AVInputFormat ff_ass_demuxer;
-extern const AVOutputFormat ff_ass_muxer;
+extern const FFOutputFormat ff_ass_muxer;
extern const AVInputFormat ff_ast_demuxer;
-extern const AVOutputFormat ff_ast_muxer;
-extern const AVOutputFormat ff_asf_stream_muxer;
+extern const FFOutputFormat ff_ast_muxer;
+extern const FFOutputFormat ff_asf_stream_muxer;
extern const AVInputFormat ff_au_demuxer;
-extern const AVOutputFormat ff_au_muxer;
+extern const FFOutputFormat ff_au_muxer;
extern const AVInputFormat ff_av1_demuxer;
extern const AVInputFormat ff_avi_demuxer;
-extern const AVOutputFormat ff_avi_muxer;
-extern const AVOutputFormat ff_avif_muxer;
+extern const FFOutputFormat ff_avi_muxer;
+extern const FFOutputFormat ff_avif_muxer;
extern const AVInputFormat ff_avisynth_demuxer;
-extern const AVOutputFormat ff_avm2_muxer;
+extern const FFOutputFormat ff_avm2_muxer;
extern const AVInputFormat ff_avr_demuxer;
extern const AVInputFormat ff_avs_demuxer;
extern const AVInputFormat ff_avs2_demuxer;
-extern const AVOutputFormat ff_avs2_muxer;
+extern const FFOutputFormat ff_avs2_muxer;
extern const AVInputFormat ff_avs3_demuxer;
-extern const AVOutputFormat ff_avs3_muxer;
+extern const FFOutputFormat ff_avs3_muxer;
extern const AVInputFormat ff_bethsoftvid_demuxer;
extern const AVInputFormat ff_bfi_demuxer;
extern const AVInputFormat ff_bintext_demuxer;
extern const AVInputFormat ff_bink_demuxer;
extern const AVInputFormat ff_binka_demuxer;
extern const AVInputFormat ff_bit_demuxer;
-extern const AVOutputFormat ff_bit_muxer;
+extern const FFOutputFormat ff_bit_muxer;
extern const AVInputFormat ff_bitpacked_demuxer;
extern const AVInputFormat ff_bmv_demuxer;
extern const AVInputFormat ff_bfstm_demuxer;
@@ -109,190 +110,190 @@ extern const AVInputFormat ff_boa_demuxer;
extern const AVInputFormat ff_bonk_demuxer;
extern const AVInputFormat ff_c93_demuxer;
extern const AVInputFormat ff_caf_demuxer;
-extern const AVOutputFormat ff_caf_muxer;
+extern const FFOutputFormat ff_caf_muxer;
extern const AVInputFormat ff_cavsvideo_demuxer;
-extern const AVOutputFormat ff_cavsvideo_muxer;
+extern const FFOutputFormat ff_cavsvideo_muxer;
extern const AVInputFormat ff_cdg_demuxer;
extern const AVInputFormat ff_cdxl_demuxer;
extern const AVInputFormat ff_cine_demuxer;
extern const AVInputFormat ff_codec2_demuxer;
-extern const AVOutputFormat ff_codec2_muxer;
+extern const FFOutputFormat ff_codec2_muxer;
extern const AVInputFormat ff_codec2raw_demuxer;
-extern const AVOutputFormat ff_codec2raw_muxer;
+extern const FFOutputFormat ff_codec2raw_muxer;
extern const AVInputFormat ff_concat_demuxer;
-extern const AVOutputFormat ff_crc_muxer;
+extern const FFOutputFormat ff_crc_muxer;
extern const AVInputFormat ff_dash_demuxer;
-extern const AVOutputFormat ff_dash_muxer;
+extern const FFOutputFormat ff_dash_muxer;
extern const AVInputFormat ff_data_demuxer;
-extern const AVOutputFormat ff_data_muxer;
+extern const FFOutputFormat ff_data_muxer;
extern const AVInputFormat ff_daud_demuxer;
-extern const AVOutputFormat ff_daud_muxer;
+extern const FFOutputFormat ff_daud_muxer;
extern const AVInputFormat ff_dcstr_demuxer;
extern const AVInputFormat ff_derf_demuxer;
extern const AVInputFormat ff_dfa_demuxer;
extern const AVInputFormat ff_dfpwm_demuxer;
-extern const AVOutputFormat ff_dfpwm_muxer;
+extern const FFOutputFormat ff_dfpwm_muxer;
extern const AVInputFormat ff_dhav_demuxer;
extern const AVInputFormat ff_dirac_demuxer;
-extern const AVOutputFormat ff_dirac_muxer;
+extern const FFOutputFormat ff_dirac_muxer;
extern const AVInputFormat ff_dnxhd_demuxer;
-extern const AVOutputFormat ff_dnxhd_muxer;
+extern const FFOutputFormat ff_dnxhd_muxer;
extern const AVInputFormat ff_dsf_demuxer;
extern const AVInputFormat ff_dsicin_demuxer;
extern const AVInputFormat ff_dss_demuxer;
extern const AVInputFormat ff_dts_demuxer;
-extern const AVOutputFormat ff_dts_muxer;
+extern const FFOutputFormat ff_dts_muxer;
extern const AVInputFormat ff_dtshd_demuxer;
extern const AVInputFormat ff_dv_demuxer;
-extern const AVOutputFormat ff_dv_muxer;
+extern const FFOutputFormat ff_dv_muxer;
extern const AVInputFormat ff_dvbsub_demuxer;
extern const AVInputFormat ff_dvbtxt_demuxer;
extern const AVInputFormat ff_dxa_demuxer;
extern const AVInputFormat ff_ea_demuxer;
extern const AVInputFormat ff_ea_cdata_demuxer;
extern const AVInputFormat ff_eac3_demuxer;
-extern const AVOutputFormat ff_eac3_muxer;
+extern const FFOutputFormat ff_eac3_muxer;
extern const AVInputFormat ff_epaf_demuxer;
-extern const AVOutputFormat ff_f4v_muxer;
+extern const FFOutputFormat ff_f4v_muxer;
extern const AVInputFormat ff_ffmetadata_demuxer;
-extern const AVOutputFormat ff_ffmetadata_muxer;
-extern const AVOutputFormat ff_fifo_muxer;
-extern const AVOutputFormat ff_fifo_test_muxer;
+extern const FFOutputFormat ff_ffmetadata_muxer;
+extern const FFOutputFormat ff_fifo_muxer;
+extern const FFOutputFormat ff_fifo_test_muxer;
extern const AVInputFormat ff_filmstrip_demuxer;
-extern const AVOutputFormat ff_filmstrip_muxer;
+extern const FFOutputFormat ff_filmstrip_muxer;
extern const AVInputFormat ff_fits_demuxer;
-extern const AVOutputFormat ff_fits_muxer;
+extern const FFOutputFormat ff_fits_muxer;
extern const AVInputFormat ff_flac_demuxer;
-extern const AVOutputFormat ff_flac_muxer;
+extern const FFOutputFormat ff_flac_muxer;
extern const AVInputFormat ff_flic_demuxer;
extern const AVInputFormat ff_flv_demuxer;
-extern const AVOutputFormat ff_flv_muxer;
+extern const FFOutputFormat ff_flv_muxer;
extern const AVInputFormat ff_live_flv_demuxer;
extern const AVInputFormat ff_fourxm_demuxer;
-extern const AVOutputFormat ff_framecrc_muxer;
-extern const AVOutputFormat ff_framehash_muxer;
-extern const AVOutputFormat ff_framemd5_muxer;
+extern const FFOutputFormat ff_framecrc_muxer;
+extern const FFOutputFormat ff_framehash_muxer;
+extern const FFOutputFormat ff_framemd5_muxer;
extern const AVInputFormat ff_frm_demuxer;
extern const AVInputFormat ff_fsb_demuxer;
extern const AVInputFormat ff_fwse_demuxer;
extern const AVInputFormat ff_g722_demuxer;
-extern const AVOutputFormat ff_g722_muxer;
+extern const FFOutputFormat ff_g722_muxer;
extern const AVInputFormat ff_g723_1_demuxer;
-extern const AVOutputFormat ff_g723_1_muxer;
+extern const FFOutputFormat ff_g723_1_muxer;
extern const AVInputFormat ff_g726_demuxer;
-extern const AVOutputFormat ff_g726_muxer;
+extern const FFOutputFormat ff_g726_muxer;
extern const AVInputFormat ff_g726le_demuxer;
-extern const AVOutputFormat ff_g726le_muxer;
+extern const FFOutputFormat ff_g726le_muxer;
extern const AVInputFormat ff_g729_demuxer;
extern const AVInputFormat ff_gdv_demuxer;
extern const AVInputFormat ff_genh_demuxer;
extern const AVInputFormat ff_gif_demuxer;
-extern const AVOutputFormat ff_gif_muxer;
+extern const FFOutputFormat ff_gif_muxer;
extern const AVInputFormat ff_gsm_demuxer;
-extern const AVOutputFormat ff_gsm_muxer;
+extern const FFOutputFormat ff_gsm_muxer;
extern const AVInputFormat ff_gxf_demuxer;
-extern const AVOutputFormat ff_gxf_muxer;
+extern const FFOutputFormat ff_gxf_muxer;
extern const AVInputFormat ff_h261_demuxer;
-extern const AVOutputFormat ff_h261_muxer;
+extern const FFOutputFormat ff_h261_muxer;
extern const AVInputFormat ff_h263_demuxer;
-extern const AVOutputFormat ff_h263_muxer;
+extern const FFOutputFormat ff_h263_muxer;
extern const AVInputFormat ff_h264_demuxer;
-extern const AVOutputFormat ff_h264_muxer;
-extern const AVOutputFormat ff_hash_muxer;
+extern const FFOutputFormat ff_h264_muxer;
+extern const FFOutputFormat ff_hash_muxer;
extern const AVInputFormat ff_hca_demuxer;
extern const AVInputFormat ff_hcom_demuxer;
-extern const AVOutputFormat ff_hds_muxer;
+extern const FFOutputFormat ff_hds_muxer;
extern const AVInputFormat ff_hevc_demuxer;
-extern const AVOutputFormat ff_hevc_muxer;
+extern const FFOutputFormat ff_hevc_muxer;
extern const AVInputFormat ff_hls_demuxer;
-extern const AVOutputFormat ff_hls_muxer;
+extern const FFOutputFormat ff_hls_muxer;
extern const AVInputFormat ff_hnm_demuxer;
extern const AVInputFormat ff_ico_demuxer;
-extern const AVOutputFormat ff_ico_muxer;
+extern const FFOutputFormat ff_ico_muxer;
extern const AVInputFormat ff_idcin_demuxer;
extern const AVInputFormat ff_idf_demuxer;
extern const AVInputFormat ff_iff_demuxer;
extern const AVInputFormat ff_ifv_demuxer;
extern const AVInputFormat ff_ilbc_demuxer;
-extern const AVOutputFormat ff_ilbc_muxer;
+extern const FFOutputFormat ff_ilbc_muxer;
extern const AVInputFormat ff_image2_demuxer;
-extern const AVOutputFormat ff_image2_muxer;
+extern const FFOutputFormat ff_image2_muxer;
extern const AVInputFormat ff_image2pipe_demuxer;
-extern const AVOutputFormat ff_image2pipe_muxer;
+extern const FFOutputFormat ff_image2pipe_muxer;
extern const AVInputFormat ff_image2_alias_pix_demuxer;
extern const AVInputFormat ff_image2_brender_pix_demuxer;
extern const AVInputFormat ff_imf_demuxer;
extern const AVInputFormat ff_ingenient_demuxer;
extern const AVInputFormat ff_ipmovie_demuxer;
-extern const AVOutputFormat ff_ipod_muxer;
+extern const FFOutputFormat ff_ipod_muxer;
extern const AVInputFormat ff_ipu_demuxer;
extern const AVInputFormat ff_ircam_demuxer;
-extern const AVOutputFormat ff_ircam_muxer;
-extern const AVOutputFormat ff_ismv_muxer;
+extern const FFOutputFormat ff_ircam_muxer;
+extern const FFOutputFormat ff_ismv_muxer;
extern const AVInputFormat ff_iss_demuxer;
extern const AVInputFormat ff_iv8_demuxer;
extern const AVInputFormat ff_ivf_demuxer;
-extern const AVOutputFormat ff_ivf_muxer;
+extern const FFOutputFormat ff_ivf_muxer;
extern const AVInputFormat ff_ivr_demuxer;
extern const AVInputFormat ff_jacosub_demuxer;
-extern const AVOutputFormat ff_jacosub_muxer;
+extern const FFOutputFormat ff_jacosub_muxer;
extern const AVInputFormat ff_jv_demuxer;
extern const AVInputFormat ff_kux_demuxer;
extern const AVInputFormat ff_kvag_demuxer;
-extern const AVOutputFormat ff_kvag_muxer;
+extern const FFOutputFormat ff_kvag_muxer;
extern const AVInputFormat ff_laf_demuxer;
-extern const AVOutputFormat ff_latm_muxer;
+extern const FFOutputFormat ff_latm_muxer;
extern const AVInputFormat ff_lmlm4_demuxer;
extern const AVInputFormat ff_loas_demuxer;
extern const AVInputFormat ff_luodat_demuxer;
extern const AVInputFormat ff_lrc_demuxer;
-extern const AVOutputFormat ff_lrc_muxer;
+extern const FFOutputFormat ff_lrc_muxer;
extern const AVInputFormat ff_lvf_demuxer;
extern const AVInputFormat ff_lxf_demuxer;
extern const AVInputFormat ff_m4v_demuxer;
-extern const AVOutputFormat ff_m4v_muxer;
+extern const FFOutputFormat ff_m4v_muxer;
extern const AVInputFormat ff_mca_demuxer;
extern const AVInputFormat ff_mcc_demuxer;
-extern const AVOutputFormat ff_md5_muxer;
+extern const FFOutputFormat ff_md5_muxer;
extern const AVInputFormat ff_matroska_demuxer;
-extern const AVOutputFormat ff_matroska_muxer;
-extern const AVOutputFormat ff_matroska_audio_muxer;
+extern const FFOutputFormat ff_matroska_muxer;
+extern const FFOutputFormat ff_matroska_audio_muxer;
extern const AVInputFormat ff_mgsts_demuxer;
extern const AVInputFormat ff_microdvd_demuxer;
-extern const AVOutputFormat ff_microdvd_muxer;
+extern const FFOutputFormat ff_microdvd_muxer;
extern const AVInputFormat ff_mjpeg_demuxer;
-extern const AVOutputFormat ff_mjpeg_muxer;
+extern const FFOutputFormat ff_mjpeg_muxer;
extern const AVInputFormat ff_mjpeg_2000_demuxer;
extern const AVInputFormat ff_mlp_demuxer;
-extern const AVOutputFormat ff_mlp_muxer;
+extern const FFOutputFormat ff_mlp_muxer;
extern const AVInputFormat ff_mlv_demuxer;
extern const AVInputFormat ff_mm_demuxer;
extern const AVInputFormat ff_mmf_demuxer;
-extern const AVOutputFormat ff_mmf_muxer;
+extern const FFOutputFormat ff_mmf_muxer;
extern const AVInputFormat ff_mods_demuxer;
extern const AVInputFormat ff_moflex_demuxer;
extern const AVInputFormat ff_mov_demuxer;
-extern const AVOutputFormat ff_mov_muxer;
-extern const AVOutputFormat ff_mp2_muxer;
+extern const FFOutputFormat ff_mov_muxer;
+extern const FFOutputFormat ff_mp2_muxer;
extern const AVInputFormat ff_mp3_demuxer;
-extern const AVOutputFormat ff_mp3_muxer;
-extern const AVOutputFormat ff_mp4_muxer;
+extern const FFOutputFormat ff_mp3_muxer;
+extern const FFOutputFormat ff_mp4_muxer;
extern const AVInputFormat ff_mpc_demuxer;
extern const AVInputFormat ff_mpc8_demuxer;
-extern const AVOutputFormat ff_mpeg1system_muxer;
-extern const AVOutputFormat ff_mpeg1vcd_muxer;
-extern const AVOutputFormat ff_mpeg1video_muxer;
-extern const AVOutputFormat ff_mpeg2dvd_muxer;
-extern const AVOutputFormat ff_mpeg2svcd_muxer;
-extern const AVOutputFormat ff_mpeg2video_muxer;
-extern const AVOutputFormat ff_mpeg2vob_muxer;
+extern const FFOutputFormat ff_mpeg1system_muxer;
+extern const FFOutputFormat ff_mpeg1vcd_muxer;
+extern const FFOutputFormat ff_mpeg1video_muxer;
+extern const FFOutputFormat ff_mpeg2dvd_muxer;
+extern const FFOutputFormat ff_mpeg2svcd_muxer;
+extern const FFOutputFormat ff_mpeg2video_muxer;
+extern const FFOutputFormat ff_mpeg2vob_muxer;
extern const AVInputFormat ff_mpegps_demuxer;
extern const AVInputFormat ff_mpegts_demuxer;
-extern const AVOutputFormat ff_mpegts_muxer;
+extern const FFOutputFormat ff_mpegts_muxer;
extern const AVInputFormat ff_mpegtsraw_demuxer;
extern const AVInputFormat ff_mpegvideo_demuxer;
extern const AVInputFormat ff_mpjpeg_demuxer;
-extern const AVOutputFormat ff_mpjpeg_muxer;
+extern const FFOutputFormat ff_mpjpeg_muxer;
extern const AVInputFormat ff_mpl2_demuxer;
extern const AVInputFormat ff_mpsub_demuxer;
extern const AVInputFormat ff_msf_demuxer;
@@ -304,114 +305,114 @@ extern const AVInputFormat ff_musx_demuxer;
extern const AVInputFormat ff_mv_demuxer;
extern const AVInputFormat ff_mvi_demuxer;
extern const AVInputFormat ff_mxf_demuxer;
-extern const AVOutputFormat ff_mxf_muxer;
-extern const AVOutputFormat ff_mxf_d10_muxer;
-extern const AVOutputFormat ff_mxf_opatom_muxer;
+extern const FFOutputFormat ff_mxf_muxer;
+extern const FFOutputFormat ff_mxf_d10_muxer;
+extern const FFOutputFormat ff_mxf_opatom_muxer;
extern const AVInputFormat ff_mxg_demuxer;
extern const AVInputFormat ff_nc_demuxer;
extern const AVInputFormat ff_nistsphere_demuxer;
extern const AVInputFormat ff_nsp_demuxer;
extern const AVInputFormat ff_nsv_demuxer;
-extern const AVOutputFormat ff_null_muxer;
+extern const FFOutputFormat ff_null_muxer;
extern const AVInputFormat ff_nut_demuxer;
-extern const AVOutputFormat ff_nut_muxer;
+extern const FFOutputFormat ff_nut_muxer;
extern const AVInputFormat ff_nuv_demuxer;
extern const AVInputFormat ff_obu_demuxer;
-extern const AVOutputFormat ff_obu_muxer;
-extern const AVOutputFormat ff_oga_muxer;
+extern const FFOutputFormat ff_obu_muxer;
+extern const FFOutputFormat ff_oga_muxer;
extern const AVInputFormat ff_ogg_demuxer;
-extern const AVOutputFormat ff_ogg_muxer;
-extern const AVOutputFormat ff_ogv_muxer;
+extern const FFOutputFormat ff_ogg_muxer;
+extern const FFOutputFormat ff_ogv_muxer;
extern const AVInputFormat ff_oma_demuxer;
-extern const AVOutputFormat ff_oma_muxer;
-extern const AVOutputFormat ff_opus_muxer;
+extern const FFOutputFormat ff_oma_muxer;
+extern const FFOutputFormat ff_opus_muxer;
extern const AVInputFormat ff_paf_demuxer;
extern const AVInputFormat ff_pcm_alaw_demuxer;
-extern const AVOutputFormat ff_pcm_alaw_muxer;
+extern const FFOutputFormat ff_pcm_alaw_muxer;
extern const AVInputFormat ff_pcm_mulaw_demuxer;
-extern const AVOutputFormat ff_pcm_mulaw_muxer;
+extern const FFOutputFormat ff_pcm_mulaw_muxer;
extern const AVInputFormat ff_pcm_vidc_demuxer;
-extern const AVOutputFormat ff_pcm_vidc_muxer;
+extern const FFOutputFormat ff_pcm_vidc_muxer;
extern const AVInputFormat ff_pcm_f64be_demuxer;
-extern const AVOutputFormat ff_pcm_f64be_muxer;
+extern const FFOutputFormat ff_pcm_f64be_muxer;
extern const AVInputFormat ff_pcm_f64le_demuxer;
-extern const AVOutputFormat ff_pcm_f64le_muxer;
+extern const FFOutputFormat ff_pcm_f64le_muxer;
extern const AVInputFormat ff_pcm_f32be_demuxer;
-extern const AVOutputFormat ff_pcm_f32be_muxer;
+extern const FFOutputFormat ff_pcm_f32be_muxer;
extern const AVInputFormat ff_pcm_f32le_demuxer;
-extern const AVOutputFormat ff_pcm_f32le_muxer;
+extern const FFOutputFormat ff_pcm_f32le_muxer;
extern const AVInputFormat ff_pcm_s32be_demuxer;
-extern const AVOutputFormat ff_pcm_s32be_muxer;
+extern const FFOutputFormat ff_pcm_s32be_muxer;
extern const AVInputFormat ff_pcm_s32le_demuxer;
-extern const AVOutputFormat ff_pcm_s32le_muxer;
+extern const FFOutputFormat ff_pcm_s32le_muxer;
extern const AVInputFormat ff_pcm_s24be_demuxer;
-extern const AVOutputFormat ff_pcm_s24be_muxer;
+extern const FFOutputFormat ff_pcm_s24be_muxer;
extern const AVInputFormat ff_pcm_s24le_demuxer;
-extern const AVOutputFormat ff_pcm_s24le_muxer;
+extern const FFOutputFormat ff_pcm_s24le_muxer;
extern const AVInputFormat ff_pcm_s16be_demuxer;
-extern const AVOutputFormat ff_pcm_s16be_muxer;
+extern const FFOutputFormat ff_pcm_s16be_muxer;
extern const AVInputFormat ff_pcm_s16le_demuxer;
-extern const AVOutputFormat ff_pcm_s16le_muxer;
+extern const FFOutputFormat ff_pcm_s16le_muxer;
extern const AVInputFormat ff_pcm_s8_demuxer;
-extern const AVOutputFormat ff_pcm_s8_muxer;
+extern const FFOutputFormat ff_pcm_s8_muxer;
extern const AVInputFormat ff_pcm_u32be_demuxer;
-extern const AVOutputFormat ff_pcm_u32be_muxer;
+extern const FFOutputFormat ff_pcm_u32be_muxer;
extern const AVInputFormat ff_pcm_u32le_demuxer;
-extern const AVOutputFormat ff_pcm_u32le_muxer;
+extern const FFOutputFormat ff_pcm_u32le_muxer;
extern const AVInputFormat ff_pcm_u24be_demuxer;
-extern const AVOutputFormat ff_pcm_u24be_muxer;
+extern const FFOutputFormat ff_pcm_u24be_muxer;
extern const AVInputFormat ff_pcm_u24le_demuxer;
-extern const AVOutputFormat ff_pcm_u24le_muxer;
+extern const FFOutputFormat ff_pcm_u24le_muxer;
extern const AVInputFormat ff_pcm_u16be_demuxer;
-extern const AVOutputFormat ff_pcm_u16be_muxer;
+extern const FFOutputFormat ff_pcm_u16be_muxer;
extern const AVInputFormat ff_pcm_u16le_demuxer;
-extern const AVOutputFormat ff_pcm_u16le_muxer;
+extern const FFOutputFormat ff_pcm_u16le_muxer;
extern const AVInputFormat ff_pcm_u8_demuxer;
-extern const AVOutputFormat ff_pcm_u8_muxer;
+extern const FFOutputFormat ff_pcm_u8_muxer;
extern const AVInputFormat ff_pjs_demuxer;
extern const AVInputFormat ff_pmp_demuxer;
extern const AVInputFormat ff_pp_bnk_demuxer;
-extern const AVOutputFormat ff_psp_muxer;
+extern const FFOutputFormat ff_psp_muxer;
extern const AVInputFormat ff_pva_demuxer;
extern const AVInputFormat ff_pvf_demuxer;
extern const AVInputFormat ff_qcp_demuxer;
extern const AVInputFormat ff_r3d_demuxer;
extern const AVInputFormat ff_rawvideo_demuxer;
-extern const AVOutputFormat ff_rawvideo_muxer;
+extern const FFOutputFormat ff_rawvideo_muxer;
extern const AVInputFormat ff_realtext_demuxer;
extern const AVInputFormat ff_redspark_demuxer;
extern const AVInputFormat ff_rl2_demuxer;
extern const AVInputFormat ff_rm_demuxer;
-extern const AVOutputFormat ff_rm_muxer;
+extern const FFOutputFormat ff_rm_muxer;
extern const AVInputFormat ff_roq_demuxer;
-extern const AVOutputFormat ff_roq_muxer;
+extern const FFOutputFormat ff_roq_muxer;
extern const AVInputFormat ff_rpl_demuxer;
extern const AVInputFormat ff_rsd_demuxer;
extern const AVInputFormat ff_rso_demuxer;
-extern const AVOutputFormat ff_rso_muxer;
+extern const FFOutputFormat ff_rso_muxer;
extern const AVInputFormat ff_rtp_demuxer;
-extern const AVOutputFormat ff_rtp_muxer;
-extern const AVOutputFormat ff_rtp_mpegts_muxer;
+extern const FFOutputFormat ff_rtp_muxer;
+extern const FFOutputFormat ff_rtp_mpegts_muxer;
extern const AVInputFormat ff_rtsp_demuxer;
-extern const AVOutputFormat ff_rtsp_muxer;
+extern const FFOutputFormat ff_rtsp_muxer;
extern const AVInputFormat ff_s337m_demuxer;
extern const AVInputFormat ff_sami_demuxer;
extern const AVInputFormat ff_sap_demuxer;
-extern const AVOutputFormat ff_sap_muxer;
+extern const FFOutputFormat ff_sap_muxer;
extern const AVInputFormat ff_sbc_demuxer;
-extern const AVOutputFormat ff_sbc_muxer;
+extern const FFOutputFormat ff_sbc_muxer;
extern const AVInputFormat ff_sbg_demuxer;
extern const AVInputFormat ff_scc_demuxer;
-extern const AVOutputFormat ff_scc_muxer;
+extern const FFOutputFormat ff_scc_muxer;
extern const AVInputFormat ff_scd_demuxer;
extern const AVInputFormat ff_sdp_demuxer;
extern const AVInputFormat ff_sdr2_demuxer;
extern const AVInputFormat ff_sds_demuxer;
extern const AVInputFormat ff_sdx_demuxer;
extern const AVInputFormat ff_segafilm_demuxer;
-extern const AVOutputFormat ff_segafilm_muxer;
-extern const AVOutputFormat ff_segment_muxer;
-extern const AVOutputFormat ff_stream_segment_muxer;
+extern const FFOutputFormat ff_segafilm_muxer;
+extern const FFOutputFormat ff_segment_muxer;
+extern const FFOutputFormat ff_stream_segment_muxer;
extern const AVInputFormat ff_ser_demuxer;
extern const AVInputFormat ff_sga_demuxer;
extern const AVInputFormat ff_shorten_demuxer;
@@ -420,85 +421,85 @@ extern const AVInputFormat ff_simbiosis_imx_demuxer;
extern const AVInputFormat ff_sln_demuxer;
extern const AVInputFormat ff_smacker_demuxer;
extern const AVInputFormat ff_smjpeg_demuxer;
-extern const AVOutputFormat ff_smjpeg_muxer;
-extern const AVOutputFormat ff_smoothstreaming_muxer;
+extern const FFOutputFormat ff_smjpeg_muxer;
+extern const FFOutputFormat ff_smoothstreaming_muxer;
extern const AVInputFormat ff_smush_demuxer;
extern const AVInputFormat ff_sol_demuxer;
extern const AVInputFormat ff_sox_demuxer;
-extern const AVOutputFormat ff_sox_muxer;
-extern const AVOutputFormat ff_spx_muxer;
+extern const FFOutputFormat ff_sox_muxer;
+extern const FFOutputFormat ff_spx_muxer;
extern const AVInputFormat ff_spdif_demuxer;
-extern const AVOutputFormat ff_spdif_muxer;
+extern const FFOutputFormat ff_spdif_muxer;
extern const AVInputFormat ff_srt_demuxer;
-extern const AVOutputFormat ff_srt_muxer;
+extern const FFOutputFormat ff_srt_muxer;
extern const AVInputFormat ff_str_demuxer;
extern const AVInputFormat ff_stl_demuxer;
-extern const AVOutputFormat ff_streamhash_muxer;
+extern const FFOutputFormat ff_streamhash_muxer;
extern const AVInputFormat ff_subviewer1_demuxer;
extern const AVInputFormat ff_subviewer_demuxer;
extern const AVInputFormat ff_sup_demuxer;
-extern const AVOutputFormat ff_sup_muxer;
+extern const FFOutputFormat ff_sup_muxer;
extern const AVInputFormat ff_svag_demuxer;
extern const AVInputFormat ff_svs_demuxer;
extern const AVInputFormat ff_swf_demuxer;
-extern const AVOutputFormat ff_swf_muxer;
+extern const FFOutputFormat ff_swf_muxer;
extern const AVInputFormat ff_tak_demuxer;
-extern const AVOutputFormat ff_tee_muxer;
+extern const FFOutputFormat ff_tee_muxer;
extern const AVInputFormat ff_tedcaptions_demuxer;
-extern const AVOutputFormat ff_tg2_muxer;
-extern const AVOutputFormat ff_tgp_muxer;
+extern const FFOutputFormat ff_tg2_muxer;
+extern const FFOutputFormat ff_tgp_muxer;
extern const AVInputFormat ff_thp_demuxer;
extern const AVInputFormat ff_threedostr_demuxer;
extern const AVInputFormat ff_tiertexseq_demuxer;
-extern const AVOutputFormat ff_mkvtimestamp_v2_muxer;
+extern const FFOutputFormat ff_mkvtimestamp_v2_muxer;
extern const AVInputFormat ff_tmv_demuxer;
extern const AVInputFormat ff_truehd_demuxer;
-extern const AVOutputFormat ff_truehd_muxer;
+extern const FFOutputFormat ff_truehd_muxer;
extern const AVInputFormat ff_tta_demuxer;
-extern const AVOutputFormat ff_tta_muxer;
-extern const AVOutputFormat ff_ttml_muxer;
+extern const FFOutputFormat ff_tta_muxer;
+extern const FFOutputFormat ff_ttml_muxer;
extern const AVInputFormat ff_txd_demuxer;
extern const AVInputFormat ff_tty_demuxer;
extern const AVInputFormat ff_ty_demuxer;
-extern const AVOutputFormat ff_uncodedframecrc_muxer;
+extern const FFOutputFormat ff_uncodedframecrc_muxer;
extern const AVInputFormat ff_v210_demuxer;
extern const AVInputFormat ff_v210x_demuxer;
extern const AVInputFormat ff_vag_demuxer;
extern const AVInputFormat ff_vc1_demuxer;
-extern const AVOutputFormat ff_vc1_muxer;
+extern const FFOutputFormat ff_vc1_muxer;
extern const AVInputFormat ff_vc1t_demuxer;
-extern const AVOutputFormat ff_vc1t_muxer;
+extern const FFOutputFormat ff_vc1t_muxer;
extern const AVInputFormat ff_vividas_demuxer;
extern const AVInputFormat ff_vivo_demuxer;
extern const AVInputFormat ff_vmd_demuxer;
extern const AVInputFormat ff_vobsub_demuxer;
extern const AVInputFormat ff_voc_demuxer;
-extern const AVOutputFormat ff_voc_muxer;
+extern const FFOutputFormat ff_voc_muxer;
extern const AVInputFormat ff_vpk_demuxer;
extern const AVInputFormat ff_vplayer_demuxer;
extern const AVInputFormat ff_vqf_demuxer;
extern const AVInputFormat ff_w64_demuxer;
-extern const AVOutputFormat ff_w64_muxer;
+extern const FFOutputFormat ff_w64_muxer;
extern const AVInputFormat ff_wady_demuxer;
extern const AVInputFormat ff_wav_demuxer;
-extern const AVOutputFormat ff_wav_muxer;
+extern const FFOutputFormat ff_wav_muxer;
extern const AVInputFormat ff_wc3_demuxer;
-extern const AVOutputFormat ff_webm_muxer;
+extern const FFOutputFormat ff_webm_muxer;
extern const AVInputFormat ff_webm_dash_manifest_demuxer;
-extern const AVOutputFormat ff_webm_dash_manifest_muxer;
-extern const AVOutputFormat ff_webm_chunk_muxer;
-extern const AVOutputFormat ff_webp_muxer;
+extern const FFOutputFormat ff_webm_dash_manifest_muxer;
+extern const FFOutputFormat ff_webm_chunk_muxer;
+extern const FFOutputFormat ff_webp_muxer;
extern const AVInputFormat ff_webvtt_demuxer;
-extern const AVOutputFormat ff_webvtt_muxer;
+extern const FFOutputFormat ff_webvtt_muxer;
extern const AVInputFormat ff_wsaud_demuxer;
-extern const AVOutputFormat ff_wsaud_muxer;
+extern const FFOutputFormat ff_wsaud_muxer;
extern const AVInputFormat ff_wsd_demuxer;
extern const AVInputFormat ff_wsvqa_demuxer;
extern const AVInputFormat ff_wtv_demuxer;
-extern const AVOutputFormat ff_wtv_muxer;
+extern const FFOutputFormat ff_wtv_muxer;
extern const AVInputFormat ff_wve_demuxer;
extern const AVInputFormat ff_wv_demuxer;
-extern const AVOutputFormat ff_wv_muxer;
+extern const FFOutputFormat ff_wv_muxer;
extern const AVInputFormat ff_xa_demuxer;
extern const AVInputFormat ff_xbin_demuxer;
extern const AVInputFormat ff_xmd_demuxer;
@@ -507,7 +508,7 @@ extern const AVInputFormat ff_xvag_demuxer;
extern const AVInputFormat ff_xwma_demuxer;
extern const AVInputFormat ff_yop_demuxer;
extern const AVInputFormat ff_yuv4mpegpipe_demuxer;
-extern const AVOutputFormat ff_yuv4mpegpipe_muxer;
+extern const FFOutputFormat ff_yuv4mpegpipe_muxer;
/* image demuxers */
extern const AVInputFormat ff_image_bmp_pipe_demuxer;
extern const AVInputFormat ff_image_cri_pipe_demuxer;
@@ -547,7 +548,7 @@ extern const AVInputFormat ff_image_xpm_pipe_demuxer;
extern const AVInputFormat ff_image_xwd_pipe_demuxer;
/* external libraries */
-extern const AVOutputFormat ff_chromaprint_muxer;
+extern const FFOutputFormat ff_chromaprint_muxer;
extern const AVInputFormat ff_libgme_demuxer;
extern const AVInputFormat ff_libmodplug_demuxer;
extern const AVInputFormat ff_libopenmpt_demuxer;
@@ -563,19 +564,21 @@ const AVOutputFormat *av_muxer_iterate(void **opaque)
{
static const uintptr_t size = sizeof(muxer_list)/sizeof(muxer_list[0]) - 1;
uintptr_t i = (uintptr_t)*opaque;
- const AVOutputFormat *f = NULL;
+ const FFOutputFormat *f = NULL;
uintptr_t tmp;
if (i < size) {
f = muxer_list[i];
} else if (tmp = atomic_load_explicit(&outdev_list_intptr, memory_order_relaxed)) {
- const AVOutputFormat *const *outdev_list = (const AVOutputFormat *const *)tmp;
+ const FFOutputFormat *const *outdev_list = (const FFOutputFormat *const *)tmp;
f = outdev_list[i - size];
}
- if (f)
+ if (f) {
*opaque = (void*)(i + 1);
- return f;
+ return &f->p;
+ }
+ return NULL;
}
const AVInputFormat *av_demuxer_iterate(void **opaque)
@@ -597,7 +600,7 @@ const AVInputFormat *av_demuxer_iterate(void **opaque)
return f;
}
-void avpriv_register_devices(const AVOutputFormat * const o[], const AVInputFormat * const i[])
+void avpriv_register_devices(const FFOutputFormat * const o[], const AVInputFormat * const i[])
{
atomic_store_explicit(&outdev_list_intptr, (uintptr_t)o, memory_order_relaxed);
atomic_store_explicit(&indev_list_intptr, (uintptr_t)i, memory_order_relaxed);
diff --git a/libavformat/alp.c b/libavformat/alp.c
index 40e4890a387..8c6066a59c6 100644
--- a/libavformat/alp.c
+++ b/libavformat/alp.c
@@ -25,6 +25,7 @@
#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "internal.h"
+#include "mux.h"
#include "rawenc.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/internal.h"
@@ -290,16 +291,16 @@ static const AVClass alp_muxer_class = {
.version = LIBAVUTIL_VERSION_INT
};
-const AVOutputFormat ff_alp_muxer = {
- .name = "alp",
- .long_name = NULL_IF_CONFIG_SMALL("LEGO Racers ALP"),
- .extensions = "tun,pcm",
- .audio_codec = AV_CODEC_ID_ADPCM_IMA_ALP,
- .video_codec = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_alp_muxer = {
+ .p.name = "alp",
+ .p.long_name = NULL_IF_CONFIG_SMALL("LEGO Racers ALP"),
+ .p.extensions = "tun,pcm",
+ .p.audio_codec = AV_CODEC_ID_ADPCM_IMA_ALP,
+ .p.video_codec = AV_CODEC_ID_NONE,
+ .p.priv_class = &alp_muxer_class,
.init = alp_write_init,
.write_header = alp_write_header,
.write_packet = ff_raw_write_packet,
- .priv_class = &alp_muxer_class,
.priv_data_size = sizeof(ALPMuxContext)
};
#endif
diff --git a/libavformat/amr.c b/libavformat/amr.c
index 88f07ce0bac..b6615d8295c 100644
--- a/libavformat/amr.c
+++ b/libavformat/amr.c
@@ -30,6 +30,7 @@ Write and read amr data according to RFC3267, http://www.ietf.org/rfc/rfc3267.tx
#include "avformat.h"
#include "avio_internal.h"
#include "internal.h"
+#include "mux.h"
#include "rawdec.h"
#include "rawenc.h"
@@ -266,15 +267,15 @@ const AVInputFormat ff_amrwb_demuxer = {
#endif
#if CONFIG_AMR_MUXER
-const AVOutputFormat ff_amr_muxer = {
- .name = "amr",
- .long_name = NULL_IF_CONFIG_SMALL("3GPP AMR"),
- .mime_type = "audio/amr",
- .extensions = "amr",
- .audio_codec = AV_CODEC_ID_AMR_NB,
- .video_codec = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_amr_muxer = {
+ .p.name = "amr",
+ .p.long_name = NULL_IF_CONFIG_SMALL("3GPP AMR"),
+ .p.mime_type = "audio/amr",
+ .p.extensions = "amr",
+ .p.audio_codec = AV_CODEC_ID_AMR_NB,
+ .p.video_codec = AV_CODEC_ID_NONE,
+ .p.flags = AVFMT_NOTIMESTAMPS,
.write_header = amr_write_header,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
};
#endif
diff --git a/libavformat/amvenc.c b/libavformat/amvenc.c
index 28d4879b19e..e1b1ffd42e2 100644
--- a/libavformat/amvenc.c
+++ b/libavformat/amvenc.c
@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "avformat.h"
+#include "mux.h"
#include "riff.h"
#include "internal.h"
#include "avio_internal.h"
@@ -401,14 +402,14 @@ static int amv_write_trailer(AVFormatContext *s)
return 0;
}
-const AVOutputFormat ff_amv_muxer = {
- .name = "amv",
- .long_name = NULL_IF_CONFIG_SMALL("AMV"),
- .mime_type = "video/amv",
- .extensions = "amv",
+const FFOutputFormat ff_amv_muxer = {
+ .p.name = "amv",
+ .p.long_name = NULL_IF_CONFIG_SMALL("AMV"),
+ .p.mime_type = "video/amv",
+ .p.extensions = "amv",
.priv_data_size = sizeof(AMVContext),
- .audio_codec = AV_CODEC_ID_ADPCM_IMA_AMV,
- .video_codec = AV_CODEC_ID_AMV,
+ .p.audio_codec = AV_CODEC_ID_ADPCM_IMA_AMV,
+ .p.video_codec = AV_CODEC_ID_AMV,
.init = amv_init,
.deinit = amv_deinit,
.write_header = amv_write_header,
diff --git a/libavformat/apm.c b/libavformat/apm.c
index a3ddc08e83b..ccb8e22437e 100644
--- a/libavformat/apm.c
+++ b/libavformat/apm.c
@@ -24,6 +24,7 @@
#include "avformat.h"
#include "internal.h"
+#include "mux.h"
#include "rawenc.h"
#include "libavutil/channel_layout.h"
#include "libavutil/internal.h"
@@ -303,12 +304,12 @@ static int apm_write_trailer(AVFormatContext *s)
return 0;
}
-const AVOutputFormat ff_apm_muxer = {
- .name = "apm",
- .long_name = NULL_IF_CONFIG_SMALL("Ubisoft Rayman 2 APM"),
- .extensions = "apm",
- .audio_codec = AV_CODEC_ID_ADPCM_IMA_APM,
- .video_codec = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_apm_muxer = {
+ .p.name = "apm",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Ubisoft Rayman 2 APM"),
+ .p.extensions = "apm",
+ .p.audio_codec = AV_CODEC_ID_ADPCM_IMA_APM,
+ .p.video_codec = AV_CODEC_ID_NONE,
.init = apm_write_init,
.write_header = apm_write_header,
.write_packet = ff_raw_write_packet,
diff --git a/libavformat/apngenc.c b/libavformat/apngenc.c
index cddb148d50b..a0af916f141 100644
--- a/libavformat/apngenc.c
+++ b/libavformat/apngenc.c
@@ -22,6 +22,7 @@
*/
#include "avformat.h"
+#include "mux.h"
#include "libavutil/avassert.h"
#include "libavutil/crc.h"
#include "libavutil/intreadwrite.h"
@@ -306,18 +307,18 @@ static const AVClass apng_muxer_class = {
.option = options,
};
-const AVOutputFormat ff_apng_muxer = {
- .name = "apng",
- .long_name = NULL_IF_CONFIG_SMALL("Animated Portable Network Graphics"),
- .mime_type = "image/png",
- .extensions = "apng",
+const FFOutputFormat ff_apng_muxer = {
+ .p.name = "apng",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Animated Portable Network Graphics"),
+ .p.mime_type = "image/png",
+ .p.extensions = "apng",
.priv_data_size = sizeof(APNGMuxContext),
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_APNG,
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_APNG,
.write_header = apng_write_header,
.write_packet = apng_write_packet,
.write_trailer = apng_write_trailer,
.deinit = apng_deinit,
- .priv_class = &apng_muxer_class,
- .flags = AVFMT_VARIABLE_FPS,
+ .p.priv_class = &apng_muxer_class,
+ .p.flags = AVFMT_VARIABLE_FPS,
};
diff --git a/libavformat/argo_asf.c b/libavformat/argo_asf.c
index 39a60a0dde4..5f38b68b6ac 100644
--- a/libavformat/argo_asf.c
+++ b/libavformat/argo_asf.c
@@ -25,6 +25,7 @@
#include "libavutil/avstring.h"
#include "avformat.h"
#include "internal.h"
+#include "mux.h"
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/avassert.h"
@@ -470,20 +471,20 @@ static const AVClass argo_asf_muxer_class = {
.version = LIBAVUTIL_VERSION_INT
};
-const AVOutputFormat ff_argo_asf_muxer = {
- .name = "argo_asf",
- .long_name = NULL_IF_CONFIG_SMALL("Argonaut Games ASF"),
+const FFOutputFormat ff_argo_asf_muxer = {
+ .p.name = "argo_asf",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Argonaut Games ASF"),
/*
* NB: Can't do this as it conflicts with the actual ASF format.
- * .extensions = "asf",
+ * .p.extensions = "asf",
*/
- .audio_codec = AV_CODEC_ID_ADPCM_ARGO,
- .video_codec = AV_CODEC_ID_NONE,
+ .p.audio_codec = AV_CODEC_ID_ADPCM_ARGO,
+ .p.video_codec = AV_CODEC_ID_NONE,
+ .p.priv_class = &argo_asf_muxer_class,
.init = argo_asf_write_init,
.write_header = argo_asf_write_header,
.write_packet = argo_asf_write_packet,
.write_trailer = argo_asf_write_trailer,
- .priv_class = &argo_asf_muxer_class,
.priv_data_size = sizeof(ArgoASFMuxContext)
};
#endif
diff --git a/libavformat/argo_cvg.c b/libavformat/argo_cvg.c
index aedc7c4a329..2c74200b7d8 100644
--- a/libavformat/argo_cvg.c
+++ b/libavformat/argo_cvg.c
@@ -26,6 +26,7 @@
#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "internal.h"
+#include "mux.h"
#include "libavutil/opt.h"
#include "libavutil/intreadwrite.h"
@@ -400,17 +401,17 @@ static const AVClass argo_cvg_muxer_class = {
.version = LIBAVUTIL_VERSION_INT
};
-const AVOutputFormat ff_argo_cvg_muxer = {
- .name = "argo_cvg",
- .long_name = NULL_IF_CONFIG_SMALL("Argonaut Games CVG"),
- .extensions = "cvg",
- .audio_codec = AV_CODEC_ID_ADPCM_PSX,
- .video_codec = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_argo_cvg_muxer = {
+ .p.name = "argo_cvg",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Argonaut Games CVG"),
+ .p.extensions = "cvg",
+ .p.audio_codec = AV_CODEC_ID_ADPCM_PSX,
+ .p.video_codec = AV_CODEC_ID_NONE,
+ .p.priv_class = &argo_cvg_muxer_class,
.init = argo_cvg_write_init,
.write_header = argo_cvg_write_header,
.write_packet = argo_cvg_write_packet,
.write_trailer = argo_cvg_write_trailer,
- .priv_class = &argo_cvg_muxer_class,
.priv_data_size = sizeof(ArgoCVGMuxContext),
};
#endif
diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c
index 47240fc0a80..244c7e7a271 100644
--- a/libavformat/asfenc.c
+++ b/libavformat/asfenc.c
@@ -1129,39 +1129,39 @@ static const AVClass asf_muxer_class = {
};
#if CONFIG_ASF_MUXER
-const AVOutputFormat ff_asf_muxer = {
- .name = "asf",
- .long_name = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"),
- .mime_type = "video/x-ms-asf",
- .extensions = "asf,wmv,wma",
+const FFOutputFormat ff_asf_muxer = {
+ .p.name = "asf",
+ .p.long_name = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"),
+ .p.mime_type = "video/x-ms-asf",
+ .p.extensions = "asf,wmv,wma",
+ .p.audio_codec = AV_CODEC_ID_WMAV2,
+ .p.video_codec = AV_CODEC_ID_MSMPEG4V3,
+ .p.flags = AVFMT_GLOBALHEADER,
+ .p.codec_tag = asf_codec_tags,
+ .p.priv_class = &asf_muxer_class,
.priv_data_size = sizeof(ASFContext),
- .audio_codec = AV_CODEC_ID_WMAV2,
- .video_codec = AV_CODEC_ID_MSMPEG4V3,
.write_header = asf_write_header,
.write_packet = asf_write_packet,
.write_trailer = asf_write_trailer,
- .flags = AVFMT_GLOBALHEADER,
- .codec_tag = asf_codec_tags,
- .priv_class = &asf_muxer_class,
.deinit = asf_deinit,
};
#endif /* CONFIG_ASF_MUXER */
#if CONFIG_ASF_STREAM_MUXER
-const AVOutputFormat ff_asf_stream_muxer = {
- .name = "asf_stream",
- .long_name = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"),
- .mime_type = "video/x-ms-asf",
- .extensions = "asf,wmv,wma",
+const FFOutputFormat ff_asf_stream_muxer = {
+ .p.name = "asf_stream",
+ .p.long_name = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"),
+ .p.mime_type = "video/x-ms-asf",
+ .p.extensions = "asf,wmv,wma",
.priv_data_size = sizeof(ASFContext),
- .audio_codec = AV_CODEC_ID_WMAV2,
- .video_codec = AV_CODEC_ID_MSMPEG4V3,
+ .p.audio_codec = AV_CODEC_ID_WMAV2,
+ .p.video_codec = AV_CODEC_ID_MSMPEG4V3,
.write_header = asf_write_stream_header,
.write_packet = asf_write_packet,
.write_trailer = asf_write_trailer,
- .flags = AVFMT_GLOBALHEADER,
- .codec_tag = asf_codec_tags,
- .priv_class = &asf_muxer_class,
+ .p.flags = AVFMT_GLOBALHEADER,
+ .p.codec_tag = asf_codec_tags,
+ .p.priv_class = &asf_muxer_class,
.deinit = asf_deinit,
};
#endif /* CONFIG_ASF_STREAM_MUXER */
diff --git a/libavformat/assenc.c b/libavformat/assenc.c
index 1600f0a02b2..85a1e533715 100644
--- a/libavformat/assenc.c
+++ b/libavformat/assenc.c
@@ -22,6 +22,7 @@
#include "libavutil/avstring.h"
#include "avformat.h"
#include "internal.h"
+#include "mux.h"
#include "libavutil/opt.h"
@@ -226,16 +227,16 @@ static const AVClass ass_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVOutputFormat ff_ass_muxer = {
- .name = "ass",
- .long_name = NULL_IF_CONFIG_SMALL("SSA (SubStation Alpha) subtitle"),
- .mime_type = "text/x-ass",
- .extensions = "ass,ssa",
+const FFOutputFormat ff_ass_muxer = {
+ .p.name = "ass",
+ .p.long_name = NULL_IF_CONFIG_SMALL("SSA (SubStation Alpha) subtitle"),
+ .p.mime_type = "text/x-ass",
+ .p.extensions = "ass,ssa",
+ .p.subtitle_codec = AV_CODEC_ID_ASS,
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_NOTIMESTAMPS | AVFMT_TS_NONSTRICT,
+ .p.priv_class = &ass_class,
.priv_data_size = sizeof(ASSContext),
- .subtitle_codec = AV_CODEC_ID_ASS,
.write_header = write_header,
.write_packet = write_packet,
.write_trailer = write_trailer,
- .flags = AVFMT_GLOBALHEADER | AVFMT_NOTIMESTAMPS | AVFMT_TS_NONSTRICT,
- .priv_class = &ass_class,
};
diff --git a/libavformat/astenc.c b/libavformat/astenc.c
index b29cfc4aaf0..9dd388040f9 100644
--- a/libavformat/astenc.c
+++ b/libavformat/astenc.c
@@ -23,6 +23,7 @@
#include "avio_internal.h"
#include "internal.h"
#include "ast.h"
+#include "mux.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
@@ -194,16 +195,16 @@ static const AVClass ast_muxer_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVOutputFormat ff_ast_muxer = {
- .name = "ast",
- .long_name = NULL_IF_CONFIG_SMALL("AST (Audio Stream)"),
- .extensions = "ast",
+const FFOutputFormat ff_ast_muxer = {
+ .p.name = "ast",
+ .p.long_name = NULL_IF_CONFIG_SMALL("AST (Audio Stream)"),
+ .p.extensions = "ast",
.priv_data_size = sizeof(ASTMuxContext),
- .audio_codec = AV_CODEC_ID_PCM_S16BE_PLANAR,
- .video_codec = AV_CODEC_ID_NONE,
+ .p.audio_codec = AV_CODEC_ID_PCM_S16BE_PLANAR,
+ .p.video_codec = AV_CODEC_ID_NONE,
.write_header = ast_write_header,
.write_packet = ast_write_packet,
.write_trailer = ast_write_trailer,
- .priv_class = &ast_muxer_class,
- .codec_tag = ff_ast_codec_tags_list,
+ .p.priv_class = &ast_muxer_class,
+ .p.codec_tag = ff_ast_codec_tags_list,
};
diff --git a/libavformat/au.c b/libavformat/au.c
index f7c47d53331..3bf21502584 100644
--- a/libavformat/au.c
+++ b/libavformat/au.c
@@ -33,6 +33,7 @@
#include "avformat.h"
#include "internal.h"
#include "avio_internal.h"
+#include "mux.h"
#include "pcm.h"
#include "libavutil/avassert.h"
@@ -331,19 +332,19 @@ static int au_write_trailer(AVFormatContext *s)
return 0;
}
-const AVOutputFormat ff_au_muxer = {
- .name = "au",
- .long_name = NULL_IF_CONFIG_SMALL("Sun AU"),
- .mime_type = "audio/basic",
- .extensions = "au",
+const FFOutputFormat ff_au_muxer = {
+ .p.name = "au",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Sun AU"),
+ .p.mime_type = "audio/basic",
+ .p.extensions = "au",
+ .p.codec_tag = au_codec_tags,
+ .p.audio_codec = AV_CODEC_ID_PCM_S16BE,
+ .p.video_codec = AV_CODEC_ID_NONE,
+ .p.flags = AVFMT_NOTIMESTAMPS,
.priv_data_size = sizeof(AUContext),
- .audio_codec = AV_CODEC_ID_PCM_S16BE,
- .video_codec = AV_CODEC_ID_NONE,
.write_header = au_write_header,
.write_packet = ff_raw_write_packet,
.write_trailer = au_write_trailer,
- .codec_tag = au_codec_tags,
- .flags = AVFMT_NOTIMESTAMPS,
};
#endif /* CONFIG_AU_MUXER */
diff --git a/libavformat/avformat.c b/libavformat/avformat.c
index 19c72194714..88ff46a5744 100644
--- a/libavformat/avformat.c
+++ b/libavformat/avformat.c
@@ -35,6 +35,7 @@
#include "avformat.h"
#include "avio.h"
#include "demux.h"
+#include "mux.h"
#include "internal.h"
void ff_free_stream(AVStream **pst)
@@ -100,8 +101,8 @@ void avformat_free_context(AVFormatContext *s)
return;
si = ffformatcontext(s);
- if (s->oformat && s->oformat->deinit && si->initialized)
- s->oformat->deinit(s);
+ if (s->oformat && ffofmt(s->oformat)->deinit && si->initialized)
+ ffofmt(s->oformat)->deinit(s);
av_opt_free(s);
if (s->iformat && s->iformat->priv_class && s->priv_data)
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index a69ee1c575c..49e50a5120a 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -328,10 +328,8 @@
#endif
struct AVFormatContext;
-struct AVStream;
struct AVDeviceInfoList;
-struct AVDeviceCapabilitiesQuery;
/**
* @defgroup metadata_api Public Metadata API
@@ -536,113 +534,6 @@ typedef struct AVOutputFormat {
const AVClass *priv_class; ///< AVClass for the private context
-
- /*****************************************************************
- * No fields below this line are part of the public API. They
- * may not be used outside of libavformat and can be changed and
- * removed at will.
- * New public fields should be added right above.
- *****************************************************************
- */
- /**
- * size of private data so that it can be allocated in the wrapper
- */
- int priv_data_size;
-
- /**
- * Internal flags. See FF_FMT_FLAG_* in internal.h.
- */
- int flags_internal;
-
- int (*write_header)(struct AVFormatContext *);
- /**
- * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags,
- * 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
- * data.
- */
- int (*write_packet)(struct AVFormatContext *, AVPacket *pkt);
- int (*write_trailer)(struct AVFormatContext *);
- /**
- * A format-specific function for interleavement.
- * If unset, packets will be interleaved by dts.
- *
- * @param s An AVFormatContext for output. pkt will be added to
- * resp. taken from its packet buffer.
- * @param[in,out] pkt A packet to be interleaved if has_packet is set;
- * also used to return packets. If no packet is returned
- * (e.g. on error), pkt is blank on return.
- * @param flush 1 if no further packets are available as input and
- * all remaining packets should be output.
- * @param has_packet If set, pkt contains a packet to be interleaved
- * on input; otherwise pkt is blank on input.
- * @return 1 if a packet was output, 0 if no packet could be output,
- * < 0 if an error occurred
- */
- int (*interleave_packet)(struct AVFormatContext *s, AVPacket *pkt,
- int flush, int has_packet);
- /**
- * Test if the given codec can be stored in this container.
- *
- * @return 1 if the codec is supported, 0 if it is not.
- * A negative number if unknown.
- * MKTAG('A', 'P', 'I', 'C') if the codec is only supported as AV_DISPOSITION_ATTACHED_PIC
- */
- int (*query_codec)(enum AVCodecID id, int std_compliance);
-
- void (*get_output_timestamp)(struct AVFormatContext *s, int stream,
- int64_t *dts, int64_t *wall);
- /**
- * Allows sending messages from application to device.
- */
- int (*control_message)(struct AVFormatContext *s, int type,
- void *data, size_t data_size);
-
- /**
- * Write an uncoded AVFrame.
- *
- * See av_write_uncoded_frame() for details.
- *
- * The library will free *frame afterwards, but the muxer can prevent it
- * by setting the pointer to NULL.
- */
- int (*write_uncoded_frame)(struct AVFormatContext *, int stream_index,
- AVFrame **frame, unsigned flags);
- /**
- * Returns device list with it properties.
- * @see avdevice_list_devices() for more details.
- */
- int (*get_device_list)(struct AVFormatContext *s, struct AVDeviceInfoList *device_list);
- /**
- * Initialize format. May allocate data here, and set any AVFormatContext or
- * AVStream parameters that need to be set before packets are sent.
- * This method must not write output.
- *
- * Return 0 if streams were fully configured, 1 if not, negative AVERROR on failure
- *
- * Any allocations made here must be freed in deinit().
- */
- int (*init)(struct AVFormatContext *);
- /**
- * Deinitialize format. If present, this is called whenever the muxer is being
- * destroyed, regardless of whether or not the header has been written.
- *
- * If a trailer is being written, this is called after write_trailer().
- *
- * This is called if init() fails as well.
- */
- void (*deinit)(struct AVFormatContext *);
- /**
- * Set up any necessary bitstream filtering and extract any extra data needed
- * for the global header.
- *
- * @note pkt might have been directly forwarded by a meta-muxer; therefore
- * pkt->stream_index as well as the pkt's timebase might be invalid.
- * Return 0 if more packets from this stream must be checked; 1 if not.
- */
- int (*check_bitstream)(struct AVFormatContext *s, struct AVStream *st,
- const AVPacket *pkt);
} AVOutputFormat;
/**
* @}
diff --git a/libavformat/avienc.c b/libavformat/avienc.c
index 14115b3e2b8..a61e5c31095 100644
--- a/libavformat/avienc.c
+++ b/libavformat/avienc.c
@@ -28,6 +28,7 @@
#include "config_components.h"
#include "riff.h"
#include "mpegts.h"
+#include "mux.h"
#include "rawutils.h"
#include "libavformat/avlanguage.h"
#include "libavutil/avstring.h"
@@ -1003,19 +1004,19 @@ static const AVClass avi_muxer_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVOutputFormat ff_avi_muxer = {
- .name = "avi",
- .long_name = NULL_IF_CONFIG_SMALL("AVI (Audio Video Interleaved)"),
- .mime_type = "video/x-msvideo",
- .extensions = "avi",
+const FFOutputFormat ff_avi_muxer = {
+ .p.name = "avi",
+ .p.long_name = NULL_IF_CONFIG_SMALL("AVI (Audio Video Interleaved)"),
+ .p.mime_type = "video/x-msvideo",
+ .p.extensions = "avi",
.priv_data_size = sizeof(AVIContext),
- .audio_codec = CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : AV_CODEC_ID_AC3,
- .video_codec = AV_CODEC_ID_MPEG4,
+ .p.audio_codec = CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : AV_CODEC_ID_AC3,
+ .p.video_codec = AV_CODEC_ID_MPEG4,
.init = avi_init,
.deinit = avi_deinit,
.write_header = avi_write_header,
.write_packet = avi_write_packet,
.write_trailer = avi_write_trailer,
- .codec_tag = ff_riff_codec_tags_list,
- .priv_class = &avi_muxer_class,
+ .p.codec_tag = ff_riff_codec_tags_list,
+ .p.priv_class = &avi_muxer_class,
};
diff --git a/libavformat/bit.c b/libavformat/bit.c
index 9efb4ac0708..c3b9cf4d3dc 100644
--- a/libavformat/bit.c
+++ b/libavformat/bit.c
@@ -23,6 +23,7 @@
#include "avformat.h"
#include "internal.h"
+#include "mux.h"
#include "libavcodec/get_bits.h"
#include "libavcodec/put_bits.h"
@@ -158,13 +159,13 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
return 0;
}
-const AVOutputFormat ff_bit_muxer = {
- .name = "bit",
- .long_name = NULL_IF_CONFIG_SMALL("G.729 BIT file format"),
- .mime_type = "audio/bit",
- .extensions = "bit",
- .audio_codec = AV_CODEC_ID_G729,
- .video_codec = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_bit_muxer = {
+ .p.name = "bit",
+ .p.long_name = NULL_IF_CONFIG_SMALL("G.729 BIT file format"),
+ .p.mime_type = "audio/bit",
+ .p.extensions = "bit",
+ .p.audio_codec = AV_CODEC_ID_G729,
+ .p.video_codec = AV_CODEC_ID_NONE,
.write_header = write_header,
.write_packet = write_packet,
};
diff --git a/libavformat/cafenc.c b/libavformat/cafenc.c
index b8317cd5edc..67be59806c0 100644
--- a/libavformat/cafenc.c
+++ b/libavformat/cafenc.c
@@ -276,16 +276,16 @@ static int caf_write_trailer(AVFormatContext *s)
return 0;
}
-const AVOutputFormat ff_caf_muxer = {
- .name = "caf",
- .long_name = NULL_IF_CONFIG_SMALL("Apple CAF (Core Audio Format)"),
- .mime_type = "audio/x-caf",
- .extensions = "caf",
+const FFOutputFormat ff_caf_muxer = {
+ .p.name = "caf",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Apple CAF (Core Audio Format)"),
+ .p.mime_type = "audio/x-caf",
+ .p.extensions = "caf",
.priv_data_size = sizeof(CAFContext),
- .audio_codec = AV_CODEC_ID_PCM_S16BE,
- .video_codec = AV_CODEC_ID_NONE,
+ .p.audio_codec = AV_CODEC_ID_PCM_S16BE,
+ .p.video_codec = AV_CODEC_ID_NONE,
.write_header = caf_write_header,
.write_packet = caf_write_packet,
.write_trailer = caf_write_trailer,
- .codec_tag = ff_caf_codec_tags_list,
+ .p.codec_tag = ff_caf_codec_tags_list,
};
diff --git a/libavformat/chromaprint.c b/libavformat/chromaprint.c
index 3953a5ced30..9e5fd780c1e 100644
--- a/libavformat/chromaprint.c
+++ b/libavformat/chromaprint.c
@@ -21,6 +21,7 @@
#include "avformat.h"
#include "internal.h"
+#include "mux.h"
#include "libavutil/opt.h"
#include <chromaprint.h>
@@ -176,15 +177,15 @@ static const AVClass chromaprint_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVOutputFormat ff_chromaprint_muxer = {
- .name = "chromaprint",
- .long_name = NULL_IF_CONFIG_SMALL("Chromaprint"),
+const FFOutputFormat ff_chromaprint_muxer = {
+ .p.name = "chromaprint",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Chromaprint"),
.priv_data_size = sizeof(ChromaprintMuxContext),
- .audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
+ .p.audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
.write_header = write_header,
.write_packet = write_packet,
.write_trailer = write_trailer,
.deinit = deinit,
- .flags = AVFMT_NOTIMESTAMPS,
- .priv_class = &chromaprint_class,
+ .p.flags = AVFMT_NOTIMESTAMPS,
+ .p.priv_class = &chromaprint_class,
};
diff --git a/libavformat/codec2.c b/libavformat/codec2.c
index 400c5acbdb6..f0f7b892533 100644
--- a/libavformat/codec2.c
+++ b/libavformat/codec2.c
@@ -28,6 +28,7 @@
#include "avio_internal.h"
#include "avformat.h"
#include "internal.h"
+#include "mux.h"
#include "rawenc.h"
#include "pcm.h"
@@ -309,16 +310,16 @@ const AVInputFormat ff_codec2_demuxer = {
#endif
#if CONFIG_CODEC2_MUXER
-const AVOutputFormat ff_codec2_muxer = {
- .name = "codec2",
- .long_name = NULL_IF_CONFIG_SMALL("codec2 .c2 muxer"),
+const FFOutputFormat ff_codec2_muxer = {
+ .p.name = "codec2",
+ .p.long_name = NULL_IF_CONFIG_SMALL("codec2 .c2 muxer"),
+ .p.extensions = "c2",
+ .p.audio_codec = AV_CODEC_ID_CODEC2,
+ .p.video_codec = AV_CODEC_ID_NONE,
+ .p.flags = AVFMT_NOTIMESTAMPS,
.priv_data_size = sizeof(Codec2Context),
- .extensions = "c2",
- .audio_codec = AV_CODEC_ID_CODEC2,
- .video_codec = AV_CODEC_ID_NONE,
.write_header = codec2_write_header,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
};
#endif
diff --git a/libavformat/crcenc.c b/libavformat/crcenc.c
index 9f40dd4ec0d..1779bdd91c0 100644
--- a/libavformat/crcenc.c
+++ b/libavformat/crcenc.c
@@ -23,6 +23,7 @@
#include "libavutil/adler32.h"
#include "avformat.h"
+#include "mux.h"
typedef struct CRCState {
uint32_t crcval;
@@ -54,14 +55,14 @@ static int crc_write_trailer(struct AVFormatContext *s)
return 0;
}
-const AVOutputFormat ff_crc_muxer = {
- .name = "crc",
- .long_name = NULL_IF_CONFIG_SMALL("CRC testing"),
+const FFOutputFormat ff_crc_muxer = {
+ .p.name = "crc",
+ .p.long_name = NULL_IF_CONFIG_SMALL("CRC testing"),
.priv_data_size = sizeof(CRCState),
- .audio_codec = AV_CODEC_ID_PCM_S16LE,
- .video_codec = AV_CODEC_ID_RAWVIDEO,
+ .p.audio_codec = AV_CODEC_ID_PCM_S16LE,
+ .p.video_codec = AV_CODEC_ID_RAWVIDEO,
.init = crc_init,
.write_packet = crc_write_packet,
.write_trailer = crc_write_trailer,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 8e725a0d3fb..52865eacb51 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -2346,10 +2346,10 @@ static int dash_check_bitstream(AVFormatContext *s, AVStream *st,
DASHContext *c = s->priv_data;
OutputStream *os = &c->streams[st->index];
AVFormatContext *oc = os->ctx;
- if (oc->oformat->check_bitstream) {
+ if (ffofmt(oc->oformat)->check_bitstream) {
AVStream *const ost = oc->streams[0];
int ret;
- ret = oc->oformat->check_bitstream(oc, ost, avpkt);
+ ret = ffofmt(oc->oformat)->check_bitstream(oc, ost, avpkt);
if (ret == 1) {
FFStream *const sti = ffstream(st);
FFStream *const osti = ffstream(ost);
@@ -2419,19 +2419,19 @@ static const AVClass dash_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVOutputFormat ff_dash_muxer = {
- .name = "dash",
- .long_name = NULL_IF_CONFIG_SMALL("DASH Muxer"),
- .extensions = "mpd",
+const FFOutputFormat ff_dash_muxer = {
+ .p.name = "dash",
+ .p.long_name = NULL_IF_CONFIG_SMALL("DASH Muxer"),
+ .p.extensions = "mpd",
+ .p.audio_codec = AV_CODEC_ID_AAC,
+ .p.video_codec = AV_CODEC_ID_H264,
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_NOFILE | AVFMT_TS_NEGATIVE,
+ .p.priv_class = &dash_class,
.priv_data_size = sizeof(DASHContext),
- .audio_codec = AV_CODEC_ID_AAC,
- .video_codec = AV_CODEC_ID_H264,
- .flags = AVFMT_GLOBALHEADER | AVFMT_NOFILE | AVFMT_TS_NEGATIVE,
.init = dash_init,
.write_header = dash_write_header,
.write_packet = dash_write_packet,
.write_trailer = dash_write_trailer,
.deinit = dash_free,
.check_bitstream = dash_check_bitstream,
- .priv_class = &dash_class,
};
diff --git a/libavformat/daudenc.c b/libavformat/daudenc.c
index 2e252449e92..2d84b16650e 100644
--- a/libavformat/daudenc.c
+++ b/libavformat/daudenc.c
@@ -20,6 +20,7 @@
*/
#include "avformat.h"
+#include "mux.h"
static int daud_init(struct AVFormatContext *s)
{
@@ -42,13 +43,13 @@ static int daud_write_packet(struct AVFormatContext *s, AVPacket *pkt)
return 0;
}
-const AVOutputFormat ff_daud_muxer = {
- .name = "daud",
- .long_name = NULL_IF_CONFIG_SMALL("D-Cinema audio"),
- .extensions = "302",
- .audio_codec = AV_CODEC_ID_PCM_S24DAUD,
- .video_codec = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_daud_muxer = {
+ .p.name = "daud",
+ .p.long_name = NULL_IF_CONFIG_SMALL("D-Cinema audio"),
+ .p.extensions = "302",
+ .p.audio_codec = AV_CODEC_ID_PCM_S24DAUD,
+ .p.video_codec = AV_CODEC_ID_NONE,
+ .p.flags = AVFMT_NOTIMESTAMPS,
.init = daud_init,
.write_packet = daud_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
};
diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c
index 11947aa4934..29d2dc47acf 100644
--- a/libavformat/dvenc.c
+++ b/libavformat/dvenc.c
@@ -442,13 +442,13 @@ static void dv_deinit(AVFormatContext *s)
av_fifo_freep2(&c->audio_data[i]);
}
-const AVOutputFormat ff_dv_muxer = {
- .name = "dv",
- .long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),
- .extensions = "dv",
+const FFOutputFormat ff_dv_muxer = {
+ .p.name = "dv",
+ .p.long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),
+ .p.extensions = "dv",
.priv_data_size = sizeof(DVMuxContext),
- .audio_codec = AV_CODEC_ID_PCM_S16LE,
- .video_codec = AV_CODEC_ID_DVVIDEO,
+ .p.audio_codec = AV_CODEC_ID_PCM_S16LE,
+ .p.video_codec = AV_CODEC_ID_DVVIDEO,
.write_header = dv_write_header,
.write_packet = dv_write_packet,
.deinit = dv_deinit,
diff --git a/libavformat/ffmetaenc.c b/libavformat/ffmetaenc.c
index f27ac1ac502..ef076407b5d 100644
--- a/libavformat/ffmetaenc.c
+++ b/libavformat/ffmetaenc.c
@@ -23,6 +23,7 @@
#include "avformat.h"
#include "ffmeta.h"
+#include "mux.h"
#include "libavutil/dict.h"
@@ -87,12 +88,12 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
return 0;
}
-const AVOutputFormat ff_ffmetadata_muxer = {
- .name = "ffmetadata",
- .long_name = NULL_IF_CONFIG_SMALL("FFmpeg metadata in text"),
- .extensions = "ffmeta",
+const FFOutputFormat ff_ffmetadata_muxer = {
+ .p.name = "ffmetadata",
+ .p.long_name = NULL_IF_CONFIG_SMALL("FFmpeg metadata in text"),
+ .p.extensions = "ffmeta",
.write_header = write_header,
.write_packet = write_packet,
.write_trailer = write_trailer,
- .flags = AVFMT_NOTIMESTAMPS | AVFMT_NOSTREAMS,
+ .p.flags = AVFMT_NOTIMESTAMPS | AVFMT_NOSTREAMS,
};
diff --git a/libavformat/fifo.c b/libavformat/fifo.c
index c125a97b0dd..ebadeef645d 100644
--- a/libavformat/fifo.c
+++ b/libavformat/fifo.c
@@ -707,15 +707,15 @@ static const AVClass fifo_muxer_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVOutputFormat ff_fifo_muxer = {
- .name = "fifo",
- .long_name = NULL_IF_CONFIG_SMALL("FIFO queue pseudo-muxer"),
+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,
+ .p.flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
.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,
- .priv_class = &fifo_muxer_class,
- .flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
};
diff --git a/libavformat/fifo_test.c b/libavformat/fifo_test.c
index 80c0c846129..0f12d88b0fd 100644
--- a/libavformat/fifo_test.c
+++ b/libavformat/fifo_test.c
@@ -25,6 +25,7 @@
#include "libavutil/time.h"
#include "avformat.h"
+#include "mux.h"
#include "url.h"
/* Implementation of mock muxer to simulate real muxer failures */
@@ -137,15 +138,15 @@ static const AVClass failing_muxer_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVOutputFormat ff_fifo_test_muxer = {
- .name = "fifo_test",
- .long_name = NULL_IF_CONFIG_SMALL("Fifo test muxer"),
+const FFOutputFormat ff_fifo_test_muxer = {
+ .p.name = "fifo_test",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Fifo test muxer"),
.priv_data_size = sizeof(FailingMuxerContext),
.write_header = failing_write_header,
.write_packet = failing_write_packet,
.write_trailer = failing_write_trailer,
.deinit = failing_deinit,
- .priv_class = &failing_muxer_class,
- .flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH,
+ .p.priv_class = &failing_muxer_class,
+ .p.flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH,
};
diff --git a/libavformat/filmstripenc.c b/libavformat/filmstripenc.c
index ebb7294175f..9033dba6925 100644
--- a/libavformat/filmstripenc.c
+++ b/libavformat/filmstripenc.c
@@ -27,6 +27,7 @@
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "avio_internal.h"
+#include "mux.h"
#include "rawenc.h"
#define RAND_TAG MKBETAG('R','a','n','d')
@@ -59,12 +60,12 @@ static int write_trailer(AVFormatContext *s)
return 0;
}
-const AVOutputFormat ff_filmstrip_muxer = {
- .name = "filmstrip",
- .long_name = NULL_IF_CONFIG_SMALL("Adobe Filmstrip"),
- .extensions = "flm",
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_RAWVIDEO,
+const FFOutputFormat ff_filmstrip_muxer = {
+ .p.name = "filmstrip",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Adobe Filmstrip"),
+ .p.extensions = "flm",
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_RAWVIDEO,
.write_header = write_header,
.write_packet = ff_raw_write_packet,
.write_trailer = write_trailer,
diff --git a/libavformat/fitsenc.c b/libavformat/fitsenc.c
index 37ee10bb139..1df7e2bcf2b 100644
--- a/libavformat/fitsenc.c
+++ b/libavformat/fitsenc.c
@@ -26,6 +26,7 @@
#include "avio_internal.h"
#include "internal.h"
+#include "mux.h"
typedef struct FITSContext {
int first_image;
@@ -191,13 +192,13 @@ static int fits_write_packet(AVFormatContext *s, AVPacket *pkt)
return 0;
}
-const AVOutputFormat ff_fits_muxer = {
- .name = "fits",
- .long_name = NULL_IF_CONFIG_SMALL("Flexible Image Transport System"),
- .extensions = "fits",
+const FFOutputFormat ff_fits_muxer = {
+ .p.name = "fits",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Flexible Image Transport System"),
+ .p.extensions = "fits",
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_FITS,
.priv_data_size = sizeof(FITSContext),
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_FITS,
.write_header = fits_write_header,
.write_packet = fits_write_packet,
};
diff --git a/libavformat/flacenc.c b/libavformat/flacenc.c
index d7930f4a6e2..a8beec7750b 100644
--- a/libavformat/flacenc.c
+++ b/libavformat/flacenc.c
@@ -30,6 +30,7 @@
#include "flacenc.h"
#include "id3v2.h"
#include "internal.h"
+#include "mux.h"
#include "version.h"
#include "vorbiscomment.h"
@@ -413,19 +414,19 @@ static const AVClass flac_muxer_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVOutputFormat ff_flac_muxer = {
- .name = "flac",
- .long_name = NULL_IF_CONFIG_SMALL("raw FLAC"),
+const FFOutputFormat ff_flac_muxer = {
+ .p.name = "flac",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw FLAC"),
.priv_data_size = sizeof(FlacMuxerContext),
- .mime_type = "audio/x-flac",
- .extensions = "flac",
- .audio_codec = AV_CODEC_ID_FLAC,
- .video_codec = AV_CODEC_ID_PNG,
+ .p.mime_type = "audio/x-flac",
+ .p.extensions = "flac",
+ .p.audio_codec = AV_CODEC_ID_FLAC,
+ .p.video_codec = AV_CODEC_ID_PNG,
.init = flac_init,
.write_header = flac_write_header,
.write_packet = flac_write_packet,
.write_trailer = flac_write_trailer,
.deinit = flac_deinit,
- .flags = AVFMT_NOTIMESTAMPS,
- .priv_class = &flac_muxer_class,
+ .p.flags = AVFMT_NOTIMESTAMPS,
+ .p.priv_class = &flac_muxer_class,
};
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 128ae8ebc0e..81d9b6100da 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -1060,24 +1060,24 @@ static const AVClass flv_muxer_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVOutputFormat ff_flv_muxer = {
- .name = "flv",
- .long_name = NULL_IF_CONFIG_SMALL("FLV (Flash Video)"),
- .mime_type = "video/x-flv",
- .extensions = "flv",
+const FFOutputFormat ff_flv_muxer = {
+ .p.name = "flv",
+ .p.long_name = NULL_IF_CONFIG_SMALL("FLV (Flash Video)"),
+ .p.mime_type = "video/x-flv",
+ .p.extensions = "flv",
.priv_data_size = sizeof(FLVContext),
- .audio_codec = CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : AV_CODEC_ID_ADPCM_SWF,
- .video_codec = AV_CODEC_ID_FLV1,
+ .p.audio_codec = CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : AV_CODEC_ID_ADPCM_SWF,
+ .p.video_codec = AV_CODEC_ID_FLV1,
.init = flv_init,
.write_header = flv_write_header,
.write_packet = flv_write_packet,
.write_trailer = flv_write_trailer,
.deinit = flv_deinit,
.check_bitstream= flv_check_bitstream,
- .codec_tag = (const AVCodecTag* const []) {
+ .p.codec_tag = (const AVCodecTag* const []) {
flv_video_codec_ids, flv_audio_codec_ids, 0
},
- .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
AVFMT_TS_NONSTRICT,
- .priv_class = &flv_muxer_class,
+ .p.priv_class = &flv_muxer_class,
};
diff --git a/libavformat/framecrcenc.c b/libavformat/framecrcenc.c
index ab79903e318..ce306a6c498 100644
--- a/libavformat/framecrcenc.c
+++ b/libavformat/framecrcenc.c
@@ -30,6 +30,7 @@
#include "avformat.h"
#include "internal.h"
+#include "mux.h"
static int framecrc_write_header(struct AVFormatContext *s)
{
@@ -69,13 +70,13 @@ static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt)
return 0;
}
-const AVOutputFormat ff_framecrc_muxer = {
- .name = "framecrc",
- .long_name = NULL_IF_CONFIG_SMALL("framecrc testing"),
- .audio_codec = AV_CODEC_ID_PCM_S16LE,
- .video_codec = AV_CODEC_ID_RAWVIDEO,
+const FFOutputFormat ff_framecrc_muxer = {
+ .p.name = "framecrc",
+ .p.long_name = NULL_IF_CONFIG_SMALL("framecrc testing"),
+ .p.audio_codec = AV_CODEC_ID_PCM_S16LE,
+ .p.video_codec = AV_CODEC_ID_RAWVIDEO,
.write_header = framecrc_write_header,
.write_packet = framecrc_write_packet,
- .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
+ .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
AVFMT_TS_NEGATIVE,
};
diff --git a/libavformat/gif.c b/libavformat/gif.c
index b52ff4dd395..bfa7deb598c 100644
--- a/libavformat/gif.c
+++ b/libavformat/gif.c
@@ -23,6 +23,7 @@
#include "avformat.h"
#include "internal.h"
+#include "mux.h"
#include "libavutil/imgutils.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
@@ -202,17 +203,17 @@ static const AVClass gif_muxer_class = {
.option = options,
};
-const AVOutputFormat ff_gif_muxer = {
- .name = "gif",
- .long_name = NULL_IF_CONFIG_SMALL("CompuServe Graphics Interchange Format (GIF)"),
- .mime_type = "image/gif",
- .extensions = "gif",
+const FFOutputFormat ff_gif_muxer = {
+ .p.name = "gif",
+ .p.long_name = NULL_IF_CONFIG_SMALL("CompuServe Graphics Interchange Format (GIF)"),
+ .p.mime_type = "image/gif",
+ .p.extensions = "gif",
.priv_data_size = sizeof(GIFContext),
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_GIF,
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_GIF,
.write_header = gif_write_header,
.write_packet = gif_write_packet,
.write_trailer = gif_write_trailer,
- .priv_class = &gif_muxer_class,
- .flags = AVFMT_VARIABLE_FPS,
+ .p.priv_class = &gif_muxer_class,
+ .p.flags = AVFMT_VARIABLE_FPS,
};
diff --git a/libavformat/gxfenc.c b/libavformat/gxfenc.c
index 0f971c039a4..74959247229 100644
--- a/libavformat/gxfenc.c
+++ b/libavformat/gxfenc.c
@@ -1009,13 +1009,13 @@ static int gxf_interleave_packet(AVFormatContext *s, AVPacket *pkt,
return ff_interleave_packet_per_dts(s, pkt, flush, 0);
}
-const AVOutputFormat ff_gxf_muxer = {
- .name = "gxf",
- .long_name = NULL_IF_CONFIG_SMALL("GXF (General eXchange Format)"),
- .extensions = "gxf",
+const FFOutputFormat ff_gxf_muxer = {
+ .p.name = "gxf",
+ .p.long_name = NULL_IF_CONFIG_SMALL("GXF (General eXchange Format)"),
+ .p.extensions = "gxf",
.priv_data_size = sizeof(GXFContext),
- .audio_codec = AV_CODEC_ID_PCM_S16LE,
- .video_codec = AV_CODEC_ID_MPEG2VIDEO,
+ .p.audio_codec = AV_CODEC_ID_PCM_S16LE,
+ .p.video_codec = AV_CODEC_ID_MPEG2VIDEO,
.write_header = gxf_write_header,
.write_packet = gxf_write_packet,
.write_trailer = gxf_write_trailer,
diff --git a/libavformat/hashenc.c b/libavformat/hashenc.c
index 1aaba0b306e..17ee2f7e9fb 100644
--- a/libavformat/hashenc.c
+++ b/libavformat/hashenc.c
@@ -27,6 +27,7 @@
#include "libavutil/opt.h"
#include "avformat.h"
#include "internal.h"
+#include "mux.h"
struct HashContext {
const AVClass *avclass;
@@ -172,19 +173,19 @@ static void hash_free(struct AVFormatContext *s)
}
#if CONFIG_HASH_MUXER
-const AVOutputFormat ff_hash_muxer = {
- .name = "hash",
- .long_name = NULL_IF_CONFIG_SMALL("Hash testing"),
+const FFOutputFormat ff_hash_muxer = {
+ .p.name = "hash",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Hash testing"),
.priv_data_size = sizeof(struct HashContext),
- .audio_codec = AV_CODEC_ID_PCM_S16LE,
- .video_codec = AV_CODEC_ID_RAWVIDEO,
+ .p.audio_codec = AV_CODEC_ID_PCM_S16LE,
+ .p.video_codec = AV_CODEC_ID_RAWVIDEO,
.init = hash_init,
.write_packet = hash_write_packet,
.write_trailer = hash_write_trailer,
.deinit = hash_free,
- .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
+ .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
AVFMT_TS_NEGATIVE,
- .priv_class = &hash_streamhashenc_class,
+ .p.priv_class = &hash_streamhashenc_class,
};
#endif
@@ -196,36 +197,36 @@ static const AVClass md5enc_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVOutputFormat ff_md5_muxer = {
- .name = "md5",
- .long_name = NULL_IF_CONFIG_SMALL("MD5 testing"),
+const FFOutputFormat ff_md5_muxer = {
+ .p.name = "md5",
+ .p.long_name = NULL_IF_CONFIG_SMALL("MD5 testing"),
.priv_data_size = sizeof(struct HashContext),
- .audio_codec = AV_CODEC_ID_PCM_S16LE,
- .video_codec = AV_CODEC_ID_RAWVIDEO,
+ .p.audio_codec = AV_CODEC_ID_PCM_S16LE,
+ .p.video_codec = AV_CODEC_ID_RAWVIDEO,
.init = hash_init,
.write_packet = hash_write_packet,
.write_trailer = hash_write_trailer,
.deinit = hash_free,
- .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
+ .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
AVFMT_TS_NEGATIVE,
- .priv_class = &md5enc_class,
+ .p.priv_class = &md5enc_class,
};
#endif
#if CONFIG_STREAMHASH_MUXER
-const AVOutputFormat ff_streamhash_muxer = {
- .name = "streamhash",
- .long_name = NULL_IF_CONFIG_SMALL("Per-stream hash testing"),
+const FFOutputFormat ff_streamhash_muxer = {
+ .p.name = "streamhash",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Per-stream hash testing"),
.priv_data_size = sizeof(struct HashContext),
- .audio_codec = AV_CODEC_ID_PCM_S16LE,
- .video_codec = AV_CODEC_ID_RAWVIDEO,
+ .p.audio_codec = AV_CODEC_ID_PCM_S16LE,
+ .p.video_codec = AV_CODEC_ID_RAWVIDEO,
.init = streamhash_init,
.write_packet = hash_write_packet,
.write_trailer = hash_write_trailer,
.deinit = hash_free,
- .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
+ .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
AVFMT_TS_NEGATIVE,
- .priv_class = &hash_streamhashenc_class,
+ .p.priv_class = &hash_streamhashenc_class,
};
#endif
@@ -324,19 +325,19 @@ static const AVClass framehash_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVOutputFormat ff_framehash_muxer = {
- .name = "framehash",
- .long_name = NULL_IF_CONFIG_SMALL("Per-frame hash testing"),
+const FFOutputFormat ff_framehash_muxer = {
+ .p.name = "framehash",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Per-frame hash testing"),
.priv_data_size = sizeof(struct HashContext),
- .audio_codec = AV_CODEC_ID_PCM_S16LE,
- .video_codec = AV_CODEC_ID_RAWVIDEO,
+ .p.audio_codec = AV_CODEC_ID_PCM_S16LE,
+ .p.video_codec = AV_CODEC_ID_RAWVIDEO,
.init = framehash_init,
.write_header = framehash_write_header,
.write_packet = framehash_write_packet,
.deinit = hash_free,
- .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
+ .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
AVFMT_TS_NEGATIVE,
- .priv_class = &framehash_class,
+ .p.priv_class = &framehash_class,
};
#endif
@@ -348,18 +349,18 @@ static const AVClass framemd5_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVOutputFormat ff_framemd5_muxer = {
- .name = "framemd5",
- .long_name = NULL_IF_CONFIG_SMALL("Per-frame MD5 testing"),
+const FFOutputFormat ff_framemd5_muxer = {
+ .p.name = "framemd5",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Per-frame MD5 testing"),
.priv_data_size = sizeof(struct HashContext),
- .audio_codec = AV_CODEC_ID_PCM_S16LE,
- .video_codec = AV_CODEC_ID_RAWVIDEO,
+ .p.audio_codec = AV_CODEC_ID_PCM_S16LE,
+ .p.video_codec = AV_CODEC_ID_RAWVIDEO,
.init = framehash_init,
.write_header = framehash_write_header,
.write_packet = framehash_write_packet,
.deinit = hash_free,
- .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
+ .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
AVFMT_TS_NEGATIVE,
- .priv_class = &framemd5_class,
+ .p.priv_class = &framemd5_class,
};
#endif
diff --git a/libavformat/hdsenc.c b/libavformat/hdsenc.c
index a8f340ac460..080a873ee8a 100644
--- a/libavformat/hdsenc.c
+++ b/libavformat/hdsenc.c
@@ -564,16 +564,16 @@ static const AVClass hds_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVOutputFormat ff_hds_muxer = {
- .name = "hds",
- .long_name = NULL_IF_CONFIG_SMALL("HDS Muxer"),
+const FFOutputFormat ff_hds_muxer = {
+ .p.name = "hds",
+ .p.long_name = NULL_IF_CONFIG_SMALL("HDS Muxer"),
+ .p.audio_codec = AV_CODEC_ID_AAC,
+ .p.video_codec = AV_CODEC_ID_H264,
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_NOFILE,
+ .p.priv_class = &hds_class,
.priv_data_size = sizeof(HDSContext),
- .audio_codec = AV_CODEC_ID_AAC,
- .video_codec = AV_CODEC_ID_H264,
- .flags = AVFMT_GLOBALHEADER | AVFMT_NOFILE,
.write_header = hds_write_header,
.write_packet = hds_write_packet,
.write_trailer = hds_write_trailer,
.deinit = hds_free,
- .priv_class = &hds_class,
};
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 39df9becc7a..adf06ec7643 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -3183,19 +3183,19 @@ static const AVClass hls_class = {
};
-const AVOutputFormat ff_hls_muxer = {
- .name = "hls",
- .long_name = NULL_IF_CONFIG_SMALL("Apple HTTP Live Streaming"),
- .extensions = "m3u8",
+const FFOutputFormat ff_hls_muxer = {
+ .p.name = "hls",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Apple HTTP Live Streaming"),
+ .p.extensions = "m3u8",
+ .p.audio_codec = AV_CODEC_ID_AAC,
+ .p.video_codec = AV_CODEC_ID_H264,
+ .p.subtitle_codec = AV_CODEC_ID_WEBVTT,
+ .p.flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_NODIMENSIONS,
+ .p.priv_class = &hls_class,
.priv_data_size = sizeof(HLSContext),
- .audio_codec = AV_CODEC_ID_AAC,
- .video_codec = AV_CODEC_ID_H264,
- .subtitle_codec = AV_CODEC_ID_WEBVTT,
- .flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_NODIMENSIONS,
.init = hls_init,
.write_header = hls_write_header,
.write_packet = hls_write_packet,
.write_trailer = hls_write_trailer,
.deinit = hls_deinit,
- .priv_class = &hls_class,
};
diff --git a/libavformat/icoenc.c b/libavformat/icoenc.c
index d684f677072..caa3ba4965a 100644
--- a/libavformat/icoenc.c
+++ b/libavformat/icoenc.c
@@ -31,6 +31,7 @@
#include "avformat.h"
#include "avio_internal.h"
+#include "mux.h"
typedef struct {
int offset;
@@ -193,17 +194,17 @@ static void ico_deinit(AVFormatContext *s)
av_freep(&ico->images);
}
-const AVOutputFormat ff_ico_muxer = {
- .name = "ico",
- .long_name = NULL_IF_CONFIG_SMALL("Microsoft Windows ICO"),
+const FFOutputFormat ff_ico_muxer = {
+ .p.name = "ico",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Microsoft Windows ICO"),
.priv_data_size = sizeof(IcoMuxContext),
- .mime_type = "image/vnd.microsoft.icon",
- .extensions = "ico",
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_BMP,
+ .p.mime_type = "image/vnd.microsoft.icon",
+ .p.extensions = "ico",
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_BMP,
.write_header = ico_write_header,
.write_packet = ico_write_packet,
.write_trailer = ico_write_trailer,
.deinit = ico_deinit,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
diff --git a/libavformat/idroqenc.c b/libavformat/idroqenc.c
index 57dd7f024ef..9baf9ad1b1b 100644
--- a/libavformat/idroqenc.c
+++ b/libavformat/idroqenc.c
@@ -20,6 +20,7 @@
*/
#include "avformat.h"
+#include "mux.h"
#include "rawenc.h"
@@ -59,12 +60,12 @@ static int roq_write_header(struct AVFormatContext *s)
return 0;
}
-const AVOutputFormat ff_roq_muxer = {
- .name = "roq",
- .long_name = NULL_IF_CONFIG_SMALL("raw id RoQ"),
- .extensions = "roq",
- .audio_codec = AV_CODEC_ID_ROQ_DPCM,
- .video_codec = AV_CODEC_ID_ROQ,
+const FFOutputFormat ff_roq_muxer = {
+ .p.name = "roq",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw id RoQ"),
+ .p.extensions = "roq",
+ .p.audio_codec = AV_CODEC_ID_ROQ_DPCM,
+ .p.video_codec = AV_CODEC_ID_ROQ,
.write_header = roq_write_header,
.write_packet = ff_raw_write_packet,
};
diff --git a/libavformat/ilbc.c b/libavformat/ilbc.c
index 26336ef2ac3..6b5bb33b620 100644
--- a/libavformat/ilbc.c
+++ b/libavformat/ilbc.c
@@ -23,6 +23,7 @@
#include "avformat.h"
#include "internal.h"
+#include "mux.h"
#include "rawenc.h"
static const char mode20_header[] = "#!iLBC20\n";
@@ -120,14 +121,14 @@ const AVInputFormat ff_ilbc_demuxer = {
};
#if CONFIG_ILBC_MUXER
-const AVOutputFormat ff_ilbc_muxer = {
- .name = "ilbc",
- .long_name = NULL_IF_CONFIG_SMALL("iLBC storage"),
- .mime_type = "audio/iLBC",
- .extensions = "lbc",
- .audio_codec = AV_CODEC_ID_ILBC,
+const FFOutputFormat ff_ilbc_muxer = {
+ .p.name = "ilbc",
+ .p.long_name = NULL_IF_CONFIG_SMALL("iLBC storage"),
+ .p.mime_type = "audio/iLBC",
+ .p.extensions = "lbc",
+ .p.audio_codec = AV_CODEC_ID_ILBC,
+ .p.flags = AVFMT_NOTIMESTAMPS,
.write_header = ilbc_write_header,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
};
#endif
diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c
index c05f37e22b3..9b8ec06cea1 100644
--- a/libavformat/img2enc.c
+++ b/libavformat/img2enc.c
@@ -33,6 +33,7 @@
#include "avio_internal.h"
#include "internal.h"
#include "img2.h"
+#include "mux.h"
typedef struct VideoMuxData {
const AVClass *class; /**< Class for private options. */
@@ -268,30 +269,30 @@ static const AVClass img2mux_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVOutputFormat ff_image2_muxer = {
- .name = "image2",
- .long_name = NULL_IF_CONFIG_SMALL("image2 sequence"),
- .extensions = "bmp,dpx,exr,jls,jpeg,jpg,jxl,ljpg,pam,pbm,pcx,pfm,pgm,pgmyuv,phm,"
+const FFOutputFormat ff_image2_muxer = {
+ .p.name = "image2",
+ .p.long_name = NULL_IF_CONFIG_SMALL("image2 sequence"),
+ .p.extensions = "bmp,dpx,exr,jls,jpeg,jpg,jxl,ljpg,pam,pbm,pcx,pfm,pgm,pgmyuv,phm,"
"png,ppm,sgi,tga,tif,tiff,jp2,j2c,j2k,xwd,sun,ras,rs,im1,im8,"
"im24,sunras,vbn,xbm,xface,pix,y,avif,qoi,hdr,wbmp",
.priv_data_size = sizeof(VideoMuxData),
- .video_codec = AV_CODEC_ID_MJPEG,
+ .p.video_codec = AV_CODEC_ID_MJPEG,
.write_header = write_header,
.write_packet = write_packet,
.query_codec = query_codec,
- .flags = AVFMT_NOTIMESTAMPS | AVFMT_NODIMENSIONS | AVFMT_NOFILE,
- .priv_class = &img2mux_class,
+ .p.flags = AVFMT_NOTIMESTAMPS | AVFMT_NODIMENSIONS | AVFMT_NOFILE,
+ .p.priv_class = &img2mux_class,
};
#endif
#if CONFIG_IMAGE2PIPE_MUXER
-const AVOutputFormat ff_image2pipe_muxer = {
- .name = "image2pipe",
- .long_name = NULL_IF_CONFIG_SMALL("piped image2 sequence"),
+const FFOutputFormat ff_image2pipe_muxer = {
+ .p.name = "image2pipe",
+ .p.long_name = NULL_IF_CONFIG_SMALL("piped image2 sequence"),
.priv_data_size = sizeof(VideoMuxData),
- .video_codec = AV_CODEC_ID_MJPEG,
+ .p.video_codec = AV_CODEC_ID_MJPEG,
.write_header = write_header,
.write_packet = write_packet_pipe,
.query_codec = query_codec,
- .flags = AVFMT_NOTIMESTAMPS | AVFMT_NODIMENSIONS
+ .p.flags = AVFMT_NOTIMESTAMPS | AVFMT_NODIMENSIONS
};
#endif
diff --git a/libavformat/internal.h b/libavformat/internal.h
index ce837fefc76..f575064e8fb 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -705,6 +705,7 @@ int ff_unlock_avformat(void);
*/
void ff_format_set_url(AVFormatContext *s, char *url);
-void avpriv_register_devices(const AVOutputFormat * const o[], const AVInputFormat * const i[]);
+struct FFOutputFormat;
+void avpriv_register_devices(const struct FFOutputFormat * const o[], const AVInputFormat * const i[]);
#endif /* AVFORMAT_INTERNAL_H */
diff --git a/libavformat/ircamenc.c b/libavformat/ircamenc.c
index df1494b2b8d..ceeab2b305b 100644
--- a/libavformat/ircamenc.c
+++ b/libavformat/ircamenc.c
@@ -23,6 +23,7 @@
#include "avformat.h"
#include "avio_internal.h"
#include "internal.h"
+#include "mux.h"
#include "rawenc.h"
#include "ircam.h"
@@ -50,13 +51,13 @@ static int ircam_write_header(AVFormatContext *s)
return 0;
}
-const AVOutputFormat ff_ircam_muxer = {
- .name = "ircam",
- .extensions = "sf,ircam",
- .long_name = NULL_IF_CONFIG_SMALL("Berkeley/IRCAM/CARL Sound Format"),
- .audio_codec = AV_CODEC_ID_PCM_S16LE,
- .video_codec = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_ircam_muxer = {
+ .p.name = "ircam",
+ .p.extensions = "sf,ircam",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Berkeley/IRCAM/CARL Sound Format"),
+ .p.audio_codec = AV_CODEC_ID_PCM_S16LE,
+ .p.video_codec = AV_CODEC_ID_NONE,
.write_header = ircam_write_header,
.write_packet = ff_raw_write_packet,
- .codec_tag = (const AVCodecTag *const []){ ff_codec_ircam_le_tags, 0 },
+ .p.codec_tag = (const AVCodecTag *const []){ ff_codec_ircam_le_tags, 0 },
};
diff --git a/libavformat/ivfenc.c b/libavformat/ivfenc.c
index ed5ec90ce94..47b4efbcd10 100644
--- a/libavformat/ivfenc.c
+++ b/libavformat/ivfenc.c
@@ -122,16 +122,16 @@ static const AVCodecTag codec_ivf_tags[] = {
{ AV_CODEC_ID_NONE, 0 }
};
-const AVOutputFormat ff_ivf_muxer = {
+const FFOutputFormat ff_ivf_muxer = {
+ .p.name = "ivf",
+ .p.long_name = NULL_IF_CONFIG_SMALL("On2 IVF"),
+ .p.extensions = "ivf",
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_VP8,
+ .p.codec_tag = (const AVCodecTag* const []){ codec_ivf_tags, 0 },
.priv_data_size = sizeof(IVFEncContext),
- .name = "ivf",
- .long_name = NULL_IF_CONFIG_SMALL("On2 IVF"),
- .extensions = "ivf",
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_VP8,
.init = ivf_init,
.write_header = ivf_write_header,
.write_packet = ivf_write_packet,
.write_trailer = ivf_write_trailer,
- .codec_tag = (const AVCodecTag* const []){ codec_ivf_tags, 0 },
};
diff --git a/libavformat/jacosubenc.c b/libavformat/jacosubenc.c
index f0548bb2820..fa0f9fdaa2a 100644
--- a/libavformat/jacosubenc.c
+++ b/libavformat/jacosubenc.c
@@ -17,6 +17,7 @@
*/
#include "avformat.h"
+#include "mux.h"
#include "rawenc.h"
static int jacosub_write_header(AVFormatContext *s)
@@ -29,13 +30,13 @@ static int jacosub_write_header(AVFormatContext *s)
return 0;
}
-const AVOutputFormat ff_jacosub_muxer = {
- .name = "jacosub",
- .long_name = NULL_IF_CONFIG_SMALL("JACOsub subtitle format"),
- .mime_type = "text/x-jacosub",
- .extensions = "jss,js",
+const FFOutputFormat ff_jacosub_muxer = {
+ .p.name = "jacosub",
+ .p.long_name = NULL_IF_CONFIG_SMALL("JACOsub subtitle format"),
+ .p.mime_type = "text/x-jacosub",
+ .p.extensions = "jss,js",
+ .p.flags = AVFMT_TS_NONSTRICT,
+ .p.subtitle_codec = AV_CODEC_ID_JACOSUB,
.write_header = jacosub_write_header,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_TS_NONSTRICT,
- .subtitle_codec = AV_CODEC_ID_JACOSUB,
};
diff --git a/libavformat/kvag.c b/libavformat/kvag.c
index 7c3816ab828..9487e7dd0eb 100644
--- a/libavformat/kvag.c
+++ b/libavformat/kvag.c
@@ -26,6 +26,7 @@
#include "avformat.h"
#include "avio_internal.h"
#include "internal.h"
+#include "mux.h"
#include "rawenc.h"
#include "libavutil/intreadwrite.h"
@@ -188,12 +189,12 @@ static int kvag_write_trailer(AVFormatContext *s)
return 0;
}
-const AVOutputFormat ff_kvag_muxer = {
- .name = "kvag",
- .long_name = NULL_IF_CONFIG_SMALL("Simon & Schuster Interactive VAG"),
- .extensions = "vag",
- .audio_codec = AV_CODEC_ID_ADPCM_IMA_SSI,
- .video_codec = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_kvag_muxer = {
+ .p.name = "kvag",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Simon & Schuster Interactive VAG"),
+ .p.extensions = "vag",
+ .p.audio_codec = AV_CODEC_ID_ADPCM_IMA_SSI,
+ .p.video_codec = AV_CODEC_ID_NONE,
.init = kvag_write_init,
.write_header = kvag_write_header,
.write_packet = ff_raw_write_packet,
diff --git a/libavformat/latmenc.c b/libavformat/latmenc.c
index 6fd36d1484f..8eec632c546 100644
--- a/libavformat/latmenc.c
+++ b/libavformat/latmenc.c
@@ -260,17 +260,17 @@ static int latm_check_bitstream(AVFormatContext *s, AVStream *st,
return ret;
}
-const AVOutputFormat ff_latm_muxer = {
- .name = "latm",
- .long_name = NULL_IF_CONFIG_SMALL("LOAS/LATM"),
- .mime_type = "audio/MP4A-LATM",
- .extensions = "latm,loas",
+const FFOutputFormat ff_latm_muxer = {
+ .p.name = "latm",
+ .p.long_name = NULL_IF_CONFIG_SMALL("LOAS/LATM"),
+ .p.mime_type = "audio/MP4A-LATM",
+ .p.extensions = "latm,loas",
.priv_data_size = sizeof(LATMContext),
- .audio_codec = AV_CODEC_ID_AAC,
- .video_codec = AV_CODEC_ID_NONE,
+ .p.audio_codec = AV_CODEC_ID_AAC,
+ .p.video_codec = AV_CODEC_ID_NONE,
.write_header = latm_write_header,
.write_packet = latm_write_packet,
- .priv_class = &latm_muxer_class,
+ .p.priv_class = &latm_muxer_class,
.check_bitstream= latm_check_bitstream,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
diff --git a/libavformat/lrcenc.c b/libavformat/lrcenc.c
index 2d6ca33e380..d66be9a8faa 100644
--- a/libavformat/lrcenc.c
+++ b/libavformat/lrcenc.c
@@ -125,14 +125,14 @@ static int lrc_write_packet(AVFormatContext *s, AVPacket *pkt)
return 0;
}
-const AVOutputFormat ff_lrc_muxer = {
- .name = "lrc",
- .long_name = NULL_IF_CONFIG_SMALL("LRC lyrics"),
- .extensions = "lrc",
+const FFOutputFormat ff_lrc_muxer = {
+ .p.name = "lrc",
+ .p.long_name = NULL_IF_CONFIG_SMALL("LRC lyrics"),
+ .p.extensions = "lrc",
+ .p.flags = AVFMT_VARIABLE_FPS | AVFMT_GLOBALHEADER |
+ AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT,
+ .p.subtitle_codec = AV_CODEC_ID_SUBRIP,
.priv_data_size = 0,
.write_header = lrc_write_header,
.write_packet = lrc_write_packet,
- .flags = AVFMT_VARIABLE_FPS | AVFMT_GLOBALHEADER |
- AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT,
- .subtitle_codec = AV_CODEC_ID_SUBRIP
};
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 2deb4284e84..113541bd9a2 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -3321,31 +3321,31 @@ static int mkv_query_codec(enum AVCodecID codec_id, int std_compliance)
return 0;
}
-const AVOutputFormat ff_matroska_muxer = {
- .name = "matroska",
- .long_name = NULL_IF_CONFIG_SMALL("Matroska"),
- .mime_type = "video/x-matroska",
- .extensions = "mkv",
+const FFOutputFormat ff_matroska_muxer = {
+ .p.name = "matroska",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Matroska"),
+ .p.mime_type = "video/x-matroska",
+ .p.extensions = "mkv",
.priv_data_size = sizeof(MatroskaMuxContext),
- .audio_codec = CONFIG_LIBVORBIS_ENCODER ?
+ .p.audio_codec = CONFIG_LIBVORBIS_ENCODER ?
AV_CODEC_ID_VORBIS : AV_CODEC_ID_AC3,
- .video_codec = CONFIG_LIBX264_ENCODER ?
+ .p.video_codec = CONFIG_LIBX264_ENCODER ?
AV_CODEC_ID_H264 : AV_CODEC_ID_MPEG4,
.init = mkv_init,
.deinit = mkv_deinit,
.write_header = mkv_write_header,
.write_packet = mkv_write_flush_packet,
.write_trailer = mkv_write_trailer,
- .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
- .codec_tag = (const AVCodecTag* const []){
+ .p.codec_tag = (const AVCodecTag* const []){
ff_codec_bmp_tags, ff_codec_wav_tags,
additional_audio_tags, additional_video_tags, additional_subtitle_tags, 0
},
- .subtitle_codec = AV_CODEC_ID_ASS,
+ .p.subtitle_codec = AV_CODEC_ID_ASS,
.query_codec = mkv_query_codec,
.check_bitstream = mkv_check_bitstream,
- .priv_class = &matroska_webm_class,
+ .p.priv_class = &matroska_webm_class,
};
#endif
@@ -3359,15 +3359,15 @@ static int webm_query_codec(enum AVCodecID codec_id, int std_compliance)
return 0;
}
-const AVOutputFormat ff_webm_muxer = {
- .name = "webm",
- .long_name = NULL_IF_CONFIG_SMALL("WebM"),
- .mime_type = "video/webm",
- .extensions = "webm",
+const FFOutputFormat ff_webm_muxer = {
+ .p.name = "webm",
+ .p.long_name = NULL_IF_CONFIG_SMALL("WebM"),
+ .p.mime_type = "video/webm",
+ .p.extensions = "webm",
.priv_data_size = sizeof(MatroskaMuxContext),
- .audio_codec = CONFIG_LIBOPUS_ENCODER ? AV_CODEC_ID_OPUS : AV_CODEC_ID_VORBIS,
- .video_codec = CONFIG_LIBVPX_VP9_ENCODER? AV_CODEC_ID_VP9 : AV_CODEC_ID_VP8,
- .subtitle_codec = AV_CODEC_ID_WEBVTT,
+ .p.audio_codec = CONFIG_LIBOPUS_ENCODER ? AV_CODEC_ID_OPUS : AV_CODEC_ID_VORBIS,
+ .p.video_codec = CONFIG_LIBVPX_VP9_ENCODER? AV_CODEC_ID_VP9 : AV_CODEC_ID_VP8,
+ .p.subtitle_codec = AV_CODEC_ID_WEBVTT,
.init = mkv_init,
.deinit = mkv_deinit,
.write_header = mkv_write_header,
@@ -3375,33 +3375,33 @@ const AVOutputFormat ff_webm_muxer = {
.write_trailer = mkv_write_trailer,
.query_codec = webm_query_codec,
.check_bitstream = mkv_check_bitstream,
- .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
- .priv_class = &matroska_webm_class,
+ .p.priv_class = &matroska_webm_class,
};
#endif
#if CONFIG_MATROSKA_AUDIO_MUXER
-const AVOutputFormat ff_matroska_audio_muxer = {
- .name = "matroska",
- .long_name = NULL_IF_CONFIG_SMALL("Matroska Audio"),
- .mime_type = "audio/x-matroska",
- .extensions = "mka",
+const FFOutputFormat ff_matroska_audio_muxer = {
+ .p.name = "matroska",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Matroska Audio"),
+ .p.mime_type = "audio/x-matroska",
+ .p.extensions = "mka",
.priv_data_size = sizeof(MatroskaMuxContext),
- .audio_codec = CONFIG_LIBVORBIS_ENCODER ?
+ .p.audio_codec = CONFIG_LIBVORBIS_ENCODER ?
AV_CODEC_ID_VORBIS : AV_CODEC_ID_AC3,
- .video_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_NONE,
.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 |
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NONSTRICT |
AVFMT_ALLOW_FLUSH,
- .codec_tag = (const AVCodecTag* const []){
+ .p.codec_tag = (const AVCodecTag* const []){
ff_codec_wav_tags, additional_audio_tags, 0
},
- .priv_class = &matroska_webm_class,
+ .p.priv_class = &matroska_webm_class,
};
#endif
diff --git a/libavformat/microdvdenc.c b/libavformat/microdvdenc.c
index 4db5e701619..950309981bb 100644
--- a/libavformat/microdvdenc.c
+++ b/libavformat/microdvdenc.c
@@ -22,6 +22,7 @@
#include <inttypes.h>
#include "avformat.h"
#include "internal.h"
+#include "mux.h"
static int microdvd_write_header(struct AVFormatContext *s)
{
@@ -55,13 +56,13 @@ static int microdvd_write_packet(AVFormatContext *avf, AVPacket *pkt)
return 0;
}
-const AVOutputFormat ff_microdvd_muxer = {
- .name = "microdvd",
- .long_name = NULL_IF_CONFIG_SMALL("MicroDVD subtitle format"),
- .mime_type = "text/x-microdvd",
- .extensions = "sub",
+const FFOutputFormat ff_microdvd_muxer = {
+ .p.name = "microdvd",
+ .p.long_name = NULL_IF_CONFIG_SMALL("MicroDVD subtitle format"),
+ .p.mime_type = "text/x-microdvd",
+ .p.extensions = "sub",
+ .p.flags = AVFMT_NOTIMESTAMPS,
+ .p.subtitle_codec = AV_CODEC_ID_MICRODVD,
.write_header = microdvd_write_header,
.write_packet = microdvd_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
- .subtitle_codec = AV_CODEC_ID_MICRODVD,
};
diff --git a/libavformat/mkvtimestamp_v2.c b/libavformat/mkvtimestamp_v2.c
index 27c7d7a68be..dde431ab7d0 100644
--- a/libavformat/mkvtimestamp_v2.c
+++ b/libavformat/mkvtimestamp_v2.c
@@ -21,6 +21,7 @@
#include "avformat.h"
#include "internal.h"
+#include "mux.h"
static int write_header(AVFormatContext *s)
{
@@ -40,11 +41,11 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
return 0;
}
-const AVOutputFormat ff_mkvtimestamp_v2_muxer = {
- .name = "mkvtimestamp_v2",
- .long_name = NULL_IF_CONFIG_SMALL("extract pts as timecode v2 format, as defined by mkvtoolnix"),
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_RAWVIDEO,
+const FFOutputFormat ff_mkvtimestamp_v2_muxer = {
+ .p.name = "mkvtimestamp_v2",
+ .p.long_name = NULL_IF_CONFIG_SMALL("extract pts as timecode v2 format, as defined by mkvtoolnix"),
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_RAWVIDEO,
.write_header = write_header,
.write_packet = write_packet,
};
diff --git a/libavformat/mmf.c b/libavformat/mmf.c
index 3f20d5bc0b7..5cac4381f45 100644
--- a/libavformat/mmf.c
+++ b/libavformat/mmf.c
@@ -25,6 +25,7 @@
#include "avformat.h"
#include "avio_internal.h"
#include "internal.h"
+#include "mux.h"
#include "pcm.h"
#include "rawenc.h"
#include "riff.h"
@@ -309,14 +310,14 @@ const AVInputFormat ff_mmf_demuxer = {
#endif
#if CONFIG_MMF_MUXER
-const AVOutputFormat ff_mmf_muxer = {
- .name = "mmf",
- .long_name = NULL_IF_CONFIG_SMALL("Yamaha SMAF"),
- .mime_type = "application/vnd.smaf",
- .extensions = "mmf",
+const FFOutputFormat ff_mmf_muxer = {
+ .p.name = "mmf",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Yamaha SMAF"),
+ .p.mime_type = "application/vnd.smaf",
+ .p.extensions = "mmf",
.priv_data_size = sizeof(MMFContext),
- .audio_codec = AV_CODEC_ID_ADPCM_YAMAHA,
- .video_codec = AV_CODEC_ID_NONE,
+ .p.audio_codec = AV_CODEC_ID_ADPCM_YAMAHA,
+ .p.video_codec = AV_CODEC_ID_NONE,
.write_header = mmf_write_header,
.write_packet = ff_raw_write_packet,
.write_trailer = mmf_write_trailer,
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 8d31317838b..87ee7a921f0 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -7805,182 +7805,182 @@ static const AVClass mov_avif_muxer_class = {
#endif
#if CONFIG_MOV_MUXER
-const AVOutputFormat ff_mov_muxer = {
- .name = "mov",
- .long_name = NULL_IF_CONFIG_SMALL("QuickTime / MOV"),
- .extensions = "mov",
+const FFOutputFormat ff_mov_muxer = {
+ .p.name = "mov",
+ .p.long_name = NULL_IF_CONFIG_SMALL("QuickTime / MOV"),
+ .p.extensions = "mov",
.priv_data_size = sizeof(MOVMuxContext),
- .audio_codec = AV_CODEC_ID_AAC,
- .video_codec = CONFIG_LIBX264_ENCODER ?
+ .p.audio_codec = AV_CODEC_ID_AAC,
+ .p.video_codec = CONFIG_LIBX264_ENCODER ?
AV_CODEC_ID_H264 : AV_CODEC_ID_MPEG4,
.init = mov_init,
.write_header = mov_write_header,
.write_packet = mov_write_packet,
.write_trailer = mov_write_trailer,
.deinit = mov_free,
- .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
- .codec_tag = (const AVCodecTag* const []){
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
+ .p.codec_tag = (const AVCodecTag* const []){
ff_codec_movvideo_tags, ff_codec_movaudio_tags, ff_codec_movsubtitle_tags, 0
},
.check_bitstream = mov_check_bitstream,
- .priv_class = &mov_isobmff_muxer_class,
+ .p.priv_class = &mov_isobmff_muxer_class,
};
#endif
#if CONFIG_TGP_MUXER
-const AVOutputFormat ff_tgp_muxer = {
- .name = "3gp",
- .long_name = NULL_IF_CONFIG_SMALL("3GP (3GPP file format)"),
- .extensions = "3gp",
+const FFOutputFormat ff_tgp_muxer = {
+ .p.name = "3gp",
+ .p.long_name = NULL_IF_CONFIG_SMALL("3GP (3GPP file format)"),
+ .p.extensions = "3gp",
.priv_data_size = sizeof(MOVMuxContext),
- .audio_codec = AV_CODEC_ID_AMR_NB,
- .video_codec = AV_CODEC_ID_H263,
+ .p.audio_codec = AV_CODEC_ID_AMR_NB,
+ .p.video_codec = AV_CODEC_ID_H263,
.init = mov_init,
.write_header = mov_write_header,
.write_packet = mov_write_packet,
.write_trailer = mov_write_trailer,
.deinit = mov_free,
- .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
- .codec_tag = codec_3gp_tags_list,
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
+ .p.codec_tag = codec_3gp_tags_list,
.check_bitstream = mov_check_bitstream,
- .priv_class = &mov_isobmff_muxer_class,
+ .p.priv_class = &mov_isobmff_muxer_class,
};
#endif
#if CONFIG_MP4_MUXER
-const AVOutputFormat ff_mp4_muxer = {
- .name = "mp4",
- .long_name = NULL_IF_CONFIG_SMALL("MP4 (MPEG-4 Part 14)"),
- .mime_type = "video/mp4",
- .extensions = "mp4",
+const FFOutputFormat ff_mp4_muxer = {
+ .p.name = "mp4",
+ .p.long_name = NULL_IF_CONFIG_SMALL("MP4 (MPEG-4 Part 14)"),
+ .p.mime_type = "video/mp4",
+ .p.extensions = "mp4",
.priv_data_size = sizeof(MOVMuxContext),
- .audio_codec = AV_CODEC_ID_AAC,
- .video_codec = CONFIG_LIBX264_ENCODER ?
+ .p.audio_codec = AV_CODEC_ID_AAC,
+ .p.video_codec = CONFIG_LIBX264_ENCODER ?
AV_CODEC_ID_H264 : AV_CODEC_ID_MPEG4,
.init = mov_init,
.write_header = mov_write_header,
.write_packet = mov_write_packet,
.write_trailer = mov_write_trailer,
.deinit = mov_free,
- .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
- .codec_tag = mp4_codec_tags_list,
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
+ .p.codec_tag = mp4_codec_tags_list,
.check_bitstream = mov_check_bitstream,
- .priv_class = &mov_isobmff_muxer_class,
+ .p.priv_class = &mov_isobmff_muxer_class,
};
#endif
#if CONFIG_PSP_MUXER
-const AVOutputFormat ff_psp_muxer = {
- .name = "psp",
- .long_name = NULL_IF_CONFIG_SMALL("PSP MP4 (MPEG-4 Part 14)"),
- .extensions = "mp4,psp",
+const FFOutputFormat ff_psp_muxer = {
+ .p.name = "psp",
+ .p.long_name = NULL_IF_CONFIG_SMALL("PSP MP4 (MPEG-4 Part 14)"),
+ .p.extensions = "mp4,psp",
.priv_data_size = sizeof(MOVMuxContext),
- .audio_codec = AV_CODEC_ID_AAC,
- .video_codec = CONFIG_LIBX264_ENCODER ?
+ .p.audio_codec = AV_CODEC_ID_AAC,
+ .p.video_codec = CONFIG_LIBX264_ENCODER ?
AV_CODEC_ID_H264 : AV_CODEC_ID_MPEG4,
.init = mov_init,
.write_header = mov_write_header,
.write_packet = mov_write_packet,
.write_trailer = mov_write_trailer,
.deinit = mov_free,
- .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
- .codec_tag = mp4_codec_tags_list,
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
+ .p.codec_tag = mp4_codec_tags_list,
.check_bitstream = mov_check_bitstream,
- .priv_class = &mov_isobmff_muxer_class,
+ .p.priv_class = &mov_isobmff_muxer_class,
};
#endif
#if CONFIG_TG2_MUXER
-const AVOutputFormat ff_tg2_muxer = {
- .name = "3g2",
- .long_name = NULL_IF_CONFIG_SMALL("3GP2 (3GPP2 file format)"),
- .extensions = "3g2",
+const FFOutputFormat ff_tg2_muxer = {
+ .p.name = "3g2",
+ .p.long_name = NULL_IF_CONFIG_SMALL("3GP2 (3GPP2 file format)"),
+ .p.extensions = "3g2",
.priv_data_size = sizeof(MOVMuxContext),
- .audio_codec = AV_CODEC_ID_AMR_NB,
- .video_codec = AV_CODEC_ID_H263,
+ .p.audio_codec = AV_CODEC_ID_AMR_NB,
+ .p.video_codec = AV_CODEC_ID_H263,
.init = mov_init,
.write_header = mov_write_header,
.write_packet = mov_write_packet,
.write_trailer = mov_write_trailer,
.deinit = mov_free,
- .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
- .codec_tag = codec_3gp_tags_list,
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
+ .p.codec_tag = codec_3gp_tags_list,
.check_bitstream = mov_check_bitstream,
- .priv_class = &mov_isobmff_muxer_class,
+ .p.priv_class = &mov_isobmff_muxer_class,
};
#endif
#if CONFIG_IPOD_MUXER
-const AVOutputFormat ff_ipod_muxer = {
- .name = "ipod",
- .long_name = NULL_IF_CONFIG_SMALL("iPod H.264 MP4 (MPEG-4 Part 14)"),
- .mime_type = "video/mp4",
- .extensions = "m4v,m4a,m4b",
+const FFOutputFormat ff_ipod_muxer = {
+ .p.name = "ipod",
+ .p.long_name = NULL_IF_CONFIG_SMALL("iPod H.264 MP4 (MPEG-4 Part 14)"),
+ .p.mime_type = "video/mp4",
+ .p.extensions = "m4v,m4a,m4b",
.priv_data_size = sizeof(MOVMuxContext),
- .audio_codec = AV_CODEC_ID_AAC,
- .video_codec = AV_CODEC_ID_H264,
+ .p.audio_codec = AV_CODEC_ID_AAC,
+ .p.video_codec = AV_CODEC_ID_H264,
.init = mov_init,
.write_header = mov_write_header,
.write_packet = mov_write_packet,
.write_trailer = mov_write_trailer,
.deinit = mov_free,
- .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
- .codec_tag = (const AVCodecTag* const []){ codec_ipod_tags, 0 },
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
+ .p.codec_tag = (const AVCodecTag* const []){ codec_ipod_tags, 0 },
.check_bitstream = mov_check_bitstream,
- .priv_class = &mov_isobmff_muxer_class,
+ .p.priv_class = &mov_isobmff_muxer_class,
};
#endif
#if CONFIG_ISMV_MUXER
-const AVOutputFormat ff_ismv_muxer = {
- .name = "ismv",
- .long_name = NULL_IF_CONFIG_SMALL("ISMV/ISMA (Smooth Streaming)"),
- .mime_type = "video/mp4",
- .extensions = "ismv,isma",
+const FFOutputFormat ff_ismv_muxer = {
+ .p.name = "ismv",
+ .p.long_name = NULL_IF_CONFIG_SMALL("ISMV/ISMA (Smooth Streaming)"),
+ .p.mime_type = "video/mp4",
+ .p.extensions = "ismv,isma",
.priv_data_size = sizeof(MOVMuxContext),
- .audio_codec = AV_CODEC_ID_AAC,
- .video_codec = AV_CODEC_ID_H264,
+ .p.audio_codec = AV_CODEC_ID_AAC,
+ .p.video_codec = AV_CODEC_ID_H264,
.init = mov_init,
.write_header = mov_write_header,
.write_packet = mov_write_packet,
.write_trailer = mov_write_trailer,
.deinit = mov_free,
- .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
- .codec_tag = (const AVCodecTag* const []){
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
+ .p.codec_tag = (const AVCodecTag* const []){
codec_mp4_tags, codec_ism_tags, 0 },
.check_bitstream = mov_check_bitstream,
- .priv_class = &mov_isobmff_muxer_class,
+ .p.priv_class = &mov_isobmff_muxer_class,
};
#endif
#if CONFIG_F4V_MUXER
-const AVOutputFormat ff_f4v_muxer = {
- .name = "f4v",
- .long_name = NULL_IF_CONFIG_SMALL("F4V Adobe Flash Video"),
- .mime_type = "application/f4v",
- .extensions = "f4v",
+const FFOutputFormat ff_f4v_muxer = {
+ .p.name = "f4v",
+ .p.long_name = NULL_IF_CONFIG_SMALL("F4V Adobe Flash Video"),
+ .p.mime_type = "application/f4v",
+ .p.extensions = "f4v",
.priv_data_size = sizeof(MOVMuxContext),
- .audio_codec = AV_CODEC_ID_AAC,
- .video_codec = AV_CODEC_ID_H264,
+ .p.audio_codec = AV_CODEC_ID_AAC,
+ .p.video_codec = AV_CODEC_ID_H264,
.init = mov_init,
.write_header = mov_write_header,
.write_packet = mov_write_packet,
.write_trailer = mov_write_trailer,
.deinit = mov_free,
- .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH,
- .codec_tag = (const AVCodecTag* const []){ codec_f4v_tags, 0 },
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH,
+ .p.codec_tag = (const AVCodecTag* const []){ codec_f4v_tags, 0 },
.check_bitstream = mov_check_bitstream,
- .priv_class = &mov_isobmff_muxer_class,
+ .p.priv_class = &mov_isobmff_muxer_class,
};
#endif
#if CONFIG_AVIF_MUXER
-const AVOutputFormat ff_avif_muxer = {
- .name = "avif",
- .long_name = NULL_IF_CONFIG_SMALL("AVIF"),
- .mime_type = "image/avif",
- .extensions = "avif",
+const FFOutputFormat ff_avif_muxer = {
+ .p.name = "avif",
+ .p.long_name = NULL_IF_CONFIG_SMALL("AVIF"),
+ .p.mime_type = "image/avif",
+ .p.extensions = "avif",
.priv_data_size = sizeof(MOVMuxContext),
- .video_codec = AV_CODEC_ID_AV1,
+ .p.video_codec = AV_CODEC_ID_AV1,
.init = mov_init,
.write_header = mov_write_header,
.write_packet = mov_write_packet,
.write_trailer = avif_write_trailer,
.deinit = mov_free,
- .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH,
- .codec_tag = codec_avif_tags_list,
- .priv_class = &mov_avif_muxer_class,
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH,
+ .p.codec_tag = codec_avif_tags_list,
+ .p.priv_class = &mov_avif_muxer_class,
};
#endif
diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c
index 91874fa14ef..5e81f72a59a 100644
--- a/libavformat/mp3enc.c
+++ b/libavformat/mp3enc.c
@@ -23,6 +23,7 @@
#include "avio_internal.h"
#include "id3v1.h"
#include "id3v2.h"
+#include "mux.h"
#include "rawenc.h"
#include "libavutil/avstring.h"
#include "libavcodec/mpegaudio.h"
@@ -636,20 +637,20 @@ static void mp3_deinit(struct AVFormatContext *s)
av_freep(&mp3->xing_frame);
}
-const AVOutputFormat ff_mp3_muxer = {
- .name = "mp3",
- .long_name = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"),
- .mime_type = "audio/mpeg",
- .extensions = "mp3",
+const FFOutputFormat ff_mp3_muxer = {
+ .p.name = "mp3",
+ .p.long_name = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"),
+ .p.mime_type = "audio/mpeg",
+ .p.extensions = "mp3",
.priv_data_size = sizeof(MP3Context),
- .audio_codec = AV_CODEC_ID_MP3,
- .video_codec = AV_CODEC_ID_PNG,
+ .p.audio_codec = AV_CODEC_ID_MP3,
+ .p.video_codec = AV_CODEC_ID_PNG,
.init = mp3_init,
.write_header = mp3_write_header,
.write_packet = mp3_write_packet,
.write_trailer = mp3_write_trailer,
.deinit = mp3_deinit,
.query_codec = query_codec,
- .flags = AVFMT_NOTIMESTAMPS,
- .priv_class = &mp3_muxer_class,
+ .p.flags = AVFMT_NOTIMESTAMPS,
+ .p.priv_class = &mp3_muxer_class,
};
diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c
index 3ab4bd3f9b2..c06e3082963 100644
--- a/libavformat/mpegenc.c
+++ b/libavformat/mpegenc.c
@@ -35,6 +35,7 @@
#include "avio_internal.h"
#include "internal.h"
#include "mpeg.h"
+#include "mux.h"
#define MAX_PAYLOAD_SIZE 4096
@@ -86,10 +87,10 @@ typedef struct MpegMuxContext {
int preload;
} MpegMuxContext;
-extern const AVOutputFormat ff_mpeg1vcd_muxer;
-extern const AVOutputFormat ff_mpeg2dvd_muxer;
-extern const AVOutputFormat ff_mpeg2svcd_muxer;
-extern const AVOutputFormat ff_mpeg2vob_muxer;
+extern const FFOutputFormat ff_mpeg1vcd_muxer;
+extern const FFOutputFormat ff_mpeg2dvd_muxer;
+extern const FFOutputFormat ff_mpeg2svcd_muxer;
+extern const FFOutputFormat ff_mpeg2vob_muxer;
static int put_pack_header(AVFormatContext *ctx, uint8_t *buf,
int64_t timestamp)
@@ -307,12 +308,12 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
int video_bitrate;
s->packet_number = 0;
- s->is_vcd = (CONFIG_MPEG1VCD_MUXER && ctx->oformat == &ff_mpeg1vcd_muxer);
- s->is_svcd = (CONFIG_MPEG2SVCD_MUXER && ctx->oformat == &ff_mpeg2svcd_muxer);
- s->is_mpeg2 = ((CONFIG_MPEG2VOB_MUXER && ctx->oformat == &ff_mpeg2vob_muxer) ||
- (CONFIG_MPEG2DVD_MUXER && ctx->oformat == &ff_mpeg2dvd_muxer) ||
- (CONFIG_MPEG2SVCD_MUXER && ctx->oformat == &ff_mpeg2svcd_muxer));
- s->is_dvd = (CONFIG_MPEG2DVD_MUXER && ctx->oformat == &ff_mpeg2dvd_muxer);
+ s->is_vcd = (CONFIG_MPEG1VCD_MUXER && ctx->oformat == &ff_mpeg1vcd_muxer.p);
+ s->is_svcd = (CONFIG_MPEG2SVCD_MUXER && ctx->oformat == &ff_mpeg2svcd_muxer.p);
+ s->is_mpeg2 = ((CONFIG_MPEG2VOB_MUXER && ctx->oformat == &ff_mpeg2vob_muxer.p) ||
+ (CONFIG_MPEG2DVD_MUXER && ctx->oformat == &ff_mpeg2dvd_muxer.p) ||
+ (CONFIG_MPEG2SVCD_MUXER && ctx->oformat == &ff_mpeg2svcd_muxer.p));
+ s->is_dvd = (CONFIG_MPEG2DVD_MUXER && ctx->oformat == &ff_mpeg2dvd_muxer.p);
if (ctx->packet_size) {
if (ctx->packet_size < 20 || ctx->packet_size > (1 << 23) + 10) {
@@ -1293,87 +1294,87 @@ static const AVClass mpeg_class = {
};
#if CONFIG_MPEG1SYSTEM_MUXER
-const AVOutputFormat ff_mpeg1system_muxer = {
- .name = "mpeg",
- .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 Systems / MPEG program stream"),
- .mime_type = "video/mpeg",
- .extensions = "mpg,mpeg",
+const FFOutputFormat ff_mpeg1system_muxer = {
+ .p.name = "mpeg",
+ .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-1 Systems / MPEG program stream"),
+ .p.mime_type = "video/mpeg",
+ .p.extensions = "mpg,mpeg",
.priv_data_size = sizeof(MpegMuxContext),
- .audio_codec = AV_CODEC_ID_MP2,
- .video_codec = AV_CODEC_ID_MPEG1VIDEO,
+ .p.audio_codec = AV_CODEC_ID_MP2,
+ .p.video_codec = AV_CODEC_ID_MPEG1VIDEO,
.write_header = mpeg_mux_init,
.write_packet = mpeg_mux_write_packet,
.write_trailer = mpeg_mux_end,
.deinit = mpeg_mux_deinit,
- .priv_class = &mpeg_class,
+ .p.priv_class = &mpeg_class,
};
#endif
#if CONFIG_MPEG1VCD_MUXER
-const AVOutputFormat ff_mpeg1vcd_muxer = {
- .name = "vcd",
- .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 Systems / MPEG program stream (VCD)"),
- .mime_type = "video/mpeg",
+const FFOutputFormat ff_mpeg1vcd_muxer = {
+ .p.name = "vcd",
+ .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-1 Systems / MPEG program stream (VCD)"),
+ .p.mime_type = "video/mpeg",
.priv_data_size = sizeof(MpegMuxContext),
- .audio_codec = AV_CODEC_ID_MP2,
- .video_codec = AV_CODEC_ID_MPEG1VIDEO,
+ .p.audio_codec = AV_CODEC_ID_MP2,
+ .p.video_codec = AV_CODEC_ID_MPEG1VIDEO,
.write_header = mpeg_mux_init,
.write_packet = mpeg_mux_write_packet,
.write_trailer = mpeg_mux_end,
.deinit = mpeg_mux_deinit,
- .priv_class = &mpeg_class,
+ .p.priv_class = &mpeg_class,
};
#endif
#if CONFIG_MPEG2VOB_MUXER
-const AVOutputFormat ff_mpeg2vob_muxer = {
- .name = "vob",
- .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 PS (VOB)"),
- .mime_type = "video/mpeg",
- .extensions = "vob",
+const FFOutputFormat ff_mpeg2vob_muxer = {
+ .p.name = "vob",
+ .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-2 PS (VOB)"),
+ .p.mime_type = "video/mpeg",
+ .p.extensions = "vob",
.priv_data_size = sizeof(MpegMuxContext),
- .audio_codec = AV_CODEC_ID_MP2,
- .video_codec = AV_CODEC_ID_MPEG2VIDEO,
+ .p.audio_codec = AV_CODEC_ID_MP2,
+ .p.video_codec = AV_CODEC_ID_MPEG2VIDEO,
.write_header = mpeg_mux_init,
.write_packet = mpeg_mux_write_packet,
.write_trailer = mpeg_mux_end,
.deinit = mpeg_mux_deinit,
- .priv_class = &mpeg_class,
+ .p.priv_class = &mpeg_class,
};
#endif
/* Same as mpeg2vob_mux except that the pack size is 2324 */
#if CONFIG_MPEG2SVCD_MUXER
-const AVOutputFormat ff_mpeg2svcd_muxer = {
- .name = "svcd",
- .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 PS (SVCD)"),
- .mime_type = "video/mpeg",
- .extensions = "vob",
+const FFOutputFormat ff_mpeg2svcd_muxer = {
+ .p.name = "svcd",
+ .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-2 PS (SVCD)"),
+ .p.mime_type = "video/mpeg",
+ .p.extensions = "vob",
.priv_data_size = sizeof(MpegMuxContext),
- .audio_codec = AV_CODEC_ID_MP2,
- .video_codec = AV_CODEC_ID_MPEG2VIDEO,
+ .p.audio_codec = AV_CODEC_ID_MP2,
+ .p.video_codec = AV_CODEC_ID_MPEG2VIDEO,
.write_header = mpeg_mux_init,
.write_packet = mpeg_mux_write_packet,
.write_trailer = mpeg_mux_end,
.deinit = mpeg_mux_deinit,
- .priv_class = &mpeg_class,
+ .p.priv_class = &mpeg_class,
};
#endif
/* Same as mpeg2vob_mux except the 'is_dvd' flag is set to produce NAV pkts */
#if CONFIG_MPEG2DVD_MUXER
-const AVOutputFormat ff_mpeg2dvd_muxer = {
- .name = "dvd",
- .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 PS (DVD VOB)"),
- .mime_type = "video/mpeg",
- .extensions = "dvd",
+const FFOutputFormat ff_mpeg2dvd_muxer = {
+ .p.name = "dvd",
+ .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-2 PS (DVD VOB)"),
+ .p.mime_type = "video/mpeg",
+ .p.extensions = "dvd",
.priv_data_size = sizeof(MpegMuxContext),
- .audio_codec = AV_CODEC_ID_MP2,
- .video_codec = AV_CODEC_ID_MPEG2VIDEO,
+ .p.audio_codec = AV_CODEC_ID_MP2,
+ .p.video_codec = AV_CODEC_ID_MPEG2VIDEO,
.write_header = mpeg_mux_init,
.write_packet = mpeg_mux_write_packet,
.write_trailer = mpeg_mux_end,
.deinit = mpeg_mux_deinit,
- .priv_class = &mpeg_class,
+ .p.priv_class = &mpeg_class,
};
#endif
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 48d39e6a7da..00ad426086f 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -2308,19 +2308,19 @@ static const AVClass mpegts_muxer_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVOutputFormat ff_mpegts_muxer = {
- .name = "mpegts",
- .long_name = NULL_IF_CONFIG_SMALL("MPEG-TS (MPEG-2 Transport Stream)"),
- .mime_type = "video/MP2T",
- .extensions = "ts,m2t,m2ts,mts",
+const FFOutputFormat ff_mpegts_muxer = {
+ .p.name = "mpegts",
+ .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-TS (MPEG-2 Transport Stream)"),
+ .p.mime_type = "video/MP2T",
+ .p.extensions = "ts,m2t,m2ts,mts",
.priv_data_size = sizeof(MpegTSWrite),
- .audio_codec = AV_CODEC_ID_MP2,
- .video_codec = AV_CODEC_ID_MPEG2VIDEO,
+ .p.audio_codec = AV_CODEC_ID_MP2,
+ .p.video_codec = AV_CODEC_ID_MPEG2VIDEO,
.init = mpegts_init,
.write_packet = mpegts_write_packet,
.write_trailer = mpegts_write_end,
.deinit = mpegts_deinit,
.check_bitstream = mpegts_check_bitstream,
- .flags = AVFMT_ALLOW_FLUSH | AVFMT_VARIABLE_FPS | AVFMT_NODIMENSIONS,
- .priv_class = &mpegts_muxer_class,
+ .p.flags = AVFMT_ALLOW_FLUSH | AVFMT_VARIABLE_FPS | AVFMT_NODIMENSIONS,
+ .p.priv_class = &mpegts_muxer_class,
};
diff --git a/libavformat/mpjpeg.c b/libavformat/mpjpeg.c
index c5e5d1e2864..81ace8e9ee1 100644
--- a/libavformat/mpjpeg.c
+++ b/libavformat/mpjpeg.c
@@ -20,6 +20,7 @@
*/
#include "libavutil/opt.h"
#include "avformat.h"
+#include "mux.h"
/* Multipart JPEG */
@@ -61,16 +62,16 @@ static const AVClass mpjpeg_muxer_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVOutputFormat ff_mpjpeg_muxer = {
- .name = "mpjpeg",
- .long_name = NULL_IF_CONFIG_SMALL("MIME multipart JPEG"),
- .mime_type = "multipart/x-mixed-replace;boundary=" BOUNDARY_TAG,
- .extensions = "mjpg",
+const FFOutputFormat ff_mpjpeg_muxer = {
+ .p.name = "mpjpeg",
+ .p.long_name = NULL_IF_CONFIG_SMALL("MIME multipart JPEG"),
+ .p.mime_type = "multipart/x-mixed-replace;boundary=" BOUNDARY_TAG,
+ .p.extensions = "mjpg",
.priv_data_size = sizeof(MPJPEGContext),
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_MJPEG,
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_MJPEG,
.write_header = mpjpeg_write_header,
.write_packet = mpjpeg_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
- .priv_class = &mpjpeg_muxer_class,
+ .p.flags = AVFMT_NOTIMESTAMPS,
+ .p.priv_class = &mpjpeg_muxer_class,
};
diff --git a/libavformat/mux.c b/libavformat/mux.c
index b2b5be63b44..04de05ec178 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -118,8 +118,8 @@ int avformat_alloc_output_context2(AVFormatContext **avctx, const AVOutputFormat
}
s->oformat = oformat;
- if (s->oformat->priv_data_size > 0) {
- s->priv_data = av_mallocz(s->oformat->priv_data_size);
+ if (ffofmt(s->oformat)->priv_data_size > 0) {
+ s->priv_data = av_mallocz(ffofmt(s->oformat)->priv_data_size);
if (!s->priv_data)
goto nomem;
if (s->oformat->priv_class) {
@@ -182,7 +182,7 @@ static int init_muxer(AVFormatContext *s, AVDictionary **options)
{
FFFormatContext *const si = ffformatcontext(s);
AVDictionary *tmp = NULL;
- const AVOutputFormat *of = s->oformat;
+ const FFOutputFormat *of = ffofmt(s->oformat);
AVDictionaryEntry *e;
int ret = 0;
@@ -201,7 +201,7 @@ static int init_muxer(AVFormatContext *s, AVDictionary **options)
}
// some sanity checks
- if (s->nb_streams == 0 && !(of->flags & AVFMT_NOSTREAMS)) {
+ if (s->nb_streams == 0 && !(of->p.flags & AVFMT_NOSTREAMS)) {
av_log(s, AV_LOG_ERROR, "No streams to mux were specified\n");
ret = AVERROR(EINVAL);
goto fail;
@@ -251,7 +251,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
break;
case AVMEDIA_TYPE_VIDEO:
if ((par->width <= 0 || par->height <= 0) &&
- !(of->flags & AVFMT_NODIMENSIONS)) {
+ !(of->p.flags & AVFMT_NODIMENSIONS)) {
av_log(s, AV_LOG_ERROR, "dimensions not set\n");
ret = AVERROR(EINVAL);
goto fail;
@@ -281,11 +281,11 @@ FF_ENABLE_DEPRECATION_WARNINGS
sti->is_intra_only = ff_is_intra_only(par->codec_id);
- if (of->codec_tag) {
+ if (of->p.codec_tag) {
if ( par->codec_tag
&& par->codec_id == AV_CODEC_ID_RAWVIDEO
- && ( av_codec_get_tag(of->codec_tag, par->codec_id) == 0
- || av_codec_get_tag(of->codec_tag, par->codec_id) == MKTAG('r', 'a', 'w', ' '))
+ && ( av_codec_get_tag(of->p.codec_tag, par->codec_id) == 0
+ || av_codec_get_tag(of->p.codec_tag, par->codec_id) == MKTAG('r', 'a', 'w', ' '))
&& !validate_codec_tag(s, st)) {
// the current rawvideo encoding system ends up setting
// the wrong codec_tag for avi/mov, we override it here
@@ -301,7 +301,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
goto fail;
}
} else
- par->codec_tag = av_codec_get_tag(of->codec_tag, par->codec_id);
+ par->codec_tag = av_codec_get_tag(of->p.codec_tag, par->codec_id);
}
if (par->codec_type != AVMEDIA_TYPE_ATTACHMENT)
@@ -319,8 +319,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
ret = AVERROR(ENOMEM);
goto fail;
}
- if (of->priv_class) {
- *(const AVClass **)s->priv_data = of->priv_class;
+ if (of->p.priv_class) {
+ *(const AVClass **)s->priv_data = of->p.priv_class;
av_opt_set_defaults(s->priv_data);
if ((ret = av_opt_set_dict2(s->priv_data, &tmp, AV_OPT_SEARCH_CHILDREN)) < 0)
goto fail;
@@ -343,10 +343,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
*options = tmp;
}
- if (s->oformat->init) {
- if ((ret = s->oformat->init(s)) < 0) {
- if (s->oformat->deinit)
- s->oformat->deinit(s);
+ if (of->init) {
+ if ((ret = of->init(s)) < 0) {
+ if (of->deinit)
+ of->deinit(s);
return ret;
}
return ret == 0;
@@ -420,8 +420,9 @@ static void flush_if_needed(AVFormatContext *s)
static void deinit_muxer(AVFormatContext *s)
{
FFFormatContext *const si = ffformatcontext(s);
- if (s->oformat && s->oformat->deinit && si->initialized)
- s->oformat->deinit(s);
+ const FFOutputFormat *const of = ffofmt(s->oformat);
+ if (of && of->deinit && si->initialized)
+ of->deinit(s);
si->initialized =
si->streams_initialized = 0;
}
@@ -437,7 +438,7 @@ int avformat_init_output(AVFormatContext *s, AVDictionary **options)
si->initialized = 1;
si->streams_initialized = ret;
- if (s->oformat->init && ret) {
+ if (ffofmt(s->oformat)->init && ret) {
if ((ret = init_pts(s)) < 0)
return ret;
@@ -460,8 +461,8 @@ int avformat_write_header(AVFormatContext *s, AVDictionary **options)
if (!(s->oformat->flags & AVFMT_NOFILE) && s->pb)
avio_write_marker(s->pb, AV_NOPTS_VALUE, AVIO_DATA_MARKER_HEADER);
- if (s->oformat->write_header) {
- ret = s->oformat->write_header(s);
+ if (ffofmt(s->oformat)->write_header) {
+ ret = ffofmt(s->oformat)->write_header(s);
if (ret >= 0 && s->pb && s->pb->error < 0)
ret = s->pb->error;
if (ret < 0)
@@ -724,9 +725,9 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
if ((pkt->flags & AV_PKT_FLAG_UNCODED_FRAME)) {
AVFrame **frame = (AVFrame **)pkt->data;
av_assert0(pkt->size == sizeof(*frame));
- ret = s->oformat->write_uncoded_frame(s, pkt->stream_index, frame, 0);
+ ret = ffofmt(s->oformat)->write_uncoded_frame(s, pkt->stream_index, frame, 0);
} else {
- ret = s->oformat->write_packet(s, pkt);
+ ret = ffofmt(s->oformat)->write_packet(s, pkt);
}
if (s->pb && ret >= 0) {
@@ -1078,9 +1079,9 @@ static int check_bitstream(AVFormatContext *s, FFStream *sti, AVPacket *pkt)
if (!(s->flags & AVFMT_FLAG_AUTO_BSF))
return 1;
- if (s->oformat->check_bitstream) {
+ if (ffofmt(s->oformat)->check_bitstream) {
if (!sti->bitstream_checked) {
- if ((ret = s->oformat->check_bitstream(s, &sti->pub, pkt)) < 0)
+ if ((ret = ffofmt(s->oformat)->check_bitstream(s, &sti->pub, pkt)) < 0)
return ret;
else if (ret == 1)
sti->bitstream_checked = 1;
@@ -1198,7 +1199,7 @@ int av_write_frame(AVFormatContext *s, AVPacket *in)
if (!in) {
if (s->oformat->flags & AVFMT_ALLOW_FLUSH) {
- ret = s->oformat->write_packet(s, NULL);
+ ret = ffofmt(s->oformat)->write_packet(s, NULL);
flush_if_needed(s);
if (ret >= 0 && s->pb && s->pb->error < 0)
ret = s->pb->error;
@@ -1273,14 +1274,12 @@ int av_write_trailer(AVFormatContext *s)
if (ret >= 0)
ret = ret1;
- if (s->oformat->write_trailer) {
+ if (ffofmt(s->oformat)->write_trailer) {
if (!(s->oformat->flags & AVFMT_NOFILE) && s->pb)
avio_write_marker(s->pb, AV_NOPTS_VALUE, AVIO_DATA_MARKER_TRAILER);
- if (ret >= 0) {
- ret = s->oformat->write_trailer(s);
- } else {
- s->oformat->write_trailer(s);
- }
+ ret1 = ffofmt(s->oformat)->write_trailer(s);
+ if (ret >= 0)
+ ret = ret1;
}
deinit_muxer(s);
@@ -1303,9 +1302,10 @@ int av_write_trailer(AVFormatContext *s)
int av_get_output_timestamp(struct AVFormatContext *s, int stream,
int64_t *dts, int64_t *wall)
{
- if (!s->oformat || !s->oformat->get_output_timestamp)
+ const FFOutputFormat *const of = ffofmt(s->oformat);
+ if (!of || !of->get_output_timestamp)
return AVERROR(ENOSYS);
- s->oformat->get_output_timestamp(s, stream, dts, wall);
+ of->get_output_timestamp(s, stream, dts, wall);
return 0;
}
@@ -1395,7 +1395,7 @@ static int write_uncoded_frame_internal(AVFormatContext *s, int stream_index,
AVPacket *pkt = si->parse_pkt;
av_assert0(s->oformat);
- if (!s->oformat->write_uncoded_frame) {
+ if (!ffofmt(s->oformat)->write_uncoded_frame) {
av_frame_free(&frame);
return AVERROR(ENOSYS);
}
@@ -1452,9 +1452,10 @@ int av_interleaved_write_uncoded_frame(AVFormatContext *s, int stream_index,
int av_write_uncoded_frame_query(AVFormatContext *s, int stream_index)
{
- av_assert0(s->oformat);
- if (!s->oformat->write_uncoded_frame)
+ const FFOutputFormat *const of = ffofmt(s->oformat);
+ av_assert0(of);
+ if (!of->write_uncoded_frame)
return AVERROR(ENOSYS);
- return s->oformat->write_uncoded_frame(s, stream_index, NULL,
- AV_WRITE_UNCODED_FRAME_QUERY);
+ return of->write_uncoded_frame(s, stream_index, NULL,
+ AV_WRITE_UNCODED_FRAME_QUERY);
}
diff --git a/libavformat/mux.h b/libavformat/mux.h
index 1bfcaf795fd..c2de45400c2 100644
--- a/libavformat/mux.h
+++ b/libavformat/mux.h
@@ -25,6 +25,119 @@
#include "libavcodec/packet.h"
#include "avformat.h"
+struct AVDeviceInfoList;
+
+typedef struct FFOutputFormat {
+ /**
+ * The public AVOutputFormat. See avformat.h for it.
+ */
+ AVOutputFormat p;
+ /**
+ * size of private data so that it can be allocated in the wrapper
+ */
+ int priv_data_size;
+
+ /**
+ * Internal flags. See FF_FMT_FLAG_* in internal.h.
+ */
+ int flags_internal;
+
+ int (*write_header)(AVFormatContext *);
+ /**
+ * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags,
+ * 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
+ * data.
+ */
+ int (*write_packet)(AVFormatContext *, AVPacket *pkt);
+ int (*write_trailer)(AVFormatContext *);
+ /**
+ * A format-specific function for interleavement.
+ * If unset, packets will be interleaved by dts.
+ *
+ * @param s An AVFormatContext for output. pkt will be added to
+ * resp. taken from its packet buffer.
+ * @param[in,out] pkt A packet to be interleaved if has_packet is set;
+ * also used to return packets. If no packet is returned
+ * (e.g. on error), pkt is blank on return.
+ * @param flush 1 if no further packets are available as input and
+ * all remaining packets should be output.
+ * @param has_packet If set, pkt contains a packet to be interleaved
+ * on input; otherwise pkt is blank on input.
+ * @return 1 if a packet was output, 0 if no packet could be output,
+ * < 0 if an error occurred
+ */
+ int (*interleave_packet)(AVFormatContext *s, AVPacket *pkt,
+ int flush, int has_packet);
+ /**
+ * Test if the given codec can be stored in this container.
+ *
+ * @return 1 if the codec is supported, 0 if it is not.
+ * A negative number if unknown.
+ * MKTAG('A', 'P', 'I', 'C') if the codec is only supported as AV_DISPOSITION_ATTACHED_PIC
+ */
+ int (*query_codec)(enum AVCodecID id, int std_compliance);
+
+ void (*get_output_timestamp)(AVFormatContext *s, int stream,
+ int64_t *dts, int64_t *wall);
+ /**
+ * Allows sending messages from application to device.
+ */
+ int (*control_message)(AVFormatContext *s, int type,
+ void *data, size_t data_size);
+
+ /**
+ * Write an uncoded AVFrame.
+ *
+ * See av_write_uncoded_frame() for details.
+ *
+ * The library will free *frame afterwards, but the muxer can prevent it
+ * by setting the pointer to NULL.
+ */
+ int (*write_uncoded_frame)(AVFormatContext *, int stream_index,
+ AVFrame **frame, unsigned flags);
+ /**
+ * Returns device list with it properties.
+ * @see avdevice_list_devices() for more details.
+ */
+ int (*get_device_list)(AVFormatContext *s, struct AVDeviceInfoList *device_list);
+ /**
+ * Initialize format. May allocate data here, and set any AVFormatContext or
+ * AVStream parameters that need to be set before packets are sent.
+ * This method must not write output.
+ *
+ * Return 0 if streams were fully configured, 1 if not, negative AVERROR on failure
+ *
+ * Any allocations made here must be freed in deinit().
+ */
+ int (*init)(AVFormatContext *);
+ /**
+ * Deinitialize format. If present, this is called whenever the muxer is being
+ * destroyed, regardless of whether or not the header has been written.
+ *
+ * If a trailer is being written, this is called after write_trailer().
+ *
+ * This is called if init() fails as well.
+ */
+ void (*deinit)(AVFormatContext *);
+ /**
+ * Set up any necessary bitstream filtering and extract any extra data needed
+ * for the global header.
+ *
+ * @note pkt might have been directly forwarded by a meta-muxer; therefore
+ * pkt->stream_index as well as the pkt's timebase might be invalid.
+ * Return 0 if more packets from this stream must be checked; 1 if not.
+ */
+ int (*check_bitstream)(AVFormatContext *s, AVStream *st,
+ const AVPacket *pkt);
+} FFOutputFormat;
+
+static inline const FFOutputFormat *ffofmt(const AVOutputFormat *fmt)
+{
+ return (const FFOutputFormat*)fmt;
+}
+
/**
* Add packet to an AVFormatContext's packet_buffer list, determining its
* interleaved position using compare() function argument.
diff --git a/libavformat/mux_utils.c b/libavformat/mux_utils.c
index 55e58ae9d68..3e63b8039af 100644
--- a/libavformat/mux_utils.c
+++ b/libavformat/mux_utils.c
@@ -45,8 +45,8 @@ int avformat_query_codec(const AVOutputFormat *ofmt, enum AVCodecID codec_id,
{
if (ofmt) {
unsigned int codec_tag;
- if (ofmt->query_codec)
- return ofmt->query_codec(codec_id, std_compliance);
+ if (ffofmt(ofmt)->query_codec)
+ return ffofmt(ofmt)->query_codec(codec_id, std_compliance);
else if (ofmt->codec_tag)
return !!av_codec_get_tag2(ofmt->codec_tag, codec_id, &codec_tag);
else if (codec_id == ofmt->video_codec ||
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 58c551c83c3..a29d678098c 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -61,8 +61,11 @@
#include "config.h"
#include "version.h"
-extern const AVOutputFormat ff_mxf_d10_muxer;
-extern const AVOutputFormat ff_mxf_opatom_muxer;
+extern const FFOutputFormat ff_mxf_d10_muxer;
+extern const FFOutputFormat ff_mxf_opatom_muxer;
+
+#define IS_D10(s) ((s)->oformat == &ff_mxf_d10_muxer.p)
+#define IS_OPATOM(s) ((s)->oformat == &ff_mxf_opatom_muxer.p)
#define EDIT_UNITS_PER_BODY 250
#define KAG_SIZE 512
@@ -667,7 +670,7 @@ static void mxf_write_preface(AVFormatContext *s)
// operational pattern
mxf_write_local_tag(s, 16, 0x3B09);
- if (s->oformat == &ff_mxf_opatom_muxer)
+ if (IS_OPATOM(s))
avio_write(pb, opatom_ul, 16);
else
avio_write(pb, op1a_ul, 16);
@@ -765,7 +768,7 @@ static void mxf_write_identification(AVFormatContext *s)
AVDictionaryEntry *product_entry = av_dict_get(s->metadata, "product_name", NULL, 0);
AVDictionaryEntry *version_entry = av_dict_get(s->metadata, "product_version", NULL, 0);
const char *company = com_entry ? com_entry->value : "FFmpeg";
- const char *product = product_entry ? product_entry->value : s->oformat != &ff_mxf_opatom_muxer ? "OP1a Muxer" : "OPAtom Muxer";
+ const char *product = product_entry ? product_entry->value : !IS_OPATOM(s) ? "OP1a Muxer" : "OPAtom Muxer";
const char *platform = s->flags & AVFMT_FLAG_BITEXACT ? "Lavf" : PLATFORM_IDENT;
const char *version = version_entry ? version_entry->value :
s->flags & AVFMT_FLAG_BITEXACT ? "0.0.0" :
@@ -866,7 +869,7 @@ static void mxf_write_track(AVFormatContext *s, AVStream *st, MXFPackage *packag
// write edit rate
mxf_write_local_tag(s, 8, 0x4B01);
- if (st == mxf->timecode_track && s->oformat == &ff_mxf_opatom_muxer) {
+ if (st == mxf->timecode_track && IS_OPATOM(s)) {
avio_wb32(pb, mxf->tc.rate.num);
avio_wb32(pb, mxf->tc.rate.den);
} else {
@@ -902,7 +905,7 @@ static void mxf_write_common_fields(AVFormatContext *s, AVStream *st)
// write duration
mxf_write_local_tag(s, 8, 0x0202);
- if (st != mxf->timecode_track && s->oformat == &ff_mxf_opatom_muxer && st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
+ if (st != mxf->timecode_track && IS_OPATOM(s) && st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
avio_wb64(pb, mxf->body_offset / mxf->edit_unit_byte_count);
} else {
avio_wb64(pb, mxf->duration);
@@ -1066,7 +1069,7 @@ static int64_t mxf_write_generic_desc(AVFormatContext *s, AVStream *st, const UI
avio_wb32(pb, st->index+2);
mxf_write_local_tag(s, 8, 0x3001);
- if (s->oformat == &ff_mxf_d10_muxer) {
+ if (IS_D10(s)) {
avio_wb32(pb, mxf->time_base.den);
avio_wb32(pb, mxf->time_base.num);
} else {
@@ -1138,7 +1141,7 @@ static int64_t mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID
mxf_write_local_tag(s, 4, 0x3202);
avio_wb32(pb, stored_height>>sc->interlaced);
- if (s->oformat == &ff_mxf_d10_muxer) {
+ if (IS_D10(s)) {
//Stored F2 Offset
mxf_write_local_tag(s, 4, 0x3216);
avio_wb32(pb, 0);
@@ -1435,7 +1438,7 @@ static int64_t mxf_write_generic_sound_common(AVFormatContext *s, AVStream *st,
int show_warnings = !mxf->footer_partition_offset;
int64_t pos = mxf_write_generic_desc(s, st, key);
- if (s->oformat == &ff_mxf_opatom_muxer) {
+ if (IS_OPATOM(s)) {
mxf_write_local_tag(s, 8, 0x3002);
avio_wb64(pb, mxf->body_offset / mxf->edit_unit_byte_count);
}
@@ -1449,19 +1452,19 @@ static int64_t mxf_write_generic_sound_common(AVFormatContext *s, AVStream *st,
avio_wb32(pb, st->codecpar->sample_rate);
avio_wb32(pb, 1);
- if (s->oformat == &ff_mxf_d10_muxer) {
+ if (IS_D10(s)) {
mxf_write_local_tag(s, 1, 0x3D04);
avio_w8(pb, 0);
}
mxf_write_local_tag(s, 4, 0x3D07);
if (mxf->channel_count == -1) {
- if (show_warnings && (s->oformat == &ff_mxf_d10_muxer) &&
+ if (show_warnings && IS_D10(s) &&
(st->codecpar->ch_layout.nb_channels != 4) &&
(st->codecpar->ch_layout.nb_channels != 8))
av_log(s, AV_LOG_WARNING, "the number of audio channels shall be 4 or 8 : the output will not comply to MXF D-10 specs, use -d10_channelcount to fix this\n");
avio_wb32(pb, st->codecpar->ch_layout.nb_channels);
- } else if (s->oformat == &ff_mxf_d10_muxer) {
+ } else if (IS_D10(s)) {
if (show_warnings && (mxf->channel_count < st->codecpar->ch_layout.nb_channels))
av_log(s, AV_LOG_WARNING, "d10_channelcount < actual number of audio channels : some channels will be discarded\n");
if (show_warnings && (mxf->channel_count != 4) && (mxf->channel_count != 8))
@@ -1961,7 +1964,7 @@ static int mxf_write_partition(AVFormatContext *s, int bodysid,
avio_wb32(pb, index_byte_count ? indexsid : 0); // indexSID
// BodyOffset
- if (bodysid && mxf->edit_units_count && mxf->body_partitions_count && s->oformat != &ff_mxf_opatom_muxer)
+ if (bodysid && mxf->edit_units_count && mxf->body_partitions_count && !IS_OPATOM(s))
avio_wb64(pb, mxf->body_offset);
else
avio_wb64(pb, 0);
@@ -1969,7 +1972,7 @@ static int mxf_write_partition(AVFormatContext *s, int bodysid,
avio_wb32(pb, bodysid); // bodySID
// operational pattern
- if (s->oformat == &ff_mxf_opatom_muxer)
+ if (IS_OPATOM(s))
avio_write(pb, opatom_ul, 16);
else
avio_write(pb, op1a_ul, 16);
@@ -2436,7 +2439,7 @@ static int mxf_parse_mpeg2_frame(AVFormatContext *s, AVStream *st,
}
}
}
- if (s->oformat != &ff_mxf_d10_muxer) {
+ if (!IS_D10(s)) {
const UID *codec_ul = mxf_get_mpeg2_codec_ul(st->codecpar);
if (!codec_ul)
return 0;
@@ -2533,7 +2536,7 @@ static int mxf_init(AVFormatContext *s)
uint8_t present[FF_ARRAY_ELEMS(mxf_essence_container_uls)] = {0};
int64_t timestamp = 0;
- if (s->oformat == &ff_mxf_opatom_muxer && s->nb_streams !=1) {
+ if (IS_OPATOM(s) && s->nb_streams != 1) {
av_log(s, AV_LOG_ERROR, "there must be exactly one stream for mxf opatom\n");
return -1;
}
@@ -2549,7 +2552,7 @@ static int mxf_init(AVFormatContext *s)
st->priv_data = sc;
sc->index = -1;
- if (((i == 0) ^ (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)) && s->oformat != &ff_mxf_opatom_muxer) {
+ if (((i == 0) ^ (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)) && !IS_OPATOM(s)) {
av_log(s, AV_LOG_ERROR, "there must be exactly one video stream and it must be the first one\n");
return -1;
}
@@ -2593,12 +2596,12 @@ static int mxf_init(AVFormatContext *s)
sc->video_bit_rate = st->codecpar->bit_rate;
- if (s->oformat == &ff_mxf_d10_muxer ||
+ if (IS_D10(s) ||
st->codecpar->codec_id == AV_CODEC_ID_DNXHD ||
st->codecpar->codec_id == AV_CODEC_ID_DVVIDEO)
mxf->cbr_index = 1;
- if (s->oformat == &ff_mxf_d10_muxer) {
+ if (IS_D10(s)) {
int ntsc = mxf->time_base.den != 25;
int ul_index;
@@ -2636,7 +2639,7 @@ static int mxf_init(AVFormatContext *s)
return -1;
}
avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);
- if (s->oformat == &ff_mxf_d10_muxer) {
+ if (IS_D10(s)) {
if (st->index != 1) {
av_log(s, AV_LOG_ERROR, "MXF D-10 only support one audio track\n");
return -1;
@@ -2648,7 +2651,7 @@ static int mxf_init(AVFormatContext *s)
sc->index = INDEX_D10_AUDIO;
sc->container_ul = ((MXFStreamContext*)s->streams[0]->priv_data)->container_ul;
sc->frame_size = 4 + 8 * av_rescale_rnd(st->codecpar->sample_rate, mxf->time_base.num, mxf->time_base.den, AV_ROUND_UP) * 4;
- } else if (s->oformat == &ff_mxf_opatom_muxer) {
+ } else if (IS_OPATOM(s)) {
AVRational tbc = av_inv_q(mxf->audio_edit_rate);
if (st->codecpar->codec_id != AV_CODEC_ID_PCM_S16LE &&
@@ -2707,7 +2710,7 @@ static int mxf_init(AVFormatContext *s)
memcpy(sc->track_essence_element_key, mxf_essence_container_uls[sc->index].element_ul, 15);
sc->track_essence_element_key[15] = present[sc->index];
- if (s->oformat == &ff_mxf_opatom_muxer && st->codecpar->codec_id == AV_CODEC_ID_DNXHD) {
+ if (IS_OPATOM(s) && st->codecpar->codec_id == AV_CODEC_ID_DNXHD) {
// clip-wrapping requires 0x0D per ST2019-4:2009 or 0x06 per previous version ST2019-4:2008
// we choose to use 0x06 instead 0x0D to be compatible with AVID systems
// and produce mxf files with the most relevant flavour for opatom
@@ -2720,7 +2723,7 @@ static int mxf_init(AVFormatContext *s)
present[sc->index]++;
}
- if (s->oformat == &ff_mxf_d10_muxer || s->oformat == &ff_mxf_opatom_muxer) {
+ if (IS_D10(s) || IS_OPATOM(s)) {
mxf->essence_container_count = 1;
}
@@ -2889,7 +2892,7 @@ static void mxf_compute_edit_unit_byte_count(AVFormatContext *s)
MXFContext *mxf = s->priv_data;
int i;
- if (s->oformat == &ff_mxf_opatom_muxer) {
+ if (IS_OPATOM(s)) {
MXFStreamContext *sc = s->streams[0]->priv_data;
mxf->edit_unit_byte_count = sc->frame_size;
return;
@@ -2915,7 +2918,7 @@ static int mxf_write_packet(AVFormatContext *s, AVPacket *pkt)
int err;
if (!mxf->header_written && pkt->stream_index != 0 &&
- s->oformat != &ff_mxf_opatom_muxer) {
+ !IS_OPATOM(s)) {
av_log(s, AV_LOG_ERROR, "Received non-video packet before "
"header has been written\n");
return AVERROR_INVALIDDATA;
@@ -2967,7 +2970,7 @@ static int mxf_write_packet(AVFormatContext *s, AVPacket *pkt)
mxf_compute_edit_unit_byte_count(s);
}
- if (s->oformat == &ff_mxf_opatom_muxer)
+ if (IS_OPATOM(s))
return mxf_write_opatom_packet(s, pkt, &ie);
if (!mxf->header_written) {
@@ -3015,8 +3018,7 @@ static int mxf_write_packet(AVFormatContext *s, AVPacket *pkt)
mxf_write_klv_fill(s);
avio_write(pb, sc->track_essence_element_key, 16); // write key
- if (s->oformat == &ff_mxf_d10_muxer &&
- st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
+ if (IS_D10(s) && st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
mxf_write_d10_audio_packet(s, st, pkt);
} else {
klv_encode_ber4_length(pb, pkt->size); // write length
@@ -3037,7 +3039,7 @@ static void mxf_write_random_index_pack(AVFormatContext *s)
avio_write(pb, ff_mxf_random_index_pack_key, 16);
klv_encode_ber_length(pb, 28 + 12LL*mxf->body_partitions_count);
- if (mxf->edit_unit_byte_count && s->oformat != &ff_mxf_opatom_muxer)
+ if (mxf->edit_unit_byte_count && !IS_OPATOM(s))
avio_wb32(pb, 1); // BodySID of header partition
else
avio_wb32(pb, 0);
@@ -3061,7 +3063,7 @@ static int mxf_write_footer(AVFormatContext *s)
int i, err;
if (!mxf->header_written ||
- (s->oformat == &ff_mxf_opatom_muxer && !mxf->body_partition_offset)) {
+ (IS_OPATOM(s) && !mxf->body_partition_offset)) {
/* reason could be invalid options/not supported codec/out of memory */
return AVERROR_UNKNOWN;
}
@@ -3070,7 +3072,7 @@ static int mxf_write_footer(AVFormatContext *s)
mxf_write_klv_fill(s);
mxf->footer_partition_offset = avio_tell(pb);
- if (mxf->edit_unit_byte_count && s->oformat != &ff_mxf_opatom_muxer) { // no need to repeat index
+ if (mxf->edit_unit_byte_count && !IS_OPATOM(s)) { // no need to repeat index
if ((err = mxf_write_partition(s, 0, 0, footer_partition_key, 0)) < 0)
return err;
} else {
@@ -3084,7 +3086,7 @@ static int mxf_write_footer(AVFormatContext *s)
mxf_write_random_index_pack(s);
if (s->pb->seekable & AVIO_SEEKABLE_NORMAL) {
- if (s->oformat == &ff_mxf_opatom_muxer) {
+ if (IS_OPATOM(s)) {
/* rewrite body partition to update lengths */
avio_seek(pb, mxf->body_partition_offset[0], SEEK_SET);
if ((err = mxf_write_opatom_body_partition(s)) < 0)
@@ -3092,7 +3094,7 @@ static int mxf_write_footer(AVFormatContext *s)
}
avio_seek(pb, 0, SEEK_SET);
- if (mxf->edit_unit_byte_count && s->oformat != &ff_mxf_opatom_muxer) {
+ if (mxf->edit_unit_byte_count && !IS_OPATOM(s)) {
if ((err = mxf_write_partition(s, 1, 2, header_closed_partition_key, 1)) < 0)
return err;
mxf_write_klv_fill(s);
@@ -3260,52 +3262,52 @@ static const AVClass mxf_opatom_muxer_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVOutputFormat ff_mxf_muxer = {
- .name = "mxf",
- .long_name = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format)"),
- .mime_type = "application/mxf",
- .extensions = "mxf",
+const FFOutputFormat ff_mxf_muxer = {
+ .p.name = "mxf",
+ .p.long_name = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format)"),
+ .p.mime_type = "application/mxf",
+ .p.extensions = "mxf",
.priv_data_size = sizeof(MXFContext),
- .audio_codec = AV_CODEC_ID_PCM_S16LE,
- .video_codec = AV_CODEC_ID_MPEG2VIDEO,
+ .p.audio_codec = AV_CODEC_ID_PCM_S16LE,
+ .p.video_codec = AV_CODEC_ID_MPEG2VIDEO,
.init = mxf_init,
.write_packet = mxf_write_packet,
.write_trailer = mxf_write_footer,
.deinit = mxf_deinit,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
.interleave_packet = mxf_interleave,
- .priv_class = &mxf_muxer_class,
+ .p.priv_class = &mxf_muxer_class,
};
-const AVOutputFormat ff_mxf_d10_muxer = {
- .name = "mxf_d10",
- .long_name = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format) D-10 Mapping"),
- .mime_type = "application/mxf",
+const FFOutputFormat ff_mxf_d10_muxer = {
+ .p.name = "mxf_d10",
+ .p.long_name = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format) D-10 Mapping"),
+ .p.mime_type = "application/mxf",
.priv_data_size = sizeof(MXFContext),
- .audio_codec = AV_CODEC_ID_PCM_S16LE,
- .video_codec = AV_CODEC_ID_MPEG2VIDEO,
+ .p.audio_codec = AV_CODEC_ID_PCM_S16LE,
+ .p.video_codec = AV_CODEC_ID_MPEG2VIDEO,
.init = mxf_init,
.write_packet = mxf_write_packet,
.write_trailer = mxf_write_footer,
.deinit = mxf_deinit,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
.interleave_packet = mxf_interleave,
- .priv_class = &mxf_d10_muxer_class,
+ .p.priv_class = &mxf_d10_muxer_class,
};
-const AVOutputFormat ff_mxf_opatom_muxer = {
- .name = "mxf_opatom",
- .long_name = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format) Operational Pattern Atom"),
- .mime_type = "application/mxf",
- .extensions = "mxf",
+const FFOutputFormat ff_mxf_opatom_muxer = {
+ .p.name = "mxf_opatom",
+ .p.long_name = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format) Operational Pattern Atom"),
+ .p.mime_type = "application/mxf",
+ .p.extensions = "mxf",
.priv_data_size = sizeof(MXFContext),
- .audio_codec = AV_CODEC_ID_PCM_S16LE,
- .video_codec = AV_CODEC_ID_DNXHD,
+ .p.audio_codec = AV_CODEC_ID_PCM_S16LE,
+ .p.video_codec = AV_CODEC_ID_DNXHD,
.init = mxf_init,
.write_packet = mxf_write_packet,
.write_trailer = mxf_write_footer,
.deinit = mxf_deinit,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
.interleave_packet = mxf_interleave,
- .priv_class = &mxf_opatom_muxer_class,
+ .p.priv_class = &mxf_opatom_muxer_class,
};
diff --git a/libavformat/nullenc.c b/libavformat/nullenc.c
index 3deca5a7eda..60bde2a0690 100644
--- a/libavformat/nullenc.c
+++ b/libavformat/nullenc.c
@@ -27,12 +27,12 @@ static int null_write_packet(struct AVFormatContext *s, AVPacket *pkt)
return 0;
}
-const AVOutputFormat ff_null_muxer = {
- .name = "null",
- .long_name = NULL_IF_CONFIG_SMALL("raw null video"),
- .audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
- .video_codec = AV_CODEC_ID_WRAPPED_AVFRAME,
+const FFOutputFormat ff_null_muxer = {
+ .p.name = "null",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw null video"),
+ .p.audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
+ .p.video_codec = AV_CODEC_ID_WRAPPED_AVFRAME,
.write_packet = null_write_packet,
- .flags = AVFMT_VARIABLE_FPS | AVFMT_NOFILE | AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_VARIABLE_FPS | AVFMT_NOFILE | AVFMT_NOTIMESTAMPS,
.interleave_packet = ff_interleave_packet_passthrough,
};
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index ff81ee34aa0..a5198c7ca9f 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -1253,20 +1253,20 @@ static const AVClass class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVOutputFormat ff_nut_muxer = {
- .name = "nut",
- .long_name = NULL_IF_CONFIG_SMALL("NUT"),
- .mime_type = "video/x-nut",
- .extensions = "nut",
+const FFOutputFormat ff_nut_muxer = {
+ .p.name = "nut",
+ .p.long_name = NULL_IF_CONFIG_SMALL("NUT"),
+ .p.mime_type = "video/x-nut",
+ .p.extensions = "nut",
.priv_data_size = sizeof(NUTContext),
- .audio_codec = CONFIG_LIBVORBIS ? AV_CODEC_ID_VORBIS :
+ .p.audio_codec = CONFIG_LIBVORBIS ? AV_CODEC_ID_VORBIS :
CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : AV_CODEC_ID_MP2,
- .video_codec = AV_CODEC_ID_MPEG4,
+ .p.video_codec = AV_CODEC_ID_MPEG4,
.write_header = nut_write_header,
.write_packet = nut_write_packet,
.write_trailer = nut_write_trailer,
.deinit = nut_write_deinit,
- .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS,
- .codec_tag = ff_nut_codec_tags,
- .priv_class = &class,
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS,
+ .p.codec_tag = ff_nut_codec_tags,
+ .p.priv_class = &class,
};
diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c
index 458b2a9bdc4..2e582d0754c 100644
--- a/libavformat/oggenc.c
+++ b/libavformat/oggenc.c
@@ -33,6 +33,7 @@
#include "avformat.h"
#include "avio_internal.h"
#include "internal.h"
+#include "mux.h"
#include "version.h"
#include "vorbiscomment.h"
@@ -746,11 +747,11 @@ static void ogg_free(AVFormatContext *s)
}
#if CONFIG_OGG_MUXER
-const AVOutputFormat ff_ogg_muxer = {
- .name = "ogg",
- .long_name = NULL_IF_CONFIG_SMALL("Ogg"),
- .mime_type = "application/ogg",
- .extensions = "ogg"
+const FFOutputFormat ff_ogg_muxer = {
+ .p.name = "ogg",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Ogg"),
+ .p.mime_type = "application/ogg",
+ .p.extensions = "ogg"
#if !CONFIG_OGV_MUXER
",ogv"
#endif
@@ -762,90 +763,90 @@ const AVOutputFormat ff_ogg_muxer = {
#endif
,
.priv_data_size = sizeof(OGGContext),
- .audio_codec = CONFIG_LIBVORBIS_ENCODER ?
+ .p.audio_codec = CONFIG_LIBVORBIS_ENCODER ?
AV_CODEC_ID_VORBIS : AV_CODEC_ID_FLAC,
- .video_codec = AV_CODEC_ID_THEORA,
+ .p.video_codec = AV_CODEC_ID_THEORA,
.init = ogg_init,
.write_header = ogg_write_header,
.write_packet = ogg_write_packet,
.write_trailer = ogg_write_trailer,
.deinit = ogg_free,
- .flags = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
- .priv_class = &ogg_muxer_class,
+ .p.flags = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
+ .p.priv_class = &ogg_muxer_class,
};
#endif
#if CONFIG_OGA_MUXER
-const AVOutputFormat ff_oga_muxer = {
- .name = "oga",
- .long_name = NULL_IF_CONFIG_SMALL("Ogg Audio"),
- .mime_type = "audio/ogg",
- .extensions = "oga",
+const FFOutputFormat ff_oga_muxer = {
+ .p.name = "oga",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Ogg Audio"),
+ .p.mime_type = "audio/ogg",
+ .p.extensions = "oga",
.priv_data_size = sizeof(OGGContext),
- .audio_codec = AV_CODEC_ID_FLAC,
+ .p.audio_codec = AV_CODEC_ID_FLAC,
.init = ogg_init,
.write_header = ogg_write_header,
.write_packet = ogg_write_packet,
.write_trailer = ogg_write_trailer,
.deinit = ogg_free,
- .flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
- .priv_class = &ogg_muxer_class,
+ .p.flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
+ .p.priv_class = &ogg_muxer_class,
};
#endif
#if CONFIG_OGV_MUXER
-const AVOutputFormat ff_ogv_muxer = {
- .name = "ogv",
- .long_name = NULL_IF_CONFIG_SMALL("Ogg Video"),
- .mime_type = "video/ogg",
- .extensions = "ogv",
+const FFOutputFormat ff_ogv_muxer = {
+ .p.name = "ogv",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Ogg Video"),
+ .p.mime_type = "video/ogg",
+ .p.extensions = "ogv",
.priv_data_size = sizeof(OGGContext),
- .audio_codec = CONFIG_LIBVORBIS_ENCODER ?
+ .p.audio_codec = CONFIG_LIBVORBIS_ENCODER ?
AV_CODEC_ID_VORBIS : AV_CODEC_ID_FLAC,
- .video_codec = CONFIG_LIBTHEORA_ENCODER ?
+ .p.video_codec = CONFIG_LIBTHEORA_ENCODER ?
AV_CODEC_ID_THEORA : AV_CODEC_ID_VP8,
.init = ogg_init,
.write_header = ogg_write_header,
.write_packet = ogg_write_packet,
.write_trailer = ogg_write_trailer,
.deinit = ogg_free,
- .flags = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
- .priv_class = &ogg_muxer_class,
+ .p.flags = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
+ .p.priv_class = &ogg_muxer_class,
};
#endif
#if CONFIG_SPX_MUXER
-const AVOutputFormat ff_spx_muxer = {
- .name = "spx",
- .long_name = NULL_IF_CONFIG_SMALL("Ogg Speex"),
- .mime_type = "audio/ogg",
- .extensions = "spx",
+const FFOutputFormat ff_spx_muxer = {
+ .p.name = "spx",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Ogg Speex"),
+ .p.mime_type = "audio/ogg",
+ .p.extensions = "spx",
.priv_data_size = sizeof(OGGContext),
- .audio_codec = AV_CODEC_ID_SPEEX,
+ .p.audio_codec = AV_CODEC_ID_SPEEX,
.init = ogg_init,
.write_header = ogg_write_header,
.write_packet = ogg_write_packet,
.write_trailer = ogg_write_trailer,
.deinit = ogg_free,
- .flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
- .priv_class = &ogg_muxer_class,
+ .p.flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
+ .p.priv_class = &ogg_muxer_class,
};
#endif
#if CONFIG_OPUS_MUXER
-const AVOutputFormat ff_opus_muxer = {
- .name = "opus",
- .long_name = NULL_IF_CONFIG_SMALL("Ogg Opus"),
- .mime_type = "audio/ogg",
- .extensions = "opus",
+const FFOutputFormat ff_opus_muxer = {
+ .p.name = "opus",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Ogg Opus"),
+ .p.mime_type = "audio/ogg",
+ .p.extensions = "opus",
.priv_data_size = sizeof(OGGContext),
- .audio_codec = AV_CODEC_ID_OPUS,
+ .p.audio_codec = AV_CODEC_ID_OPUS,
.init = ogg_init,
.write_header = ogg_write_header,
.write_packet = ogg_write_packet,
.write_trailer = ogg_write_trailer,
.deinit = ogg_free,
- .flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
- .priv_class = &ogg_muxer_class,
+ .p.flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
+ .p.priv_class = &ogg_muxer_class,
};
#endif
diff --git a/libavformat/omaenc.c b/libavformat/omaenc.c
index 246f5195fb9..6d0b47465d1 100644
--- a/libavformat/omaenc.c
+++ b/libavformat/omaenc.c
@@ -24,6 +24,7 @@
#include "avio_internal.h"
#include "id3v2.h"
#include "internal.h"
+#include "mux.h"
#include "oma.h"
#include "rawenc.h"
@@ -91,14 +92,14 @@ static av_cold int oma_write_header(AVFormatContext *s)
return 0;
}
-const AVOutputFormat ff_oma_muxer = {
- .name = "oma",
- .long_name = NULL_IF_CONFIG_SMALL("Sony OpenMG audio"),
- .mime_type = "audio/x-oma",
- .extensions = "oma",
- .audio_codec = AV_CODEC_ID_ATRAC3,
+const FFOutputFormat ff_oma_muxer = {
+ .p.name = "oma",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Sony OpenMG audio"),
+ .p.mime_type = "audio/x-oma",
+ .p.extensions = "oma",
+ .p.audio_codec = AV_CODEC_ID_ATRAC3,
.write_header = oma_write_header,
.write_packet = ff_raw_write_packet,
- .codec_tag = ff_oma_codec_tags_list,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.codec_tag = ff_oma_codec_tags_list,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
diff --git a/libavformat/pcmenc.c b/libavformat/pcmenc.c
index 0cf497989af..7f716443081 100644
--- a/libavformat/pcmenc.c
+++ b/libavformat/pcmenc.c
@@ -22,18 +22,19 @@
#include "config_components.h"
#include "avformat.h"
+#include "mux.h"
#include "rawenc.h"
#define PCMDEF_0(name_, long_name_, ext, codec)
#define PCMDEF_1(name_, long_name_, ext, codec) \
-const AVOutputFormat ff_pcm_ ## name_ ## _muxer = { \
- .name = #name_, \
- .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
- .extensions = ext, \
- .audio_codec = codec, \
- .video_codec = AV_CODEC_ID_NONE, \
+const FFOutputFormat ff_pcm_ ## name_ ## _muxer = { \
+ .p.name = #name_, \
+ .p.long_name = NULL_IF_CONFIG_SMALL(long_name_), \
+ .p.extensions = ext, \
+ .p.audio_codec = codec, \
+ .p.video_codec = AV_CODEC_ID_NONE, \
+ .p.flags = AVFMT_NOTIMESTAMPS, \
.write_packet = ff_raw_write_packet, \
- .flags = AVFMT_NOTIMESTAMPS, \
};
#define PCMDEF_2(name, long_name, ext, codec, enabled) \
PCMDEF_ ## enabled(name, long_name, ext, codec)
diff --git a/libavformat/rawenc.c b/libavformat/rawenc.c
index 267fce252d1..78fadda9679 100644
--- a/libavformat/rawenc.c
+++ b/libavformat/rawenc.c
@@ -59,16 +59,16 @@ static int force_one_stream(AVFormatContext *s)
/* Note: Do not forget to add new entries to the Makefile as well. */
#if CONFIG_AC3_MUXER
-const AVOutputFormat ff_ac3_muxer = {
- .name = "ac3",
- .long_name = NULL_IF_CONFIG_SMALL("raw AC-3"),
- .mime_type = "audio/x-ac3",
- .extensions = "ac3",
- .audio_codec = AV_CODEC_ID_AC3,
- .video_codec = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_ac3_muxer = {
+ .p.name = "ac3",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw AC-3"),
+ .p.mime_type = "audio/x-ac3",
+ .p.extensions = "ac3",
+ .p.audio_codec = AV_CODEC_ID_AC3,
+ .p.video_codec = AV_CODEC_ID_NONE,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
@@ -92,266 +92,266 @@ static int adx_write_trailer(AVFormatContext *s)
return 0;
}
-const AVOutputFormat ff_adx_muxer = {
- .name = "adx",
- .long_name = NULL_IF_CONFIG_SMALL("CRI ADX"),
- .extensions = "adx",
- .audio_codec = AV_CODEC_ID_ADPCM_ADX,
- .video_codec = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_adx_muxer = {
+ .p.name = "adx",
+ .p.long_name = NULL_IF_CONFIG_SMALL("CRI ADX"),
+ .p.extensions = "adx",
+ .p.audio_codec = AV_CODEC_ID_ADPCM_ADX,
+ .p.video_codec = AV_CODEC_ID_NONE,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
.write_trailer = adx_write_trailer,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_APTX_MUXER
-const AVOutputFormat ff_aptx_muxer = {
- .name = "aptx",
- .long_name = NULL_IF_CONFIG_SMALL("raw aptX (Audio Processing Technology for Bluetooth)"),
- .extensions = "aptx",
- .audio_codec = AV_CODEC_ID_APTX,
- .video_codec = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_aptx_muxer = {
+ .p.name = "aptx",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw aptX (Audio Processing Technology for Bluetooth)"),
+ .p.extensions = "aptx",
+ .p.audio_codec = AV_CODEC_ID_APTX,
+ .p.video_codec = AV_CODEC_ID_NONE,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_APTX_HD_MUXER
-const AVOutputFormat ff_aptx_hd_muxer = {
- .name = "aptx_hd",
- .long_name = NULL_IF_CONFIG_SMALL("raw aptX HD (Audio Processing Technology for Bluetooth)"),
- .extensions = "aptxhd",
- .audio_codec = AV_CODEC_ID_APTX_HD,
- .video_codec = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_aptx_hd_muxer = {
+ .p.name = "aptx_hd",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw aptX HD (Audio Processing Technology for Bluetooth)"),
+ .p.extensions = "aptxhd",
+ .p.audio_codec = AV_CODEC_ID_APTX_HD,
+ .p.video_codec = AV_CODEC_ID_NONE,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_AVS2_MUXER
-const AVOutputFormat ff_avs2_muxer = {
- .name = "avs2",
- .long_name = NULL_IF_CONFIG_SMALL("raw AVS2-P2/IEEE1857.4 video"),
- .extensions = "avs,avs2",
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_AVS2,
+const FFOutputFormat ff_avs2_muxer = {
+ .p.name = "avs2",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw AVS2-P2/IEEE1857.4 video"),
+ .p.extensions = "avs,avs2",
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_AVS2,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_AVS3_MUXER
-const AVOutputFormat ff_avs3_muxer = {
- .name = "avs3",
- .long_name = NULL_IF_CONFIG_SMALL("AVS3-P2/IEEE1857.10"),
- .extensions = "avs3",
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_AVS3,
+const FFOutputFormat ff_avs3_muxer = {
+ .p.name = "avs3",
+ .p.long_name = NULL_IF_CONFIG_SMALL("AVS3-P2/IEEE1857.10"),
+ .p.extensions = "avs3",
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_AVS3,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_CAVSVIDEO_MUXER
-const AVOutputFormat ff_cavsvideo_muxer = {
- .name = "cavsvideo",
- .long_name = NULL_IF_CONFIG_SMALL("raw Chinese AVS (Audio Video Standard) video"),
- .extensions = "cavs",
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_CAVS,
+const FFOutputFormat ff_cavsvideo_muxer = {
+ .p.name = "cavsvideo",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw Chinese AVS (Audio Video Standard) video"),
+ .p.extensions = "cavs",
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_CAVS,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_CODEC2RAW_MUXER
-const AVOutputFormat ff_codec2raw_muxer = {
- .name = "codec2raw",
- .long_name = NULL_IF_CONFIG_SMALL("raw codec2 muxer"),
- .audio_codec = AV_CODEC_ID_CODEC2,
- .video_codec = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_codec2raw_muxer = {
+ .p.name = "codec2raw",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw codec2 muxer"),
+ .p.audio_codec = AV_CODEC_ID_CODEC2,
+ .p.video_codec = AV_CODEC_ID_NONE,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_DATA_MUXER
-const AVOutputFormat ff_data_muxer = {
- .name = "data",
- .long_name = NULL_IF_CONFIG_SMALL("raw data"),
+const FFOutputFormat ff_data_muxer = {
+ .p.name = "data",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw data"),
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_DFPWM_MUXER
-const AVOutputFormat ff_dfpwm_muxer = {
- .name = "dfpwm",
- .long_name = NULL_IF_CONFIG_SMALL("raw DFPWM1a"),
- .extensions = "dfpwm",
- .audio_codec = AV_CODEC_ID_DFPWM,
- .video_codec = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_dfpwm_muxer = {
+ .p.name = "dfpwm",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw DFPWM1a"),
+ .p.extensions = "dfpwm",
+ .p.audio_codec = AV_CODEC_ID_DFPWM,
+ .p.video_codec = AV_CODEC_ID_NONE,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_DIRAC_MUXER
-const AVOutputFormat ff_dirac_muxer = {
- .name = "dirac",
- .long_name = NULL_IF_CONFIG_SMALL("raw Dirac"),
- .extensions = "drc,vc2",
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_DIRAC,
+const FFOutputFormat ff_dirac_muxer = {
+ .p.name = "dirac",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw Dirac"),
+ .p.extensions = "drc,vc2",
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_DIRAC,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_DNXHD_MUXER
-const AVOutputFormat ff_dnxhd_muxer = {
- .name = "dnxhd",
- .long_name = NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"),
- .extensions = "dnxhd,dnxhr",
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_DNXHD,
+const FFOutputFormat ff_dnxhd_muxer = {
+ .p.name = "dnxhd",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"),
+ .p.extensions = "dnxhd,dnxhr",
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_DNXHD,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_DTS_MUXER
-const AVOutputFormat ff_dts_muxer = {
- .name = "dts",
- .long_name = NULL_IF_CONFIG_SMALL("raw DTS"),
- .mime_type = "audio/x-dca",
- .extensions = "dts",
- .audio_codec = AV_CODEC_ID_DTS,
- .video_codec = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_dts_muxer = {
+ .p.name = "dts",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw DTS"),
+ .p.mime_type = "audio/x-dca",
+ .p.extensions = "dts",
+ .p.audio_codec = AV_CODEC_ID_DTS,
+ .p.video_codec = AV_CODEC_ID_NONE,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_EAC3_MUXER
-const AVOutputFormat ff_eac3_muxer = {
- .name = "eac3",
- .long_name = NULL_IF_CONFIG_SMALL("raw E-AC-3"),
- .mime_type = "audio/x-eac3",
- .extensions = "eac3,ec3",
- .audio_codec = AV_CODEC_ID_EAC3,
- .video_codec = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_eac3_muxer = {
+ .p.name = "eac3",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw E-AC-3"),
+ .p.mime_type = "audio/x-eac3",
+ .p.extensions = "eac3,ec3",
+ .p.audio_codec = AV_CODEC_ID_EAC3,
+ .p.video_codec = AV_CODEC_ID_NONE,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_G722_MUXER
-const AVOutputFormat ff_g722_muxer = {
- .name = "g722",
- .long_name = NULL_IF_CONFIG_SMALL("raw G.722"),
- .mime_type = "audio/G722",
- .extensions = "g722",
- .audio_codec = AV_CODEC_ID_ADPCM_G722,
- .video_codec = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_g722_muxer = {
+ .p.name = "g722",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw G.722"),
+ .p.mime_type = "audio/G722",
+ .p.extensions = "g722",
+ .p.audio_codec = AV_CODEC_ID_ADPCM_G722,
+ .p.video_codec = AV_CODEC_ID_NONE,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_G723_1_MUXER
-const AVOutputFormat ff_g723_1_muxer = {
- .name = "g723_1",
- .long_name = NULL_IF_CONFIG_SMALL("raw G.723.1"),
- .mime_type = "audio/g723",
- .extensions = "tco,rco",
- .audio_codec = AV_CODEC_ID_G723_1,
- .video_codec = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_g723_1_muxer = {
+ .p.name = "g723_1",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw G.723.1"),
+ .p.mime_type = "audio/g723",
+ .p.extensions = "tco,rco",
+ .p.audio_codec = AV_CODEC_ID_G723_1,
+ .p.video_codec = AV_CODEC_ID_NONE,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_G726_MUXER
-const AVOutputFormat ff_g726_muxer = {
- .name = "g726",
- .long_name = NULL_IF_CONFIG_SMALL("raw big-endian G.726 (\"left-justified\")"),
- .audio_codec = AV_CODEC_ID_ADPCM_G726,
- .video_codec = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_g726_muxer = {
+ .p.name = "g726",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw big-endian G.726 (\"left-justified\")"),
+ .p.audio_codec = AV_CODEC_ID_ADPCM_G726,
+ .p.video_codec = AV_CODEC_ID_NONE,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_G726LE_MUXER
-const AVOutputFormat ff_g726le_muxer = {
- .name = "g726le",
- .long_name = NULL_IF_CONFIG_SMALL("raw little-endian G.726 (\"right-justified\")"),
- .audio_codec = AV_CODEC_ID_ADPCM_G726LE,
- .video_codec = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_g726le_muxer = {
+ .p.name = "g726le",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw little-endian G.726 (\"right-justified\")"),
+ .p.audio_codec = AV_CODEC_ID_ADPCM_G726LE,
+ .p.video_codec = AV_CODEC_ID_NONE,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_GSM_MUXER
-const AVOutputFormat ff_gsm_muxer = {
- .name = "gsm",
- .long_name = NULL_IF_CONFIG_SMALL("raw GSM"),
- .mime_type = "audio/x-gsm",
- .extensions = "gsm",
- .audio_codec = AV_CODEC_ID_GSM,
- .video_codec = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_gsm_muxer = {
+ .p.name = "gsm",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw GSM"),
+ .p.mime_type = "audio/x-gsm",
+ .p.extensions = "gsm",
+ .p.audio_codec = AV_CODEC_ID_GSM,
+ .p.video_codec = AV_CODEC_ID_NONE,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_H261_MUXER
-const AVOutputFormat ff_h261_muxer = {
- .name = "h261",
- .long_name = NULL_IF_CONFIG_SMALL("raw H.261"),
- .mime_type = "video/x-h261",
- .extensions = "h261",
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_H261,
+const FFOutputFormat ff_h261_muxer = {
+ .p.name = "h261",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw H.261"),
+ .p.mime_type = "video/x-h261",
+ .p.extensions = "h261",
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_H261,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_H263_MUXER
-const AVOutputFormat ff_h263_muxer = {
- .name = "h263",
- .long_name = NULL_IF_CONFIG_SMALL("raw H.263"),
- .mime_type = "video/x-h263",
- .extensions = "h263",
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_H263,
+const FFOutputFormat ff_h263_muxer = {
+ .p.name = "h263",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw H.263"),
+ .p.mime_type = "video/x-h263",
+ .p.extensions = "h263",
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_H263,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
@@ -365,16 +365,16 @@ static int h264_check_bitstream(AVFormatContext *s, AVStream *st,
return 1;
}
-const AVOutputFormat ff_h264_muxer = {
- .name = "h264",
- .long_name = NULL_IF_CONFIG_SMALL("raw H.264 video"),
- .extensions = "h264,264",
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_H264,
+const FFOutputFormat ff_h264_muxer = {
+ .p.name = "h264",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw H.264 video"),
+ .p.extensions = "h264,264",
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_H264,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
.check_bitstream = h264_check_bitstream,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
@@ -388,97 +388,97 @@ static int hevc_check_bitstream(AVFormatContext *s, AVStream *st,
return 1;
}
-const AVOutputFormat ff_hevc_muxer = {
- .name = "hevc",
- .long_name = NULL_IF_CONFIG_SMALL("raw HEVC video"),
- .extensions = "hevc,h265,265",
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_HEVC,
+const FFOutputFormat ff_hevc_muxer = {
+ .p.name = "hevc",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw HEVC video"),
+ .p.extensions = "hevc,h265,265",
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_HEVC,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
.check_bitstream = hevc_check_bitstream,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_M4V_MUXER
-const AVOutputFormat ff_m4v_muxer = {
- .name = "m4v",
- .long_name = NULL_IF_CONFIG_SMALL("raw MPEG-4 video"),
- .extensions = "m4v",
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_MPEG4,
+const FFOutputFormat ff_m4v_muxer = {
+ .p.name = "m4v",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw MPEG-4 video"),
+ .p.extensions = "m4v",
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_MPEG4,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_MJPEG_MUXER
-const AVOutputFormat ff_mjpeg_muxer = {
- .name = "mjpeg",
- .long_name = NULL_IF_CONFIG_SMALL("raw MJPEG video"),
- .mime_type = "video/x-mjpeg",
- .extensions = "mjpg,mjpeg",
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_MJPEG,
+const FFOutputFormat ff_mjpeg_muxer = {
+ .p.name = "mjpeg",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw MJPEG video"),
+ .p.mime_type = "video/x-mjpeg",
+ .p.extensions = "mjpg,mjpeg",
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_MJPEG,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_MLP_MUXER
-const AVOutputFormat ff_mlp_muxer = {
- .name = "mlp",
- .long_name = NULL_IF_CONFIG_SMALL("raw MLP"),
- .extensions = "mlp",
- .audio_codec = AV_CODEC_ID_MLP,
- .video_codec = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_mlp_muxer = {
+ .p.name = "mlp",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw MLP"),
+ .p.extensions = "mlp",
+ .p.audio_codec = AV_CODEC_ID_MLP,
+ .p.video_codec = AV_CODEC_ID_NONE,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_MP2_MUXER
-const AVOutputFormat ff_mp2_muxer = {
- .name = "mp2",
- .long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
- .mime_type = "audio/mpeg",
- .extensions = "mp2,m2a,mpa",
- .audio_codec = AV_CODEC_ID_MP2,
- .video_codec = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_mp2_muxer = {
+ .p.name = "mp2",
+ .p.long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
+ .p.mime_type = "audio/mpeg",
+ .p.extensions = "mp2,m2a,mpa",
+ .p.audio_codec = AV_CODEC_ID_MP2,
+ .p.video_codec = AV_CODEC_ID_NONE,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_MPEG1VIDEO_MUXER
-const AVOutputFormat ff_mpeg1video_muxer = {
- .name = "mpeg1video",
- .long_name = NULL_IF_CONFIG_SMALL("raw MPEG-1 video"),
- .mime_type = "video/mpeg",
- .extensions = "mpg,mpeg,m1v",
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_MPEG1VIDEO,
+const FFOutputFormat ff_mpeg1video_muxer = {
+ .p.name = "mpeg1video",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw MPEG-1 video"),
+ .p.mime_type = "video/mpeg",
+ .p.extensions = "mpg,mpeg,m1v",
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_MPEG1VIDEO,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_MPEG2VIDEO_MUXER
-const AVOutputFormat ff_mpeg2video_muxer = {
- .name = "mpeg2video",
- .long_name = NULL_IF_CONFIG_SMALL("raw MPEG-2 video"),
- .extensions = "m2v",
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_MPEG2VIDEO,
+const FFOutputFormat ff_mpeg2video_muxer = {
+ .p.name = "mpeg2video",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw MPEG-2 video"),
+ .p.extensions = "m2v",
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_MPEG2VIDEO,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
@@ -489,66 +489,66 @@ static int obu_check_bitstream(AVFormatContext *s, AVStream *st,
return ff_stream_add_bitstream_filter(st, "av1_metadata", "td=insert");
}
-const AVOutputFormat ff_obu_muxer = {
- .name = "obu",
- .long_name = NULL_IF_CONFIG_SMALL("AV1 low overhead OBU"),
- .extensions = "obu",
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_AV1,
+const FFOutputFormat ff_obu_muxer = {
+ .p.name = "obu",
+ .p.long_name = NULL_IF_CONFIG_SMALL("AV1 low overhead OBU"),
+ .p.extensions = "obu",
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_AV1,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
.check_bitstream = obu_check_bitstream,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_RAWVIDEO_MUXER
-const AVOutputFormat ff_rawvideo_muxer = {
- .name = "rawvideo",
- .long_name = NULL_IF_CONFIG_SMALL("raw video"),
- .extensions = "yuv,rgb",
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_RAWVIDEO,
+const FFOutputFormat ff_rawvideo_muxer = {
+ .p.name = "rawvideo",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw video"),
+ .p.extensions = "yuv,rgb",
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_RAWVIDEO,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_SBC_MUXER
-const AVOutputFormat ff_sbc_muxer = {
- .name = "sbc",
- .long_name = NULL_IF_CONFIG_SMALL("raw SBC"),
- .mime_type = "audio/x-sbc",
- .extensions = "sbc,msbc",
- .audio_codec = AV_CODEC_ID_SBC,
+const FFOutputFormat ff_sbc_muxer = {
+ .p.name = "sbc",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw SBC"),
+ .p.mime_type = "audio/x-sbc",
+ .p.extensions = "sbc,msbc",
+ .p.audio_codec = AV_CODEC_ID_SBC,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_TRUEHD_MUXER
-const AVOutputFormat ff_truehd_muxer = {
- .name = "truehd",
- .long_name = NULL_IF_CONFIG_SMALL("raw TrueHD"),
- .extensions = "thd",
- .audio_codec = AV_CODEC_ID_TRUEHD,
- .video_codec = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_truehd_muxer = {
+ .p.name = "truehd",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw TrueHD"),
+ .p.extensions = "thd",
+ .p.audio_codec = AV_CODEC_ID_TRUEHD,
+ .p.video_codec = AV_CODEC_ID_NONE,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_VC1_MUXER
-const AVOutputFormat ff_vc1_muxer = {
- .name = "vc1",
- .long_name = NULL_IF_CONFIG_SMALL("raw VC-1 video"),
- .extensions = "vc1",
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_VC1,
+const FFOutputFormat ff_vc1_muxer = {
+ .p.name = "vc1",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw VC-1 video"),
+ .p.extensions = "vc1",
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_VC1,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
diff --git a/libavformat/rmenc.c b/libavformat/rmenc.c
index 1fba092b888..0d001224cb6 100644
--- a/libavformat/rmenc.c
+++ b/libavformat/rmenc.c
@@ -20,6 +20,7 @@
*/
#include "avformat.h"
#include "avio_internal.h"
+#include "mux.h"
#include "rm.h"
#include "libavutil/dict.h"
@@ -465,16 +466,16 @@ static int rm_write_trailer(AVFormatContext *s)
}
-const AVOutputFormat ff_rm_muxer = {
- .name = "rm",
- .long_name = NULL_IF_CONFIG_SMALL("RealMedia"),
- .mime_type = "application/vnd.rn-realmedia",
- .extensions = "rm,ra",
+const FFOutputFormat ff_rm_muxer = {
+ .p.name = "rm",
+ .p.long_name = NULL_IF_CONFIG_SMALL("RealMedia"),
+ .p.mime_type = "application/vnd.rn-realmedia",
+ .p.extensions = "rm,ra",
.priv_data_size = sizeof(RMMuxContext),
- .audio_codec = AV_CODEC_ID_AC3,
- .video_codec = AV_CODEC_ID_RV10,
+ .p.audio_codec = AV_CODEC_ID_AC3,
+ .p.video_codec = AV_CODEC_ID_RV10,
.write_header = rm_write_header,
.write_packet = rm_write_packet,
.write_trailer = rm_write_trailer,
- .codec_tag = (const AVCodecTag* const []){ ff_rm_codec_tags, 0 },
+ .p.codec_tag = (const AVCodecTag* const []){ ff_rm_codec_tags, 0 },
};
diff --git a/libavformat/rsoenc.c b/libavformat/rsoenc.c
index 858b53f6c6b..fe22e22812a 100644
--- a/libavformat/rsoenc.c
+++ b/libavformat/rsoenc.c
@@ -22,6 +22,7 @@
#include "avformat.h"
#include "internal.h"
+#include "mux.h"
#include "rawenc.h"
#include "riff.h"
#include "rso.h"
@@ -91,15 +92,15 @@ static int rso_write_trailer(AVFormatContext *s)
return 0;
}
-const AVOutputFormat ff_rso_muxer = {
- .name = "rso",
- .long_name = NULL_IF_CONFIG_SMALL("Lego Mindstorms RSO"),
- .extensions = "rso",
- .audio_codec = AV_CODEC_ID_PCM_U8,
- .video_codec = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_rso_muxer = {
+ .p.name = "rso",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Lego Mindstorms RSO"),
+ .p.extensions = "rso",
+ .p.audio_codec = AV_CODEC_ID_PCM_U8,
+ .p.video_codec = AV_CODEC_ID_NONE,
.write_header = rso_write_header,
.write_packet = ff_raw_write_packet,
.write_trailer = rso_write_trailer,
- .codec_tag = ff_rso_codec_tags_list,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.codec_tag = ff_rso_codec_tags_list,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
index ce629a80954..a8d296a1542 100644
--- a/libavformat/rtpenc.c
+++ b/libavformat/rtpenc.c
@@ -22,6 +22,7 @@
#include "avformat.h"
#include "mpegts.h"
#include "internal.h"
+#include "mux.h"
#include "libavutil/mathematics.h"
#include "libavutil/random_seed.h"
#include "libavutil/opt.h"
@@ -659,15 +660,15 @@ static int rtp_write_trailer(AVFormatContext *s1)
return 0;
}
-const AVOutputFormat ff_rtp_muxer = {
- .name = "rtp",
- .long_name = NULL_IF_CONFIG_SMALL("RTP output"),
+const FFOutputFormat ff_rtp_muxer = {
+ .p.name = "rtp",
+ .p.long_name = NULL_IF_CONFIG_SMALL("RTP output"),
.priv_data_size = sizeof(RTPMuxContext),
- .audio_codec = AV_CODEC_ID_PCM_MULAW,
- .video_codec = AV_CODEC_ID_MPEG4,
+ .p.audio_codec = AV_CODEC_ID_PCM_MULAW,
+ .p.video_codec = AV_CODEC_ID_MPEG4,
.write_header = rtp_write_header,
.write_packet = rtp_write_packet,
.write_trailer = rtp_write_trailer,
- .priv_class = &rtp_muxer_class,
- .flags = AVFMT_TS_NONSTRICT,
+ .p.priv_class = &rtp_muxer_class,
+ .p.flags = AVFMT_TS_NONSTRICT,
};
diff --git a/libavformat/rtpenc_mpegts.c b/libavformat/rtpenc_mpegts.c
index fdc759c1793..0d6403a0484 100644
--- a/libavformat/rtpenc_mpegts.c
+++ b/libavformat/rtpenc_mpegts.c
@@ -23,6 +23,7 @@
#include "libavutil/opt.h"
#include "avformat.h"
#include "avio_internal.h"
+#include "mux.h"
typedef struct MuxChain {
const AVClass *class;
@@ -187,14 +188,14 @@ static const AVClass rtp_mpegts_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVOutputFormat ff_rtp_mpegts_muxer = {
- .name = "rtp_mpegts",
- .long_name = NULL_IF_CONFIG_SMALL("RTP/mpegts output format"),
+const FFOutputFormat ff_rtp_mpegts_muxer = {
+ .p.name = "rtp_mpegts",
+ .p.long_name = NULL_IF_CONFIG_SMALL("RTP/mpegts output format"),
.priv_data_size = sizeof(MuxChain),
- .audio_codec = AV_CODEC_ID_AAC,
- .video_codec = AV_CODEC_ID_MPEG4,
+ .p.audio_codec = AV_CODEC_ID_AAC,
+ .p.video_codec = AV_CODEC_ID_MPEG4,
.write_header = rtp_mpegts_write_header,
.write_packet = rtp_mpegts_write_packet,
.write_trailer = rtp_mpegts_write_close,
- .priv_class = &rtp_mpegts_class,
+ .p.priv_class = &rtp_mpegts_class,
};
diff --git a/libavformat/rtspenc.c b/libavformat/rtspenc.c
index 21b204381b3..3d444ccbfd8 100644
--- a/libavformat/rtspenc.c
+++ b/libavformat/rtspenc.c
@@ -244,15 +244,15 @@ static int rtsp_write_close(AVFormatContext *s)
return 0;
}
-const AVOutputFormat ff_rtsp_muxer = {
- .name = "rtsp",
- .long_name = NULL_IF_CONFIG_SMALL("RTSP output"),
+const FFOutputFormat ff_rtsp_muxer = {
+ .p.name = "rtsp",
+ .p.long_name = NULL_IF_CONFIG_SMALL("RTSP output"),
.priv_data_size = sizeof(RTSPState),
- .audio_codec = AV_CODEC_ID_AAC,
- .video_codec = AV_CODEC_ID_MPEG4,
+ .p.audio_codec = AV_CODEC_ID_AAC,
+ .p.video_codec = AV_CODEC_ID_MPEG4,
.write_header = rtsp_write_header,
.write_packet = rtsp_write_packet,
.write_trailer = rtsp_write_close,
- .flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER,
- .priv_class = &rtsp_muxer_class,
+ .p.flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER,
+ .p.priv_class = &rtsp_muxer_class,
};
diff --git a/libavformat/sapenc.c b/libavformat/sapenc.c
index 8eb9d3b92a7..28839b837ff 100644
--- a/libavformat/sapenc.c
+++ b/libavformat/sapenc.c
@@ -268,14 +268,14 @@ static int sap_write_packet(AVFormatContext *s, AVPacket *pkt)
return ff_write_chained(rtpctx, 0, pkt, s, 0);
}
-const AVOutputFormat ff_sap_muxer = {
- .name = "sap",
- .long_name = NULL_IF_CONFIG_SMALL("SAP output"),
+const FFOutputFormat ff_sap_muxer = {
+ .p.name = "sap",
+ .p.long_name = NULL_IF_CONFIG_SMALL("SAP output"),
.priv_data_size = sizeof(struct SAPState),
- .audio_codec = AV_CODEC_ID_AAC,
- .video_codec = AV_CODEC_ID_MPEG4,
+ .p.audio_codec = AV_CODEC_ID_AAC,
+ .p.video_codec = AV_CODEC_ID_MPEG4,
.write_header = sap_write_header,
.write_packet = sap_write_packet,
.write_trailer = sap_write_close,
- .flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER,
+ .p.flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER,
};
diff --git a/libavformat/sccenc.c b/libavformat/sccenc.c
index 2b924ba6e77..ea7865ecf22 100644
--- a/libavformat/sccenc.c
+++ b/libavformat/sccenc.c
@@ -21,6 +21,7 @@
#include "avformat.h"
#include "internal.h"
+#include "mux.h"
#include "libavutil/log.h"
#include "libavutil/intreadwrite.h"
@@ -111,13 +112,13 @@ static int scc_write_packet(AVFormatContext *avf, AVPacket *pkt)
return 0;
}
-const AVOutputFormat ff_scc_muxer = {
- .name = "scc",
- .long_name = NULL_IF_CONFIG_SMALL("Scenarist Closed Captions"),
- .extensions = "scc",
+const FFOutputFormat ff_scc_muxer = {
+ .p.name = "scc",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Scenarist Closed Captions"),
+ .p.extensions = "scc",
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT,
+ .p.subtitle_codec = AV_CODEC_ID_EIA_608,
.priv_data_size = sizeof(SCCContext),
.write_header = scc_write_header,
.write_packet = scc_write_packet,
- .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT,
- .subtitle_codec = AV_CODEC_ID_EIA_608,
};
diff --git a/libavformat/segafilmenc.c b/libavformat/segafilmenc.c
index 42d56fccd61..ba06dc655d0 100644
--- a/libavformat/segafilmenc.c
+++ b/libavformat/segafilmenc.c
@@ -280,13 +280,13 @@ static void film_deinit(AVFormatContext *format_context)
ffio_free_dyn_buf(&film->header);
}
-const AVOutputFormat ff_segafilm_muxer = {
- .name = "film_cpk",
- .long_name = NULL_IF_CONFIG_SMALL("Sega FILM / CPK"),
- .extensions = "cpk",
+const FFOutputFormat ff_segafilm_muxer = {
+ .p.name = "film_cpk",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Sega FILM / CPK"),
+ .p.extensions = "cpk",
.priv_data_size = sizeof(FILMOutputContext),
- .audio_codec = AV_CODEC_ID_PCM_S16BE_PLANAR,
- .video_codec = AV_CODEC_ID_CINEPAK,
+ .p.audio_codec = AV_CODEC_ID_PCM_S16BE_PLANAR,
+ .p.video_codec = AV_CODEC_ID_CINEPAK,
.init = film_init,
.write_trailer = film_write_header,
.write_packet = film_write_packet,
diff --git a/libavformat/segment.c b/libavformat/segment.c
index 80e4bf851c1..eb629b342ce 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -976,7 +976,8 @@ calc_times:
av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &st->time_base));
ret = ff_write_chained(seg->avf, pkt->stream_index, pkt, s,
- seg->initial_offset || seg->reset_timestamps || seg->avf->oformat->interleave_packet);
+ seg->initial_offset || seg->reset_timestamps ||
+ ffofmt(seg->avf->oformat)->interleave_packet);
fail:
/* Use st->index here as the packet returned from ff_write_chained()
@@ -1016,9 +1017,9 @@ static int seg_check_bitstream(AVFormatContext *s, AVStream *st,
{
SegmentContext *seg = s->priv_data;
AVFormatContext *oc = seg->avf;
- if (oc->oformat->check_bitstream) {
+ if (ffofmt(oc->oformat)->check_bitstream) {
AVStream *const ost = oc->streams[st->index];
- int ret = oc->oformat->check_bitstream(oc, ost, pkt);
+ int ret = ffofmt(oc->oformat)->check_bitstream(oc, ost, pkt);
if (ret == 1) {
FFStream *const sti = ffstream(st);
FFStream *const osti = ffstream(ost);
@@ -1085,33 +1086,33 @@ static const AVClass seg_class = {
};
#if CONFIG_SEGMENT_MUXER
-const AVOutputFormat ff_segment_muxer = {
- .name = "segment",
- .long_name = NULL_IF_CONFIG_SMALL("segment"),
+const FFOutputFormat ff_segment_muxer = {
+ .p.name = "segment",
+ .p.long_name = NULL_IF_CONFIG_SMALL("segment"),
+ .p.flags = AVFMT_NOFILE|AVFMT_GLOBALHEADER,
+ .p.priv_class = &seg_class,
.priv_data_size = sizeof(SegmentContext),
- .flags = AVFMT_NOFILE|AVFMT_GLOBALHEADER,
.init = seg_init,
.write_header = seg_write_header,
.write_packet = seg_write_packet,
.write_trailer = seg_write_trailer,
.deinit = seg_free,
.check_bitstream = seg_check_bitstream,
- .priv_class = &seg_class,
};
#endif
#if CONFIG_STREAM_SEGMENT_MUXER
-const AVOutputFormat ff_stream_segment_muxer = {
- .name = "stream_segment,ssegment",
- .long_name = NULL_IF_CONFIG_SMALL("streaming segment muxer"),
- .priv_data_size = sizeof(SegmentContext),
- .flags = AVFMT_NOFILE,
+const FFOutputFormat ff_stream_segment_muxer = {
+ .p.name = "stream_segment,ssegment",
+ .p.long_name = NULL_IF_CONFIG_SMALL("streaming segment muxer"),
+ .p.flags = AVFMT_NOFILE,
+ .p.priv_class = &seg_class,
+ .priv_data_size = sizeof(SegmentContext),
.init = seg_init,
.write_header = seg_write_header,
.write_packet = seg_write_packet,
.write_trailer = seg_write_trailer,
.deinit = seg_free,
.check_bitstream = seg_check_bitstream,
- .priv_class = &seg_class,
};
#endif
diff --git a/libavformat/smjpegenc.c b/libavformat/smjpegenc.c
index edba08cf9b7..56907c96f7a 100644
--- a/libavformat/smjpegenc.c
+++ b/libavformat/smjpegenc.c
@@ -133,15 +133,15 @@ static int smjpeg_write_trailer(AVFormatContext *s)
return 0;
}
-const AVOutputFormat ff_smjpeg_muxer = {
- .name = "smjpeg",
- .long_name = NULL_IF_CONFIG_SMALL("Loki SDL MJPEG"),
+const FFOutputFormat ff_smjpeg_muxer = {
+ .p.name = "smjpeg",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Loki SDL MJPEG"),
.priv_data_size = sizeof(SMJPEGMuxContext),
- .audio_codec = AV_CODEC_ID_PCM_S16LE,
- .video_codec = AV_CODEC_ID_MJPEG,
+ .p.audio_codec = AV_CODEC_ID_PCM_S16LE,
+ .p.video_codec = AV_CODEC_ID_MJPEG,
.write_header = smjpeg_write_header,
.write_packet = smjpeg_write_packet,
.write_trailer = smjpeg_write_trailer,
- .flags = AVFMT_GLOBALHEADER | AVFMT_TS_NONSTRICT,
- .codec_tag = (const AVCodecTag *const []){ ff_codec_smjpeg_video_tags, ff_codec_smjpeg_audio_tags, 0 },
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NONSTRICT,
+ .p.codec_tag = (const AVCodecTag *const []){ ff_codec_smjpeg_video_tags, ff_codec_smjpeg_audio_tags, 0 },
};
diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c
index ade6d5723b2..66e6313934a 100644
--- a/libavformat/smoothstreamingenc.c
+++ b/libavformat/smoothstreamingenc.c
@@ -637,16 +637,16 @@ static const AVClass ism_class = {
};
-const AVOutputFormat ff_smoothstreaming_muxer = {
- .name = "smoothstreaming",
- .long_name = NULL_IF_CONFIG_SMALL("Smooth Streaming Muxer"),
+const FFOutputFormat ff_smoothstreaming_muxer = {
+ .p.name = "smoothstreaming",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Smooth Streaming Muxer"),
+ .p.audio_codec = AV_CODEC_ID_AAC,
+ .p.video_codec = AV_CODEC_ID_H264,
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_NOFILE,
+ .p.priv_class = &ism_class,
.priv_data_size = sizeof(SmoothStreamingContext),
- .audio_codec = AV_CODEC_ID_AAC,
- .video_codec = AV_CODEC_ID_H264,
- .flags = AVFMT_GLOBALHEADER | AVFMT_NOFILE,
.write_header = ism_write_header,
.write_packet = ism_write_packet,
.write_trailer = ism_write_trailer,
.deinit = ism_free,
- .priv_class = &ism_class,
};
diff --git a/libavformat/soxenc.c b/libavformat/soxenc.c
index ac01f97df5c..062b4a3fae2 100644
--- a/libavformat/soxenc.c
+++ b/libavformat/soxenc.c
@@ -34,6 +34,7 @@
#include "libavutil/dict.h"
#include "avformat.h"
#include "avio_internal.h"
+#include "mux.h"
#include "rawenc.h"
#include "sox.h"
@@ -104,15 +105,15 @@ static int sox_write_trailer(AVFormatContext *s)
return 0;
}
-const AVOutputFormat ff_sox_muxer = {
- .name = "sox",
- .long_name = NULL_IF_CONFIG_SMALL("SoX native"),
- .extensions = "sox",
+const FFOutputFormat ff_sox_muxer = {
+ .p.name = "sox",
+ .p.long_name = NULL_IF_CONFIG_SMALL("SoX native"),
+ .p.extensions = "sox",
.priv_data_size = sizeof(SoXContext),
- .audio_codec = AV_CODEC_ID_PCM_S32LE,
- .video_codec = AV_CODEC_ID_NONE,
+ .p.audio_codec = AV_CODEC_ID_PCM_S32LE,
+ .p.video_codec = AV_CODEC_ID_NONE,
.write_header = sox_write_header,
.write_packet = ff_raw_write_packet,
.write_trailer = sox_write_trailer,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
diff --git a/libavformat/spdifenc.c b/libavformat/spdifenc.c
index 2861f828b42..ca386746268 100644
--- a/libavformat/spdifenc.c
+++ b/libavformat/spdifenc.c
@@ -48,6 +48,7 @@
#include "avformat.h"
#include "avio_internal.h"
+#include "mux.h"
#include "spdif.h"
#include "libavcodec/ac3defs.h"
#include "libavcodec/adts_parser.h"
@@ -673,16 +674,16 @@ static int spdif_write_packet(struct AVFormatContext *s, AVPacket *pkt)
return 0;
}
-const AVOutputFormat ff_spdif_muxer = {
- .name = "spdif",
- .long_name = NULL_IF_CONFIG_SMALL("IEC 61937 (used on S/PDIF - IEC958)"),
- .extensions = "spdif",
+const FFOutputFormat ff_spdif_muxer = {
+ .p.name = "spdif",
+ .p.long_name = NULL_IF_CONFIG_SMALL("IEC 61937 (used on S/PDIF - IEC958)"),
+ .p.extensions = "spdif",
.priv_data_size = sizeof(IEC61937Context),
- .audio_codec = AV_CODEC_ID_AC3,
- .video_codec = AV_CODEC_ID_NONE,
+ .p.audio_codec = AV_CODEC_ID_AC3,
+ .p.video_codec = AV_CODEC_ID_NONE,
.write_header = spdif_write_header,
.write_packet = spdif_write_packet,
.deinit = spdif_deinit,
- .flags = AVFMT_NOTIMESTAMPS,
- .priv_class = &spdif_class,
+ .p.flags = AVFMT_NOTIMESTAMPS,
+ .p.priv_class = &spdif_class,
};
diff --git a/libavformat/srtenc.c b/libavformat/srtenc.c
index 7f6171edd34..30dc59e0f8d 100644
--- a/libavformat/srtenc.c
+++ b/libavformat/srtenc.c
@@ -21,6 +21,7 @@
#include "avformat.h"
#include "internal.h"
+#include "mux.h"
#include "libavutil/log.h"
#include "libavutil/intreadwrite.h"
@@ -96,14 +97,14 @@ static int srt_write_packet(AVFormatContext *avf, AVPacket *pkt)
return 0;
}
-const AVOutputFormat ff_srt_muxer = {
- .name = "srt",
- .long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle"),
- .mime_type = "application/x-subrip",
- .extensions = "srt",
+const FFOutputFormat ff_srt_muxer = {
+ .p.name = "srt",
+ .p.long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle"),
+ .p.mime_type = "application/x-subrip",
+ .p.extensions = "srt",
+ .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT,
+ .p.subtitle_codec = AV_CODEC_ID_SUBRIP,
.priv_data_size = sizeof(SRTContext),
.write_header = srt_write_header,
.write_packet = srt_write_packet,
- .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT,
- .subtitle_codec = AV_CODEC_ID_SUBRIP,
};
diff --git a/libavformat/supenc.c b/libavformat/supenc.c
index c45d8a5321b..4af92fefa2e 100644
--- a/libavformat/supenc.c
+++ b/libavformat/supenc.c
@@ -21,6 +21,7 @@
#include "avformat.h"
#include "internal.h"
+#include "mux.h"
#include "libavutil/intreadwrite.h"
#define SUP_PGS_MAGIC 0x5047 /* "PG", big endian */
@@ -84,13 +85,13 @@ static int sup_write_header(AVFormatContext *s)
return 0;
}
-const AVOutputFormat ff_sup_muxer = {
- .name = "sup",
- .long_name = NULL_IF_CONFIG_SMALL("raw HDMV Presentation Graphic Stream subtitles"),
- .extensions = "sup",
- .mime_type = "application/x-pgs",
- .subtitle_codec = AV_CODEC_ID_HDMV_PGS_SUBTITLE,
+const FFOutputFormat ff_sup_muxer = {
+ .p.name = "sup",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw HDMV Presentation Graphic Stream subtitles"),
+ .p.extensions = "sup",
+ .p.mime_type = "application/x-pgs",
+ .p.subtitle_codec = AV_CODEC_ID_HDMV_PGS_SUBTITLE,
+ .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT,
.write_header = sup_write_header,
.write_packet = sup_write_packet,
- .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT,
};
diff --git a/libavformat/swfenc.c b/libavformat/swfenc.c
index 75b892087fe..f9ac69539b4 100644
--- a/libavformat/swfenc.c
+++ b/libavformat/swfenc.c
@@ -27,6 +27,7 @@
#include "libavutil/fifo.h"
#include "avformat.h"
#include "flv.h"
+#include "mux.h"
#include "swf.h"
#define AUDIO_FIFO_SIZE 65536
@@ -547,33 +548,33 @@ static void swf_deinit(AVFormatContext *s)
}
#if CONFIG_SWF_MUXER
-const AVOutputFormat ff_swf_muxer = {
- .name = "swf",
- .long_name = NULL_IF_CONFIG_SMALL("SWF (ShockWave Flash)"),
- .mime_type = "application/x-shockwave-flash",
- .extensions = "swf",
+const FFOutputFormat ff_swf_muxer = {
+ .p.name = "swf",
+ .p.long_name = NULL_IF_CONFIG_SMALL("SWF (ShockWave Flash)"),
+ .p.mime_type = "application/x-shockwave-flash",
+ .p.extensions = "swf",
.priv_data_size = sizeof(SWFEncContext),
- .audio_codec = AV_CODEC_ID_MP3,
- .video_codec = AV_CODEC_ID_FLV1,
+ .p.audio_codec = AV_CODEC_ID_MP3,
+ .p.video_codec = AV_CODEC_ID_FLV1,
.write_header = swf_write_header,
.write_packet = swf_write_packet,
.write_trailer = swf_write_trailer,
.deinit = swf_deinit,
- .flags = AVFMT_TS_NONSTRICT,
+ .p.flags = AVFMT_TS_NONSTRICT,
};
#endif
#if CONFIG_AVM2_MUXER
-const AVOutputFormat ff_avm2_muxer = {
- .name = "avm2",
- .long_name = NULL_IF_CONFIG_SMALL("SWF (ShockWave Flash) (AVM2)"),
- .mime_type = "application/x-shockwave-flash",
+const FFOutputFormat ff_avm2_muxer = {
+ .p.name = "avm2",
+ .p.long_name = NULL_IF_CONFIG_SMALL("SWF (ShockWave Flash) (AVM2)"),
+ .p.mime_type = "application/x-shockwave-flash",
.priv_data_size = sizeof(SWFEncContext),
- .audio_codec = AV_CODEC_ID_MP3,
- .video_codec = AV_CODEC_ID_FLV1,
+ .p.audio_codec = AV_CODEC_ID_MP3,
+ .p.video_codec = AV_CODEC_ID_FLV1,
.write_header = swf_write_header,
.write_packet = swf_write_packet,
.write_trailer = swf_write_trailer,
.deinit = swf_deinit,
- .flags = AVFMT_TS_NONSTRICT,
+ .p.flags = AVFMT_TS_NONSTRICT,
};
#endif
diff --git a/libavformat/tee.c b/libavformat/tee.c
index dd408dd096c..960b2ea574b 100644
--- a/libavformat/tee.c
+++ b/libavformat/tee.c
@@ -602,13 +602,13 @@ static int tee_write_packet(AVFormatContext *avf, AVPacket *pkt)
return ret_all;
}
-const AVOutputFormat ff_tee_muxer = {
- .name = "tee",
- .long_name = NULL_IF_CONFIG_SMALL("Multiple muxer tee"),
+const FFOutputFormat ff_tee_muxer = {
+ .p.name = "tee",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Multiple muxer tee"),
.priv_data_size = sizeof(TeeContext),
.write_header = tee_write_header,
.write_trailer = tee_write_trailer,
.write_packet = tee_write_packet,
- .priv_class = &tee_muxer_class,
- .flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
+ .p.priv_class = &tee_muxer_class,
+ .p.flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
};
diff --git a/libavformat/ttaenc.c b/libavformat/ttaenc.c
index 1938582bb3a..c7f7e065dc1 100644
--- a/libavformat/ttaenc.c
+++ b/libavformat/ttaenc.c
@@ -27,6 +27,7 @@
#include "avformat.h"
#include "avio_internal.h"
#include "internal.h"
+#include "mux.h"
typedef struct TTAMuxContext {
AVIOContext *seek_table;
@@ -165,14 +166,14 @@ static void tta_deinit(AVFormatContext *s)
avpriv_packet_list_free(&tta->queue);
}
-const AVOutputFormat ff_tta_muxer = {
- .name = "tta",
- .long_name = NULL_IF_CONFIG_SMALL("TTA (True Audio)"),
- .mime_type = "audio/x-tta",
- .extensions = "tta",
+const FFOutputFormat ff_tta_muxer = {
+ .p.name = "tta",
+ .p.long_name = NULL_IF_CONFIG_SMALL("TTA (True Audio)"),
+ .p.mime_type = "audio/x-tta",
+ .p.extensions = "tta",
.priv_data_size = sizeof(TTAMuxContext),
- .audio_codec = AV_CODEC_ID_TTA,
- .video_codec = AV_CODEC_ID_NONE,
+ .p.audio_codec = AV_CODEC_ID_TTA,
+ .p.video_codec = AV_CODEC_ID_NONE,
.init = tta_init,
.deinit = tta_deinit,
.write_header = tta_write_header,
diff --git a/libavformat/ttmlenc.c b/libavformat/ttmlenc.c
index fc8069f7b56..212994be503 100644
--- a/libavformat/ttmlenc.c
+++ b/libavformat/ttmlenc.c
@@ -30,6 +30,7 @@
#include "libavutil/avstring.h"
#include "avformat.h"
#include "internal.h"
+#include "mux.h"
#include "ttmlenc.h"
#include "libavcodec/ttmlenc.h"
#include "libavutil/internal.h"
@@ -215,15 +216,15 @@ static int ttml_write_trailer(AVFormatContext *ctx)
return 0;
}
-const AVOutputFormat ff_ttml_muxer = {
- .name = "ttml",
- .long_name = NULL_IF_CONFIG_SMALL("TTML subtitle"),
- .extensions = "ttml",
- .mime_type = "text/ttml",
+const FFOutputFormat ff_ttml_muxer = {
+ .p.name = "ttml",
+ .p.long_name = NULL_IF_CONFIG_SMALL("TTML subtitle"),
+ .p.extensions = "ttml",
+ .p.mime_type = "text/ttml",
.priv_data_size = sizeof(TTMLMuxContext),
- .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
+ .p.flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
AVFMT_TS_NONSTRICT,
- .subtitle_codec = AV_CODEC_ID_TTML,
+ .p.subtitle_codec = AV_CODEC_ID_TTML,
.write_header = ttml_write_header,
.write_packet = ttml_write_packet,
.write_trailer = ttml_write_trailer,
diff --git a/libavformat/uncodedframecrcenc.c b/libavformat/uncodedframecrcenc.c
index 99990616d32..4c37ef6e5b2 100644
--- a/libavformat/uncodedframecrcenc.c
+++ b/libavformat/uncodedframecrcenc.c
@@ -165,14 +165,14 @@ static int write_packet(struct AVFormatContext *s, AVPacket *pkt)
return AVERROR(ENOSYS);
}
-const AVOutputFormat ff_uncodedframecrc_muxer = {
- .name = "uncodedframecrc",
- .long_name = NULL_IF_CONFIG_SMALL("uncoded framecrc testing"),
- .audio_codec = AV_CODEC_ID_PCM_S16LE,
- .video_codec = AV_CODEC_ID_RAWVIDEO,
+const FFOutputFormat ff_uncodedframecrc_muxer = {
+ .p.name = "uncodedframecrc",
+ .p.long_name = NULL_IF_CONFIG_SMALL("uncoded framecrc testing"),
+ .p.audio_codec = AV_CODEC_ID_PCM_S16LE,
+ .p.video_codec = AV_CODEC_ID_RAWVIDEO,
+ .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
+ AVFMT_TS_NEGATIVE,
.write_header = write_header,
.write_packet = write_packet,
.write_uncoded_frame = write_frame,
- .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
- AVFMT_TS_NEGATIVE,
};
diff --git a/libavformat/vc1testenc.c b/libavformat/vc1testenc.c
index 4bc95026f56..89b916deeb1 100644
--- a/libavformat/vc1testenc.c
+++ b/libavformat/vc1testenc.c
@@ -20,6 +20,7 @@
*/
#include "avformat.h"
#include "internal.h"
+#include "mux.h"
typedef struct RCVContext {
int frames;
@@ -80,13 +81,13 @@ static int vc1test_write_trailer(AVFormatContext *s)
return 0;
}
-const AVOutputFormat ff_vc1t_muxer = {
- .name = "vc1test",
- .long_name = NULL_IF_CONFIG_SMALL("VC-1 test bitstream"),
- .extensions = "rcv",
+const FFOutputFormat ff_vc1t_muxer = {
+ .p.name = "vc1test",
+ .p.long_name = NULL_IF_CONFIG_SMALL("VC-1 test bitstream"),
+ .p.extensions = "rcv",
.priv_data_size = sizeof(RCVContext),
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_WMV3,
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_WMV3,
.write_header = vc1test_write_header,
.write_packet = vc1test_write_packet,
.write_trailer = vc1test_write_trailer,
diff --git a/libavformat/vocenc.c b/libavformat/vocenc.c
index 59c2bbba7b5..8739a177157 100644
--- a/libavformat/vocenc.c
+++ b/libavformat/vocenc.c
@@ -21,6 +21,7 @@
#include "voc.h"
#include "internal.h"
+#include "mux.h"
typedef struct voc_enc_context {
@@ -96,17 +97,17 @@ static int voc_write_trailer(AVFormatContext *s)
return 0;
}
-const AVOutputFormat ff_voc_muxer = {
- .name = "voc",
- .long_name = NULL_IF_CONFIG_SMALL("Creative Voice"),
- .mime_type = "audio/x-voc",
- .extensions = "voc",
+const FFOutputFormat ff_voc_muxer = {
+ .p.name = "voc",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Creative Voice"),
+ .p.mime_type = "audio/x-voc",
+ .p.extensions = "voc",
.priv_data_size = sizeof(VocEncContext),
- .audio_codec = AV_CODEC_ID_PCM_S16LE,
- .video_codec = AV_CODEC_ID_NONE,
+ .p.audio_codec = AV_CODEC_ID_PCM_S16LE,
+ .p.video_codec = AV_CODEC_ID_NONE,
.write_header = voc_write_header,
.write_packet = voc_write_packet,
.write_trailer = voc_write_trailer,
- .codec_tag = ff_voc_codec_tags_list,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.codec_tag = ff_voc_codec_tags_list,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
diff --git a/libavformat/wavenc.c b/libavformat/wavenc.c
index 3531a8f909d..c12c0909349 100644
--- a/libavformat/wavenc.c
+++ b/libavformat/wavenc.c
@@ -46,6 +46,7 @@
#include "avio.h"
#include "avio_internal.h"
#include "internal.h"
+#include "mux.h"
#include "riff.h"
#define RF64_AUTO (-1)
@@ -506,21 +507,21 @@ static const AVClass wav_muxer_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVOutputFormat ff_wav_muxer = {
- .name = "wav",
- .long_name = NULL_IF_CONFIG_SMALL("WAV / WAVE (Waveform Audio)"),
- .mime_type = "audio/x-wav",
- .extensions = "wav",
+const FFOutputFormat ff_wav_muxer = {
+ .p.name = "wav",
+ .p.long_name = NULL_IF_CONFIG_SMALL("WAV / WAVE (Waveform Audio)"),
+ .p.mime_type = "audio/x-wav",
+ .p.extensions = "wav",
.priv_data_size = sizeof(WAVMuxContext),
- .audio_codec = AV_CODEC_ID_PCM_S16LE,
- .video_codec = AV_CODEC_ID_NONE,
+ .p.audio_codec = AV_CODEC_ID_PCM_S16LE,
+ .p.video_codec = AV_CODEC_ID_NONE,
.write_header = wav_write_header,
.write_packet = wav_write_packet,
.write_trailer = wav_write_trailer,
.deinit = wav_deinit,
- .flags = AVFMT_TS_NONSTRICT,
- .codec_tag = ff_wav_codec_tags_list,
- .priv_class = &wav_muxer_class,
+ .p.flags = AVFMT_TS_NONSTRICT,
+ .p.codec_tag = ff_wav_codec_tags_list,
+ .p.priv_class = &wav_muxer_class,
};
#endif /* CONFIG_WAV_MUXER */
@@ -615,18 +616,18 @@ static int w64_write_trailer(AVFormatContext *s)
return 0;
}
-const AVOutputFormat ff_w64_muxer = {
- .name = "w64",
- .long_name = NULL_IF_CONFIG_SMALL("Sony Wave64"),
- .extensions = "w64",
+const FFOutputFormat ff_w64_muxer = {
+ .p.name = "w64",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Sony Wave64"),
+ .p.extensions = "w64",
.priv_data_size = sizeof(WAVMuxContext),
- .audio_codec = AV_CODEC_ID_PCM_S16LE,
- .video_codec = AV_CODEC_ID_NONE,
+ .p.audio_codec = AV_CODEC_ID_PCM_S16LE,
+ .p.video_codec = AV_CODEC_ID_NONE,
.init = w64_init,
.write_header = w64_write_header,
.write_packet = wav_write_packet,
.write_trailer = w64_write_trailer,
- .flags = AVFMT_TS_NONSTRICT,
- .codec_tag = ff_wav_codec_tags_list,
+ .p.flags = AVFMT_TS_NONSTRICT,
+ .p.codec_tag = ff_wav_codec_tags_list,
};
#endif /* CONFIG_W64_MUXER */
diff --git a/libavformat/webm_chunk.c b/libavformat/webm_chunk.c
index 916ed0cbaba..494a83f5078 100644
--- a/libavformat/webm_chunk.c
+++ b/libavformat/webm_chunk.c
@@ -292,18 +292,18 @@ static const AVClass webm_chunk_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVOutputFormat ff_webm_chunk_muxer = {
- .name = "webm_chunk",
- .long_name = NULL_IF_CONFIG_SMALL("WebM Chunk Muxer"),
- .mime_type = "video/webm",
- .extensions = "chk",
- .flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER | AVFMT_NEEDNUMBER |
+const FFOutputFormat ff_webm_chunk_muxer = {
+ .p.name = "webm_chunk",
+ .p.long_name = NULL_IF_CONFIG_SMALL("WebM Chunk Muxer"),
+ .p.mime_type = "video/webm",
+ .p.extensions = "chk",
+ .p.flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER | AVFMT_NEEDNUMBER |
AVFMT_TS_NONSTRICT,
+ .p.priv_class = &webm_chunk_class,
.priv_data_size = sizeof(WebMChunkContext),
.init = webm_chunk_init,
.write_header = webm_chunk_write_header,
.write_packet = webm_chunk_write_packet,
.write_trailer = webm_chunk_write_trailer,
.deinit = webm_chunk_deinit,
- .priv_class = &webm_chunk_class,
};
diff --git a/libavformat/webmdashenc.c b/libavformat/webmdashenc.c
index f8f2274556d..0d6c4a2072e 100644
--- a/libavformat/webmdashenc.c
+++ b/libavformat/webmdashenc.c
@@ -32,6 +32,7 @@
#include "avformat.h"
#include "matroska.h"
+#include "mux.h"
#include "libavutil/avstring.h"
#include "libavutil/dict.h"
@@ -540,13 +541,13 @@ static const AVClass webm_dash_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const AVOutputFormat ff_webm_dash_manifest_muxer = {
- .name = "webm_dash_manifest",
- .long_name = NULL_IF_CONFIG_SMALL("WebM DASH Manifest"),
- .mime_type = "application/xml",
- .extensions = "xml",
+const FFOutputFormat ff_webm_dash_manifest_muxer = {
+ .p.name = "webm_dash_manifest",
+ .p.long_name = NULL_IF_CONFIG_SMALL("WebM DASH Manifest"),
+ .p.mime_type = "application/xml",
+ .p.extensions = "xml",
.priv_data_size = sizeof(WebMDashMuxContext),
.write_header = webm_dash_manifest_write_header,
.write_packet = webm_dash_manifest_write_packet,
- .priv_class = &webm_dash_class,
+ .p.priv_class = &webm_dash_class,
};
diff --git a/libavformat/webpenc.c b/libavformat/webpenc.c
index 8a5c29201a8..b3f5bdc9b57 100644
--- a/libavformat/webpenc.c
+++ b/libavformat/webpenc.c
@@ -23,6 +23,7 @@
#include "libavutil/opt.h"
#include "avformat.h"
#include "internal.h"
+#include "mux.h"
typedef struct WebpContext{
AVClass *class;
@@ -208,15 +209,15 @@ static const AVClass webp_muxer_class = {
.version = LIBAVUTIL_VERSION_INT,
.option = options,
};
-const AVOutputFormat ff_webp_muxer = {
- .name = "webp",
- .long_name = NULL_IF_CONFIG_SMALL("WebP"),
- .extensions = "webp",
+const FFOutputFormat ff_webp_muxer = {
+ .p.name = "webp",
+ .p.long_name = NULL_IF_CONFIG_SMALL("WebP"),
+ .p.extensions = "webp",
.priv_data_size = sizeof(WebpContext),
- .video_codec = AV_CODEC_ID_WEBP,
+ .p.video_codec = AV_CODEC_ID_WEBP,
.init = webp_init,
.write_packet = webp_write_packet,
.write_trailer = webp_write_trailer,
- .priv_class = &webp_muxer_class,
- .flags = AVFMT_VARIABLE_FPS,
+ .p.priv_class = &webp_muxer_class,
+ .p.flags = AVFMT_VARIABLE_FPS,
};
diff --git a/libavformat/webvttenc.c b/libavformat/webvttenc.c
index fcff80c4bf3..13370453251 100644
--- a/libavformat/webvttenc.c
+++ b/libavformat/webvttenc.c
@@ -26,6 +26,7 @@
#include "avformat.h"
#include "internal.h"
+#include "mux.h"
static void webvtt_write_time(AVIOContext *pb, int64_t millisec)
{
@@ -102,13 +103,13 @@ static int webvtt_write_packet(AVFormatContext *ctx, AVPacket *pkt)
return 0;
}
-const AVOutputFormat ff_webvtt_muxer = {
- .name = "webvtt",
- .long_name = NULL_IF_CONFIG_SMALL("WebVTT subtitle"),
- .extensions = "vtt",
- .mime_type = "text/vtt",
- .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT,
- .subtitle_codec = AV_CODEC_ID_WEBVTT,
+const FFOutputFormat ff_webvtt_muxer = {
+ .p.name = "webvtt",
+ .p.long_name = NULL_IF_CONFIG_SMALL("WebVTT subtitle"),
+ .p.extensions = "vtt",
+ .p.mime_type = "text/vtt",
+ .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT,
+ .p.subtitle_codec = AV_CODEC_ID_WEBVTT,
.write_header = webvtt_write_header,
.write_packet = webvtt_write_packet,
};
diff --git a/libavformat/westwood_audenc.c b/libavformat/westwood_audenc.c
index a2401eff5a7..84a871e4782 100644
--- a/libavformat/westwood_audenc.c
+++ b/libavformat/westwood_audenc.c
@@ -31,6 +31,7 @@
#include "avformat.h"
#include "avio_internal.h"
#include "internal.h"
+#include "mux.h"
#include <stdint.h>
#define AUD_CHUNK_SIGNATURE 0x0000DEAF
@@ -125,13 +126,13 @@ static int wsaud_write_trailer(AVFormatContext *ctx)
return 0;
}
-const AVOutputFormat ff_wsaud_muxer = {
- .name = "wsaud",
- .long_name = NULL_IF_CONFIG_SMALL("Westwood Studios audio"),
- .extensions = "aud",
+const FFOutputFormat ff_wsaud_muxer = {
+ .p.name = "wsaud",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Westwood Studios audio"),
+ .p.extensions = "aud",
.priv_data_size = sizeof(AUDMuxContext),
- .audio_codec = AV_CODEC_ID_ADPCM_IMA_WS,
- .video_codec = AV_CODEC_ID_NONE,
+ .p.audio_codec = AV_CODEC_ID_ADPCM_IMA_WS,
+ .p.video_codec = AV_CODEC_ID_NONE,
.init = wsaud_write_init,
.write_header = wsaud_write_header,
.write_packet = wsaud_write_packet,
diff --git a/libavformat/wtvenc.c b/libavformat/wtvenc.c
index 62dca62b062..c0e56216467 100644
--- a/libavformat/wtvenc.c
+++ b/libavformat/wtvenc.c
@@ -829,15 +829,15 @@ static int write_trailer(AVFormatContext *s)
return 0;
}
-const AVOutputFormat ff_wtv_muxer = {
- .name = "wtv",
- .long_name = NULL_IF_CONFIG_SMALL("Windows Television (WTV)"),
- .extensions = "wtv",
+const FFOutputFormat ff_wtv_muxer = {
+ .p.name = "wtv",
+ .p.long_name = NULL_IF_CONFIG_SMALL("Windows Television (WTV)"),
+ .p.extensions = "wtv",
.priv_data_size = sizeof(WtvContext),
- .audio_codec = AV_CODEC_ID_AC3,
- .video_codec = AV_CODEC_ID_MPEG2VIDEO,
+ .p.audio_codec = AV_CODEC_ID_AC3,
+ .p.video_codec = AV_CODEC_ID_MPEG2VIDEO,
.write_header = write_header,
.write_packet = write_packet,
.write_trailer = write_trailer,
- .codec_tag = ff_riff_codec_tags_list,
+ .p.codec_tag = ff_riff_codec_tags_list,
};
diff --git a/libavformat/wvenc.c b/libavformat/wvenc.c
index 0dca2f7996c..9d9190f2527 100644
--- a/libavformat/wvenc.c
+++ b/libavformat/wvenc.c
@@ -24,6 +24,7 @@
#include "apetag.h"
#include "avformat.h"
+#include "mux.h"
#include "wv.h"
typedef struct WvMuxContext {
@@ -76,16 +77,16 @@ static av_cold int wv_write_trailer(AVFormatContext *ctx)
return 0;
}
-const AVOutputFormat ff_wv_muxer = {
- .name = "wv",
- .long_name = NULL_IF_CONFIG_SMALL("raw WavPack"),
- .mime_type = "audio/x-wavpack",
- .extensions = "wv",
+const FFOutputFormat ff_wv_muxer = {
+ .p.name = "wv",
+ .p.long_name = NULL_IF_CONFIG_SMALL("raw WavPack"),
+ .p.mime_type = "audio/x-wavpack",
+ .p.extensions = "wv",
.priv_data_size = sizeof(WvMuxContext),
- .audio_codec = AV_CODEC_ID_WAVPACK,
- .video_codec = AV_CODEC_ID_NONE,
+ .p.audio_codec = AV_CODEC_ID_WAVPACK,
+ .p.video_codec = AV_CODEC_ID_NONE,
.init = wv_init,
.write_packet = wv_write_packet,
.write_trailer = wv_write_trailer,
- .flags = AVFMT_NOTIMESTAMPS,
+ .p.flags = AVFMT_NOTIMESTAMPS,
};
diff --git a/libavformat/yuv4mpegenc.c b/libavformat/yuv4mpegenc.c
index fca0ee31207..fc6b08e0cd4 100644
--- a/libavformat/yuv4mpegenc.c
+++ b/libavformat/yuv4mpegenc.c
@@ -22,6 +22,7 @@
#include "libavutil/pixdesc.h"
#include "avformat.h"
#include "internal.h"
+#include "mux.h"
#include "yuv4mpeg.h"
static int yuv4_write_header(AVFormatContext *s)
@@ -282,12 +283,12 @@ static int yuv4_init(AVFormatContext *s)
return 0;
}
-const AVOutputFormat ff_yuv4mpegpipe_muxer = {
- .name = "yuv4mpegpipe",
- .long_name = NULL_IF_CONFIG_SMALL("YUV4MPEG pipe"),
- .extensions = "y4m",
- .audio_codec = AV_CODEC_ID_NONE,
- .video_codec = AV_CODEC_ID_WRAPPED_AVFRAME,
+const FFOutputFormat ff_yuv4mpegpipe_muxer = {
+ .p.name = "yuv4mpegpipe",
+ .p.long_name = NULL_IF_CONFIG_SMALL("YUV4MPEG pipe"),
+ .p.extensions = "y4m",
+ .p.audio_codec = AV_CODEC_ID_NONE,
+ .p.video_codec = AV_CODEC_ID_WRAPPED_AVFRAME,
.init = yuv4_init,
.write_header = yuv4_write_header,
.write_packet = yuv4_write_packet,
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 06/33] avcodec/avcodec: Remove AV_CODEC_FLAG2_DROP_FRAME_TIMECODE
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (4 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 05/33] avformat/avformat: Move AVOutputFormat internals out of public header Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 07/33] avcodec: remove FF_API_OPENH264_SLICE_MODE Anton Khirnov
` (26 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
It has been deprecated in 94d68a41fabb55dd8c7e59b88fe4a28a637d1e5f
and can't be set via AVOptions. The only codecs that use it
(the MPEG-1/2 encoders) have private options for this.
So remove it.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
---
libavcodec/avcodec.h | 5 -----
libavcodec/mpeg12enc.c | 1 -
2 files changed, 6 deletions(-)
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index b9bd69a2ec7..d8f22f58007 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -343,11 +343,6 @@ typedef struct RcOverride{
*/
#define AV_CODEC_FLAG2_LOCAL_HEADER (1 << 3)
-/**
- * timecode is in drop frame format. DEPRECATED!!!!
- */
-#define AV_CODEC_FLAG2_DROP_FRAME_TIMECODE (1 << 13)
-
/**
* Input bitstream might be truncated at a packet boundaries
* instead of only at frame boundaries.
diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c
index b5951e43070..26cf33a3c68 100644
--- a/libavcodec/mpeg12enc.c
+++ b/libavcodec/mpeg12enc.c
@@ -249,7 +249,6 @@ static av_cold int encode_init(AVCodecContext *avctx)
}
}
- mpeg12->drop_frame_timecode = mpeg12->drop_frame_timecode || !!(avctx->flags2 & AV_CODEC_FLAG2_DROP_FRAME_TIMECODE);
if (mpeg12->drop_frame_timecode)
mpeg12->tc.flags |= AV_TIMECODE_FLAG_DROPFRAME;
if (mpeg12->drop_frame_timecode && mpeg12->frame_rate_index != 4) {
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 07/33] avcodec: remove FF_API_OPENH264_SLICE_MODE
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (5 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 06/33] avcodec/avcodec: Remove AV_CODEC_FLAG2_DROP_FRAME_TIMECODE Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 08/33] avcodec: remove FF_API_OPENH264_CABAC Anton Khirnov
` (25 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavcodec/libopenh264enc.c | 16 ----------------
libavcodec/version_major.h | 1 -
2 files changed, 17 deletions(-)
diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c
index 6934fd481ce..4dd15b0afe5 100644
--- a/libavcodec/libopenh264enc.c
+++ b/libavcodec/libopenh264enc.c
@@ -63,22 +63,6 @@ typedef struct SVCContext {
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
#define DEPRECATED AV_OPT_FLAG_DEPRECATED
static const AVOption options[] = {
-#if FF_API_OPENH264_SLICE_MODE
-#if OPENH264_VER_AT_LEAST(1, 6)
- { "slice_mode", "set slice mode, use slices/max_nal_size", OFFSET(slice_mode), AV_OPT_TYPE_INT, { .i64 = SM_FIXEDSLCNUM_SLICE }, SM_SINGLE_SLICE, SM_RESERVED, VE|DEPRECATED, "slice_mode" },
-#else
- { "slice_mode", "set slice mode, use slices/max_nal_size", OFFSET(slice_mode), AV_OPT_TYPE_INT, { .i64 = SM_AUTO_SLICE }, SM_SINGLE_SLICE, SM_RESERVED, VE|DEPRECATED, "slice_mode" },
-#endif
- { "fixed", "a fixed number of slices", 0, AV_OPT_TYPE_CONST, { .i64 = SM_FIXEDSLCNUM_SLICE }, 0, 0, VE, "slice_mode" },
-#if OPENH264_VER_AT_LEAST(1, 6)
- { "dyn", "Size limited (compatibility name)", 0, AV_OPT_TYPE_CONST, { .i64 = SM_SIZELIMITED_SLICE }, 0, 0, VE, "slice_mode" },
- { "sizelimited", "Size limited", 0, AV_OPT_TYPE_CONST, { .i64 = SM_SIZELIMITED_SLICE }, 0, 0, VE, "slice_mode" },
-#else
- { "rowmb", "one slice per row of macroblocks", 0, AV_OPT_TYPE_CONST, { .i64 = SM_ROWMB_SLICE }, 0, 0, VE, "slice_mode" },
- { "auto", "automatic number of slices according to number of threads", 0, AV_OPT_TYPE_CONST, { .i64 = SM_AUTO_SLICE }, 0, 0, VE, "slice_mode" },
- { "dyn", "Dynamic slicing", 0, AV_OPT_TYPE_CONST, { .i64 = SM_DYN_SLICE }, 0, 0, VE, "slice_mode" },
-#endif
-#endif
{ "loopfilter", "enable loop filter", OFFSET(loopfilter), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
{ "profile", "set profile restrictions", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, 0xffff, VE, "profile" },
#define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, { .i64 = value }, 0, 0, VE, "profile"
diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
index 2c0443c4c8e..e9a4910df0d 100644
--- a/libavcodec/version_major.h
+++ b/libavcodec/version_major.h
@@ -37,7 +37,6 @@
* at once through the bump. This improves the git bisect-ability of the change.
*/
-#define FF_API_OPENH264_SLICE_MODE (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_OPENH264_CABAC (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_UNUSED_CODEC_CAPS (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_THREAD_SAFE_CALLBACKS (LIBAVCODEC_VERSION_MAJOR < 60)
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 08/33] avcodec: remove FF_API_OPENH264_CABAC
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (6 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 07/33] avcodec: remove FF_API_OPENH264_SLICE_MODE Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 09/33] avcodec: remove FF_API_UNUSED_CODEC_CAPS Anton Khirnov
` (24 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavcodec/libopenh264enc.c | 6 ------
libavcodec/version_major.h | 1 -
2 files changed, 7 deletions(-)
diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c
index 4dd15b0afe5..8b4755f5ba4 100644
--- a/libavcodec/libopenh264enc.c
+++ b/libavcodec/libopenh264enc.c
@@ -50,9 +50,6 @@ typedef struct SVCContext {
int max_nal_size;
int skip_frames;
int skipped;
-#if FF_API_OPENH264_CABAC
- int cabac; // deprecated
-#endif
int coder;
// rate control mode
@@ -72,9 +69,6 @@ static const AVOption options[] = {
#undef PROFILE
{ "max_nal_size", "set maximum NAL size in bytes", OFFSET(max_nal_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
{ "allow_skip_frames", "allow skipping frames to hit the target bitrate", OFFSET(skip_frames), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
-#if FF_API_OPENH264_CABAC
- { "cabac", "Enable cabac(deprecated, use coder)", OFFSET(cabac), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE|DEPRECATED },
-#endif
{ "coder", "Coder type", OFFSET(coder), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE, "coder" },
{ "default", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = -1 }, INT_MIN, INT_MAX, VE, "coder" },
{ "cavlc", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, VE, "coder" },
diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
index e9a4910df0d..cd4830c69ae 100644
--- a/libavcodec/version_major.h
+++ b/libavcodec/version_major.h
@@ -37,7 +37,6 @@
* at once through the bump. This improves the git bisect-ability of the change.
*/
-#define FF_API_OPENH264_CABAC (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_UNUSED_CODEC_CAPS (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_THREAD_SAFE_CALLBACKS (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_DEBUG_MV (LIBAVCODEC_VERSION_MAJOR < 60)
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 09/33] avcodec: remove FF_API_UNUSED_CODEC_CAPS
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (7 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 08/33] avcodec: remove FF_API_OPENH264_CABAC Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 10/33] avcodec: remove FF_API_THREAD_SAFE_CALLBACKS Anton Khirnov
` (23 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavcodec/codec.h | 11 -----------
libavcodec/version_major.h | 1 -
2 files changed, 12 deletions(-)
diff --git a/libavcodec/codec.h b/libavcodec/codec.h
index 77a1a3f5a29..e10fcb9c7c2 100644
--- a/libavcodec/codec.h
+++ b/libavcodec/codec.h
@@ -143,17 +143,6 @@
*/
#define AV_CODEC_CAP_AVOID_PROBING (1 << 17)
-#if FF_API_UNUSED_CODEC_CAPS
-/**
- * Deprecated and unused. Use AVCodecDescriptor.props instead
- */
-#define AV_CODEC_CAP_INTRA_ONLY 0x40000000
-/**
- * Deprecated and unused. Use AVCodecDescriptor.props instead
- */
-#define AV_CODEC_CAP_LOSSLESS 0x80000000
-#endif
-
/**
* Codec is backed by a hardware implementation. Typically used to
* identify a non-hwaccel hardware decoder. For information about hwaccels, use
diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
index cd4830c69ae..7b561940b0c 100644
--- a/libavcodec/version_major.h
+++ b/libavcodec/version_major.h
@@ -37,7 +37,6 @@
* at once through the bump. This improves the git bisect-ability of the change.
*/
-#define FF_API_UNUSED_CODEC_CAPS (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_THREAD_SAFE_CALLBACKS (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_DEBUG_MV (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_GET_FRAME_CLASS (LIBAVCODEC_VERSION_MAJOR < 60)
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 10/33] avcodec: remove FF_API_THREAD_SAFE_CALLBACKS
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (8 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 09/33] avcodec: remove FF_API_UNUSED_CODEC_CAPS Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-05 21:04 ` Michael Niedermayer
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 11/33] avcodec: remove FF_API_DEBUG_MV Anton Khirnov
` (22 subsequent siblings)
32 siblings, 1 reply; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
fftools/ffmpeg.c | 5 -
libavcodec/avcodec.h | 21 ---
libavcodec/decode.c | 13 --
libavcodec/encode.c | 7 +-
libavcodec/frame_thread_encoder.c | 20 ---
libavcodec/pthread_frame.c | 237 +-----------------------------
libavcodec/thread.h | 12 --
libavcodec/version_major.h | 1 -
8 files changed, 6 insertions(+), 310 deletions(-)
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 257f319550c..52a3e14f697 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2640,11 +2640,6 @@ static int init_input_stream(InputStream *ist, char *error, int error_len)
ist->dec_ctx->opaque = ist;
ist->dec_ctx->get_format = get_format;
-#if LIBAVCODEC_VERSION_MAJOR < 60
- AV_NOWARN_DEPRECATED({
- ist->dec_ctx->thread_safe_callbacks = 1;
- })
-#endif
if (ist->dec_ctx->codec_id == AV_CODEC_ID_DVB_SUBTITLE &&
(ist->decoding_needed & DECODING_FOR_OST)) {
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index d8f22f58007..6cf6031705b 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1512,27 +1512,6 @@ typedef struct AVCodecContext {
*/
int active_thread_type;
-#if FF_API_THREAD_SAFE_CALLBACKS
- /**
- * Set by the client if its custom get_buffer() callback can be called
- * synchronously from another thread, which allows faster multithreaded decoding.
- * draw_horiz_band() will be called from other threads regardless of this setting.
- * Ignored if the default get_buffer() is used.
- * - encoding: Set by user.
- * - decoding: Set by user.
- *
- * @deprecated the custom get_buffer2() callback should always be
- * thread-safe. Thread-unsafe get_buffer2() implementations will be
- * invalid starting with LIBAVCODEC_VERSION_MAJOR=60; in other words,
- * libavcodec will behave as if this field was always set to 1.
- * Callers that want to be forward compatible with future libavcodec
- * versions should wrap access to this field in
- * `#if LIBAVCODEC_VERSION_MAJOR < 60`
- */
- attribute_deprecated
- int thread_safe_callbacks;
-#endif
-
/**
* The codec may call this to execute several independent things.
* It will return only after finishing all tasks.
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 45c1f085792..8e790102136 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1592,19 +1592,6 @@ int ff_decode_preinit(AVCodecContext *avctx)
* free the already allocated subtitle_header before overwriting it */
av_freep(&avctx->subtitle_header);
-#if FF_API_THREAD_SAFE_CALLBACKS
-FF_DISABLE_DEPRECATION_WARNINGS
- if ((avctx->thread_type & FF_THREAD_FRAME) &&
- avctx->get_buffer2 != avcodec_default_get_buffer2 &&
- !avctx->thread_safe_callbacks) {
- av_log(avctx, AV_LOG_WARNING, "Requested frame threading with a "
- "custom get_buffer2() implementation which is not marked as "
- "thread safe. This is not supported anymore, make your "
- "callback thread-safe.\n");
- }
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
if (avctx->codec->max_lowres < avctx->lowres || avctx->lowres < 0) {
av_log(avctx, AV_LOG_WARNING, "The maximum value for lowres supported by the decoder is %d\n",
avctx->codec->max_lowres);
diff --git a/libavcodec/encode.c b/libavcodec/encode.c
index c92beaf8e1f..22407a233df 100644
--- a/libavcodec/encode.c
+++ b/libavcodec/encode.c
@@ -255,10 +255,9 @@ int ff_encode_encode_cb(AVCodecContext *avctx, AVPacket *avpkt,
unref:
av_packet_unref(avpkt);
}
-#if !FF_API_THREAD_SAFE_CALLBACKS
+
if (frame)
av_frame_unref(frame);
-#endif
return ret;
}
@@ -299,10 +298,6 @@ static int encode_simple_internal(AVCodecContext *avctx, AVPacket *avpkt)
ret = ff_thread_video_encode_frame(avctx, avpkt, frame, &got_packet);
else {
ret = ff_encode_encode_cb(avctx, avpkt, frame, &got_packet);
-#if FF_API_THREAD_SAFE_CALLBACKS
- if (frame)
- av_frame_unref(frame);
-#endif
}
if (avci->draining && !got_packet)
diff --git a/libavcodec/frame_thread_encoder.c b/libavcodec/frame_thread_encoder.c
index 35775ae823e..62d9580ad4c 100644
--- a/libavcodec/frame_thread_encoder.c
+++ b/libavcodec/frame_thread_encoder.c
@@ -48,9 +48,6 @@ typedef struct{
typedef struct{
AVCodecContext *parent_avctx;
-#if FF_API_THREAD_SAFE_CALLBACKS
- pthread_mutex_t buffer_mutex;
-#endif
pthread_mutex_t task_fifo_mutex; /* Used to guard (next_)task_index */
pthread_cond_t task_fifo_cond;
@@ -70,15 +67,9 @@ typedef struct{
} ThreadContext;
#define OFF(member) offsetof(ThreadContext, member)
-#if FF_API_THREAD_SAFE_CALLBACKS
-DEFINE_OFFSET_ARRAY(ThreadContext, thread_ctx, pthread_init_cnt,
- (OFF(buffer_mutex), OFF(task_fifo_mutex), OFF(finished_task_mutex)),
- (OFF(task_fifo_cond), OFF(finished_task_cond)));
-#else
DEFINE_OFFSET_ARRAY(ThreadContext, thread_ctx, pthread_init_cnt,
(OFF(task_fifo_mutex), OFF(finished_task_mutex)),
(OFF(task_fifo_cond), OFF(finished_task_cond)));
-#endif
#undef OFF
static void * attribute_align_arg worker(void *v){
@@ -112,11 +103,6 @@ static void * attribute_align_arg worker(void *v){
pkt = task->outdata;
ret = ff_encode_encode_cb(avctx, pkt, frame, &task->got_packet);
-#if FF_API_THREAD_SAFE_CALLBACKS
- pthread_mutex_lock(&c->buffer_mutex);
- av_frame_unref(frame);
- pthread_mutex_unlock(&c->buffer_mutex);
-#endif
pthread_mutex_lock(&c->finished_task_mutex);
task->return_code = ret;
task->finished = 1;
@@ -124,13 +110,7 @@ static void * attribute_align_arg worker(void *v){
pthread_mutex_unlock(&c->finished_task_mutex);
}
end:
-#if FF_API_THREAD_SAFE_CALLBACKS
- pthread_mutex_lock(&c->buffer_mutex);
-#endif
avcodec_close(avctx);
-#if FF_API_THREAD_SAFE_CALLBACKS
- pthread_mutex_unlock(&c->buffer_mutex);
-#endif
av_freep(&avctx);
return NULL;
}
diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
index 62a0b18a8ac..81c21143783 100644
--- a/libavcodec/pthread_frame.c
+++ b/libavcodec/pthread_frame.c
@@ -99,22 +99,6 @@ typedef struct PerThreadContext {
atomic_int state;
-#if FF_API_THREAD_SAFE_CALLBACKS
- /**
- * Array of frames passed to ff_thread_release_buffer().
- * Frames are released after all threads referencing them are finished.
- */
- AVFrame **released_buffers;
- int num_released_buffers;
- int released_buffers_allocated;
-
- AVFrame *requested_frame; ///< AVFrame the codec passed to get_buffer()
- int requested_flags; ///< flags passed to get_buffer() for requested_frame
-
- const enum AVPixelFormat *available_formats; ///< Format array for get_format()
- enum AVPixelFormat result_format; ///< get_format() result
-#endif
-
int die; ///< Set when the thread should exit.
int hwaccel_serializing;
@@ -156,11 +140,6 @@ typedef struct FrameThreadContext {
void *stash_hwaccel_priv;
} FrameThreadContext;
-#if FF_API_THREAD_SAFE_CALLBACKS
-#define THREAD_SAFE_CALLBACKS(avctx) \
-((avctx)->thread_safe_callbacks || (avctx)->get_buffer2 == avcodec_default_get_buffer2)
-#endif
-
static void async_lock(FrameThreadContext *fctx)
{
pthread_mutex_lock(&fctx->async_mutex);
@@ -212,14 +191,8 @@ static attribute_align_arg void *frame_worker_thread(void *arg)
if (p->die) break;
-FF_DISABLE_DEPRECATION_WARNINGS
- if (!codec->update_thread_context
-#if FF_API_THREAD_SAFE_CALLBACKS
- && THREAD_SAFE_CALLBACKS(avctx)
-#endif
- )
+ if (!codec->update_thread_context)
ff_thread_finish_setup(avctx);
-FF_ENABLE_DEPRECATION_WARNINGS
/* If a decoder supports hwaccel, then it must call ff_get_format().
* Since that call must happen before ff_thread_finish_setup(), the
@@ -391,11 +364,6 @@ static int update_context_from_user(AVCodecContext *dst, AVCodecContext *src)
dst->frame_number = src->frame_number;
dst->reordered_opaque = src->reordered_opaque;
-#if FF_API_THREAD_SAFE_CALLBACKS
-FF_DISABLE_DEPRECATION_WARNINGS
- dst->thread_safe_callbacks = src->thread_safe_callbacks;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
if (src->slice_count && src->slice_offset) {
if (dst->slice_count < src->slice_count) {
@@ -417,29 +385,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
return 0;
}
-#if FF_API_THREAD_SAFE_CALLBACKS
-/// Releases the buffers that this decoding thread was the last user of.
-static void release_delayed_buffers(PerThreadContext *p)
-{
- FrameThreadContext *fctx = p->parent;
-
- while (p->num_released_buffers > 0) {
- AVFrame *f;
-
- pthread_mutex_lock(&fctx->buffer_mutex);
-
- // fix extended data in case the caller screwed it up
- av_assert0(p->avctx->codec_type == AVMEDIA_TYPE_VIDEO ||
- p->avctx->codec_type == AVMEDIA_TYPE_AUDIO);
- f = p->released_buffers[--p->num_released_buffers];
- f->extended_data = f->data;
- av_frame_unref(f);
-
- pthread_mutex_unlock(&fctx->buffer_mutex);
- }
-}
-#endif
-
static int submit_packet(PerThreadContext *p, AVCodecContext *user_avctx,
AVPacket *avpkt)
{
@@ -462,10 +407,6 @@ static int submit_packet(PerThreadContext *p, AVCodecContext *user_avctx,
(p->avctx->debug & FF_DEBUG_THREADS) != 0,
memory_order_relaxed);
-#if FF_API_THREAD_SAFE_CALLBACKS
- release_delayed_buffers(p);
-#endif
-
if (prev_thread) {
int err;
if (atomic_load(&prev_thread->state) == STATE_SETTING_UP) {
@@ -500,44 +441,6 @@ static int submit_packet(PerThreadContext *p, AVCodecContext *user_avctx,
pthread_cond_signal(&p->input_cond);
pthread_mutex_unlock(&p->mutex);
-#if FF_API_THREAD_SAFE_CALLBACKS
-FF_DISABLE_DEPRECATION_WARNINGS
- /*
- * If the client doesn't have a thread-safe get_buffer(),
- * then decoding threads call back to the main thread,
- * and it calls back to the client here.
- */
-
- if (!p->avctx->thread_safe_callbacks && (
- p->avctx->get_format != avcodec_default_get_format ||
- p->avctx->get_buffer2 != avcodec_default_get_buffer2)) {
- while (atomic_load(&p->state) != STATE_SETUP_FINISHED && atomic_load(&p->state) != STATE_INPUT_READY) {
- int call_done = 1;
- pthread_mutex_lock(&p->progress_mutex);
- while (atomic_load(&p->state) == STATE_SETTING_UP)
- pthread_cond_wait(&p->progress_cond, &p->progress_mutex);
-
- switch (atomic_load_explicit(&p->state, memory_order_acquire)) {
- case STATE_GET_BUFFER:
- p->result = ff_get_buffer(p->avctx, p->requested_frame, p->requested_flags);
- break;
- case STATE_GET_FORMAT:
- p->result_format = ff_get_format(p->avctx, p->available_formats);
- break;
- default:
- call_done = 0;
- break;
- }
- if (call_done) {
- atomic_store(&p->state, STATE_SETTING_UP);
- pthread_cond_signal(&p->progress_cond);
- }
- pthread_mutex_unlock(&p->progress_mutex);
- }
- }
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
fctx->prev_thread = p;
fctx->next_decoding++;
@@ -768,12 +671,6 @@ void ff_frame_thread_free(AVCodecContext *avctx, int thread_count)
if (codec->close && p->thread_init != UNINITIALIZED)
codec->close(ctx);
-#if FF_API_THREAD_SAFE_CALLBACKS
- release_delayed_buffers(p);
- for (int j = 0; j < p->released_buffers_allocated; j++)
- av_frame_free(&p->released_buffers[j]);
- av_freep(&p->released_buffers);
-#endif
if (ctx->priv_data) {
if (codec->p.priv_class)
av_opt_free(ctx->priv_data);
@@ -971,10 +868,6 @@ void ff_thread_flush(AVCodecContext *avctx)
av_frame_unref(p->frame);
p->result = 0;
-#if FF_API_THREAD_SAFE_CALLBACKS
- release_delayed_buffers(p);
-#endif
-
if (ffcodec(avctx->codec)->flush)
ffcodec(avctx->codec)->flush(p->avctx);
}
@@ -983,16 +876,12 @@ void ff_thread_flush(AVCodecContext *avctx)
int ff_thread_can_start_frame(AVCodecContext *avctx)
{
PerThreadContext *p = avctx->internal->thread_ctx;
-FF_DISABLE_DEPRECATION_WARNINGS
+
if ((avctx->active_thread_type&FF_THREAD_FRAME) && atomic_load(&p->state) != STATE_SETTING_UP &&
- (ffcodec(avctx->codec)->update_thread_context
-#if FF_API_THREAD_SAFE_CALLBACKS
- || !THREAD_SAFE_CALLBACKS(avctx)
-#endif
- )) {
+ ffcodec(avctx->codec)->update_thread_context) {
return 0;
}
-FF_ENABLE_DEPRECATION_WARNINGS
+
return 1;
}
@@ -1007,80 +896,20 @@ static int thread_get_buffer_internal(AVCodecContext *avctx, AVFrame *f, int fla
p = avctx->internal->thread_ctx;
FF_DISABLE_DEPRECATION_WARNINGS
if (atomic_load(&p->state) != STATE_SETTING_UP &&
- (ffcodec(avctx->codec)->update_thread_context
-#if FF_API_THREAD_SAFE_CALLBACKS
- || !THREAD_SAFE_CALLBACKS(avctx)
-#endif
- )) {
+ ffcodec(avctx->codec)->update_thread_context) {
FF_ENABLE_DEPRECATION_WARNINGS
av_log(avctx, AV_LOG_ERROR, "get_buffer() cannot be called after ff_thread_finish_setup()\n");
return -1;
}
pthread_mutex_lock(&p->parent->buffer_mutex);
-#if !FF_API_THREAD_SAFE_CALLBACKS
err = ff_get_buffer(avctx, f, flags);
-#else
-FF_DISABLE_DEPRECATION_WARNINGS
- if (THREAD_SAFE_CALLBACKS(avctx)) {
- err = ff_get_buffer(avctx, f, flags);
- } else {
- pthread_mutex_lock(&p->progress_mutex);
- p->requested_frame = f;
- p->requested_flags = flags;
- atomic_store_explicit(&p->state, STATE_GET_BUFFER, memory_order_release);
- pthread_cond_broadcast(&p->progress_cond);
-
- while (atomic_load(&p->state) != STATE_SETTING_UP)
- pthread_cond_wait(&p->progress_cond, &p->progress_mutex);
-
- err = p->result;
-
- pthread_mutex_unlock(&p->progress_mutex);
-
- }
- if (!THREAD_SAFE_CALLBACKS(avctx) && !ffcodec(avctx->codec)->update_thread_context)
- ff_thread_finish_setup(avctx);
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
pthread_mutex_unlock(&p->parent->buffer_mutex);
return err;
}
-#if FF_API_THREAD_SAFE_CALLBACKS
-FF_DISABLE_DEPRECATION_WARNINGS
-enum AVPixelFormat ff_thread_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
-{
- enum AVPixelFormat res;
- PerThreadContext *p;
- if (!(avctx->active_thread_type & FF_THREAD_FRAME) || avctx->thread_safe_callbacks ||
- avctx->get_format == avcodec_default_get_format)
- return ff_get_format(avctx, fmt);
-
- p = avctx->internal->thread_ctx;
- if (atomic_load(&p->state) != STATE_SETTING_UP) {
- av_log(avctx, AV_LOG_ERROR, "get_format() cannot be called after ff_thread_finish_setup()\n");
- return -1;
- }
- pthread_mutex_lock(&p->progress_mutex);
- p->available_formats = fmt;
- atomic_store(&p->state, STATE_GET_FORMAT);
- pthread_cond_broadcast(&p->progress_cond);
-
- while (atomic_load(&p->state) != STATE_SETTING_UP)
- pthread_cond_wait(&p->progress_cond, &p->progress_mutex);
-
- res = p->result_format;
-
- pthread_mutex_unlock(&p->progress_mutex);
-
- return res;
-}
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f, int flags)
{
int ret = thread_get_buffer_internal(avctx, f, flags);
@@ -1122,69 +951,13 @@ int ff_thread_get_ext_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
void ff_thread_release_buffer(AVCodecContext *avctx, AVFrame *f)
{
-#if FF_API_THREAD_SAFE_CALLBACKS
-FF_DISABLE_DEPRECATION_WARNINGS
- PerThreadContext *p;
- FrameThreadContext *fctx;
- AVFrame *dst;
- int ret = 0;
- int can_direct_free = !(avctx->active_thread_type & FF_THREAD_FRAME) ||
- THREAD_SAFE_CALLBACKS(avctx);
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
if (!f)
return;
if (avctx->debug & FF_DEBUG_BUFFERS)
av_log(avctx, AV_LOG_DEBUG, "thread_release_buffer called on pic %p\n", f);
-#if !FF_API_THREAD_SAFE_CALLBACKS
av_frame_unref(f);
-#else
- // when the frame buffers are not allocated, just reset it to clean state
- if (can_direct_free || !f->buf[0]) {
- av_frame_unref(f);
- return;
- }
-
- p = avctx->internal->thread_ctx;
- fctx = p->parent;
- pthread_mutex_lock(&fctx->buffer_mutex);
-
- if (p->num_released_buffers == p->released_buffers_allocated) {
- AVFrame **tmp = av_realloc_array(p->released_buffers, p->released_buffers_allocated + 1,
- sizeof(*p->released_buffers));
- if (tmp) {
- tmp[p->released_buffers_allocated] = av_frame_alloc();
- p->released_buffers = tmp;
- }
-
- if (!tmp || !tmp[p->released_buffers_allocated]) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
- p->released_buffers_allocated++;
- }
-
- dst = p->released_buffers[p->num_released_buffers];
- av_frame_move_ref(dst, f);
-
- p->num_released_buffers++;
-
-fail:
- pthread_mutex_unlock(&fctx->buffer_mutex);
-
- // make sure the frame is clean even if we fail to free it
- // this leaks, but it is better than crashing
- if (ret < 0) {
- av_log(avctx, AV_LOG_ERROR, "Could not queue a frame for freeing, this will leak\n");
- memset(f->buf, 0, sizeof(f->buf));
- if (f->extended_buf)
- memset(f->extended_buf, 0, f->nb_extended_buf * sizeof(*f->extended_buf));
- av_frame_unref(f);
- }
-#endif
}
void ff_thread_release_ext_buffer(AVCodecContext *avctx, ThreadFrame *f)
diff --git a/libavcodec/thread.h b/libavcodec/thread.h
index d5673f25eaf..88a14cfeb12 100644
--- a/libavcodec/thread.h
+++ b/libavcodec/thread.h
@@ -62,19 +62,7 @@ int ff_thread_decode_frame(AVCodecContext *avctx, AVFrame *picture,
*/
void ff_thread_finish_setup(AVCodecContext *avctx);
-#if FF_API_THREAD_SAFE_CALLBACKS
-/**
- * Wrapper around get_format() for frame-multithreaded codecs.
- * Call this function instead of avctx->get_format().
- * Cannot be called after the codec has called ff_thread_finish_setup().
- *
- * @param avctx The current context.
- * @param fmt The list of available formats.
- */
-enum AVPixelFormat ff_thread_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt);
-#else
#define ff_thread_get_format ff_get_format
-#endif
/**
* Wrapper around get_buffer() for frame-multithreaded codecs.
diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
index 7b561940b0c..dbb5606c147 100644
--- a/libavcodec/version_major.h
+++ b/libavcodec/version_major.h
@@ -37,7 +37,6 @@
* at once through the bump. This improves the git bisect-ability of the change.
*/
-#define FF_API_THREAD_SAFE_CALLBACKS (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_DEBUG_MV (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_GET_FRAME_CLASS (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_AUTO_THREADS (LIBAVCODEC_VERSION_MAJOR < 60)
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 11/33] avcodec: remove FF_API_DEBUG_MV
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (9 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 10/33] avcodec: remove FF_API_THREAD_SAFE_CALLBACKS Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 12/33] avcodec: remove FF_API_GET_FRAME_CLASS Anton Khirnov
` (21 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavcodec/avcodec.h | 11 -----------
libavcodec/version_major.h | 1 -
2 files changed, 12 deletions(-)
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 6cf6031705b..25c4b4eacc3 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1812,17 +1812,6 @@ typedef struct AVCodecContext {
*/
int seek_preroll;
-#if FF_API_DEBUG_MV
- /**
- * @deprecated unused
- */
- attribute_deprecated
- int debug_mv;
-#define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames
-#define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames
-#define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
-#endif
-
/**
* custom intra quantization matrix
* - encoding: Set by user, can be NULL.
diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
index dbb5606c147..d5d55c6dad0 100644
--- a/libavcodec/version_major.h
+++ b/libavcodec/version_major.h
@@ -37,7 +37,6 @@
* at once through the bump. This improves the git bisect-ability of the change.
*/
-#define FF_API_DEBUG_MV (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_GET_FRAME_CLASS (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_AUTO_THREADS (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 60)
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 12/33] avcodec: remove FF_API_GET_FRAME_CLASS
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (10 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 11/33] avcodec: remove FF_API_DEBUG_MV Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 13/33] avcodec: remove FF_API_AUTO_THREADS Anton Khirnov
` (20 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavcodec/avcodec.h | 8 --------
libavcodec/options.c | 33 ---------------------------------
libavcodec/version_major.h | 1 -
3 files changed, 42 deletions(-)
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 25c4b4eacc3..8aa08500a46 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2370,14 +2370,6 @@ void avcodec_free_context(AVCodecContext **avctx);
*/
const AVClass *avcodec_get_class(void);
-#if FF_API_GET_FRAME_CLASS
-/**
- * @deprecated This function should not be used.
- */
-attribute_deprecated
-const AVClass *avcodec_get_frame_class(void);
-#endif
-
/**
* Get the AVClass for AVSubtitleRect. It can be used in combination with
* AV_OPT_SEARCH_FAKE_OBJ for examining options.
diff --git a/libavcodec/options.c b/libavcodec/options.c
index 2e05d29e1ee..fdfbc0ababd 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -185,39 +185,6 @@ const AVClass *avcodec_get_class(void)
return &av_codec_context_class;
}
-#if FF_API_GET_FRAME_CLASS
-FF_DISABLE_DEPRECATION_WARNINGS
-#define FOFFSET(x) offsetof(AVFrame,x)
-
-static const AVOption frame_options[]={
-{"best_effort_timestamp", "", FOFFSET(best_effort_timestamp), AV_OPT_TYPE_INT64, {.i64 = AV_NOPTS_VALUE }, INT64_MIN, INT64_MAX, 0},
-{"pkt_pos", "", FOFFSET(pkt_pos), AV_OPT_TYPE_INT64, {.i64 = -1 }, INT64_MIN, INT64_MAX, 0},
-{"pkt_size", "", FOFFSET(pkt_size), AV_OPT_TYPE_INT64, {.i64 = -1 }, INT64_MIN, INT64_MAX, 0},
-{"sample_aspect_ratio", "", FOFFSET(sample_aspect_ratio), AV_OPT_TYPE_RATIONAL, {.dbl = 0 }, 0, INT_MAX, 0},
-{"width", "", FOFFSET(width), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0},
-{"height", "", FOFFSET(height), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0},
-{"format", "", FOFFSET(format), AV_OPT_TYPE_INT, {.i64 = -1 }, 0, INT_MAX, 0},
-#if FF_API_OLD_CHANNEL_LAYOUT
-{"channel_layout", "", FOFFSET(channel_layout), AV_OPT_TYPE_INT64, {.i64 = 0 }, 0, INT64_MAX, 0},
-#endif
-{"sample_rate", "", FOFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0},
-{NULL},
-};
-
-static const AVClass av_frame_class = {
- .class_name = "AVFrame",
- .item_name = NULL,
- .option = frame_options,
- .version = LIBAVUTIL_VERSION_INT,
-};
-
-const AVClass *avcodec_get_frame_class(void)
-{
- return &av_frame_class;
-}
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
#define SROFFSET(x) offsetof(AVSubtitleRect,x)
static const AVOption subtitle_rect_options[]={
diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
index d5d55c6dad0..1a6a60942fc 100644
--- a/libavcodec/version_major.h
+++ b/libavcodec/version_major.h
@@ -37,7 +37,6 @@
* at once through the bump. This improves the git bisect-ability of the change.
*/
-#define FF_API_GET_FRAME_CLASS (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_AUTO_THREADS (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_AVCTX_TIMEBASE (LIBAVCODEC_VERSION_MAJOR < 60)
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 13/33] avcodec: remove FF_API_AUTO_THREADS
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (11 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 12/33] avcodec: remove FF_API_GET_FRAME_CLASS Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 14/33] avcodec: remove FF_API_AVCTX_TIMEBASE Anton Khirnov
` (19 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavcodec/codec.h | 3 ---
libavcodec/version_major.h | 1 -
2 files changed, 4 deletions(-)
diff --git a/libavcodec/codec.h b/libavcodec/codec.h
index e10fcb9c7c2..8bf85b2f9c8 100644
--- a/libavcodec/codec.h
+++ b/libavcodec/codec.h
@@ -125,9 +125,6 @@
* multithreading-capable external libraries.
*/
#define AV_CODEC_CAP_OTHER_THREADS (1 << 15)
-#if FF_API_AUTO_THREADS
-#define AV_CODEC_CAP_AUTO_THREADS AV_CODEC_CAP_OTHER_THREADS
-#endif
/**
* Audio encoder supports receiving a different number of samples in each call.
*/
diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
index 1a6a60942fc..1b96c4c8fe9 100644
--- a/libavcodec/version_major.h
+++ b/libavcodec/version_major.h
@@ -37,7 +37,6 @@
* at once through the bump. This improves the git bisect-ability of the change.
*/
-#define FF_API_AUTO_THREADS (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_AVCTX_TIMEBASE (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_FLAG_TRUNCATED (LIBAVCODEC_VERSION_MAJOR < 60)
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 14/33] avcodec: remove FF_API_AVCTX_TIMEBASE
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (12 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 13/33] avcodec: remove FF_API_AUTO_THREADS Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 15/33] avcodec: remove FF_API_FLAG_TRUNCATED Anton Khirnov
` (18 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavcodec/av1_parser.c | 3 ---
libavcodec/avcodec.c | 5 -----
libavcodec/avcodec.h | 3 +--
libavcodec/avs2_parser.c | 4 ++--
libavcodec/avs3_parser.c | 4 ++--
libavcodec/cpia.c | 8 -------
libavcodec/decode.c | 5 -----
libavcodec/h264_parser.c | 7 +++---
libavcodec/h264dec.c | 6 -----
libavcodec/mjpegdec.c | 2 +-
libavcodec/mpeg4video_parser.c | 4 ++--
libavcodec/mpeg4videodec.c | 3 ---
libavcodec/mpegvideo_parser.c | 5 -----
libavcodec/vc1_parser.c | 2 --
libavcodec/version_major.h | 1 -
libavformat/avformat.c | 33 ++++++++++++++++-----------
libavformat/demux.c | 41 +++++++++++++++++++---------------
17 files changed, 55 insertions(+), 81 deletions(-)
diff --git a/libavcodec/av1_parser.c b/libavcodec/av1_parser.c
index e57e382757e..14dae92fe9f 100644
--- a/libavcodec/av1_parser.c
+++ b/libavcodec/av1_parser.c
@@ -168,9 +168,6 @@ static int av1_parser_parse(AVCodecParserContext *ctx,
timing->num_units_in_display_tick, timing->time_scale, INT_MAX);
}
- if (avctx->framerate.num)
- avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1}));
-
end:
ff_cbs_fragment_reset(td);
diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c
index efa76d2740a..00a58518071 100644
--- a/libavcodec/avcodec.c
+++ b/libavcodec/avcodec.c
@@ -349,11 +349,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
ret = AVERROR(EINVAL);
goto free_and_end;
}
-
-#if FF_API_AVCTX_TIMEBASE
- if (avctx->framerate.num > 0 && avctx->framerate.den > 0)
- avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1}));
-#endif
}
if (codec->priv_class)
av_assert0(*(const AVClass **)avctx->priv_data == codec->priv_class);
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 8aa08500a46..f82608561ac 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -543,8 +543,7 @@ typedef struct AVCodecContext {
* (fixed_vop_rate == 0 implies that it is different from the framerate)
*
* - encoding: MUST be set by user.
- * - decoding: the use of this field for decoding is deprecated.
- * Use framerate instead.
+ * - decoding: unused.
*/
AVRational time_base;
diff --git a/libavcodec/avs2_parser.c b/libavcodec/avs2_parser.c
index 0350517493a..200134f91db 100644
--- a/libavcodec/avs2_parser.c
+++ b/libavcodec/avs2_parser.c
@@ -112,9 +112,9 @@ static void parse_avs2_seq_header(AVCodecParserContext *s, const uint8_t *buf,
s->height = height;
s->coded_width = FFALIGN(width, 8);
s->coded_height = FFALIGN(height, 8);
- avctx->framerate.num = avctx->time_base.den =
+ avctx->framerate.num =
ff_avs2_frame_rate_tab[frame_rate_code].num;
- avctx->framerate.den = avctx->time_base.num =
+ avctx->framerate.den =
ff_avs2_frame_rate_tab[frame_rate_code].den;
avctx->has_b_frames = FFMAX(avctx->has_b_frames, !low_delay);
diff --git a/libavcodec/avs3_parser.c b/libavcodec/avs3_parser.c
index a9fd879e9de..a819b5783d6 100644
--- a/libavcodec/avs3_parser.c
+++ b/libavcodec/avs3_parser.c
@@ -117,8 +117,8 @@ static void parse_avs3_nal_units(AVCodecParserContext *s, const uint8_t *buf,
low_delay = get_bits(&gb, 1);
avctx->has_b_frames = FFMAX(avctx->has_b_frames, !low_delay);
- avctx->framerate.num = avctx->time_base.den = ff_avs3_frame_rate_tab[ratecode].num;
- avctx->framerate.den = avctx->time_base.num = ff_avs3_frame_rate_tab[ratecode].den;
+ avctx->framerate.num = ff_avs3_frame_rate_tab[ratecode].num;
+ avctx->framerate.den = ff_avs3_frame_rate_tab[ratecode].den;
s->width = s->coded_width = avctx->width;
s->height = s->coded_height = avctx->height;
diff --git a/libavcodec/cpia.c b/libavcodec/cpia.c
index 99362e73f07..bfd270dae2b 100644
--- a/libavcodec/cpia.c
+++ b/libavcodec/cpia.c
@@ -198,14 +198,6 @@ static av_cold int cpia_decode_init(AVCodecContext *avctx)
// output pixel format
avctx->pix_fmt = AV_PIX_FMT_YUV420P;
- /* The default timebase set by the v4l2 demuxer leads to probing which is buggy.
- * Set some reasonable time_base to skip this.
- */
- if (avctx->time_base.num == 1 && avctx->time_base.den == 1000000) {
- avctx->time_base.num = 1;
- avctx->time_base.den = 60;
- }
-
s->frame = av_frame_alloc();
if (!s->frame)
return AVERROR(ENOMEM);
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 8e790102136..bc6966d454a 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -434,11 +434,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
#endif
ret = pkt->size;
-#if FF_API_AVCTX_TIMEBASE
- if (avctx->framerate.num > 0 && avctx->framerate.den > 0)
- avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1}));
-#endif
-
/* do not stop draining when actual_got_frame != 0 or ret < 0 */
/* got_frame == 0 but actual_got_frame != 0 when frame is discarded */
if (avci->draining && !actual_got_frame) {
diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index 3ed23fb9cae..46134a1c483 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -593,6 +593,7 @@ static int h264_parse(AVCodecParserContext *s,
{
H264ParseContext *p = s->priv_data;
ParseContext *pc = &p->pc;
+ AVRational time_base = { 0, 1 };
int next;
if (!p->got_first) {
@@ -624,7 +625,7 @@ static int h264_parse(AVCodecParserContext *s,
parse_nal_units(s, avctx, buf, buf_size);
if (avctx->framerate.num)
- avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1}));
+ time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1}));
if (p->sei.picture_timing.cpb_removal_delay >= 0) {
s->dts_sync_point = p->sei.buffering_period.present;
s->dts_ref_dts_delta = p->sei.picture_timing.cpb_removal_delay;
@@ -640,9 +641,9 @@ static int h264_parse(AVCodecParserContext *s,
}
if (s->dts_sync_point >= 0) {
- int64_t den = avctx->time_base.den * (int64_t)avctx->pkt_timebase.num;
+ int64_t den = time_base.den * (int64_t)avctx->pkt_timebase.num;
if (den > 0) {
- int64_t num = avctx->time_base.num * (int64_t)avctx->pkt_timebase.den;
+ int64_t num = time_base.num * (int64_t)avctx->pkt_timebase.den;
if (s->dts != AV_NOPTS_VALUE) {
// got DTS from the stream, update reference timestamp
p->reference_dts = s->dts - av_rescale(s->dts_ref_dts_delta, num, den);
diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
index 9f7b3782e84..2d691731c5d 100644
--- a/libavcodec/h264dec.c
+++ b/libavcodec/h264dec.c
@@ -382,12 +382,6 @@ static av_cold int h264_decode_init(AVCodecContext *avctx)
return AVERROR_UNKNOWN;
}
- if (avctx->ticks_per_frame == 1) {
- if(h->avctx->time_base.den < INT_MAX/2) {
- h->avctx->time_base.den *= 2;
- } else
- h->avctx->time_base.num /= 2;
- }
avctx->ticks_per_frame = 2;
if (!avctx->internal->is_copy) {
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index f33911e1a86..b2be55af4af 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -436,7 +436,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
/* test interlaced mode */
if (s->first_picture &&
- (s->multiscope != 2 || s->avctx->time_base.den >= 25 * s->avctx->time_base.num) &&
+ (s->multiscope != 2 || s->avctx->pkt_timebase.den >= 25 * s->avctx->pkt_timebase.num) &&
s->orig_height != 0 &&
s->height < ((s->orig_height * 3) / 4)) {
s->interlaced = 1;
diff --git a/libavcodec/mpeg4video_parser.c b/libavcodec/mpeg4video_parser.c
index e32a93d2964..3beb5f6dae0 100644
--- a/libavcodec/mpeg4video_parser.c
+++ b/libavcodec/mpeg4video_parser.c
@@ -114,11 +114,11 @@ static int mpeg4_decode_header(AVCodecParserContext *s1, AVCodecContext *avctx,
if (ret < 0)
return ret;
}
- if((s1->flags & PARSER_FLAG_USE_CODEC_TS) && s->avctx->time_base.den>0 && ret>=0){
+ if((s1->flags & PARSER_FLAG_USE_CODEC_TS) && s->avctx->framerate.num>0 && ret>=0){
av_assert1(s1->pts == AV_NOPTS_VALUE);
av_assert1(s1->dts == AV_NOPTS_VALUE);
- s1->pts = av_rescale_q(s->time, (AVRational){1, s->avctx->time_base.den}, (AVRational){1, 1200000});
+ s1->pts = av_rescale_q(s->time, (AVRational){1, s->avctx->framerate.num}, (AVRational){1, 1200000});
}
s1->pict_type = s->pict_type;
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 0a100d2064e..f96b6a31171 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -2648,8 +2648,6 @@ static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb)
else
s->avctx->framerate.den = 1;
- s->avctx->time_base = av_inv_q(av_mul_q(s->avctx->framerate, (AVRational){s->avctx->ticks_per_frame, 1}));
-
ctx->t_frame = 0;
if (ctx->shape != BIN_ONLY_SHAPE) {
@@ -3145,7 +3143,6 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb,
"time_increment_bits set to %d bits, based on bitstream analysis\n", ctx->time_increment_bits);
if (s->avctx->framerate.num && 4*s->avctx->framerate.num < 1<<ctx->time_increment_bits) {
s->avctx->framerate.num = 1<<ctx->time_increment_bits;
- s->avctx->time_base = av_inv_q(av_mul_q(s->avctx->framerate, (AVRational){s->avctx->ticks_per_frame, 1}));
}
}
diff --git a/libavcodec/mpegvideo_parser.c b/libavcodec/mpegvideo_parser.c
index ac6efb69091..57bc1f706cc 100644
--- a/libavcodec/mpegvideo_parser.c
+++ b/libavcodec/mpegvideo_parser.c
@@ -241,11 +241,6 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
s->coded_width = FFALIGN(pc->width, 16);
s->coded_height = FFALIGN(pc->height, 16);
}
-
-#if FF_API_AVCTX_TIMEBASE
- if (avctx->framerate.num)
- avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1}));
-#endif
}
static int mpegvideo_parse(AVCodecParserContext *s,
diff --git a/libavcodec/vc1_parser.c b/libavcodec/vc1_parser.c
index a459a2aa7d7..4167215fb11 100644
--- a/libavcodec/vc1_parser.c
+++ b/libavcodec/vc1_parser.c
@@ -112,8 +112,6 @@ static void vc1_extract_header(AVCodecParserContext *s, AVCodecContext *avctx,
break;
}
- if (avctx->framerate.num)
- avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1}));
s->format = vpc->v.chromaformat == 1 ? AV_PIX_FMT_YUV420P
: AV_PIX_FMT_NONE;
if (avctx->width && avctx->height) {
diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
index 1b96c4c8fe9..6e85ae3e312 100644
--- a/libavcodec/version_major.h
+++ b/libavcodec/version_major.h
@@ -38,7 +38,6 @@
*/
#define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 60)
-#define FF_API_AVCTX_TIMEBASE (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_FLAG_TRUNCATED (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_SUB_TEXT_FORMAT (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_IDCT_NONE (LIBAVCODEC_VERSION_MAJOR < 60)
diff --git a/libavformat/avformat.c b/libavformat/avformat.c
index 88ff46a5744..a2767836b31 100644
--- a/libavformat/avformat.c
+++ b/libavformat/avformat.c
@@ -703,6 +703,10 @@ int avformat_transfer_internal_stream_timing_info(const AVOutputFormat *ofmt,
{
const AVCodecContext *const dec_ctx = cffstream(ist)->avctx;
AVCodecContext *const enc_ctx = ffstream(ost)->avctx;
+ AVRational dec_ctx_tb = dec_ctx->framerate.num ? av_inv_q(av_mul_q(dec_ctx->framerate,
+ (AVRational){dec_ctx->ticks_per_frame, 1}))
+ : (ist->codecpar->codec_type == AVMEDIA_TYPE_AUDIO ? (AVRational){0, 1}
+ : ist->time_base);
enc_ctx->time_base = ist->time_base;
/*
@@ -715,38 +719,41 @@ int avformat_transfer_internal_stream_timing_info(const AVOutputFormat *ofmt,
if (copy_tb == AVFMT_TBCF_AUTO && ist->r_frame_rate.num
&& av_q2d(ist->r_frame_rate) >= av_q2d(ist->avg_frame_rate)
&& 0.5/av_q2d(ist->r_frame_rate) > av_q2d(ist->time_base)
- && 0.5/av_q2d(ist->r_frame_rate) > av_q2d(dec_ctx->time_base)
- && av_q2d(ist->time_base) < 1.0/500 && av_q2d(dec_ctx->time_base) < 1.0/500
+ && 0.5/av_q2d(ist->r_frame_rate) > av_q2d(dec_ctx_tb)
+ && av_q2d(ist->time_base) < 1.0/500 && av_q2d(dec_ctx_tb) < 1.0/500
|| copy_tb == AVFMT_TBCF_R_FRAMERATE) {
enc_ctx->time_base.num = ist->r_frame_rate.den;
enc_ctx->time_base.den = 2*ist->r_frame_rate.num;
enc_ctx->ticks_per_frame = 2;
} else
#endif
- if (copy_tb == AVFMT_TBCF_AUTO && av_q2d(dec_ctx->time_base)*dec_ctx->ticks_per_frame > 2*av_q2d(ist->time_base)
+ if (copy_tb == AVFMT_TBCF_AUTO && dec_ctx->framerate.num &&
+ av_q2d(av_inv_q(dec_ctx->framerate)) > 2*av_q2d(ist->time_base)
&& av_q2d(ist->time_base) < 1.0/500
- || copy_tb == AVFMT_TBCF_DECODER) {
- enc_ctx->time_base = dec_ctx->time_base;
+ || (copy_tb == AVFMT_TBCF_DECODER &&
+ (dec_ctx->framerate.num || ist->codecpar->codec_type == AVMEDIA_TYPE_AUDIO))) {
+ enc_ctx->time_base = dec_ctx_tb;
enc_ctx->time_base.num *= dec_ctx->ticks_per_frame;
enc_ctx->time_base.den *= 2;
enc_ctx->ticks_per_frame = 2;
}
} else if (!(ofmt->flags & AVFMT_VARIABLE_FPS)
&& !av_match_name(ofmt->name, "mov,mp4,3gp,3g2,psp,ipod,ismv,f4v")) {
- if (copy_tb == AVFMT_TBCF_AUTO && dec_ctx->time_base.den
- && av_q2d(dec_ctx->time_base)*dec_ctx->ticks_per_frame > av_q2d(ist->time_base)
+ if (copy_tb == AVFMT_TBCF_AUTO && dec_ctx->framerate.num
+ && av_q2d(av_inv_q(dec_ctx->framerate)) > av_q2d(ist->time_base)
&& av_q2d(ist->time_base) < 1.0/500
- || copy_tb == AVFMT_TBCF_DECODER) {
- enc_ctx->time_base = dec_ctx->time_base;
+ || (copy_tb == AVFMT_TBCF_DECODER &&
+ (dec_ctx->framerate.num || ist->codecpar->codec_type == AVMEDIA_TYPE_AUDIO))) {
+ enc_ctx->time_base = dec_ctx_tb;
enc_ctx->time_base.num *= dec_ctx->ticks_per_frame;
}
}
if ((enc_ctx->codec_tag == AV_RL32("tmcd") || ost->codecpar->codec_tag == AV_RL32("tmcd"))
- && dec_ctx->time_base.num < dec_ctx->time_base.den
- && dec_ctx->time_base.num > 0
- && 121LL*dec_ctx->time_base.num > dec_ctx->time_base.den) {
- enc_ctx->time_base = dec_ctx->time_base;
+ && dec_ctx_tb.num < dec_ctx_tb.den
+ && dec_ctx_tb.num > 0
+ && 121LL*dec_ctx_tb.num > dec_ctx_tb.den) {
+ enc_ctx->time_base = dec_ctx_tb;
}
av_reduce(&enc_ctx->time_base.num, &enc_ctx->time_base.den,
diff --git a/libavformat/demux.c b/libavformat/demux.c
index ba2991750bc..c39919b978d 100644
--- a/libavformat/demux.c
+++ b/libavformat/demux.c
@@ -2156,10 +2156,19 @@ static int get_std_framerate(int i)
* Old DivX and Xvid often have nonsense timebases like 1fps or 2fps.
* MPEG-2 commonly misuses field repeat flags to store different framerates.
* And there are "variable" fps files this needs to detect as well. */
-static int tb_unreliable(AVCodecContext *c)
+static int tb_unreliable(AVFormatContext *ic, AVStream *st)
{
- if (c->time_base.den >= 101LL * c->time_base.num ||
- c->time_base.den < 5LL * c->time_base.num ||
+ FFStream *const sti = ffstream(st);
+ AVCodecContext *c = sti->avctx;
+ AVRational time_base = c->framerate.num ? av_inv_q(av_mul_q(c->framerate,
+ (AVRational){c->ticks_per_frame, 1}))
+ /* NOHEADER check added to not break existing behavior */
+ : (((ic->ctx_flags & AVFMTCTX_NOHEADER) ||
+ st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) ? (AVRational){0, 1}
+ : st->time_base);
+
+ if (time_base.den >= 101LL * time_base.num ||
+ time_base.den < 5LL * time_base.num ||
// c->codec_tag == AV_RL32("DIVX") ||
// c->codec_tag == AV_RL32("XVID") ||
c->codec_tag == AV_RL32("mp4v") ||
@@ -2243,11 +2252,11 @@ void ff_rfps_calculate(AVFormatContext *ic)
// the check for tb_unreliable() is not completely correct, since this is not about handling
// an unreliable/inexact time base, but a time base that is finer than necessary, as e.g.
// ipmovie.c produces.
- if (tb_unreliable(sti->avctx) && sti->info->duration_count > 15 && sti->info->duration_gcd > FFMAX(1, st->time_base.den/(500LL*st->time_base.num)) && !st->r_frame_rate.num &&
+ if (tb_unreliable(ic, st) && sti->info->duration_count > 15 && sti->info->duration_gcd > FFMAX(1, st->time_base.den/(500LL*st->time_base.num)) && !st->r_frame_rate.num &&
sti->info->duration_gcd < INT64_MAX / st->time_base.num)
av_reduce(&st->r_frame_rate.num, &st->r_frame_rate.den, st->time_base.den, st->time_base.num * sti->info->duration_gcd, INT_MAX);
if (sti->info->duration_count > 1 && !st->r_frame_rate.num
- && tb_unreliable(sti->avctx)) {
+ && tb_unreliable(ic, st)) {
int num = 0;
double best_error = 0.01;
AVRational ref_rate = st->r_frame_rate.num ? st->r_frame_rate : av_inv_q(st->time_base);
@@ -2459,14 +2468,6 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
FFStream *const sti = ffstream(st);
AVCodecContext *const avctx = sti->avctx;
- if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO ||
- st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) {
-/* if (!st->time_base.num)
- st->time_base = */
- if (!avctx->time_base.num)
- avctx->time_base = st->time_base;
- }
-
/* check if the caller has overridden the codec id */
// only for the split stuff
if (!sti->parser && !(ic->flags & AVFMT_FLAG_NOPARSE) && sti->request_probe <= 0) {
@@ -2544,7 +2545,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
* the correct fps. */
if (av_q2d(st->time_base) > 0.0005)
fps_analyze_framecount *= 2;
- if (!tb_unreliable(sti->avctx))
+ if (!tb_unreliable(ic, st))
fps_analyze_framecount = 0;
if (ic->fps_probe_size >= 0)
fps_analyze_framecount = ic->fps_probe_size;
@@ -2857,12 +2858,16 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
best_fps, 12 * 1001, INT_MAX);
}
-
if (!st->r_frame_rate.num) {
- if ( avctx->time_base.den * (int64_t) st->time_base.num
- <= avctx->time_base.num * (uint64_t)avctx->ticks_per_frame * st->time_base.den) {
+ AVRational time_base = avctx->framerate.num ? av_inv_q(av_mul_q(avctx->framerate,
+ (AVRational){avctx->ticks_per_frame, 1}))
+ /* NOHEADER check added to not break existing behavior */
+ : ((ic->ctx_flags & AVFMTCTX_NOHEADER) ? (AVRational){0, 1}
+ : st->time_base);
+ if ( time_base.den * (int64_t) st->time_base.num
+ <= time_base.num * (uint64_t)avctx->ticks_per_frame * st->time_base.den) {
av_reduce(&st->r_frame_rate.num, &st->r_frame_rate.den,
- avctx->time_base.den, (int64_t)avctx->time_base.num * avctx->ticks_per_frame, INT_MAX);
+ time_base.den, (int64_t)time_base.num * avctx->ticks_per_frame, INT_MAX);
} else {
st->r_frame_rate.num = st->time_base.den;
st->r_frame_rate.den = st->time_base.num;
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 15/33] avcodec: remove FF_API_FLAG_TRUNCATED
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (13 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 14/33] avcodec: remove FF_API_AVCTX_TIMEBASE Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 16/33] avcodec: remove FF_API_SUB_TEXT_FORMAT Anton Khirnov
` (17 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavcodec/avcodec.h | 9 -----
libavcodec/codec.h | 6 ----
libavcodec/decode.c | 4 ---
libavcodec/h263_parser.c | 11 ------
libavcodec/h263_parser.h | 29 ---------------
libavcodec/h263dec.c | 42 ----------------------
libavcodec/mpeg12.c | 66 ----------------------------------
libavcodec/mpeg12.h | 9 -----
libavcodec/mpeg12dec.c | 31 ----------------
libavcodec/mpeg4video_parser.c | 12 -------
libavcodec/mpeg4video_parser.h | 34 ------------------
libavcodec/mpeg4videodec.c | 3 --
libavcodec/mpegvideo.c | 9 -----
libavcodec/mpegvideo.h | 7 ----
libavcodec/mpegvideo_dec.c | 8 -----
libavcodec/mpegvideo_parser.c | 7 +---
libavcodec/options_table.h | 3 --
libavcodec/pthread.c | 3 --
libavcodec/version_major.h | 1 -
19 files changed, 1 insertion(+), 293 deletions(-)
delete mode 100644 libavcodec/h263_parser.h
delete mode 100644 libavcodec/mpeg4video_parser.h
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index f82608561ac..9066f6c5297 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -294,15 +294,6 @@ typedef struct RcOverride{
* error[?] variables will be set during encoding.
*/
#define AV_CODEC_FLAG_PSNR (1 << 15)
-#if FF_API_FLAG_TRUNCATED
-/**
- * Input bitstream might be truncated at a random location
- * instead of only at frame boundaries.
- *
- * @deprecated use codec parsers for packetizing input
- */
-#define AV_CODEC_FLAG_TRUNCATED (1 << 16)
-#endif
/**
* Use interlaced DCT.
*/
diff --git a/libavcodec/codec.h b/libavcodec/codec.h
index 8bf85b2f9c8..035bcd080b5 100644
--- a/libavcodec/codec.h
+++ b/libavcodec/codec.h
@@ -50,12 +50,6 @@
* avcodec_default_get_buffer2 or avcodec_default_get_encode_buffer.
*/
#define AV_CODEC_CAP_DR1 (1 << 1)
-#if FF_API_FLAG_TRUNCATED
-/**
- * @deprecated Use parsers to always send proper frames.
- */
-#define AV_CODEC_CAP_TRUNCATED (1 << 3)
-#endif
/**
* Encoder or decoder requires flushing with NULL input at the end in order to
* give the complete and correct output.
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index bc6966d454a..c37d607e27f 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -427,11 +427,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (!got_frame)
av_frame_unref(frame);
-#if FF_API_FLAG_TRUNCATED
- if (ret >= 0 && avctx->codec->type == AVMEDIA_TYPE_VIDEO && !(avctx->flags & AV_CODEC_FLAG_TRUNCATED))
-#else
if (ret >= 0 && avctx->codec->type == AVMEDIA_TYPE_VIDEO)
-#endif
ret = pkt->size;
/* do not stop draining when actual_got_frame != 0 or ret < 0 */
diff --git a/libavcodec/h263_parser.c b/libavcodec/h263_parser.c
index 7a742caa80b..f70a7911777 100644
--- a/libavcodec/h263_parser.c
+++ b/libavcodec/h263_parser.c
@@ -25,16 +25,9 @@
*/
#include "parser.h"
-#if FF_API_FLAG_TRUNCATED
-/* Nuke this header when removing FF_API_FLAG_TRUNCATED */
-#include "h263_parser.h"
-
-int ff_h263_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size){
-#else
static int h263_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size)
{
-#endif
int vop_found, i;
uint32_t state;
@@ -80,11 +73,7 @@ static int h263_parse(AVCodecParserContext *s,
if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
next = buf_size;
} else {
-#if FF_API_FLAG_TRUNCATED
- next= ff_h263_find_frame_end(pc, buf, buf_size);
-#else
next = h263_find_frame_end(pc, buf, buf_size);
-#endif
if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
*poutbuf = NULL;
diff --git a/libavcodec/h263_parser.h b/libavcodec/h263_parser.h
deleted file mode 100644
index 565a222bc1e..00000000000
--- a/libavcodec/h263_parser.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * H.263 parser
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_H263_PARSER_H
-#define AVCODEC_H263_PARSER_H
-
-#include "parser.h"
-
-int ff_h263_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size);
-
-#endif /* AVCODEC_H263_PARSER_H */
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 0a2d7487a83..f4e7048a5f2 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -36,17 +36,11 @@
#include "flvdec.h"
#include "h263.h"
#include "h263dec.h"
-#if FF_API_FLAG_TRUNCATED
-#include "h263_parser.h"
-#endif
#include "hwconfig.h"
#include "mpeg_er.h"
#include "mpeg4video.h"
#include "mpeg4videodec.h"
#include "mpeg4videodefs.h"
-#if FF_API_FLAG_TRUNCATED
-#include "mpeg4video_parser.h"
-#endif
#include "mpegutils.h"
#include "mpegvideo.h"
#include "mpegvideodec.h"
@@ -163,14 +157,6 @@ static int get_consumed_bytes(MpegEncContext *s, int buf_size)
/* We would have to scan through the whole buf to handle the weird
* reordering ... */
return buf_size;
-#if FF_API_FLAG_TRUNCATED
- } else if (s->avctx->flags & AV_CODEC_FLAG_TRUNCATED) {
- pos -= s->parse_context.last_index;
- // padding is not really read so this might be -1
- if (pos < 0)
- pos = 0;
- return pos;
-#endif
} else {
// avoid infinite loops (maybe not needed...)
if (pos == 0)
@@ -448,28 +434,6 @@ int ff_h263_decode_frame(AVCodecContext *avctx, AVFrame *pict,
return 0;
}
-#if FF_API_FLAG_TRUNCATED
- if (s->avctx->flags & AV_CODEC_FLAG_TRUNCATED) {
- int next;
-
- if (CONFIG_MPEG4_DECODER && s->codec_id == AV_CODEC_ID_MPEG4) {
- next = ff_mpeg4_find_frame_end(&s->parse_context, buf, buf_size);
- } else if (CONFIG_H263_DECODER && s->codec_id == AV_CODEC_ID_H263) {
- next = ff_h263_find_frame_end(&s->parse_context, buf, buf_size);
- } else if (CONFIG_H263P_DECODER && s->codec_id == AV_CODEC_ID_H263P) {
- next = ff_h263_find_frame_end(&s->parse_context, buf, buf_size);
- } else {
- av_log(s->avctx, AV_LOG_ERROR,
- "this codec does not support truncated bitstreams\n");
- return AVERROR(ENOSYS);
- }
-
- if (ff_combine_frame(&s->parse_context, next, (const uint8_t **)&buf,
- &buf_size) < 0)
- return buf_size;
- }
-#endif
-
retry:
if (s->divx_packed && s->bitstream_buffer_size) {
int i;
@@ -749,9 +713,6 @@ const FFCodec ff_h263_decoder = {
.close = ff_h263_decode_end,
FF_CODEC_DECODE_CB(ff_h263_decode_frame),
.p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 |
-#if FF_API_FLAG_TRUNCATED
- AV_CODEC_CAP_TRUNCATED |
-#endif
AV_CODEC_CAP_DELAY,
.caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
.flush = ff_mpeg_flush,
@@ -770,9 +731,6 @@ const FFCodec ff_h263p_decoder = {
.close = ff_h263_decode_end,
FF_CODEC_DECODE_CB(ff_h263_decode_frame),
.p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 |
-#if FF_API_FLAG_TRUNCATED
- AV_CODEC_CAP_TRUNCATED |
-#endif
AV_CODEC_CAP_DELAY,
.caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
.flush = ff_mpeg_flush,
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 5d5f39388f9..a256d45c85b 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -167,72 +167,6 @@ av_cold void ff_mpeg12_init_vlcs(void)
ff_thread_once(&init_static_once, mpeg12_init_vlcs);
}
-#if FF_API_FLAG_TRUNCATED
-/**
- * Find the end of the current frame in the bitstream.
- * @return the position of the first byte of the next frame, or -1
- */
-int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size, AVCodecParserContext *s)
-{
- int i;
- uint32_t state = pc->state;
-
- /* EOF considered as end of frame */
- if (buf_size == 0)
- return 0;
-
-/*
- 0 frame start -> 1/4
- 1 first_SEQEXT -> 0/2
- 2 first field start -> 3/0
- 3 second_SEQEXT -> 2/0
- 4 searching end
-*/
-
- for (i = 0; i < buf_size; i++) {
- av_assert1(pc->frame_start_found >= 0 && pc->frame_start_found <= 4);
- if (pc->frame_start_found & 1) {
- if (state == EXT_START_CODE && (buf[i] & 0xF0) != 0x80)
- pc->frame_start_found--;
- else if (state == EXT_START_CODE + 2) {
- if ((buf[i] & 3) == 3)
- pc->frame_start_found = 0;
- else
- pc->frame_start_found = (pc->frame_start_found + 1) & 3;
- }
- state++;
- } else {
- i = avpriv_find_start_code(buf + i, buf + buf_size, &state) - buf - 1;
- if (pc->frame_start_found == 0 && state >= SLICE_MIN_START_CODE && state <= SLICE_MAX_START_CODE) {
- i++;
- pc->frame_start_found = 4;
- }
- if (state == SEQ_END_CODE) {
- pc->frame_start_found = 0;
- pc->state=-1;
- return i+1;
- }
- if (pc->frame_start_found == 2 && state == SEQ_START_CODE)
- pc->frame_start_found = 0;
- if (pc->frame_start_found < 4 && state == EXT_START_CODE)
- pc->frame_start_found++;
- if (pc->frame_start_found == 4 && (state & 0xFFFFFF00) == 0x100) {
- if (state < SLICE_MIN_START_CODE || state > SLICE_MAX_START_CODE) {
- pc->frame_start_found = 0;
- pc->state = -1;
- return i - 3;
- }
- }
- if (pc->frame_start_found == 0 && s && state == PICTURE_START_CODE) {
- ff_fetch_timestamp(s, i - 3, 1, i > 3);
- }
- }
- }
- pc->state = state;
- return END_NOT_FOUND;
-}
-#endif
-
#define MAX_INDEX (64 - 1)
int ff_mpeg1_decode_block_intra(GetBitContext *gb,
diff --git a/libavcodec/mpeg12.h b/libavcodec/mpeg12.h
index 4e2e67eae18..86dd627e954 100644
--- a/libavcodec/mpeg12.h
+++ b/libavcodec/mpeg12.h
@@ -34,15 +34,6 @@
#define EXT_START_CODE 0x000001b5
#define USER_START_CODE 0x000001b2
-#include "version_major.h"
-#if FF_API_FLAG_TRUNCATED
-#include <stdint.h>
-
-struct ParseContext;
-struct AVCodecParserContext;
-int ff_mpeg1_find_frame_end(struct ParseContext *pc, const uint8_t *buf, int buf_size, struct AVCodecParserContext *s);
-#endif
-
void ff_mpeg12_find_best_frame_rate(AVRational frame_rate,
int *code, int *ext_n, int *ext_d,
int nonstandard);
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 9999926f55d..457d985265d 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -1239,14 +1239,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)
(s1->save_progressive_seq != s->progressive_sequence && FFALIGN(s->height, 16) != FFALIGN(s->height, 32)) ||
0) {
if (s1->mpeg_enc_ctx_allocated) {
-#if FF_API_FLAG_TRUNCATED
- ParseContext pc = s->parse_context;
- s->parse_context.buffer = 0;
ff_mpv_common_end(s);
- s->parse_context = pc;
-#else
- ff_mpv_common_end(s);
-#endif
s1->mpeg_enc_ctx_allocated = 0;
}
@@ -2482,11 +2475,7 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture,
if (avctx->err_recognition & AV_EF_EXPLODE && s2->er.error_count)
return AVERROR_INVALIDDATA;
-#if FF_API_FLAG_TRUNCATED
- return FFMAX(0, buf_ptr - buf - s2->parse_context.last_index);
-#else
return FFMAX(0, buf_ptr - buf);
-#endif
}
input_size = buf_end - buf_ptr;
@@ -2799,17 +2788,6 @@ static int mpeg_decode_frame(AVCodecContext *avctx, AVFrame *picture,
return buf_size;
}
-#if FF_API_FLAG_TRUNCATED
- if (s2->avctx->flags & AV_CODEC_FLAG_TRUNCATED) {
- int next = ff_mpeg1_find_frame_end(&s2->parse_context, buf,
- buf_size, NULL);
-
- if (ff_combine_frame(&s2->parse_context, next,
- (const uint8_t **) &buf, &buf_size) < 0)
- return buf_size;
- }
-#endif
-
if (s->mpeg_enc_ctx_allocated == 0 && ( s2->codec_tag == AV_RL32("VCR2")
|| s2->codec_tag == AV_RL32("BW10")
))
@@ -2886,9 +2864,6 @@ const FFCodec ff_mpeg1video_decoder = {
.close = mpeg_decode_end,
FF_CODEC_DECODE_CB(mpeg_decode_frame),
.p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 |
-#if FF_API_FLAG_TRUNCATED
- AV_CODEC_CAP_TRUNCATED |
-#endif
AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS,
.caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
.flush = flush,
@@ -2918,9 +2893,6 @@ const FFCodec ff_mpeg2video_decoder = {
.close = mpeg_decode_end,
FF_CODEC_DECODE_CB(mpeg_decode_frame),
.p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 |
-#if FF_API_FLAG_TRUNCATED
- AV_CODEC_CAP_TRUNCATED |
-#endif
AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS,
.caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
.flush = flush,
@@ -2963,9 +2935,6 @@ const FFCodec ff_mpegvideo_decoder = {
.close = mpeg_decode_end,
FF_CODEC_DECODE_CB(mpeg_decode_frame),
.p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 |
-#if FF_API_FLAG_TRUNCATED
- AV_CODEC_CAP_TRUNCATED |
-#endif
AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS,
.caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
.flush = flush,
diff --git a/libavcodec/mpeg4video_parser.c b/libavcodec/mpeg4video_parser.c
index 3beb5f6dae0..28353aa146b 100644
--- a/libavcodec/mpeg4video_parser.c
+++ b/libavcodec/mpeg4video_parser.c
@@ -27,10 +27,6 @@
#include "mpegvideo.h"
#include "mpeg4videodec.h"
#include "mpeg4videodefs.h"
-#if FF_API_FLAG_TRUNCATED
-/* Nuke this header when removing FF_API_FLAG_TRUNCATED */
-#include "mpeg4video_parser.h"
-#endif
struct Mp4vParseContext {
ParseContext pc;
@@ -38,15 +34,11 @@ struct Mp4vParseContext {
int first_picture;
};
-#if FF_API_FLAG_TRUNCATED
-int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size)
-#else
/**
* Find the end of the current frame in the bitstream.
* @return the position of the first byte of the next frame, or -1
*/
static int mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size)
-#endif
{
int vop_found, i;
uint32_t state;
@@ -148,11 +140,7 @@ static int mpeg4video_parse(AVCodecParserContext *s,
if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
next = buf_size;
} else {
-#if FF_API_FLAG_TRUNCATED
- next = ff_mpeg4_find_frame_end(pc, buf, buf_size);
-#else
next = mpeg4_find_frame_end(pc, buf, buf_size);
-#endif
if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
*poutbuf = NULL;
diff --git a/libavcodec/mpeg4video_parser.h b/libavcodec/mpeg4video_parser.h
deleted file mode 100644
index 8008e693b43..00000000000
--- a/libavcodec/mpeg4video_parser.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * MPEG-4 video parser prototypes
- * Copyright (c) 2003 Fabrice Bellard
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_MPEG4VIDEO_PARSER_H
-#define AVCODEC_MPEG4VIDEO_PARSER_H
-
-#include "parser.h"
-
-/**
- * Find the end of the current frame in the bitstream.
- * @return the position of the first byte of the next frame, or -1
- */
-int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size);
-
-#endif /* AVCODEC_MPEG4VIDEO_PARSER_H */
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index f96b6a31171..d456e5dd113 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -3859,9 +3859,6 @@ const FFCodec ff_mpeg4_decoder = {
.close = ff_h263_decode_end,
FF_CODEC_DECODE_CB(ff_h263_decode_frame),
.p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 |
-#if FF_API_FLAG_TRUNCATED
- AV_CODEC_CAP_TRUNCATED |
-#endif
AV_CODEC_CAP_DELAY | AV_CODEC_CAP_FRAME_THREADS,
.caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM |
FF_CODEC_CAP_ALLOCATE_PROGRESS,
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 836869c1d92..fc73abab9cd 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -738,10 +738,6 @@ av_cold int ff_mpv_common_init(MpegEncContext *s)
nb_slices = max_slices;
}
-#if FF_API_FLAG_TRUNCATED
- s->parse_context.state = -1;
-#endif
-
s->context_initialized = 1;
memset(s->thread_context, 0, sizeof(s->thread_context));
s->thread_context[0] = s;
@@ -791,11 +787,6 @@ void ff_mpv_common_end(MpegEncContext *s)
if (s->slice_context_count > 1)
s->slice_context_count = 1;
-#if FF_API_FLAG_TRUNCATED
- av_freep(&s->parse_context.buffer);
- s->parse_context.buffer_size = 0;
-#endif
-
av_freep(&s->bitstream_buffer);
s->allocated_bitstream_buffer_size = 0;
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index 42275953b9e..55828e61027 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -44,9 +44,6 @@
#include "pixblockdsp.h"
#include "put_bits.h"
#include "ratecontrol.h"
-#if FF_API_FLAG_TRUNCATED
-#include "parser.h"
-#endif
#include "mpegutils.h"
#include "qpeldsp.h"
#include "videodsp.h"
@@ -353,10 +350,6 @@ typedef struct MpegEncContext {
GetBitContext last_resync_gb; ///< used to search for the next resync marker
int mb_num_left; ///< number of MBs left in this video packet (for partitioned Slices only)
-#if FF_API_FLAG_TRUNCATED
- ParseContext parse_context;
-#endif
-
/* H.263 specific */
int gob_index;
int obmc; ///< overlapped block motion compensation
diff --git a/libavcodec/mpegvideo_dec.c b/libavcodec/mpegvideo_dec.c
index 12c7144ffb1..7a0c51e53d1 100644
--- a/libavcodec/mpegvideo_dec.c
+++ b/libavcodec/mpegvideo_dec.c
@@ -554,14 +554,6 @@ void ff_mpeg_flush(AVCodecContext *avctx)
s->mb_x = s->mb_y = 0;
-#if FF_API_FLAG_TRUNCATED
- s->parse_context.state = -1;
- s->parse_context.frame_start_found = 0;
- s->parse_context.overread = 0;
- s->parse_context.overread_index = 0;
- s->parse_context.index = 0;
- s->parse_context.last_index = 0;
-#endif
s->bitstream_buffer_size = 0;
s->pp_time = 0;
}
diff --git a/libavcodec/mpegvideo_parser.c b/libavcodec/mpegvideo_parser.c
index 57bc1f706cc..8e7e88ff25e 100644
--- a/libavcodec/mpegvideo_parser.c
+++ b/libavcodec/mpegvideo_parser.c
@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/avassert.h"
#include "decode.h"
#include "parser.h"
#include "mpeg12.h"
@@ -33,7 +34,6 @@ struct MpvParseContext {
int width, height;
};
-#if !FF_API_FLAG_TRUNCATED
/**
* Find the end of the current frame in the bitstream.
* @return the position of the first byte of the next frame, or -1
@@ -98,7 +98,6 @@ static int mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf,
pc->state = state;
return END_NOT_FOUND;
}
-#endif
static void mpegvideo_extract_headers(AVCodecParserContext *s,
AVCodecContext *avctx,
@@ -255,11 +254,7 @@ static int mpegvideo_parse(AVCodecParserContext *s,
if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){
next= buf_size;
}else{
-#if FF_API_FLAG_TRUNCATED
- next= ff_mpeg1_find_frame_end(pc, buf, buf_size, s);
-#else
next = mpeg1_find_frame_end(pc, buf, buf_size, s);
-#endif
if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
*poutbuf = NULL;
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 322ec7a1566..52ecc25cf9b 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -64,9 +64,6 @@ static const AVOption avcodec_options[] = {
{"pass2", "use internal 2-pass ratecontrol in second pass mode", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_PASS2 }, INT_MIN, INT_MAX, 0, "flags"},
{"gray", "only decode/encode grayscale", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_GRAY }, INT_MIN, INT_MAX, V|E|D, "flags"},
{"psnr", "error[?] variables will be set during encoding", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_PSNR }, INT_MIN, INT_MAX, V|E, "flags"},
-#if FF_API_FLAG_TRUNCATED
-{"truncated", "(Deprecated, use parsers instead.) Input bitstream might be randomly truncated", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_TRUNCATED }, INT_MIN, INT_MAX, V|D | AV_OPT_FLAG_DEPRECATED, "flags"},
-#endif
{"ildct", "use interlaced DCT", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_INTERLACED_DCT }, INT_MIN, INT_MAX, V|E, "flags"},
{"low_delay", "force low delay", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_LOW_DELAY }, INT_MIN, INT_MAX, V|D|E, "flags"},
{"global_header", "place global headers in extradata instead of every keyframe", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_GLOBAL_HEADER }, INT_MIN, INT_MAX, V|A|E, "flags"},
diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index 60ba87dac48..ca84b81391d 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -48,9 +48,6 @@
static void validate_thread_parameters(AVCodecContext *avctx)
{
int frame_threading_supported = (avctx->codec->capabilities & AV_CODEC_CAP_FRAME_THREADS)
-#if FF_API_FLAG_TRUNCATED
- && !(avctx->flags & AV_CODEC_FLAG_TRUNCATED)
-#endif
&& !(avctx->flags & AV_CODEC_FLAG_LOW_DELAY)
&& !(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS);
if (avctx->thread_count == 1) {
diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
index 6e85ae3e312..eea761c7dd6 100644
--- a/libavcodec/version_major.h
+++ b/libavcodec/version_major.h
@@ -38,7 +38,6 @@
*/
#define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 60)
-#define FF_API_FLAG_TRUNCATED (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_SUB_TEXT_FORMAT (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_IDCT_NONE (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_SVTAV1_OPTS (LIBAVCODEC_VERSION_MAJOR < 60)
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 16/33] avcodec: remove FF_API_SUB_TEXT_FORMAT
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (14 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 15/33] avcodec: remove FF_API_FLAG_TRUNCATED Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 17/33] avformat: remove FF_API_LAVF_PRIV_OPT Anton Khirnov
` (16 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavcodec/avcodec.h | 9 ---------
libavcodec/options_table.h | 4 ----
libavcodec/version_major.h | 1 -
3 files changed, 14 deletions(-)
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 9066f6c5297..ecd02ff4747 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1868,15 +1868,6 @@ typedef struct AVCodecContext {
*/
AVBufferRef *hw_frames_ctx;
-#if FF_API_SUB_TEXT_FORMAT
- /**
- * @deprecated unused
- */
- attribute_deprecated
- int sub_text_format;
-#define FF_SUB_TEXT_FMT_ASS 0
-#endif
-
/**
* Audio only. The amount of padding (in samples) appended by the encoder to
* the end of the audio. I.e. this number of decoded samples must be
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 52ecc25cf9b..bcd6f381917 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -376,10 +376,6 @@ static const AVOption avcodec_options[] = {
{"auto", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_SUB_CHARENC_MODE_AUTOMATIC}, INT_MIN, INT_MAX, S|D, "sub_charenc_mode"},
{"pre_decoder", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_SUB_CHARENC_MODE_PRE_DECODER}, INT_MIN, INT_MAX, S|D, "sub_charenc_mode"},
{"ignore", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_SUB_CHARENC_MODE_IGNORE}, INT_MIN, INT_MAX, S|D, "sub_charenc_mode"},
-#if FF_API_SUB_TEXT_FORMAT
-{"sub_text_format", "Deprecated, does nothing", OFFSET(sub_text_format), AV_OPT_TYPE_INT, {.i64 = FF_SUB_TEXT_FMT_ASS}, 0, 1, S|D | AV_OPT_FLAG_DEPRECATED, "sub_text_format"},
-{"ass", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_SUB_TEXT_FMT_ASS}, INT_MIN, INT_MAX, S|D, "sub_text_format"},
-#endif
{"apply_cropping", NULL, OFFSET(apply_cropping), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, V | D },
{"skip_alpha", "Skip processing alpha", OFFSET(skip_alpha), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, V|D },
{"field_order", "Field order", OFFSET(field_order), AV_OPT_TYPE_INT, {.i64 = AV_FIELD_UNKNOWN }, 0, 5, V|D|E, "field_order" },
diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
index eea761c7dd6..04e6225f9b3 100644
--- a/libavcodec/version_major.h
+++ b/libavcodec/version_major.h
@@ -38,7 +38,6 @@
*/
#define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 60)
-#define FF_API_SUB_TEXT_FORMAT (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_IDCT_NONE (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_SVTAV1_OPTS (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_AYUV_CODECID (LIBAVCODEC_VERSION_MAJOR < 60)
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 17/33] avformat: remove FF_API_LAVF_PRIV_OPT
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (15 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 16/33] avcodec: remove FF_API_SUB_TEXT_FORMAT Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 18/33] avformat: remove FF_API_AVIOCONTEXT_WRITTEN Anton Khirnov
` (15 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavformat/avformat.h | 3 ---
libavformat/version_major.h | 1 -
2 files changed, 4 deletions(-)
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 49e50a5120a..ac40e197f62 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1242,9 +1242,6 @@ typedef struct AVFormatContext {
*/
#define AVFMT_FLAG_BITEXACT 0x0400
#define AVFMT_FLAG_SORT_DTS 0x10000 ///< try to interleave outputted packets by dts (using this flag can slow demuxing down)
-#if FF_API_LAVF_PRIV_OPT
-#define AVFMT_FLAG_PRIV_OPT 0x20000 ///< Enable use of private options by delaying codec open (deprecated, does nothing)
-#endif
#define AVFMT_FLAG_FAST_SEEK 0x80000 ///< Enable fast, but inaccurate seeks for some formats
#define AVFMT_FLAG_SHORTEST 0x100000 ///< Stop muxing when the shortest stream stops.
#define AVFMT_FLAG_AUTO_BSF 0x200000 ///< Add bitstream filters as requested by the muxer
diff --git a/libavformat/version_major.h b/libavformat/version_major.h
index 86af3ee4a5a..abc1699685a 100644
--- a/libavformat/version_major.h
+++ b/libavformat/version_major.h
@@ -41,7 +41,6 @@
* at once through the bump. This improves the git bisect-ability of the change.
*
*/
-#define FF_API_LAVF_PRIV_OPT (LIBAVFORMAT_VERSION_MAJOR < 60)
#define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 60)
#define FF_API_AVIOCONTEXT_WRITTEN (LIBAVFORMAT_VERSION_MAJOR < 60)
#define FF_HLS_TS_OPTIONS (LIBAVFORMAT_VERSION_MAJOR < 60)
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 18/33] avformat: remove FF_API_AVIOCONTEXT_WRITTEN
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (16 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 17/33] avformat: remove FF_API_LAVF_PRIV_OPT Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 19/33] avformat: remove FF_HLS_TS_OPTIONS Anton Khirnov
` (14 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavformat/avio.h | 10 ----------
libavformat/aviobuf.c | 10 ----------
libavformat/version_major.h | 1 -
3 files changed, 21 deletions(-)
diff --git a/libavformat/avio.h b/libavformat/avio.h
index 4bf6b1fbdaa..5f13e0622d3 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -295,16 +295,6 @@ typedef struct AVIOContext {
*/
int ignore_boundary_point;
-#if FF_API_AVIOCONTEXT_WRITTEN
- /**
- * @deprecated field utilized privately by libavformat. For a public
- * statistic of how many bytes were written out, see
- * AVIOContext::bytes_written.
- */
- attribute_deprecated
- int64_t written;
-#endif
-
/**
* Maximum reached position before a backward seek in the write buffer,
* used keeping track of already written data for a later flush.
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 257535a9642..4ad734a3c3e 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -125,11 +125,6 @@ void ffio_init_context(FFIOContext *ctx,
ctx->current_type = AVIO_DATA_MARKER_UNKNOWN;
ctx->last_time = AV_NOPTS_VALUE;
ctx->short_seek_get = NULL;
-#if FF_API_AVIOCONTEXT_WRITTEN
-FF_DISABLE_DEPRECATION_WARNINGS
- s->written = 0;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
}
AVIOContext *avio_alloc_context(
@@ -174,11 +169,6 @@ static void writeout(AVIOContext *s, const uint8_t *data, int len)
if (s->pos + len > ctx->written_output_size) {
ctx->written_output_size = s->pos + len;
-#if FF_API_AVIOCONTEXT_WRITTEN
-FF_DISABLE_DEPRECATION_WARNINGS
- s->written = ctx->written_output_size;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
}
}
}
diff --git a/libavformat/version_major.h b/libavformat/version_major.h
index abc1699685a..044af1ebf6f 100644
--- a/libavformat/version_major.h
+++ b/libavformat/version_major.h
@@ -42,7 +42,6 @@
*
*/
#define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 60)
-#define FF_API_AVIOCONTEXT_WRITTEN (LIBAVFORMAT_VERSION_MAJOR < 60)
#define FF_HLS_TS_OPTIONS (LIBAVFORMAT_VERSION_MAJOR < 60)
#define FF_API_AVSTREAM_CLASS (LIBAVFORMAT_VERSION_MAJOR > 59)
#define FF_API_GET_END_PTS (LIBAVFORMAT_VERSION_MAJOR < 60)
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 19/33] avformat: remove FF_HLS_TS_OPTIONS
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (17 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 18/33] avformat: remove FF_API_AVIOCONTEXT_WRITTEN Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 20/33] avformat: remove FF_API_AVSTREAM_CLASS Anton Khirnov
` (13 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavformat/hlsenc.c | 3 ---
libavformat/version_major.h | 1 -
2 files changed, 4 deletions(-)
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index adf06ec7643..dcc363b42e3 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -3116,9 +3116,6 @@ static const AVOption options[] = {
{"hls_init_time", "set segment length at init list", OFFSET(init_time), AV_OPT_TYPE_DURATION, {.i64 = 0}, 0, INT64_MAX, E},
{"hls_list_size", "set maximum number of playlist entries", OFFSET(max_nb_segments), AV_OPT_TYPE_INT, {.i64 = 5}, 0, INT_MAX, E},
{"hls_delete_threshold", "set number of unreferenced segments to keep before deleting", OFFSET(hls_delete_threshold), AV_OPT_TYPE_INT, {.i64 = 1}, 1, INT_MAX, E},
-#if FF_HLS_TS_OPTIONS
- {"hls_ts_options","set hls mpegts list of options for the container format used for hls (deprecated, use hls_segment_options instead of it.)", OFFSET(format_options), AV_OPT_TYPE_DICT, {.str = NULL}, 0, 0, E | AV_OPT_FLAG_DEPRECATED},
-#endif
{"hls_vtt_options","set hls vtt list of options for the container format used for hls", OFFSET(vtt_format_options_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E},
{"hls_allow_cache", "explicitly set whether the client MAY (1) or MUST NOT (0) cache media segments", OFFSET(allowcache), AV_OPT_TYPE_INT, {.i64 = -1}, INT_MIN, INT_MAX, E},
{"hls_base_url", "url to prepend to each playlist entry", OFFSET(baseurl), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E},
diff --git a/libavformat/version_major.h b/libavformat/version_major.h
index 044af1ebf6f..057d1ac0fb0 100644
--- a/libavformat/version_major.h
+++ b/libavformat/version_major.h
@@ -42,7 +42,6 @@
*
*/
#define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 60)
-#define FF_HLS_TS_OPTIONS (LIBAVFORMAT_VERSION_MAJOR < 60)
#define FF_API_AVSTREAM_CLASS (LIBAVFORMAT_VERSION_MAJOR > 59)
#define FF_API_GET_END_PTS (LIBAVFORMAT_VERSION_MAJOR < 60)
#define FF_API_AVIODIRCONTEXT (LIBAVFORMAT_VERSION_MAJOR < 60)
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 20/33] avformat: remove FF_API_AVSTREAM_CLASS
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (18 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 19/33] avformat: remove FF_HLS_TS_OPTIONS Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 21/33] avfilter: remove FF_API_SWS_PARAM_OPTION Anton Khirnov
` (12 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
fftools/ffmpeg_mux_init.c | 11 -----------
libavformat/avformat.h | 2 --
libavformat/options.c | 3 ---
libavformat/version_major.h | 1 -
4 files changed, 17 deletions(-)
diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c
index f8ccf4a3e9b..34172406394 100644
--- a/fftools/ffmpeg_mux_init.c
+++ b/fftools/ffmpeg_mux_init.c
@@ -1983,18 +1983,7 @@ static int set_dispositions(Muxer *mux, const OptionsContext *o)
if (!disp)
continue;
-#if LIBAVFORMAT_VERSION_MAJOR >= 60
ret = av_opt_set(ost->st, "disposition", disp, 0);
-#else
- {
- const AVClass *class = av_stream_get_class();
- const AVOption *o = av_opt_find(&class, "disposition", NULL, 0, AV_OPT_SEARCH_FAKE_OBJ);
-
- av_assert0(o);
- ret = av_opt_eval_flags(&class, o, disp, &ost->st->disposition);
- }
-#endif
-
if (ret < 0)
goto finish;
}
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index ac40e197f62..b986aacc785 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -838,12 +838,10 @@ const char *av_disposition_to_string(int disposition);
* sizeof(AVStream) must not be used outside libav*.
*/
typedef struct AVStream {
-#if FF_API_AVSTREAM_CLASS
/**
* A class for @ref avoptions. Set on stream creation.
*/
const AVClass *av_class;
-#endif
int index; /**< stream index in AVFormatContext */
/**
diff --git a/libavformat/options.c b/libavformat/options.c
index 0079a06d9a5..c7681122cd7 100644
--- a/libavformat/options.c
+++ b/libavformat/options.c
@@ -257,10 +257,7 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c)
return NULL;
st = &sti->pub;
-#if FF_API_AVSTREAM_CLASS
st->av_class = &stream_class;
-#endif
-
st->codecpar = avcodec_parameters_alloc();
if (!st->codecpar)
goto fail;
diff --git a/libavformat/version_major.h b/libavformat/version_major.h
index 057d1ac0fb0..1db8e7600eb 100644
--- a/libavformat/version_major.h
+++ b/libavformat/version_major.h
@@ -42,7 +42,6 @@
*
*/
#define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 60)
-#define FF_API_AVSTREAM_CLASS (LIBAVFORMAT_VERSION_MAJOR > 59)
#define FF_API_GET_END_PTS (LIBAVFORMAT_VERSION_MAJOR < 60)
#define FF_API_AVIODIRCONTEXT (LIBAVFORMAT_VERSION_MAJOR < 60)
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 21/33] avfilter: remove FF_API_SWS_PARAM_OPTION
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (19 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 20/33] avformat: remove FF_API_AVSTREAM_CLASS Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 22/33] avfilter: remove FF_API_BUFFERSINK_ALLOC Anton Khirnov
` (11 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavfilter/buffersrc.c | 11 -----------
libavfilter/version_major.h | 1 -
2 files changed, 12 deletions(-)
diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c
index ae8bba19b07..ba17450b937 100644
--- a/libavfilter/buffersrc.c
+++ b/libavfilter/buffersrc.c
@@ -50,9 +50,6 @@ typedef struct BufferSourceContext {
int w, h;
enum AVPixelFormat pix_fmt;
AVRational pixel_aspect;
-#if FF_API_SWS_PARAM_OPTION
- char *sws_param;
-#endif
AVBufferRef *hw_frames_ctx;
@@ -287,11 +284,6 @@ static av_cold int init_video(AVFilterContext *ctx)
c->time_base.num, c->time_base.den, c->frame_rate.num, c->frame_rate.den,
c->pixel_aspect.num, c->pixel_aspect.den);
-#if FF_API_SWS_PARAM_OPTION
- if (c->sws_param)
- av_log(ctx, AV_LOG_WARNING, "sws_param option is deprecated and ignored\n");
-#endif
-
return 0;
}
@@ -313,9 +305,6 @@ static const AVOption buffer_options[] = {
{ "pixel_aspect", "sample aspect ratio", OFFSET(pixel_aspect), AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V },
{ "time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V },
{ "frame_rate", NULL, OFFSET(frame_rate), AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V },
-#if FF_API_SWS_PARAM_OPTION
- { "sws_param", NULL, OFFSET(sws_param), AV_OPT_TYPE_STRING, .flags = V },
-#endif
{ NULL },
};
diff --git a/libavfilter/version_major.h b/libavfilter/version_major.h
index de0cf6e9793..655e3d119d2 100644
--- a/libavfilter/version_major.h
+++ b/libavfilter/version_major.h
@@ -35,7 +35,6 @@
* the public API and may change, break or disappear at any time.
*/
-#define FF_API_SWS_PARAM_OPTION (LIBAVFILTER_VERSION_MAJOR < 9)
#define FF_API_BUFFERSINK_ALLOC (LIBAVFILTER_VERSION_MAJOR < 9)
#define FF_API_PAD_COUNT (LIBAVFILTER_VERSION_MAJOR < 9)
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 22/33] avfilter: remove FF_API_BUFFERSINK_ALLOC
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (20 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 21/33] avfilter: remove FF_API_SWS_PARAM_OPTION Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 23/33] avfilter: remove FF_API_PAD_COUNT Anton Khirnov
` (10 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavfilter/buffersink.c | 22 ----------------------
libavfilter/buffersink.h | 36 ------------------------------------
libavfilter/version_major.h | 1 -
3 files changed, 59 deletions(-)
diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c
index e269cf72d1b..306c283f775 100644
--- a/libavfilter/buffersink.c
+++ b/libavfilter/buffersink.c
@@ -154,28 +154,6 @@ int attribute_align_arg av_buffersink_get_samples(AVFilterContext *ctx,
return get_frame_internal(ctx, frame, 0, nb_samples);
}
-#if FF_API_BUFFERSINK_ALLOC
-AVBufferSinkParams *av_buffersink_params_alloc(void)
-{
- static const int pixel_fmts[] = { AV_PIX_FMT_NONE };
- AVBufferSinkParams *params = av_malloc(sizeof(AVBufferSinkParams));
- if (!params)
- return NULL;
-
- params->pixel_fmts = pixel_fmts;
- return params;
-}
-
-AVABufferSinkParams *av_abuffersink_params_alloc(void)
-{
- AVABufferSinkParams *params = av_mallocz(sizeof(AVABufferSinkParams));
-
- if (!params)
- return NULL;
- return params;
-}
-#endif
-
static av_cold int common_init(AVFilterContext *ctx)
{
BufferSinkContext *buf = ctx->priv;
diff --git a/libavfilter/buffersink.h b/libavfilter/buffersink.h
index 01e7c747d8e..64e08de53ee 100644
--- a/libavfilter/buffersink.h
+++ b/libavfilter/buffersink.h
@@ -94,42 +94,6 @@ int av_buffersink_get_frame_flags(AVFilterContext *ctx, AVFrame *frame, int flag
*/
#define AV_BUFFERSINK_FLAG_NO_REQUEST 2
-#if FF_API_BUFFERSINK_ALLOC
-/**
- * Deprecated and unused struct to use for initializing a buffersink context.
- */
-typedef struct AVBufferSinkParams {
- const enum AVPixelFormat *pixel_fmts; ///< list of allowed pixel formats, terminated by AV_PIX_FMT_NONE
-} AVBufferSinkParams;
-
-/**
- * Create an AVBufferSinkParams structure.
- *
- * Must be freed with av_free().
- */
-attribute_deprecated
-AVBufferSinkParams *av_buffersink_params_alloc(void);
-
-/**
- * Deprecated and unused struct to use for initializing an abuffersink context.
- */
-typedef struct AVABufferSinkParams {
- const enum AVSampleFormat *sample_fmts; ///< list of allowed sample formats, terminated by AV_SAMPLE_FMT_NONE
- const int64_t *channel_layouts; ///< list of allowed channel layouts, terminated by -1
- const int *channel_counts; ///< list of allowed channel counts, terminated by -1
- int all_channel_counts; ///< if not 0, accept any channel count or layout
- int *sample_rates; ///< list of allowed sample rates, terminated by -1
-} AVABufferSinkParams;
-
-/**
- * Create an AVABufferSinkParams structure.
- *
- * Must be freed with av_free().
- */
-attribute_deprecated
-AVABufferSinkParams *av_abuffersink_params_alloc(void);
-#endif
-
/**
* Set the frame size for an audio buffer sink.
*
diff --git a/libavfilter/version_major.h b/libavfilter/version_major.h
index 655e3d119d2..5a8bf4eda21 100644
--- a/libavfilter/version_major.h
+++ b/libavfilter/version_major.h
@@ -35,7 +35,6 @@
* the public API and may change, break or disappear at any time.
*/
-#define FF_API_BUFFERSINK_ALLOC (LIBAVFILTER_VERSION_MAJOR < 9)
#define FF_API_PAD_COUNT (LIBAVFILTER_VERSION_MAJOR < 9)
#endif /* AVFILTER_VERSION_MAJOR_H */
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 23/33] avfilter: remove FF_API_PAD_COUNT
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (21 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 22/33] avfilter: remove FF_API_BUFFERSINK_ALLOC Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 24/33] avdevice: remove FF_API_DEVICE_CAPABILITIES Anton Khirnov
` (9 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavfilter/avfilter.c | 21 ---------------------
libavfilter/avfilter.h | 10 ----------
libavfilter/version_major.h | 2 --
3 files changed, 33 deletions(-)
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index c2ecdffa6f5..ed363351add 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -560,27 +560,6 @@ int avfilter_process_command(AVFilterContext *filter, const char *cmd, const cha
return AVERROR(ENOSYS);
}
-#if FF_API_PAD_COUNT
-int avfilter_pad_count(const AVFilterPad *pads)
-{
- const AVFilter *filter;
- void *opaque = NULL;
-
- if (!pads)
- return 0;
-
- while (filter = av_filter_iterate(&opaque)) {
- if (pads == filter->inputs)
- return filter->nb_inputs;
- if (pads == filter->outputs)
- return filter->nb_outputs;
- }
-
- av_assert0(!"AVFilterPad list not from a filter");
- return AVERROR_BUG;
-}
-#endif
-
unsigned avfilter_filter_pad_count(const AVFilter *filter, int is_output)
{
return is_output ? filter->nb_outputs : filter->nb_inputs;
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index c2ec7a4b5fc..333eeb31c3d 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -76,16 +76,6 @@ typedef struct AVFilterPad AVFilterPad;
typedef struct AVFilterFormats AVFilterFormats;
typedef struct AVFilterChannelLayouts AVFilterChannelLayouts;
-#if FF_API_PAD_COUNT
-/**
- * Get the number of elements in an AVFilter's inputs or outputs array.
- *
- * @deprecated Use avfilter_filter_pad_count() instead.
- */
-attribute_deprecated
-int avfilter_pad_count(const AVFilterPad *pads);
-#endif
-
/**
* Get the name of an AVFilterPad.
*
diff --git a/libavfilter/version_major.h b/libavfilter/version_major.h
index 5a8bf4eda21..cb2238ffdd0 100644
--- a/libavfilter/version_major.h
+++ b/libavfilter/version_major.h
@@ -35,6 +35,4 @@
* the public API and may change, break or disappear at any time.
*/
-#define FF_API_PAD_COUNT (LIBAVFILTER_VERSION_MAJOR < 9)
-
#endif /* AVFILTER_VERSION_MAJOR_H */
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 24/33] avdevice: remove FF_API_DEVICE_CAPABILITIES
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (22 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 23/33] avfilter: remove FF_API_PAD_COUNT Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 25/33] avutil: remove FF_API_D2STR Anton Khirnov
` (8 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavdevice/avdevice.c | 19 ------
libavdevice/avdevice.h | 130 ------------------------------------
libavdevice/version_major.h | 1 -
3 files changed, 150 deletions(-)
diff --git a/libavdevice/avdevice.c b/libavdevice/avdevice.c
index b47f89c4bf2..38110ddfdb2 100644
--- a/libavdevice/avdevice.c
+++ b/libavdevice/avdevice.c
@@ -21,12 +21,6 @@
#include "internal.h"
#include "libavformat/mux.h"
-#if FF_API_DEVICE_CAPABILITIES
-const AVOption av_device_capabilities[] = {
- { NULL }
-};
-#endif
-
int avdevice_app_to_dev_control_message(struct AVFormatContext *s, enum AVAppToDevMessageType type,
void *data, size_t data_size)
{
@@ -43,19 +37,6 @@ int avdevice_dev_to_app_control_message(struct AVFormatContext *s, enum AVDevToA
return s->control_message_cb(s, type, data, data_size);
}
-#if FF_API_DEVICE_CAPABILITIES
-int avdevice_capabilities_create(AVDeviceCapabilitiesQuery **caps, AVFormatContext *s,
- AVDictionary **device_options)
-{
- return AVERROR(ENOSYS);
-}
-
-void avdevice_capabilities_free(AVDeviceCapabilitiesQuery **caps, AVFormatContext *s)
-{
- return;
-}
-#endif
-
int avdevice_list_devices(AVFormatContext *s, AVDeviceInfoList **device_list)
{
int ret;
diff --git a/libavdevice/avdevice.h b/libavdevice/avdevice.h
index 185593053f7..887fd5e3c80 100644
--- a/libavdevice/avdevice.h
+++ b/libavdevice/avdevice.h
@@ -327,136 +327,6 @@ int avdevice_dev_to_app_control_message(struct AVFormatContext *s,
enum AVDevToAppMessageType type,
void *data, size_t data_size);
-#if FF_API_DEVICE_CAPABILITIES
-/**
- * Following API allows user to probe device capabilities (supported codecs,
- * pixel formats, sample formats, resolutions, channel counts, etc).
- * It is build on top op AVOption API.
- * Queried capabilities make it possible to set up converters of video or audio
- * parameters that fit to the device.
- *
- * List of capabilities that can be queried:
- * - Capabilities valid for both audio and video devices:
- * - codec: supported audio/video codecs.
- * type: AV_OPT_TYPE_INT (AVCodecID value)
- * - Capabilities valid for audio devices:
- * - sample_format: supported sample formats.
- * type: AV_OPT_TYPE_INT (AVSampleFormat value)
- * - sample_rate: supported sample rates.
- * type: AV_OPT_TYPE_INT
- * - channels: supported number of channels.
- * type: AV_OPT_TYPE_INT
- * - channel_layout: supported channel layouts.
- * type: AV_OPT_TYPE_INT64
- * - Capabilities valid for video devices:
- * - pixel_format: supported pixel formats.
- * type: AV_OPT_TYPE_INT (AVPixelFormat value)
- * - window_size: supported window sizes (describes size of the window size presented to the user).
- * type: AV_OPT_TYPE_IMAGE_SIZE
- * - frame_size: supported frame sizes (describes size of provided video frames).
- * type: AV_OPT_TYPE_IMAGE_SIZE
- * - fps: supported fps values
- * type: AV_OPT_TYPE_RATIONAL
- *
- * Value of the capability may be set by user using av_opt_set() function
- * and AVDeviceCapabilitiesQuery object. Following queries will
- * limit results to the values matching already set capabilities.
- * For example, setting a codec may impact number of formats or fps values
- * returned during next query. Setting invalid value may limit results to zero.
- *
- * Example of the usage basing on opengl output device:
- *
- * @code
- * AVFormatContext *oc = NULL;
- * AVDeviceCapabilitiesQuery *caps = NULL;
- * AVOptionRanges *ranges;
- * int ret;
- *
- * if ((ret = avformat_alloc_output_context2(&oc, NULL, "opengl", NULL)) < 0)
- * goto fail;
- * if (avdevice_capabilities_create(&caps, oc, NULL) < 0)
- * goto fail;
- *
- * //query codecs
- * if (av_opt_query_ranges(&ranges, caps, "codec", AV_OPT_MULTI_COMPONENT_RANGE)) < 0)
- * goto fail;
- * //pick codec here and set it
- * av_opt_set(caps, "codec", AV_CODEC_ID_RAWVIDEO, 0);
- *
- * //query format
- * if (av_opt_query_ranges(&ranges, caps, "pixel_format", AV_OPT_MULTI_COMPONENT_RANGE)) < 0)
- * goto fail;
- * //pick format here and set it
- * av_opt_set(caps, "pixel_format", AV_PIX_FMT_YUV420P, 0);
- *
- * //query and set more capabilities
- *
- * fail:
- * //clean up code
- * avdevice_capabilities_free(&query, oc);
- * avformat_free_context(oc);
- * @endcode
- */
-
-/**
- * Structure describes device capabilities.
- *
- * It is used by devices in conjunction with av_device_capabilities AVOption table
- * to implement capabilities probing API based on AVOption API. Should not be used directly.
- */
-typedef struct AVDeviceCapabilitiesQuery {
- const AVClass *av_class;
- AVFormatContext *device_context;
- enum AVCodecID codec;
- enum AVSampleFormat sample_format;
- enum AVPixelFormat pixel_format;
- int sample_rate;
- int channels;
- int64_t channel_layout;
- int window_width;
- int window_height;
- int frame_width;
- int frame_height;
- AVRational fps;
-} AVDeviceCapabilitiesQuery;
-
-/**
- * AVOption table used by devices to implement device capabilities API. Should not be used by a user.
- */
-attribute_deprecated
-extern const AVOption av_device_capabilities[];
-
-/**
- * Initialize capabilities probing API based on AVOption API.
- *
- * avdevice_capabilities_free() must be called when query capabilities API is
- * not used anymore.
- *
- * @param[out] caps Device capabilities data. Pointer to a NULL pointer must be passed.
- * @param s Context of the device.
- * @param device_options An AVDictionary filled with device-private options.
- * On return this parameter will be destroyed and replaced with a dict
- * containing options that were not found. May be NULL.
- * The same options must be passed later to avformat_write_header() for output
- * devices or avformat_open_input() for input devices, or at any other place
- * that affects device-private options.
- *
- * @return >= 0 on success, negative otherwise.
- */
-attribute_deprecated
-int avdevice_capabilities_create(AVDeviceCapabilitiesQuery **caps, AVFormatContext *s,
- AVDictionary **device_options);
-
-/**
- * Free resources created by avdevice_capabilities_create()
- *
- * @param caps Device capabilities data to be freed.
- * @param s Context of the device.
- */
-attribute_deprecated
-void avdevice_capabilities_free(AVDeviceCapabilitiesQuery **caps, AVFormatContext *s);
-#endif
-
/**
* Structure describes basic parameters of the device.
*/
diff --git a/libavdevice/version_major.h b/libavdevice/version_major.h
index d255ff6992d..571257f31d7 100644
--- a/libavdevice/version_major.h
+++ b/libavdevice/version_major.h
@@ -32,6 +32,5 @@
* dropped at a future version bump. The defines themselves are not part of
* the public API and may change, break or disappear at any time.
*/
-#define FF_API_DEVICE_CAPABILITIES (LIBAVDEVICE_VERSION_MAJOR < 60)
#endif /* AVDEVICE_VERSION_MAJOR_H */
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 25/33] avutil: remove FF_API_D2STR
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (23 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 24/33] avdevice: remove FF_API_DEVICE_CAPABILITIES Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 26/33] avutil: remove FF_API_DECLARE_ALIGNED Anton Khirnov
` (7 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavutil/avstring.c | 10 ----------
libavutil/avstring.h | 9 ---------
libavutil/tests/avstring.c | 16 ----------------
libavutil/version.h | 1 -
4 files changed, 36 deletions(-)
diff --git a/libavutil/avstring.c b/libavutil/avstring.c
index 5ddbe9219e8..e460b5be7f3 100644
--- a/libavutil/avstring.c
+++ b/libavutil/avstring.c
@@ -139,16 +139,6 @@ end:
return p;
}
-#if FF_API_D2STR
-char *av_d2str(double d)
-{
- char *str = av_malloc(16);
- if (str)
- snprintf(str, 16, "%f", d);
- return str;
-}
-#endif
-
#define WHITESPACES " \n\t\r"
char *av_get_token(const char **buf, const char *term)
diff --git a/libavutil/avstring.h b/libavutil/avstring.h
index 74aa4cd0e4e..e2602637630 100644
--- a/libavutil/avstring.h
+++ b/libavutil/avstring.h
@@ -157,15 +157,6 @@ static inline size_t av_strnlen(const char *s, size_t len)
*/
char *av_asprintf(const char *fmt, ...) av_printf_format(1, 2);
-#if FF_API_D2STR
-/**
- * Convert a number to an av_malloced string.
- * @deprecated use av_asprintf() with "%f" or a more specific format
- */
-attribute_deprecated
-char *av_d2str(double d);
-#endif
-
/**
* Unescape the given string until a non escaped terminating char,
* and return the token corresponding to the unescaped string.
diff --git a/libavutil/tests/avstring.c b/libavutil/tests/avstring.c
index 37a2cf18334..bc0bde358d5 100644
--- a/libavutil/tests/avstring.c
+++ b/libavutil/tests/avstring.c
@@ -109,21 +109,5 @@ int main(void)
TEST_STRIREPLACE(haystack, needle [2], "Education consists mainly in what we have instead.");
TEST_STRIREPLACE(haystack, needle [1], "Education consists mainly in what we have instead");
-#if FF_API_D2STR
-FF_DISABLE_DEPRECATION_WARNINGS
- /*Testing av_d2str()*/
- #define TEST_D2STR(value, expected) \
- if((ptr = av_d2str(value)) == NULL){ \
- printf("error, received null pointer!\n"); \
- } else { \
- if(strcmp(ptr, expected) != 0) \
- printf( "expected: %s, received: %s\n", expected, ptr); \
- av_free(ptr); \
- }
- TEST_D2STR(0 , "0.000000");
- TEST_D2STR(-1.2333234, "-1.233323");
- TEST_D2STR(-1.2333237, "-1.233324");
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
return 0;
}
diff --git a/libavutil/version.h b/libavutil/version.h
index 60f96af5df8..38769962cc3 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -105,7 +105,6 @@
* @{
*/
-#define FF_API_D2STR (LIBAVUTIL_VERSION_MAJOR < 58)
#define FF_API_DECLARE_ALIGNED (LIBAVUTIL_VERSION_MAJOR < 58)
#define FF_API_COLORSPACE_NAME (LIBAVUTIL_VERSION_MAJOR < 58)
#define FF_API_AV_MALLOCZ_ARRAY (LIBAVUTIL_VERSION_MAJOR < 58)
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 26/33] avutil: remove FF_API_DECLARE_ALIGNED
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (24 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 25/33] avutil: remove FF_API_D2STR Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 27/33] avutil: remove FF_API_COLORSPACE_NAME Anton Khirnov
` (6 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavcodec/qdmc.c | 1 +
libavutil/mem.h | 80 ----------------------------------------
libavutil/mem_internal.h | 2 -
libavutil/version.h | 1 -
4 files changed, 1 insertion(+), 83 deletions(-)
diff --git a/libavcodec/qdmc.c b/libavcodec/qdmc.c
index 4b582dc3491..081c4dd46f0 100644
--- a/libavcodec/qdmc.c
+++ b/libavcodec/qdmc.c
@@ -25,6 +25,7 @@
#define BITSTREAM_READER_LE
#include "libavutil/channel_layout.h"
+#include "libavutil/mem_internal.h"
#include "libavutil/thread.h"
#include "libavutil/tx.h"
diff --git a/libavutil/mem.h b/libavutil/mem.h
index c9c4fcf1ff0..b093b3b5cb0 100644
--- a/libavutil/mem.h
+++ b/libavutil/mem.h
@@ -51,86 +51,6 @@
* @{
*/
-#if FF_API_DECLARE_ALIGNED
-/**
- *
- * @defgroup lavu_mem_macros Alignment Macros
- * Helper macros for declaring aligned variables.
- * @{
- */
-
-/**
- * @def DECLARE_ALIGNED(n,t,v)
- * Declare a variable that is aligned in memory.
- *
- * @code{.c}
- * DECLARE_ALIGNED(16, uint16_t, aligned_int) = 42;
- * DECLARE_ALIGNED(32, uint8_t, aligned_array)[128];
- *
- * // The default-alignment equivalent would be
- * uint16_t aligned_int = 42;
- * uint8_t aligned_array[128];
- * @endcode
- *
- * @param n Minimum alignment in bytes
- * @param t Type of the variable (or array element)
- * @param v Name of the variable
- */
-
-/**
- * @def DECLARE_ASM_ALIGNED(n,t,v)
- * Declare an aligned variable appropriate for use in inline assembly code.
- *
- * @code{.c}
- * DECLARE_ASM_ALIGNED(16, uint64_t, pw_08) = UINT64_C(0x0008000800080008);
- * @endcode
- *
- * @param n Minimum alignment in bytes
- * @param t Type of the variable (or array element)
- * @param v Name of the variable
- */
-
-/**
- * @def DECLARE_ASM_CONST(n,t,v)
- * Declare a static constant aligned variable appropriate for use in inline
- * assembly code.
- *
- * @code{.c}
- * DECLARE_ASM_CONST(16, uint64_t, pw_08) = UINT64_C(0x0008000800080008);
- * @endcode
- *
- * @param n Minimum alignment in bytes
- * @param t Type of the variable (or array element)
- * @param v Name of the variable
- */
-
-#if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1110 || defined(__SUNPRO_C)
- #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
- #define DECLARE_ASM_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
- #define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v
-#elif defined(__DJGPP__)
- #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (FFMIN(n, 16)))) v
- #define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v
- #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v
-#elif defined(__GNUC__) || defined(__clang__)
- #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
- #define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (n))) v
- #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v
-#elif defined(_MSC_VER)
- #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v
- #define DECLARE_ASM_ALIGNED(n,t,v) __declspec(align(n)) t v
- #define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v
-#else
- #define DECLARE_ALIGNED(n,t,v) t v
- #define DECLARE_ASM_ALIGNED(n,t,v) t v
- #define DECLARE_ASM_CONST(n,t,v) static const t v
-#endif
-
-/**
- * @}
- */
-#endif
-
/**
* @defgroup lavu_mem_attrs Function Attributes
* Function attributes applicable to memory handling functions.
diff --git a/libavutil/mem_internal.h b/libavutil/mem_internal.h
index 955e31a6981..2448c606f19 100644
--- a/libavutil/mem_internal.h
+++ b/libavutil/mem_internal.h
@@ -30,7 +30,6 @@
#include "mem.h"
#include "version.h"
-#if !FF_API_DECLARE_ALIGNED
/**
* @def DECLARE_ALIGNED(n,t,v)
* Declare a variable that is aligned in memory.
@@ -97,7 +96,6 @@
#define DECLARE_ASM_ALIGNED(n,t,v) t v
#define DECLARE_ASM_CONST(n,t,v) static const t v
#endif
-#endif
// Some broken preprocessors need a second expansion
// to be forced to tokenize __VA_ARGS__
diff --git a/libavutil/version.h b/libavutil/version.h
index 38769962cc3..6014743947c 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -105,7 +105,6 @@
* @{
*/
-#define FF_API_DECLARE_ALIGNED (LIBAVUTIL_VERSION_MAJOR < 58)
#define FF_API_COLORSPACE_NAME (LIBAVUTIL_VERSION_MAJOR < 58)
#define FF_API_AV_MALLOCZ_ARRAY (LIBAVUTIL_VERSION_MAJOR < 58)
#define FF_API_FIFO_PEEK2 (LIBAVUTIL_VERSION_MAJOR < 58)
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 27/33] avutil: remove FF_API_COLORSPACE_NAME
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (25 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 26/33] avutil: remove FF_API_DECLARE_ALIGNED Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 28/33] avutil: remove FF_API_AV_MALLOCZ_ARRAY Anton Khirnov
` (5 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavutil/frame.c | 17 -----------------
libavutil/frame.h | 9 ---------
libavutil/version.h | 1 -
3 files changed, 27 deletions(-)
diff --git a/libavutil/frame.c b/libavutil/frame.c
index fa9b11aa543..3198a50f67f 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -35,23 +35,6 @@
av_get_channel_layout_nb_channels((frame)->channel_layout))
#endif
-#if FF_API_COLORSPACE_NAME
-const char *av_get_colorspace_name(enum AVColorSpace val)
-{
- static const char * const name[] = {
- [AVCOL_SPC_RGB] = "GBR",
- [AVCOL_SPC_BT709] = "bt709",
- [AVCOL_SPC_FCC] = "fcc",
- [AVCOL_SPC_BT470BG] = "bt470bg",
- [AVCOL_SPC_SMPTE170M] = "smpte170m",
- [AVCOL_SPC_SMPTE240M] = "smpte240m",
- [AVCOL_SPC_YCOCG] = "YCgCo",
- };
- if ((unsigned)val >= FF_ARRAY_ELEMS(name))
- return NULL;
- return name[val];
-}
-#endif
static void get_frame_defaults(AVFrame *frame)
{
memset(frame, 0, sizeof(*frame));
diff --git a/libavutil/frame.h b/libavutil/frame.h
index bbe909ee2da..1172d013a3d 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -720,15 +720,6 @@ typedef struct AVFrame {
} AVFrame;
-#if FF_API_COLORSPACE_NAME
-/**
- * Get the name of a colorspace.
- * @return a static string identifying the colorspace; can be NULL.
- * @deprecated use av_color_space_name()
- */
-attribute_deprecated
-const char *av_get_colorspace_name(enum AVColorSpace val);
-#endif
/**
* Allocate an AVFrame and set its fields to default values. The resulting
* struct must be freed using av_frame_free().
diff --git a/libavutil/version.h b/libavutil/version.h
index 6014743947c..700af5d8749 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -105,7 +105,6 @@
* @{
*/
-#define FF_API_COLORSPACE_NAME (LIBAVUTIL_VERSION_MAJOR < 58)
#define FF_API_AV_MALLOCZ_ARRAY (LIBAVUTIL_VERSION_MAJOR < 58)
#define FF_API_FIFO_PEEK2 (LIBAVUTIL_VERSION_MAJOR < 58)
#define FF_API_FIFO_OLD_API (LIBAVUTIL_VERSION_MAJOR < 58)
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 28/33] avutil: remove FF_API_AV_MALLOCZ_ARRAY
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (26 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 27/33] avutil: remove FF_API_COLORSPACE_NAME Anton Khirnov
@ 2023-02-04 10:41 ` Anton Khirnov
2023-02-04 10:42 ` [FFmpeg-devel] [PATCH v2 29/33] avutil/{color_utils, csp}: merge color_utils into csp and expose API Anton Khirnov
` (4 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:41 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavutil/mem.c | 10 ----------
libavutil/mem.h | 8 --------
libavutil/version.h | 1 -
3 files changed, 19 deletions(-)
diff --git a/libavutil/mem.c b/libavutil/mem.c
index 18aff5291f0..36b8940a0cf 100644
--- a/libavutil/mem.c
+++ b/libavutil/mem.c
@@ -212,16 +212,6 @@ void *av_malloc_array(size_t nmemb, size_t size)
return av_malloc(result);
}
-#if FF_API_AV_MALLOCZ_ARRAY
-void *av_mallocz_array(size_t nmemb, size_t size)
-{
- size_t result;
- if (size_mult(nmemb, size, &result) < 0)
- return NULL;
- return av_mallocz(result);
-}
-#endif
-
void *av_realloc_array(void *ptr, size_t nmemb, size_t size)
{
size_t result;
diff --git a/libavutil/mem.h b/libavutil/mem.h
index b093b3b5cb0..62b4ca6e50e 100644
--- a/libavutil/mem.h
+++ b/libavutil/mem.h
@@ -159,14 +159,6 @@ av_alloc_size(1, 2) void *av_malloc_array(size_t nmemb, size_t size);
*/
void *av_calloc(size_t nmemb, size_t size) av_malloc_attrib av_alloc_size(1, 2);
-#if FF_API_AV_MALLOCZ_ARRAY
-/**
- * @deprecated use av_calloc()
- */
-attribute_deprecated
-void *av_mallocz_array(size_t nmemb, size_t size) av_malloc_attrib av_alloc_size(1, 2);
-#endif
-
/**
* Allocate, reallocate, or free a block of memory.
*
diff --git a/libavutil/version.h b/libavutil/version.h
index 700af5d8749..3bad472227a 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -105,7 +105,6 @@
* @{
*/
-#define FF_API_AV_MALLOCZ_ARRAY (LIBAVUTIL_VERSION_MAJOR < 58)
#define FF_API_FIFO_PEEK2 (LIBAVUTIL_VERSION_MAJOR < 58)
#define FF_API_FIFO_OLD_API (LIBAVUTIL_VERSION_MAJOR < 58)
#define FF_API_XVMC (LIBAVUTIL_VERSION_MAJOR < 58)
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 29/33] avutil/{color_utils, csp}: merge color_utils into csp and expose API
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (27 preceding siblings ...)
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 28/33] avutil: remove FF_API_AV_MALLOCZ_ARRAY Anton Khirnov
@ 2023-02-04 10:42 ` Anton Khirnov
2023-02-04 16:27 ` Ronald S. Bultje
2023-02-04 10:42 ` [FFmpeg-devel] [PATCH v2 30/33] avutil/version: postpone the remaining API deprecations Anton Khirnov
` (3 subsequent siblings)
32 siblings, 1 reply; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:42 UTC (permalink / raw)
To: ffmpeg-devel
From: Leo Izen <leo.izen@gmail.com>
libavutil/color_utils contains some avpriv_ symbols that map
enum AVTransferCharacteristic values to gamma-curve approximations and
to the actual transfer functions to invert them (i.e. -> linear).
There's two issues with this:
(1) avpriv is evil and should be avoided whenever possible
(2) libavutil/csp.h exposes a public API for handling color that
already handles primaries and matricies
I don't see any reason this API has to be private, so this commit takes
the functionality from avutil/color_utils and merges it into avutil/csp
with an exposed av_ API rather than the previous avpriv_ API.
Every reference to the previous API has been updated to point to the
new one. color_utils.h has been deleted as well. This should not break
any applications as it only contained avpriv_ symbols in the first
place, so nothing in that header could be referenced by other
applications.
Signed-off-by: Leo Izen <leo.izen@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
---
doc/APIchanges | 4 +
libavcodec/exr.c | 8 +-
libavcodec/fflcms2.c | 1 -
libavcodec/pngenc.c | 3 +-
libavformat/movenc.c | 7 +-
libavutil/Makefile | 1 -
libavutil/color_utils.c | 234 ----------------------------------
libavutil/color_utils.h | 56 --------
libavutil/csp.c | 172 +++++++++++++++++++++++++
libavutil/csp.h | 39 ++++++
libavutil/tests/color_utils.c | 4 +-
11 files changed, 225 insertions(+), 304 deletions(-)
delete mode 100644 libavutil/color_utils.c
delete mode 100644 libavutil/color_utils.h
diff --git a/doc/APIchanges b/doc/APIchanges
index b1181ec60a3..385385bda8d 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -14,6 +14,10 @@ libavutil: 2021-04-27
API changes, most recent first:
+2023-02-xx - xxxxxxxxxx - lavu 58.0.100 - csp.h
+ Add av_csp_approximate_trc_gamma() and av_csp_trc_func_from_id().
+ Add av_csp_trc_function.
+
2023-02-xx - xxxxxxxxxx - lavc 60.0.100 - avcodec.h
avcodec_decode_subtitle2() now accepts const AVPacket*.
diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index 6a0af96ce4f..2f1766c17bf 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -36,11 +36,11 @@
#include "libavutil/avassert.h"
#include "libavutil/common.h"
+#include "libavutil/csp.h"
#include "libavutil/imgutils.h"
#include "libavutil/intfloat.h"
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
-#include "libavutil/color_utils.h"
#include "libavutil/half2float.h"
#include "avcodec.h"
@@ -1189,7 +1189,7 @@ static int decode_block(AVCodecContext *avctx, void *tdata,
int i, x, buf_size = s->buf_size;
int c, rgb_channel_count;
float one_gamma = 1.0f / s->gamma;
- avpriv_trc_function trc_func = avpriv_get_trc_function_from_trc(s->apply_trc_type);
+ av_csp_trc_function trc_func = av_csp_trc_func_from_id(s->apply_trc_type);
int ret;
line_offset = AV_RL64(s->gb.buffer + jobnr * 8);
@@ -2215,7 +2215,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
uint32_t i;
union av_intfloat32 t;
float one_gamma = 1.0f / s->gamma;
- avpriv_trc_function trc_func = NULL;
+ av_csp_trc_function trc_func = NULL;
ff_init_half2float_tables(&s->h2f_tables);
@@ -2227,7 +2227,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
ff_bswapdsp_init(&s->bbdsp);
#endif
- trc_func = avpriv_get_trc_function_from_trc(s->apply_trc_type);
+ trc_func = av_csp_trc_func_from_id(s->apply_trc_type);
if (trc_func) {
for (i = 0; i < 65536; ++i) {
t.i = half2float(i, &s->h2f_tables);
diff --git a/libavcodec/fflcms2.c b/libavcodec/fflcms2.c
index fd370fb310f..5443f178bc9 100644
--- a/libavcodec/fflcms2.c
+++ b/libavcodec/fflcms2.c
@@ -17,7 +17,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "libavutil/color_utils.h"
#include "libavutil/csp.h"
#include "fflcms2.h"
diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index 2393161c3b9..ac27eebf3a7 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -29,7 +29,6 @@
#include "zlib_wrapper.h"
#include "libavutil/avassert.h"
-#include "libavutil/color_utils.h"
#include "libavutil/crc.h"
#include "libavutil/csp.h"
#include "libavutil/libm.h"
@@ -317,7 +316,7 @@ static int png_get_chrm(enum AVColorPrimaries prim, uint8_t *buf)
static int png_get_gama(enum AVColorTransferCharacteristic trc, uint8_t *buf)
{
- double gamma = avpriv_get_gamma_from_trc(trc);
+ double gamma = av_csp_approximate_trc_gamma(trc);
if (gamma <= 1e-6)
return 0;
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 87ee7a921f0..aca8b9d5853 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -47,6 +47,7 @@
#include "internal.h"
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
+#include "libavutil/csp.h"
#include "libavutil/intfloat.h"
#include "libavutil/mathematics.h"
#include "libavutil/libm.h"
@@ -56,7 +57,6 @@
#include "libavutil/stereo3d.h"
#include "libavutil/timecode.h"
#include "libavutil/dovi_meta.h"
-#include "libavutil/color_utils.h"
#include "libavutil/uuid.h"
#include "hevc.h"
#include "rtpenc.h"
@@ -2011,9 +2011,8 @@ static int mov_write_pasp_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_gama_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track, double gamma)
{
uint32_t gama = 0;
- if (gamma <= 0.0) {
- gamma = avpriv_get_gamma_from_trc(track->par->color_trc);
- }
+ if (gamma <= 0.0)
+ gamma = av_csp_approximate_trc_gamma(track->par->color_trc);
av_log(s, AV_LOG_DEBUG, "gamma value %g\n", gamma);
if (gamma > 1e-6) {
diff --git a/libavutil/Makefile b/libavutil/Makefile
index 29b06665f50..dc9012f9a83 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -114,7 +114,6 @@ OBJS = adler32.o \
cast5.o \
camellia.o \
channel_layout.o \
- color_utils.o \
cpu.o \
crc.o \
csp.o \
diff --git a/libavutil/color_utils.c b/libavutil/color_utils.c
deleted file mode 100644
index 5e221fb7983..00000000000
--- a/libavutil/color_utils.c
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * Copyright (c) 2015 Kevin Wheatley <kevin.j.wheatley@gmail.com>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stddef.h>
-#include <math.h>
-
-#include "libavutil/color_utils.h"
-#include "libavutil/pixfmt.h"
-
-double avpriv_get_gamma_from_trc(enum AVColorTransferCharacteristic trc)
-{
- double gamma;
- switch (trc) {
- case AVCOL_TRC_BT709:
- case AVCOL_TRC_SMPTE170M:
- case AVCOL_TRC_SMPTE240M:
- case AVCOL_TRC_BT1361_ECG:
- case AVCOL_TRC_BT2020_10:
- case AVCOL_TRC_BT2020_12:
- /* these share a segmented TRC, but gamma 1.961 is a close
- approximation, and also more correct for decoding content */
- gamma = 1.961;
- break;
- case AVCOL_TRC_GAMMA22:
- case AVCOL_TRC_IEC61966_2_1:
- gamma = 2.2;
- break;
- case AVCOL_TRC_GAMMA28:
- gamma = 2.8;
- break;
- case AVCOL_TRC_LINEAR:
- gamma = 1.0;
- break;
- default:
- gamma = 0.0; // Unknown value representation
- }
- return gamma;
-}
-
-#define BT709_alpha 1.099296826809442
-#define BT709_beta 0.018053968510807
-
-static double avpriv_trc_bt709(double Lc)
-{
- const double a = BT709_alpha;
- const double b = BT709_beta;
-
- return (0.0 > Lc) ? 0.0
- : ( b > Lc) ? 4.500 * Lc
- : a * pow(Lc, 0.45) - (a - 1.0);
-}
-
-static double avpriv_trc_gamma22(double Lc)
-{
- return (0.0 > Lc) ? 0.0 : pow(Lc, 1.0/ 2.2);
-}
-
-static double avpriv_trc_gamma28(double Lc)
-{
- return (0.0 > Lc) ? 0.0 : pow(Lc, 1.0/ 2.8);
-}
-
-static double avpriv_trc_smpte240M(double Lc)
-{
- const double a = 1.1115;
- const double b = 0.0228;
-
- return (0.0 > Lc) ? 0.0
- : ( b > Lc) ? 4.000 * Lc
- : a * pow(Lc, 0.45) - (a - 1.0);
-}
-
-static double avpriv_trc_linear(double Lc)
-{
- return Lc;
-}
-
-static double avpriv_trc_log(double Lc)
-{
- return (0.01 > Lc) ? 0.0 : 1.0 + log10(Lc) / 2.0;
-}
-
-static double avpriv_trc_log_sqrt(double Lc)
-{
- // sqrt(10) / 1000
- return (0.00316227766 > Lc) ? 0.0 : 1.0 + log10(Lc) / 2.5;
-}
-
-static double avpriv_trc_iec61966_2_4(double Lc)
-{
- const double a = BT709_alpha;
- const double b = BT709_beta;
-
- return (-b >= Lc) ? -a * pow(-Lc, 0.45) + (a - 1.0)
- : ( b > Lc) ? 4.500 * Lc
- : a * pow( Lc, 0.45) - (a - 1.0);
-}
-
-static double avpriv_trc_bt1361(double Lc)
-{
- const double a = BT709_alpha;
- const double b = BT709_beta;
-
- return (-0.0045 >= Lc) ? -(a * pow(-4.0 * Lc, 0.45) + (a - 1.0)) / 4.0
- : ( b > Lc) ? 4.500 * Lc
- : a * pow( Lc, 0.45) - (a - 1.0);
-}
-
-static double avpriv_trc_iec61966_2_1(double Lc)
-{
- const double a = 1.055;
- const double b = 0.0031308;
-
- return (0.0 > Lc) ? 0.0
- : ( b > Lc) ? 12.92 * Lc
- : a * pow(Lc, 1.0 / 2.4) - (a - 1.0);
-}
-
-static double avpriv_trc_smpte_st2084(double Lc)
-{
- const double c1 = 3424.0 / 4096.0; // c3-c2 + 1
- const double c2 = 32.0 * 2413.0 / 4096.0;
- const double c3 = 32.0 * 2392.0 / 4096.0;
- const double m = 128.0 * 2523.0 / 4096.0;
- const double n = 0.25 * 2610.0 / 4096.0;
- const double L = Lc / 10000.0;
- const double Ln = pow(L, n);
-
- return (0.0 > Lc) ? 0.0
- : pow((c1 + c2 * Ln) / (1.0 + c3 * Ln), m);
-
-}
-
-static double avpriv_trc_smpte_st428_1(double Lc)
-{
- return (0.0 > Lc) ? 0.0
- : pow(48.0 * Lc / 52.37, 1.0 / 2.6);
-}
-
-
-static double avpriv_trc_arib_std_b67(double Lc) {
- // The function uses the definition from HEVC, which assumes that the peak
- // white is input level = 1. (this is equivalent to scaling E = Lc * 12 and
- // using the definition from the ARIB STD-B67 spec)
- const double a = 0.17883277;
- const double b = 0.28466892;
- const double c = 0.55991073;
- return (0.0 > Lc) ? 0.0 :
- (Lc <= 1.0 / 12.0 ? sqrt(3.0 * Lc) : a * log(12.0 * Lc - b) + c);
-}
-
-avpriv_trc_function avpriv_get_trc_function_from_trc(enum AVColorTransferCharacteristic trc)
-{
- avpriv_trc_function func = NULL;
- switch (trc) {
- case AVCOL_TRC_BT709:
- case AVCOL_TRC_SMPTE170M:
- case AVCOL_TRC_BT2020_10:
- case AVCOL_TRC_BT2020_12:
- func = avpriv_trc_bt709;
- break;
-
- case AVCOL_TRC_GAMMA22:
- func = avpriv_trc_gamma22;
- break;
- case AVCOL_TRC_GAMMA28:
- func = avpriv_trc_gamma28;
- break;
-
- case AVCOL_TRC_SMPTE240M:
- func = avpriv_trc_smpte240M;
- break;
-
- case AVCOL_TRC_LINEAR:
- func = avpriv_trc_linear;
- break;
-
- case AVCOL_TRC_LOG:
- func = avpriv_trc_log;
- break;
-
- case AVCOL_TRC_LOG_SQRT:
- func = avpriv_trc_log_sqrt;
- break;
-
- case AVCOL_TRC_IEC61966_2_4:
- func = avpriv_trc_iec61966_2_4;
- break;
-
- case AVCOL_TRC_BT1361_ECG:
- func = avpriv_trc_bt1361;
- break;
-
- case AVCOL_TRC_IEC61966_2_1:
- func = avpriv_trc_iec61966_2_1;
- break;
-
- case AVCOL_TRC_SMPTEST2084:
- func = avpriv_trc_smpte_st2084;
- break;
-
- case AVCOL_TRC_SMPTEST428_1:
- func = avpriv_trc_smpte_st428_1;
- break;
-
- case AVCOL_TRC_ARIB_STD_B67:
- func = avpriv_trc_arib_std_b67;
- break;
-
- case AVCOL_TRC_RESERVED0:
- case AVCOL_TRC_UNSPECIFIED:
- case AVCOL_TRC_RESERVED:
- default:
- break;
- }
- return func;
-}
diff --git a/libavutil/color_utils.h b/libavutil/color_utils.h
deleted file mode 100644
index 9529006452c..00000000000
--- a/libavutil/color_utils.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2015 Kevin Wheatley <kevin.j.wheatley@gmail.com>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_COLOR_UTILS_H
-#define AVUTIL_COLOR_UTILS_H
-
-
-#include "libavutil/pixfmt.h"
-
-/**
- * Determine a suitable 'gamma' value to match the supplied
- * AVColorTransferCharacteristic.
- *
- * See Apple Technical Note TN2257 (https://developer.apple.com/library/mac/technotes/tn2257/_index.html)
- *
- * @return Will return an approximation to the simple gamma function matching
- * the supplied Transfer Characteristic, Will return 0.0 for any
- * we cannot reasonably match against.
- */
-double avpriv_get_gamma_from_trc(enum AVColorTransferCharacteristic trc);
-
-
-typedef double (*avpriv_trc_function)(double);
-
-/**
- * Determine the function needed to apply the given
- * AVColorTransferCharacteristic to linear input.
- *
- * The function returned should expect a nominal domain and range of [0.0-1.0]
- * values outside of this range maybe valid depending on the chosen
- * characteristic function.
- *
- * @return Will return pointer to the function matching the
- * supplied Transfer Characteristic. If unspecified will
- * return NULL:
- */
-avpriv_trc_function avpriv_get_trc_function_from_trc(enum AVColorTransferCharacteristic trc);
-
-#endif
diff --git a/libavutil/csp.c b/libavutil/csp.c
index 98fc83c1da0..7ef822c60bc 100644
--- a/libavutil/csp.c
+++ b/libavutil/csp.c
@@ -1,5 +1,8 @@
/*
+ * Copyright (c) 2015 Kevin Wheatley <kevin.j.wheatley@gmail.com>
* Copyright (c) 2016 Ronald S. Bultje <rsbultje@gmail.com>
+ * Copyright (c) 2023 Leo Izen <leo.izen@gmail.com>
+ *
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
@@ -21,9 +24,11 @@
* @file Colorspace functions for libavutil
* @author Ronald S. Bultje <rsbultje@gmail.com>
* @author Leo Izen <leo.izen@gmail.com>
+ * @author Kevin Wheatley <kevin.j.wheatley@gmail.com>
*/
#include <stdlib.h>
+#include <math.h>
#include "attributes.h"
#include "csp.h"
@@ -126,3 +131,170 @@ enum AVColorPrimaries av_csp_primaries_id_from_desc(const AVColorPrimariesDesc *
return AVCOL_PRI_UNSPECIFIED;
}
+
+static const double approximate_gamma[AVCOL_TRC_NB] = {
+ [AVCOL_TRC_BT709] = 1.961,
+ [AVCOL_TRC_SMPTE170M] = 1.961,
+ [AVCOL_TRC_SMPTE240M] = 1.961,
+ [AVCOL_TRC_BT1361_ECG] = 1.961,
+ [AVCOL_TRC_BT2020_10] = 1.961,
+ [AVCOL_TRC_BT2020_12] = 1.961,
+ [AVCOL_TRC_GAMMA22] = 2.2,
+ [AVCOL_TRC_IEC61966_2_1] = 2.2,
+ [AVCOL_TRC_GAMMA28] = 2.8,
+ [AVCOL_TRC_LINEAR] = 1.0,
+ [AVCOL_TRC_SMPTE428] = 2.6,
+};
+
+double av_csp_approximate_trc_gamma(enum AVColorTransferCharacteristic trc)
+{
+ double gamma;
+ if (trc >= AVCOL_TRC_NB)
+ return 0.0;
+ gamma = approximate_gamma[trc];
+ if (gamma > 0)
+ return gamma;
+ return 0.0;
+}
+
+#define BT709_alpha 1.099296826809442
+#define BT709_beta 0.018053968510807
+
+static double trc_bt709(double Lc)
+{
+ const double a = BT709_alpha;
+ const double b = BT709_beta;
+
+ return (0.0 > Lc) ? 0.0
+ : ( b > Lc) ? 4.500 * Lc
+ : a * pow(Lc, 0.45) - (a - 1.0);
+}
+
+static double trc_gamma22(double Lc)
+{
+ return (0.0 > Lc) ? 0.0 : pow(Lc, 1.0/ 2.2);
+}
+
+static double trc_gamma28(double Lc)
+{
+ return (0.0 > Lc) ? 0.0 : pow(Lc, 1.0/ 2.8);
+}
+
+static double trc_smpte240M(double Lc)
+{
+ const double a = 1.1115;
+ const double b = 0.0228;
+
+ return (0.0 > Lc) ? 0.0
+ : ( b > Lc) ? 4.000 * Lc
+ : a * pow(Lc, 0.45) - (a - 1.0);
+}
+
+static double trc_linear(double Lc)
+{
+ return Lc;
+}
+
+static double trc_log(double Lc)
+{
+ return (0.01 > Lc) ? 0.0 : 1.0 + log10(Lc) / 2.0;
+}
+
+static double trc_log_sqrt(double Lc)
+{
+ // sqrt(10) / 1000
+ return (0.00316227766 > Lc) ? 0.0 : 1.0 + log10(Lc) / 2.5;
+}
+
+static double trc_iec61966_2_4(double Lc)
+{
+ const double a = BT709_alpha;
+ const double b = BT709_beta;
+
+ return (-b >= Lc) ? -a * pow(-Lc, 0.45) + (a - 1.0)
+ : ( b > Lc) ? 4.500 * Lc
+ : a * pow( Lc, 0.45) - (a - 1.0);
+}
+
+static double trc_bt1361(double Lc)
+{
+ const double a = BT709_alpha;
+ const double b = BT709_beta;
+
+ return (-0.0045 >= Lc) ? -(a * pow(-4.0 * Lc, 0.45) + (a - 1.0)) / 4.0
+ : ( b > Lc) ? 4.500 * Lc
+ : a * pow( Lc, 0.45) - (a - 1.0);
+}
+
+static double trc_iec61966_2_1(double Lc)
+{
+ const double a = 1.055;
+ const double b = 0.0031308;
+
+ return (0.0 > Lc) ? 0.0
+ : ( b > Lc) ? 12.92 * Lc
+ : a * pow(Lc, 1.0 / 2.4) - (a - 1.0);
+}
+
+static double trc_smpte_st2084(double Lc)
+{
+ const double c1 = 3424.0 / 4096.0; // c3-c2 + 1
+ const double c2 = 32.0 * 2413.0 / 4096.0;
+ const double c3 = 32.0 * 2392.0 / 4096.0;
+ const double m = 128.0 * 2523.0 / 4096.0;
+ const double n = 0.25 * 2610.0 / 4096.0;
+ const double L = Lc / 10000.0;
+ const double Ln = pow(L, n);
+
+ return (0.0 > Lc) ? 0.0
+ : pow((c1 + c2 * Ln) / (1.0 + c3 * Ln), m);
+
+}
+
+static double trc_smpte_st428_1(double Lc)
+{
+ return (0.0 > Lc) ? 0.0
+ : pow(48.0 * Lc / 52.37, 1.0 / 2.6);
+}
+
+
+static double trc_arib_std_b67(double Lc) {
+ // The function uses the definition from HEVC, which assumes that the peak
+ // white is input level = 1. (this is equivalent to scaling E = Lc * 12 and
+ // using the definition from the ARIB STD-B67 spec)
+ const double a = 0.17883277;
+ const double b = 0.28466892;
+ const double c = 0.55991073;
+ return (0.0 > Lc) ? 0.0 :
+ (Lc <= 1.0 / 12.0 ? sqrt(3.0 * Lc) : a * log(12.0 * Lc - b) + c);
+}
+
+static const av_csp_trc_function trc_funcs[AVCOL_TRC_NB] = {
+ [AVCOL_TRC_BT709] = trc_bt709,
+ [AVCOL_TRC_GAMMA22] = trc_gamma22,
+ [AVCOL_TRC_GAMMA28] = trc_gamma28,
+ [AVCOL_TRC_SMPTE170M] = trc_bt709,
+ [AVCOL_TRC_SMPTE240M] = trc_smpte240M,
+ [AVCOL_TRC_LINEAR] = trc_linear,
+ [AVCOL_TRC_LOG] = trc_log,
+ [AVCOL_TRC_LOG_SQRT] = trc_log_sqrt,
+ [AVCOL_TRC_IEC61966_2_4] = trc_iec61966_2_4,
+ [AVCOL_TRC_BT1361_ECG] = trc_bt1361,
+ [AVCOL_TRC_IEC61966_2_1] = trc_iec61966_2_1,
+ [AVCOL_TRC_BT2020_10] = trc_bt709,
+ [AVCOL_TRC_BT2020_12] = trc_bt709,
+ [AVCOL_TRC_SMPTE2084] = trc_smpte_st2084,
+ [AVCOL_TRC_SMPTE428] = trc_smpte_st428_1,
+ [AVCOL_TRC_ARIB_STD_B67] = trc_arib_std_b67,
+};
+
+av_csp_trc_function av_csp_trc_func_from_id(enum AVColorTransferCharacteristic trc)
+{
+ av_csp_trc_function func;
+ if (trc >= AVCOL_TRC_NB)
+ return NULL;
+ func = trc_funcs[trc];
+ if (!func)
+ return NULL;
+ return func;
+}
diff --git a/libavutil/csp.h b/libavutil/csp.h
index 18ef208adf3..73bce52bc0c 100644
--- a/libavutil/csp.h
+++ b/libavutil/csp.h
@@ -1,5 +1,8 @@
/*
+ * Copyright (c) 2015 Kevin Wheatley <kevin.j.wheatley@gmail.com>
* Copyright (c) 2016 Ronald S. Bultje <rsbultje@gmail.com>
+ * Copyright (c) 2023 Leo Izen <leo.izen@gmail.com>
+ *
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
@@ -29,6 +32,7 @@
* @ingroup lavu_math_csp
* @author Ronald S. Bultje <rsbultje@gmail.com>
* @author Leo Izen <leo.izen@gmail.com>
+ * @author Kevin Wheatley <kevin.j.wheatley@gmail.com>
*/
/**
@@ -76,6 +80,12 @@ typedef struct AVColorPrimariesDesc {
AVPrimaryCoefficients prim;
} AVColorPrimariesDesc;
+/**
+ * Function pointer representing a double -> double transfer function that performs
+ * an EOTF transfer inversion. This function outputs linear light.
+ */
+typedef double (*av_csp_trc_function)(double);
+
/**
* Retrieves the Luma coefficients necessary to construct a conversion matrix
* from an enum constant describing the colorspace.
@@ -104,6 +114,35 @@ const AVColorPrimariesDesc *av_csp_primaries_desc_from_id(enum AVColorPrimaries
*/
enum AVColorPrimaries av_csp_primaries_id_from_desc(const AVColorPrimariesDesc *prm);
+/**
+ * Determine a suitable 'gamma' value to match the supplied
+ * AVColorTransferCharacteristic.
+ *
+ * See Apple Technical Note TN2257 (https://developer.apple.com/library/mac/technotes/tn2257/_index.html)
+ *
+ * This function returns the gamma exponent for the OETF. For example, sRGB is approximated
+ * by gamma 2.2, not by gamma 0.45455.
+ *
+ * @return Will return an approximation to the simple gamma function matching
+ * the supplied Transfer Characteristic, Will return 0.0 for any
+ * we cannot reasonably match against.
+ */
+double av_csp_approximate_trc_gamma(enum AVColorTransferCharacteristic trc);
+
+/**
+ * Determine the function needed to apply the given
+ * AVColorTransferCharacteristic to linear input.
+ *
+ * The function returned should expect a nominal domain and range of [0.0-1.0]
+ * values outside of this range maybe valid depending on the chosen
+ * characteristic function.
+ *
+ * @return Will return pointer to the function matching the
+ * supplied Transfer Characteristic. If unspecified will
+ * return NULL:
+ */
+av_csp_trc_function av_csp_trc_func_from_id(enum AVColorTransferCharacteristic trc);
+
/**
* @}
*/
diff --git a/libavutil/tests/color_utils.c b/libavutil/tests/color_utils.c
index 4bdc550330e..95fb3c1d560 100644
--- a/libavutil/tests/color_utils.c
+++ b/libavutil/tests/color_utils.c
@@ -19,7 +19,7 @@
*/
#include <stdio.h>
-#include "libavutil/color_utils.c"
+#include "libavutil/csp.h"
#include "libavutil/macros.h"
int main(int argc, char *argv[])
@@ -32,7 +32,7 @@ int main(int argc, char *argv[])
};
for(i = 0; i < AVCOL_TRC_NB; i++) {
- avpriv_trc_function func = avpriv_get_trc_function_from_trc(i);
+ av_csp_trc_function func = av_csp_trc_func_from_id(i);
for(j = 0; j < FF_ARRAY_ELEMS(test_data); j++) {
if(func != NULL) {
double result = func(test_data[j]);
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 30/33] avutil/version: postpone the remaining API deprecations
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (28 preceding siblings ...)
2023-02-04 10:42 ` [FFmpeg-devel] [PATCH v2 29/33] avutil/{color_utils, csp}: merge color_utils into csp and expose API Anton Khirnov
@ 2023-02-04 10:42 ` Anton Khirnov
2023-02-04 10:42 ` [FFmpeg-devel] [PATCH v2 31/33] avcodec/version: " Anton Khirnov
` (2 subsequent siblings)
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:42 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
They are too recent.
Signed-off-by: James Almer <jamrial@gmail.com>
---
fftools/ffprobe.c | 2 +-
libavutil/version.h | 12 ++++++------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index 5beaece094f..db37ec52f49 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -2588,7 +2588,7 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
print_time("pkt_dts_time", frame->pkt_dts, &stream->time_base);
print_ts ("best_effort_timestamp", frame->best_effort_timestamp);
print_time("best_effort_timestamp_time", frame->best_effort_timestamp, &stream->time_base);
-#if LIBAVUTIL_VERSION_MAJOR < 58
+#if LIBAVUTIL_VERSION_MAJOR < 59
AV_NOWARN_DEPRECATED(
print_duration_ts ("pkt_duration", frame->pkt_duration);
print_duration_time("pkt_duration_time", frame->pkt_duration, &stream->time_base);
diff --git a/libavutil/version.h b/libavutil/version.h
index 3bad472227a..24b9980601d 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -105,12 +105,12 @@
* @{
*/
-#define FF_API_FIFO_PEEK2 (LIBAVUTIL_VERSION_MAJOR < 58)
-#define FF_API_FIFO_OLD_API (LIBAVUTIL_VERSION_MAJOR < 58)
-#define FF_API_XVMC (LIBAVUTIL_VERSION_MAJOR < 58)
-#define FF_API_OLD_CHANNEL_LAYOUT (LIBAVUTIL_VERSION_MAJOR < 58)
-#define FF_API_AV_FOPEN_UTF8 (LIBAVUTIL_VERSION_MAJOR < 58)
-#define FF_API_PKT_DURATION (LIBAVUTIL_VERSION_MAJOR < 58)
+#define FF_API_FIFO_PEEK2 (LIBAVUTIL_VERSION_MAJOR < 59)
+#define FF_API_FIFO_OLD_API (LIBAVUTIL_VERSION_MAJOR < 59)
+#define FF_API_XVMC (LIBAVUTIL_VERSION_MAJOR < 59)
+#define FF_API_OLD_CHANNEL_LAYOUT (LIBAVUTIL_VERSION_MAJOR < 59)
+#define FF_API_AV_FOPEN_UTF8 (LIBAVUTIL_VERSION_MAJOR < 59)
+#define FF_API_PKT_DURATION (LIBAVUTIL_VERSION_MAJOR < 59)
/**
* @}
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 31/33] avcodec/version: postpone the remaining API deprecations
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (29 preceding siblings ...)
2023-02-04 10:42 ` [FFmpeg-devel] [PATCH v2 30/33] avutil/version: postpone the remaining API deprecations Anton Khirnov
@ 2023-02-04 10:42 ` Anton Khirnov
2023-02-04 10:42 ` [FFmpeg-devel] [PATCH v2 32/33] avformat/version: " Anton Khirnov
2023-02-04 10:42 ` [FFmpeg-devel] [PATCH v2 33/33] Bump major versions of all libraries Anton Khirnov
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:42 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
They are either too recent, or still need work like FF_API_INIT_PACKET.
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavcodec/version_major.h | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
index 04e6225f9b3..bcea37d7977 100644
--- a/libavcodec/version_major.h
+++ b/libavcodec/version_major.h
@@ -37,12 +37,12 @@
* at once through the bump. This improves the git bisect-ability of the change.
*/
-#define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 60)
-#define FF_API_IDCT_NONE (LIBAVCODEC_VERSION_MAJOR < 60)
-#define FF_API_SVTAV1_OPTS (LIBAVCODEC_VERSION_MAJOR < 60)
-#define FF_API_AYUV_CODECID (LIBAVCODEC_VERSION_MAJOR < 60)
-#define FF_API_VT_OUTPUT_CALLBACK (LIBAVCODEC_VERSION_MAJOR < 60)
-#define FF_API_VT_HWACCEL_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 60)
-#define FF_API_AVCODEC_CHROMA_POS (LIBAVCODEC_VERSION_MAJOR < 60)
+#define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 61)
+#define FF_API_IDCT_NONE (LIBAVCODEC_VERSION_MAJOR < 61)
+#define FF_API_SVTAV1_OPTS (LIBAVCODEC_VERSION_MAJOR < 61)
+#define FF_API_AYUV_CODECID (LIBAVCODEC_VERSION_MAJOR < 61)
+#define FF_API_VT_OUTPUT_CALLBACK (LIBAVCODEC_VERSION_MAJOR < 61)
+#define FF_API_AVCODEC_CHROMA_POS (LIBAVCODEC_VERSION_MAJOR < 61)
+#define FF_API_VT_HWACCEL_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 61)
#endif /* AVCODEC_VERSION_MAJOR_H */
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 32/33] avformat/version: postpone the remaining API deprecations
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (30 preceding siblings ...)
2023-02-04 10:42 ` [FFmpeg-devel] [PATCH v2 31/33] avcodec/version: " Anton Khirnov
@ 2023-02-04 10:42 ` Anton Khirnov
2023-02-04 10:42 ` [FFmpeg-devel] [PATCH v2 33/33] Bump major versions of all libraries Anton Khirnov
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:42 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
They are either too recent, or still need work like FF_API_COMPUTE_PKT_FIELDS2.
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavformat/version_major.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavformat/version_major.h b/libavformat/version_major.h
index 1db8e7600eb..b11f8113838 100644
--- a/libavformat/version_major.h
+++ b/libavformat/version_major.h
@@ -41,9 +41,9 @@
* at once through the bump. This improves the git bisect-ability of the change.
*
*/
-#define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 60)
-#define FF_API_GET_END_PTS (LIBAVFORMAT_VERSION_MAJOR < 60)
-#define FF_API_AVIODIRCONTEXT (LIBAVFORMAT_VERSION_MAJOR < 60)
+#define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 61)
+#define FF_API_GET_END_PTS (LIBAVFORMAT_VERSION_MAJOR < 61)
+#define FF_API_AVIODIRCONTEXT (LIBAVFORMAT_VERSION_MAJOR < 61)
#define FF_API_R_FRAME_RATE 1
--
2.35.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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2 33/33] Bump major versions of all libraries
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
` (31 preceding siblings ...)
2023-02-04 10:42 ` [FFmpeg-devel] [PATCH v2 32/33] avformat/version: " Anton Khirnov
@ 2023-02-04 10:42 ` Anton Khirnov
32 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-04 10:42 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
doc/APIchanges | 14 +-------------
libavcodec/version.h | 2 +-
libavcodec/version_major.h | 2 +-
libavdevice/version.h | 4 ++--
libavdevice/version_major.h | 2 +-
libavfilter/version.h | 2 +-
libavfilter/version_major.h | 2 +-
libavformat/version.h | 2 +-
libavformat/version_major.h | 2 +-
libavutil/version.h | 4 ++--
libpostproc/version.h | 2 +-
libpostproc/version_major.h | 2 +-
libswscale/version.h | 4 ++--
libswscale/version_major.h | 2 +-
14 files changed, 17 insertions(+), 29 deletions(-)
diff --git a/doc/APIchanges b/doc/APIchanges
index 385385bda8d..9600e0c2d6e 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -1,16 +1,4 @@
-Never assume the API of libav* to be stable unless at least 1 month has passed
-since the last major version increase or the API was added.
-
-The last version increases were:
-libavcodec: 2021-04-27
-libavdevice: 2021-04-27
-libavfilter: 2021-04-27
-libavformat: 2021-04-27
-libpostproc: 2021-04-27
-libswresample: 2021-04-27
-libswscale: 2021-04-27
-libavutil: 2021-04-27
-
+The last version increases of all lbiraries were on 2023-02-xx
API changes, most recent first:
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 2ed4ef5547f..8c3d476003e 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
#include "version_major.h"
-#define LIBAVCODEC_VERSION_MINOR 60
+#define LIBAVCODEC_VERSION_MINOR 0
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
index bcea37d7977..dacbbbf3453 100644
--- a/libavcodec/version_major.h
+++ b/libavcodec/version_major.h
@@ -25,7 +25,7 @@
* Libavcodec version macros.
*/
-#define LIBAVCODEC_VERSION_MAJOR 59
+#define LIBAVCODEC_VERSION_MAJOR 60
/**
* FF_API_* defines may be placed below to indicate public API that will be
diff --git a/libavdevice/version.h b/libavdevice/version.h
index 3e654fff892..25befdead12 100644
--- a/libavdevice/version.h
+++ b/libavdevice/version.h
@@ -29,8 +29,8 @@
#include "version_major.h"
-#define LIBAVDEVICE_VERSION_MINOR 8
-#define LIBAVDEVICE_VERSION_MICRO 101
+#define LIBAVDEVICE_VERSION_MINOR 0
+#define LIBAVDEVICE_VERSION_MICRO 100
#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
LIBAVDEVICE_VERSION_MINOR, \
diff --git a/libavdevice/version_major.h b/libavdevice/version_major.h
index 571257f31d7..b884fd42246 100644
--- a/libavdevice/version_major.h
+++ b/libavdevice/version_major.h
@@ -25,7 +25,7 @@
* Libavdevice version macros
*/
-#define LIBAVDEVICE_VERSION_MAJOR 59
+#define LIBAVDEVICE_VERSION_MAJOR 60
/**
* FF_API_* defines may be placed below to indicate public API that will be
diff --git a/libavfilter/version.h b/libavfilter/version.h
index 057ab634157..d5a6bc143a9 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -31,7 +31,7 @@
#include "version_major.h"
-#define LIBAVFILTER_VERSION_MINOR 56
+#define LIBAVFILTER_VERSION_MINOR 0
#define LIBAVFILTER_VERSION_MICRO 100
diff --git a/libavfilter/version_major.h b/libavfilter/version_major.h
index cb2238ffdd0..899dfdb27db 100644
--- a/libavfilter/version_major.h
+++ b/libavfilter/version_major.h
@@ -27,7 +27,7 @@
* Libavfilter version macros
*/
-#define LIBAVFILTER_VERSION_MAJOR 8
+#define LIBAVFILTER_VERSION_MAJOR 9
/**
* FF_API_* defines may be placed below to indicate public API that will be
diff --git a/libavformat/version.h b/libavformat/version.h
index 789859fbe29..752aac16f7b 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -31,7 +31,7 @@
#include "version_major.h"
-#define LIBAVFORMAT_VERSION_MINOR 37
+#define LIBAVFORMAT_VERSION_MINOR 0
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
diff --git a/libavformat/version_major.h b/libavformat/version_major.h
index b11f8113838..9ccf40bdc17 100644
--- a/libavformat/version_major.h
+++ b/libavformat/version_major.h
@@ -29,7 +29,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 59
+#define LIBAVFORMAT_VERSION_MAJOR 60
/**
* FF_API_* defines may be placed below to indicate public API that will be
diff --git a/libavutil/version.h b/libavutil/version.h
index 24b9980601d..eef270f66a2 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -78,8 +78,8 @@
* @{
*/
-#define LIBAVUTIL_VERSION_MAJOR 57
-#define LIBAVUTIL_VERSION_MINOR 44
+#define LIBAVUTIL_VERSION_MAJOR 58
+#define LIBAVUTIL_VERSION_MINOR 0
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
diff --git a/libpostproc/version.h b/libpostproc/version.h
index c258957d4d0..bcbdd210c4f 100644
--- a/libpostproc/version.h
+++ b/libpostproc/version.h
@@ -30,7 +30,7 @@
#include "version_major.h"
-#define LIBPOSTPROC_VERSION_MINOR 7
+#define LIBPOSTPROC_VERSION_MINOR 0
#define LIBPOSTPROC_VERSION_MICRO 100
#define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \
diff --git a/libpostproc/version_major.h b/libpostproc/version_major.h
index 7afc4dbb72f..771e17a9e7c 100644
--- a/libpostproc/version_major.h
+++ b/libpostproc/version_major.h
@@ -26,6 +26,6 @@
* Libpostproc version macros
*/
-#define LIBPOSTPROC_VERSION_MAJOR 56
+#define LIBPOSTPROC_VERSION_MAJOR 57
#endif /* POSTPROC_VERSION_MAJOR_H */
diff --git a/libswscale/version.h b/libswscale/version.h
index 9bb3b171a73..148efd83eb5 100644
--- a/libswscale/version.h
+++ b/libswscale/version.h
@@ -28,8 +28,8 @@
#include "version_major.h"
-#define LIBSWSCALE_VERSION_MINOR 8
-#define LIBSWSCALE_VERSION_MICRO 112
+#define LIBSWSCALE_VERSION_MINOR 0
+#define LIBSWSCALE_VERSION_MICRO 100
#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
LIBSWSCALE_VERSION_MINOR, \
diff --git a/libswscale/version_major.h b/libswscale/version_major.h
index 2f8418780cd..88577a2b42a 100644
--- a/libswscale/version_major.h
+++ b/libswscale/version_major.h
@@ -24,7 +24,7 @@
* swscale version macros
*/
-#define LIBSWSCALE_VERSION_MAJOR 6
+#define LIBSWSCALE_VERSION_MAJOR 7
/**
* FF_API_* defines may be placed below to indicate public API that will be
--
2.35.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] 37+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2 29/33] avutil/{color_utils, csp}: merge color_utils into csp and expose API
2023-02-04 10:42 ` [FFmpeg-devel] [PATCH v2 29/33] avutil/{color_utils, csp}: merge color_utils into csp and expose API Anton Khirnov
@ 2023-02-04 16:27 ` Ronald S. Bultje
0 siblings, 0 replies; 37+ messages in thread
From: Ronald S. Bultje @ 2023-02-04 16:27 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Hi,
On Sat, Feb 4, 2023 at 11:50 AM Anton Khirnov <anton@khirnov.net> wrote:
> From: Leo Izen <leo.izen@gmail.com>
>
> libavutil/color_utils contains some avpriv_ symbols that map
> enum AVTransferCharacteristic values to gamma-curve approximations and
> to the actual transfer functions to invert them (i.e. -> linear).
>
> There's two issues with this:
> (1) avpriv is evil and should be avoided whenever possible
> (2) libavutil/csp.h exposes a public API for handling color that
> already handles primaries and matricies
>
> I don't see any reason this API has to be private, so this commit takes
> the functionality from avutil/color_utils and merges it into avutil/csp
> with an exposed av_ API rather than the previous avpriv_ API.
>
> Every reference to the previous API has been updated to point to the
> new one. color_utils.h has been deleted as well. This should not break
> any applications as it only contained avpriv_ symbols in the first
> place, so nothing in that header could be referenced by other
> applications.
>
Ok with me.
Ronald
_______________________________________________
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] 37+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2 10/33] avcodec: remove FF_API_THREAD_SAFE_CALLBACKS
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 10/33] avcodec: remove FF_API_THREAD_SAFE_CALLBACKS Anton Khirnov
@ 2023-02-05 21:04 ` Michael Niedermayer
2023-02-07 7:58 ` [FFmpeg-devel] [PATCH v2.5 " Anton Khirnov
0 siblings, 1 reply; 37+ messages in thread
From: Michael Niedermayer @ 2023-02-05 21:04 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 1646 bytes --]
On Sat, Feb 04, 2023 at 11:41:41AM +0100, Anton Khirnov wrote:
> From: James Almer <jamrial@gmail.com>
>
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
> fftools/ffmpeg.c | 5 -
> libavcodec/avcodec.h | 21 ---
> libavcodec/decode.c | 13 --
> libavcodec/encode.c | 7 +-
> libavcodec/frame_thread_encoder.c | 20 ---
> libavcodec/pthread_frame.c | 237 +-----------------------------
> libavcodec/thread.h | 12 --
> libavcodec/version_major.h | 1 -
> 8 files changed, 6 insertions(+), 310 deletions(-)
This seems to break build without pthreads
libavcodec/libavcodec.a(utils.o): In function `ff_get_format':
libavcodec/utils.c:917: multiple definition of `ff_get_format'
libavcodec/libavcodec.a(decode.o):libavcodec/decode.c:1147: first defined here
collect2: error: ld returned 1 exit status
Makefile:131: recipe for target 'ffplay_g' failed
make: *** [ffplay_g] Error 1
make: *** Waiting for unfinished jobs....
libavcodec/libavcodec.a(utils.o): In function `ff_get_format':
libavcodec/utils.c:917: multiple definition of `ff_get_format'
libavcodec/libavcodec.a(decode.o):libavcodec/decode.c:1147: first defined here
collect2: error: ld returned 1 exit status
Makefile:131: recipe for target 'ffprobe_g' failed
make: *** [ffprobe_g] Error 1
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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] 37+ messages in thread
* [FFmpeg-devel] [PATCH v2.5 10/33] avcodec: remove FF_API_THREAD_SAFE_CALLBACKS
2023-02-05 21:04 ` Michael Niedermayer
@ 2023-02-07 7:58 ` Anton Khirnov
0 siblings, 0 replies; 37+ messages in thread
From: Anton Khirnov @ 2023-02-07 7:58 UTC (permalink / raw)
To: ffmpeg-devel
From: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
---
Sorry, picked the wrong patch version.
This one does build without pthreads.
---
fftools/ffmpeg.c | 5 -
libavcodec/avcodec.h | 21 ---
libavcodec/decode.c | 13 --
libavcodec/encode.c | 7 +-
libavcodec/frame_thread_encoder.c | 20 ---
libavcodec/pthread_frame.c | 237 +-----------------------------
libavcodec/thread.h | 12 --
libavcodec/utils.c | 5 -
libavcodec/version_major.h | 1 -
9 files changed, 6 insertions(+), 315 deletions(-)
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 03e29e8834..80ca76ae04 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2795,11 +2795,6 @@ static int init_input_stream(InputStream *ist, char *error, int error_len)
ist->dec_ctx->opaque = ist;
ist->dec_ctx->get_format = get_format;
-#if LIBAVCODEC_VERSION_MAJOR < 60
- AV_NOWARN_DEPRECATED({
- ist->dec_ctx->thread_safe_callbacks = 1;
- })
-#endif
if (ist->dec_ctx->codec_id == AV_CODEC_ID_DVB_SUBTITLE &&
(ist->decoding_needed & DECODING_FOR_OST)) {
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 3884e52de9..22d7f50649 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1526,27 +1526,6 @@ typedef struct AVCodecContext {
*/
int active_thread_type;
-#if FF_API_THREAD_SAFE_CALLBACKS
- /**
- * Set by the client if its custom get_buffer() callback can be called
- * synchronously from another thread, which allows faster multithreaded decoding.
- * draw_horiz_band() will be called from other threads regardless of this setting.
- * Ignored if the default get_buffer() is used.
- * - encoding: Set by user.
- * - decoding: Set by user.
- *
- * @deprecated the custom get_buffer2() callback should always be
- * thread-safe. Thread-unsafe get_buffer2() implementations will be
- * invalid starting with LIBAVCODEC_VERSION_MAJOR=60; in other words,
- * libavcodec will behave as if this field was always set to 1.
- * Callers that want to be forward compatible with future libavcodec
- * versions should wrap access to this field in
- * `#if LIBAVCODEC_VERSION_MAJOR < 60`
- */
- attribute_deprecated
- int thread_safe_callbacks;
-#endif
-
/**
* The codec may call this to execute several independent things.
* It will return only after finishing all tasks.
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 78bf3ba547..34e67a649b 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1604,19 +1604,6 @@ int ff_decode_preinit(AVCodecContext *avctx)
* free the already allocated subtitle_header before overwriting it */
av_freep(&avctx->subtitle_header);
-#if FF_API_THREAD_SAFE_CALLBACKS
-FF_DISABLE_DEPRECATION_WARNINGS
- if ((avctx->thread_type & FF_THREAD_FRAME) &&
- avctx->get_buffer2 != avcodec_default_get_buffer2 &&
- !avctx->thread_safe_callbacks) {
- av_log(avctx, AV_LOG_WARNING, "Requested frame threading with a "
- "custom get_buffer2() implementation which is not marked as "
- "thread safe. This is not supported anymore, make your "
- "callback thread-safe.\n");
- }
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
if (avctx->codec->max_lowres < avctx->lowres || avctx->lowres < 0) {
av_log(avctx, AV_LOG_WARNING, "The maximum value for lowres supported by the decoder is %d\n",
avctx->codec->max_lowres);
diff --git a/libavcodec/encode.c b/libavcodec/encode.c
index b0a9625ca9..6499d962ca 100644
--- a/libavcodec/encode.c
+++ b/libavcodec/encode.c
@@ -259,10 +259,9 @@ int ff_encode_encode_cb(AVCodecContext *avctx, AVPacket *avpkt,
unref:
av_packet_unref(avpkt);
}
-#if !FF_API_THREAD_SAFE_CALLBACKS
+
if (frame)
av_frame_unref(frame);
-#endif
return ret;
}
@@ -303,10 +302,6 @@ static int encode_simple_internal(AVCodecContext *avctx, AVPacket *avpkt)
ret = ff_thread_video_encode_frame(avctx, avpkt, frame, &got_packet);
else {
ret = ff_encode_encode_cb(avctx, avpkt, frame, &got_packet);
-#if FF_API_THREAD_SAFE_CALLBACKS
- if (frame)
- av_frame_unref(frame);
-#endif
}
if (avci->draining && !got_packet)
diff --git a/libavcodec/frame_thread_encoder.c b/libavcodec/frame_thread_encoder.c
index 35775ae823..62d9580ad4 100644
--- a/libavcodec/frame_thread_encoder.c
+++ b/libavcodec/frame_thread_encoder.c
@@ -48,9 +48,6 @@ typedef struct{
typedef struct{
AVCodecContext *parent_avctx;
-#if FF_API_THREAD_SAFE_CALLBACKS
- pthread_mutex_t buffer_mutex;
-#endif
pthread_mutex_t task_fifo_mutex; /* Used to guard (next_)task_index */
pthread_cond_t task_fifo_cond;
@@ -70,15 +67,9 @@ typedef struct{
} ThreadContext;
#define OFF(member) offsetof(ThreadContext, member)
-#if FF_API_THREAD_SAFE_CALLBACKS
-DEFINE_OFFSET_ARRAY(ThreadContext, thread_ctx, pthread_init_cnt,
- (OFF(buffer_mutex), OFF(task_fifo_mutex), OFF(finished_task_mutex)),
- (OFF(task_fifo_cond), OFF(finished_task_cond)));
-#else
DEFINE_OFFSET_ARRAY(ThreadContext, thread_ctx, pthread_init_cnt,
(OFF(task_fifo_mutex), OFF(finished_task_mutex)),
(OFF(task_fifo_cond), OFF(finished_task_cond)));
-#endif
#undef OFF
static void * attribute_align_arg worker(void *v){
@@ -112,11 +103,6 @@ static void * attribute_align_arg worker(void *v){
pkt = task->outdata;
ret = ff_encode_encode_cb(avctx, pkt, frame, &task->got_packet);
-#if FF_API_THREAD_SAFE_CALLBACKS
- pthread_mutex_lock(&c->buffer_mutex);
- av_frame_unref(frame);
- pthread_mutex_unlock(&c->buffer_mutex);
-#endif
pthread_mutex_lock(&c->finished_task_mutex);
task->return_code = ret;
task->finished = 1;
@@ -124,13 +110,7 @@ static void * attribute_align_arg worker(void *v){
pthread_mutex_unlock(&c->finished_task_mutex);
}
end:
-#if FF_API_THREAD_SAFE_CALLBACKS
- pthread_mutex_lock(&c->buffer_mutex);
-#endif
avcodec_close(avctx);
-#if FF_API_THREAD_SAFE_CALLBACKS
- pthread_mutex_unlock(&c->buffer_mutex);
-#endif
av_freep(&avctx);
return NULL;
}
diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
index ae8d051acd..71edd6b3ec 100644
--- a/libavcodec/pthread_frame.c
+++ b/libavcodec/pthread_frame.c
@@ -99,22 +99,6 @@ typedef struct PerThreadContext {
atomic_int state;
-#if FF_API_THREAD_SAFE_CALLBACKS
- /**
- * Array of frames passed to ff_thread_release_buffer().
- * Frames are released after all threads referencing them are finished.
- */
- AVFrame **released_buffers;
- int num_released_buffers;
- int released_buffers_allocated;
-
- AVFrame *requested_frame; ///< AVFrame the codec passed to get_buffer()
- int requested_flags; ///< flags passed to get_buffer() for requested_frame
-
- const enum AVPixelFormat *available_formats; ///< Format array for get_format()
- enum AVPixelFormat result_format; ///< get_format() result
-#endif
-
int die; ///< Set when the thread should exit.
int hwaccel_serializing;
@@ -156,11 +140,6 @@ typedef struct FrameThreadContext {
void *stash_hwaccel_priv;
} FrameThreadContext;
-#if FF_API_THREAD_SAFE_CALLBACKS
-#define THREAD_SAFE_CALLBACKS(avctx) \
-((avctx)->thread_safe_callbacks || (avctx)->get_buffer2 == avcodec_default_get_buffer2)
-#endif
-
static void async_lock(FrameThreadContext *fctx)
{
pthread_mutex_lock(&fctx->async_mutex);
@@ -212,14 +191,8 @@ static attribute_align_arg void *frame_worker_thread(void *arg)
if (p->die) break;
-FF_DISABLE_DEPRECATION_WARNINGS
- if (!codec->update_thread_context
-#if FF_API_THREAD_SAFE_CALLBACKS
- && THREAD_SAFE_CALLBACKS(avctx)
-#endif
- )
+ if (!codec->update_thread_context)
ff_thread_finish_setup(avctx);
-FF_ENABLE_DEPRECATION_WARNINGS
/* If a decoder supports hwaccel, then it must call ff_get_format().
* Since that call must happen before ff_thread_finish_setup(), the
@@ -394,11 +367,6 @@ static int update_context_from_user(AVCodecContext *dst, AVCodecContext *src)
FF_DISABLE_DEPRECATION_WARNINGS
dst->reordered_opaque = src->reordered_opaque;
FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-#if FF_API_THREAD_SAFE_CALLBACKS
-FF_DISABLE_DEPRECATION_WARNINGS
- dst->thread_safe_callbacks = src->thread_safe_callbacks;
-FF_ENABLE_DEPRECATION_WARNINGS
#endif
if (src->slice_count && src->slice_offset) {
@@ -421,29 +389,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
return 0;
}
-#if FF_API_THREAD_SAFE_CALLBACKS
-/// Releases the buffers that this decoding thread was the last user of.
-static void release_delayed_buffers(PerThreadContext *p)
-{
- FrameThreadContext *fctx = p->parent;
-
- while (p->num_released_buffers > 0) {
- AVFrame *f;
-
- pthread_mutex_lock(&fctx->buffer_mutex);
-
- // fix extended data in case the caller screwed it up
- av_assert0(p->avctx->codec_type == AVMEDIA_TYPE_VIDEO ||
- p->avctx->codec_type == AVMEDIA_TYPE_AUDIO);
- f = p->released_buffers[--p->num_released_buffers];
- f->extended_data = f->data;
- av_frame_unref(f);
-
- pthread_mutex_unlock(&fctx->buffer_mutex);
- }
-}
-#endif
-
static int submit_packet(PerThreadContext *p, AVCodecContext *user_avctx,
AVPacket *avpkt)
{
@@ -466,10 +411,6 @@ static int submit_packet(PerThreadContext *p, AVCodecContext *user_avctx,
(p->avctx->debug & FF_DEBUG_THREADS) != 0,
memory_order_relaxed);
-#if FF_API_THREAD_SAFE_CALLBACKS
- release_delayed_buffers(p);
-#endif
-
if (prev_thread) {
int err;
if (atomic_load(&prev_thread->state) == STATE_SETTING_UP) {
@@ -504,44 +445,6 @@ static int submit_packet(PerThreadContext *p, AVCodecContext *user_avctx,
pthread_cond_signal(&p->input_cond);
pthread_mutex_unlock(&p->mutex);
-#if FF_API_THREAD_SAFE_CALLBACKS
-FF_DISABLE_DEPRECATION_WARNINGS
- /*
- * If the client doesn't have a thread-safe get_buffer(),
- * then decoding threads call back to the main thread,
- * and it calls back to the client here.
- */
-
- if (!p->avctx->thread_safe_callbacks && (
- p->avctx->get_format != avcodec_default_get_format ||
- p->avctx->get_buffer2 != avcodec_default_get_buffer2)) {
- while (atomic_load(&p->state) != STATE_SETUP_FINISHED && atomic_load(&p->state) != STATE_INPUT_READY) {
- int call_done = 1;
- pthread_mutex_lock(&p->progress_mutex);
- while (atomic_load(&p->state) == STATE_SETTING_UP)
- pthread_cond_wait(&p->progress_cond, &p->progress_mutex);
-
- switch (atomic_load_explicit(&p->state, memory_order_acquire)) {
- case STATE_GET_BUFFER:
- p->result = ff_get_buffer(p->avctx, p->requested_frame, p->requested_flags);
- break;
- case STATE_GET_FORMAT:
- p->result_format = ff_get_format(p->avctx, p->available_formats);
- break;
- default:
- call_done = 0;
- break;
- }
- if (call_done) {
- atomic_store(&p->state, STATE_SETTING_UP);
- pthread_cond_signal(&p->progress_cond);
- }
- pthread_mutex_unlock(&p->progress_mutex);
- }
- }
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
fctx->prev_thread = p;
fctx->next_decoding++;
@@ -772,12 +675,6 @@ void ff_frame_thread_free(AVCodecContext *avctx, int thread_count)
if (codec->close && p->thread_init != UNINITIALIZED)
codec->close(ctx);
-#if FF_API_THREAD_SAFE_CALLBACKS
- release_delayed_buffers(p);
- for (int j = 0; j < p->released_buffers_allocated; j++)
- av_frame_free(&p->released_buffers[j]);
- av_freep(&p->released_buffers);
-#endif
if (ctx->priv_data) {
if (codec->p.priv_class)
av_opt_free(ctx->priv_data);
@@ -975,10 +872,6 @@ void ff_thread_flush(AVCodecContext *avctx)
av_frame_unref(p->frame);
p->result = 0;
-#if FF_API_THREAD_SAFE_CALLBACKS
- release_delayed_buffers(p);
-#endif
-
if (ffcodec(avctx->codec)->flush)
ffcodec(avctx->codec)->flush(p->avctx);
}
@@ -987,16 +880,12 @@ void ff_thread_flush(AVCodecContext *avctx)
int ff_thread_can_start_frame(AVCodecContext *avctx)
{
PerThreadContext *p = avctx->internal->thread_ctx;
-FF_DISABLE_DEPRECATION_WARNINGS
+
if ((avctx->active_thread_type&FF_THREAD_FRAME) && atomic_load(&p->state) != STATE_SETTING_UP &&
- (ffcodec(avctx->codec)->update_thread_context
-#if FF_API_THREAD_SAFE_CALLBACKS
- || !THREAD_SAFE_CALLBACKS(avctx)
-#endif
- )) {
+ ffcodec(avctx->codec)->update_thread_context) {
return 0;
}
-FF_ENABLE_DEPRECATION_WARNINGS
+
return 1;
}
@@ -1011,80 +900,20 @@ static int thread_get_buffer_internal(AVCodecContext *avctx, AVFrame *f, int fla
p = avctx->internal->thread_ctx;
FF_DISABLE_DEPRECATION_WARNINGS
if (atomic_load(&p->state) != STATE_SETTING_UP &&
- (ffcodec(avctx->codec)->update_thread_context
-#if FF_API_THREAD_SAFE_CALLBACKS
- || !THREAD_SAFE_CALLBACKS(avctx)
-#endif
- )) {
+ ffcodec(avctx->codec)->update_thread_context) {
FF_ENABLE_DEPRECATION_WARNINGS
av_log(avctx, AV_LOG_ERROR, "get_buffer() cannot be called after ff_thread_finish_setup()\n");
return -1;
}
pthread_mutex_lock(&p->parent->buffer_mutex);
-#if !FF_API_THREAD_SAFE_CALLBACKS
err = ff_get_buffer(avctx, f, flags);
-#else
-FF_DISABLE_DEPRECATION_WARNINGS
- if (THREAD_SAFE_CALLBACKS(avctx)) {
- err = ff_get_buffer(avctx, f, flags);
- } else {
- pthread_mutex_lock(&p->progress_mutex);
- p->requested_frame = f;
- p->requested_flags = flags;
- atomic_store_explicit(&p->state, STATE_GET_BUFFER, memory_order_release);
- pthread_cond_broadcast(&p->progress_cond);
-
- while (atomic_load(&p->state) != STATE_SETTING_UP)
- pthread_cond_wait(&p->progress_cond, &p->progress_mutex);
-
- err = p->result;
-
- pthread_mutex_unlock(&p->progress_mutex);
-
- }
- if (!THREAD_SAFE_CALLBACKS(avctx) && !ffcodec(avctx->codec)->update_thread_context)
- ff_thread_finish_setup(avctx);
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
pthread_mutex_unlock(&p->parent->buffer_mutex);
return err;
}
-#if FF_API_THREAD_SAFE_CALLBACKS
-FF_DISABLE_DEPRECATION_WARNINGS
-enum AVPixelFormat ff_thread_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
-{
- enum AVPixelFormat res;
- PerThreadContext *p;
- if (!(avctx->active_thread_type & FF_THREAD_FRAME) || avctx->thread_safe_callbacks ||
- avctx->get_format == avcodec_default_get_format)
- return ff_get_format(avctx, fmt);
-
- p = avctx->internal->thread_ctx;
- if (atomic_load(&p->state) != STATE_SETTING_UP) {
- av_log(avctx, AV_LOG_ERROR, "get_format() cannot be called after ff_thread_finish_setup()\n");
- return -1;
- }
- pthread_mutex_lock(&p->progress_mutex);
- p->available_formats = fmt;
- atomic_store(&p->state, STATE_GET_FORMAT);
- pthread_cond_broadcast(&p->progress_cond);
-
- while (atomic_load(&p->state) != STATE_SETTING_UP)
- pthread_cond_wait(&p->progress_cond, &p->progress_mutex);
-
- res = p->result_format;
-
- pthread_mutex_unlock(&p->progress_mutex);
-
- return res;
-}
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f, int flags)
{
int ret = thread_get_buffer_internal(avctx, f, flags);
@@ -1126,69 +955,13 @@ int ff_thread_get_ext_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
void ff_thread_release_buffer(AVCodecContext *avctx, AVFrame *f)
{
-#if FF_API_THREAD_SAFE_CALLBACKS
-FF_DISABLE_DEPRECATION_WARNINGS
- PerThreadContext *p;
- FrameThreadContext *fctx;
- AVFrame *dst;
- int ret = 0;
- int can_direct_free = !(avctx->active_thread_type & FF_THREAD_FRAME) ||
- THREAD_SAFE_CALLBACKS(avctx);
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
if (!f)
return;
if (avctx->debug & FF_DEBUG_BUFFERS)
av_log(avctx, AV_LOG_DEBUG, "thread_release_buffer called on pic %p\n", f);
-#if !FF_API_THREAD_SAFE_CALLBACKS
av_frame_unref(f);
-#else
- // when the frame buffers are not allocated, just reset it to clean state
- if (can_direct_free || !f->buf[0]) {
- av_frame_unref(f);
- return;
- }
-
- p = avctx->internal->thread_ctx;
- fctx = p->parent;
- pthread_mutex_lock(&fctx->buffer_mutex);
-
- if (p->num_released_buffers == p->released_buffers_allocated) {
- AVFrame **tmp = av_realloc_array(p->released_buffers, p->released_buffers_allocated + 1,
- sizeof(*p->released_buffers));
- if (tmp) {
- tmp[p->released_buffers_allocated] = av_frame_alloc();
- p->released_buffers = tmp;
- }
-
- if (!tmp || !tmp[p->released_buffers_allocated]) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
- p->released_buffers_allocated++;
- }
-
- dst = p->released_buffers[p->num_released_buffers];
- av_frame_move_ref(dst, f);
-
- p->num_released_buffers++;
-
-fail:
- pthread_mutex_unlock(&fctx->buffer_mutex);
-
- // make sure the frame is clean even if we fail to free it
- // this leaks, but it is better than crashing
- if (ret < 0) {
- av_log(avctx, AV_LOG_ERROR, "Could not queue a frame for freeing, this will leak\n");
- memset(f->buf, 0, sizeof(f->buf));
- if (f->extended_buf)
- memset(f->extended_buf, 0, f->nb_extended_buf * sizeof(*f->extended_buf));
- av_frame_unref(f);
- }
-#endif
}
void ff_thread_release_ext_buffer(AVCodecContext *avctx, ThreadFrame *f)
diff --git a/libavcodec/thread.h b/libavcodec/thread.h
index d5673f25ea..88a14cfeb1 100644
--- a/libavcodec/thread.h
+++ b/libavcodec/thread.h
@@ -62,19 +62,7 @@ int ff_thread_decode_frame(AVCodecContext *avctx, AVFrame *picture,
*/
void ff_thread_finish_setup(AVCodecContext *avctx);
-#if FF_API_THREAD_SAFE_CALLBACKS
-/**
- * Wrapper around get_format() for frame-multithreaded codecs.
- * Call this function instead of avctx->get_format().
- * Cannot be called after the codec has called ff_thread_finish_setup().
- *
- * @param avctx The current context.
- * @param fmt The list of available formats.
- */
-enum AVPixelFormat ff_thread_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt);
-#else
#define ff_thread_get_format ff_get_format
-#endif
/**
* Wrapper around get_buffer() for frame-multithreaded codecs.
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 18a433b1af..3b58c8a2ed 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -913,11 +913,6 @@ int ff_thread_ref_frame(ThreadFrame *dst, const ThreadFrame *src)
#if !HAVE_THREADS
-enum AVPixelFormat ff_thread_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
-{
- return ff_get_format(avctx, fmt);
-}
-
int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f, int flags)
{
return ff_get_buffer(avctx, f, flags);
diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
index 269b1f4eaa..852f4a9cab 100644
--- a/libavcodec/version_major.h
+++ b/libavcodec/version_major.h
@@ -37,7 +37,6 @@
* at once through the bump. This improves the git bisect-ability of the change.
*/
-#define FF_API_THREAD_SAFE_CALLBACKS (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_DEBUG_MV (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_GET_FRAME_CLASS (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_AUTO_THREADS (LIBAVCODEC_VERSION_MAJOR < 60)
--
2.35.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] 37+ messages in thread
end of thread, other threads:[~2023-02-07 7:59 UTC | newest]
Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 01/33] avformat/avformat: Remove AVOutputFormat.data_codec Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 02/33] avformat/avformat: Move codecpar up in AVStream Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 03/33] avcodec: Make avcodec_decode_subtitle2 accept a const AVPacket* Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 04/33] avformat/demux: Avoid stack packet when decoding frame Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 05/33] avformat/avformat: Move AVOutputFormat internals out of public header Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 06/33] avcodec/avcodec: Remove AV_CODEC_FLAG2_DROP_FRAME_TIMECODE Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 07/33] avcodec: remove FF_API_OPENH264_SLICE_MODE Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 08/33] avcodec: remove FF_API_OPENH264_CABAC Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 09/33] avcodec: remove FF_API_UNUSED_CODEC_CAPS Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 10/33] avcodec: remove FF_API_THREAD_SAFE_CALLBACKS Anton Khirnov
2023-02-05 21:04 ` Michael Niedermayer
2023-02-07 7:58 ` [FFmpeg-devel] [PATCH v2.5 " Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 11/33] avcodec: remove FF_API_DEBUG_MV Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 12/33] avcodec: remove FF_API_GET_FRAME_CLASS Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 13/33] avcodec: remove FF_API_AUTO_THREADS Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 14/33] avcodec: remove FF_API_AVCTX_TIMEBASE Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 15/33] avcodec: remove FF_API_FLAG_TRUNCATED Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 16/33] avcodec: remove FF_API_SUB_TEXT_FORMAT Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 17/33] avformat: remove FF_API_LAVF_PRIV_OPT Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 18/33] avformat: remove FF_API_AVIOCONTEXT_WRITTEN Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 19/33] avformat: remove FF_HLS_TS_OPTIONS Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 20/33] avformat: remove FF_API_AVSTREAM_CLASS Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 21/33] avfilter: remove FF_API_SWS_PARAM_OPTION Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 22/33] avfilter: remove FF_API_BUFFERSINK_ALLOC Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 23/33] avfilter: remove FF_API_PAD_COUNT Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 24/33] avdevice: remove FF_API_DEVICE_CAPABILITIES Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 25/33] avutil: remove FF_API_D2STR Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 26/33] avutil: remove FF_API_DECLARE_ALIGNED Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 27/33] avutil: remove FF_API_COLORSPACE_NAME Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 28/33] avutil: remove FF_API_AV_MALLOCZ_ARRAY Anton Khirnov
2023-02-04 10:42 ` [FFmpeg-devel] [PATCH v2 29/33] avutil/{color_utils, csp}: merge color_utils into csp and expose API Anton Khirnov
2023-02-04 16:27 ` Ronald S. Bultje
2023-02-04 10:42 ` [FFmpeg-devel] [PATCH v2 30/33] avutil/version: postpone the remaining API deprecations Anton Khirnov
2023-02-04 10:42 ` [FFmpeg-devel] [PATCH v2 31/33] avcodec/version: " Anton Khirnov
2023-02-04 10:42 ` [FFmpeg-devel] [PATCH v2 32/33] avformat/version: " Anton Khirnov
2023-02-04 10:42 ` [FFmpeg-devel] [PATCH v2 33/33] Bump major versions of all libraries Anton Khirnov
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