* [FFmpeg-devel] [PATCH 00/26] Major library version bump
@ 2023-01-16 13:38 James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 01/26] avcodec: remove FF_API_OPENH264_SLICE_MODE James Almer
` (31 more replies)
0 siblings, 32 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
It's been a while since the last bump, so it's time to do some cleaning and
remove deprecated APIs. This will also give us an "Open ABI season" in which we
can do breaking changes (like changing public struct offsets, public enum
values, adding fields to structs that have their size tied to the ABI, etc) for
a few weeks.
I'm also taking this opportunity to suggest a change in our deprecation period
policy. Until now it's been a generic two years period, with no concrete reason
for it other than giving library users "time" to migrate. What we have seen
however is that users migrate in two cases: As soon as things are deprecated
when they use git head to get rid of deprecation warnings, or when they have no
choice (aka, when they want to move their project to a new ffmpeg version that
no longer has the symbols they depended on).
In the latter case, any arbitrary amount of time will make no difference
whatsoever. Projects could right now still be using ffmpeg 4.3 (since that's
what Debian stable ships) and would not consider moving to 5.1 or any future
version for the foreseeable future. So the suggestion is to change to a release
based scheme, which will in some form be time based anyway. Namely, every three
releases we do a major bump, which will be a good year or so in real world
terms, in which all API deprecated during that period, as long as it's present
in a release, is removed. This would also go with the idea of a recurrent LTS
release, so if we do three releases per major version, it could be x.0 (initial
release) x.1 (LTS), and x.2 (last release made pre bump).
If we go the above route, we could also remove API like the old lavu FIFO stuff,
a deprecation that's slightly less than a year old but effectively present in
v5.1.
We'd also need to add all this in writing, because this kind of policy can't
just be "oh yeah, we do it that way" in random emails.
James Almer (26):
avcodec: remove FF_API_OPENH264_SLICE_MODE
avcodec: remove FF_API_OPENH264_CABAC
avcodec: remove FF_API_UNUSED_CODEC_CAPS
avcodec: remove FF_API_THREAD_SAFE_CALLBACKS
avcodec: remove FF_API_DEBUG_MV
avcodec: remove FF_API_GET_FRAME_CLASS
avcodec: remove FF_API_AUTO_THREADS
avcodec: remove FF_API_AVCTX_TIMEBASE
avcodec: remove FF_API_FLAG_TRUNCATED
avcodec: remove FF_API_SUB_TEXT_FORMAT
avformat: remove FF_API_LAVF_PRIV_OPT
avformat: remove FF_API_AVIOCONTEXT_WRITTEN
avformat: remove FF_HLS_TS_OPTIONS
avformat: remove FF_API_AVSTREAM_CLASS
avfilter: remove FF_API_SWS_PARAM_OPTION
avfilter: remove FF_API_BUFFERSINK_ALLOC
avfilter: remove FF_API_PAD_COUNT
avdevice: remove FF_API_DEVICE_CAPABILITIES
avutil: remove FF_API_D2STR
avutil: remove FF_API_DECLARE_ALIGNED
avutil: remove FF_API_COLORSPACE_NAME
avutil: remove FF_API_AV_MALLOCZ_ARRAY
avutil/version: postpone the remaining API deprecations
avcodec/version: postpone the remaining API deprecations
avformat/version: postpone the remaining API deprecations
Bump major versions of all libraries
doc/APIchanges | 16 +-
fftools/ffmpeg.c | 5 -
fftools/ffmpeg_mux_init.c | 11 --
fftools/ffprobe.c | 2 +-
libavcodec/av1_parser.c | 3 -
libavcodec/avcodec.c | 5 -
libavcodec/avcodec.h | 61 +-------
libavcodec/avs2_parser.c | 4 +-
libavcodec/avs3_parser.c | 4 +-
libavcodec/codec.h | 20 ---
libavcodec/cpia.c | 8 -
libavcodec/decode.c | 22 ---
libavcodec/encode.c | 7 +-
libavcodec/frame_thread_encoder.c | 20 ---
libavcodec/h263_parser.c | 11 --
libavcodec/h263_parser.h | 29 ----
libavcodec/h263dec.c | 42 ------
libavcodec/h264_parser.c | 7 +-
libavcodec/h264dec.c | 6 -
libavcodec/libopenh264enc.c | 22 ---
libavcodec/mjpegdec.c | 2 +-
libavcodec/mpeg12.c | 66 ---------
libavcodec/mpeg12.h | 9 --
libavcodec/mpeg12dec.c | 31 ----
libavcodec/mpeg4video_parser.c | 16 +-
libavcodec/mpeg4video_parser.h | 34 -----
libavcodec/mpeg4videodec.c | 6 -
libavcodec/mpegvideo.c | 9 --
libavcodec/mpegvideo.h | 7 -
libavcodec/mpegvideo_dec.c | 8 -
libavcodec/mpegvideo_parser.c | 12 +-
libavcodec/options.c | 33 -----
libavcodec/options_table.h | 7 -
libavcodec/pthread.c | 3 -
libavcodec/pthread_frame.c | 237 +-----------------------------
libavcodec/qdmc.c | 1 +
libavcodec/thread.h | 12 --
libavcodec/vc1_parser.c | 2 -
libavcodec/version.h | 2 +-
libavcodec/version_major.h | 24 +--
libavdevice/avdevice.c | 19 ---
libavdevice/avdevice.h | 130 ----------------
libavdevice/version.h | 4 +-
libavdevice/version_major.h | 3 +-
libavfilter/avfilter.c | 21 ---
libavfilter/avfilter.h | 10 --
libavfilter/buffersink.c | 22 ---
libavfilter/buffersink.h | 36 -----
libavfilter/buffersrc.c | 11 --
libavfilter/version.h | 2 +-
libavfilter/version_major.h | 6 +-
libavformat/avformat.c | 33 +++--
libavformat/avformat.h | 5 -
libavformat/avio.h | 10 --
libavformat/aviobuf.c | 10 --
libavformat/demux.c | 41 +++---
libavformat/hlsenc.c | 3 -
libavformat/options.c | 3 -
libavformat/version.h | 2 +-
libavformat/version_major.h | 12 +-
libavutil/avstring.c | 10 --
libavutil/avstring.h | 9 --
libavutil/frame.c | 17 ---
libavutil/frame.h | 9 --
libavutil/mem.c | 10 --
libavutil/mem.h | 88 -----------
libavutil/mem_internal.h | 2 -
libavutil/tests/avstring.c | 16 --
libavutil/version.h | 20 +--
libpostproc/version.h | 2 +-
libpostproc/version_major.h | 2 +-
libswscale/version.h | 4 +-
libswscale/version_major.h | 2 +-
73 files changed, 103 insertions(+), 1297 deletions(-)
delete mode 100644 libavcodec/h263_parser.h
delete mode 100644 libavcodec/mpeg4video_parser.h
--
2.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 01/26] avcodec: remove FF_API_OPENH264_SLICE_MODE
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 02/26] avcodec: remove FF_API_OPENH264_CABAC James Almer
` (30 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
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 bbd6969568..99d1c67154 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 12f863deb7..dbd5f9adba 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.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 02/26] avcodec: remove FF_API_OPENH264_CABAC
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 01/26] avcodec: remove FF_API_OPENH264_SLICE_MODE James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 03/26] avcodec: remove FF_API_UNUSED_CODEC_CAPS James Almer
` (29 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
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 99d1c67154..84c1d8b59c 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 dbd5f9adba..5199d644ca 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.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 03/26] avcodec: remove FF_API_UNUSED_CODEC_CAPS
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 01/26] avcodec: remove FF_API_OPENH264_SLICE_MODE James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 02/26] avcodec: remove FF_API_OPENH264_CABAC James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 04/26] avcodec: remove FF_API_THREAD_SAFE_CALLBACKS James Almer
` (28 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
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 77a1a3f5a2..e10fcb9c7c 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 5199d644ca..282fcea55e 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.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 04/26] avcodec: remove FF_API_THREAD_SAFE_CALLBACKS
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (2 preceding siblings ...)
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 03/26] avcodec: remove FF_API_UNUSED_CODEC_CAPS James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-20 22:44 ` Michael Niedermayer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 05/26] avcodec: remove FF_API_DEBUG_MV James Almer
` (27 subsequent siblings)
31 siblings, 1 reply; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
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 f722ae7632..bef910a787 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2543,11 +2543,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 0ac581d660..c1a4fbf4d0 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1484,27 +1484,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 0abc88737b..3680fc539c 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1593,19 +1593,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 fbe2c97cd6..9f45927390 100644
--- a/libavcodec/encode.c
+++ b/libavcodec/encode.c
@@ -231,10 +231,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;
}
@@ -275,10 +274,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 62a0b18a8a..81c2114378 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 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/version_major.h b/libavcodec/version_major.h
index 282fcea55e..8550610b4e 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.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 05/26] avcodec: remove FF_API_DEBUG_MV
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (3 preceding siblings ...)
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 04/26] avcodec: remove FF_API_THREAD_SAFE_CALLBACKS James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 06/26] avcodec: remove FF_API_GET_FRAME_CLASS James Almer
` (26 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
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 c1a4fbf4d0..4e8417ca07 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1784,17 +1784,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 8550610b4e..d66754f9f5 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.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 06/26] avcodec: remove FF_API_GET_FRAME_CLASS
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (4 preceding siblings ...)
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 05/26] avcodec: remove FF_API_DEBUG_MV James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 07/26] avcodec: remove FF_API_AUTO_THREADS James Almer
` (25 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
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 4e8417ca07..ee5acc5c9b 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2342,14 +2342,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 2e05d29e1e..fdfbc0abab 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 d66754f9f5..80097566bc 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.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 07/26] avcodec: remove FF_API_AUTO_THREADS
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (5 preceding siblings ...)
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 06/26] avcodec: remove FF_API_GET_FRAME_CLASS James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 08/26] avcodec: remove FF_API_AVCTX_TIMEBASE James Almer
` (24 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
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 e10fcb9c7c..8bf85b2f9c 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 80097566bc..d4b0abe29e 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.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 08/26] avcodec: remove FF_API_AVCTX_TIMEBASE
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (6 preceding siblings ...)
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 07/26] avcodec: remove FF_API_AUTO_THREADS James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 09/26] avcodec: remove FF_API_FLAG_TRUNCATED James Almer
` (23 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
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 e57e382757..14dae92fe9 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 efa76d2740..00a5851807 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 ee5acc5c9b..7f6aaf6964 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -515,8 +515,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 0350517493..200134f91d 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 a9fd879e9d..a819b5783d 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 99362e73f0..bfd270dae2 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 3680fc539c..b5edbb143e 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 3ed23fb9ca..46134a1c48 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 9f7b3782e8..2d691731c5 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 f33911e1a8..b2be55af4a 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 e32a93d296..3beb5f6dae 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 0a100d2064..f96b6a3117 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 ac6efb6909..57bc1f706c 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 a459a2aa7d..4167215fb1 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 d4b0abe29e..17f2acb319 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 19c7219471..ecb2cc5311 100644
--- a/libavformat/avformat.c
+++ b/libavformat/avformat.c
@@ -702,6 +702,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;
/*
@@ -714,38 +718,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 2dfd82a63c..a973a08731 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.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 09/26] avcodec: remove FF_API_FLAG_TRUNCATED
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (7 preceding siblings ...)
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 08/26] avcodec: remove FF_API_AVCTX_TIMEBASE James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 10/26] avcodec: remove FF_API_SUB_TEXT_FORMAT James Almer
` (22 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
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 7f6aaf6964..86228e64b4 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -261,15 +261,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 8bf85b2f9c..035bcd080b 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 b5edbb143e..96889f7dea 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 7a742caa80..f70a791177 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 565a222bc1..0000000000
--- 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 0a2d7487a8..f4e7048a5f 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 5d5f39388f..a256d45c85 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 4e2e67eae1..86dd627e95 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 9999926f55..457d985265 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 3beb5f6dae..28353aa146 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 8008e693b4..0000000000
--- 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 f96b6a3117..d456e5dd11 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 836869c1d9..fc73abab9c 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 42275953b9..55828e6102 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 12c7144ffb..7a0c51e53d 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 57bc1f706c..8e7e88ff25 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 7924ca6144..f6f73fb3f9 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -62,9 +62,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 60ba87dac4..ca84b81391 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 17f2acb319..a0cd3728fa 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.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 10/26] avcodec: remove FF_API_SUB_TEXT_FORMAT
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (8 preceding siblings ...)
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 09/26] avcodec: remove FF_API_FLAG_TRUNCATED James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 11/26] avformat: remove FF_API_LAVF_PRIV_OPT James Almer
` (21 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
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 86228e64b4..e2582f2484 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1840,15 +1840,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 f6f73fb3f9..b262bcbacb 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -374,10 +374,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 a0cd3728fa..e162bf708c 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.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 11/26] avformat: remove FF_API_LAVF_PRIV_OPT
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (9 preceding siblings ...)
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 10/26] avcodec: remove FF_API_SUB_TEXT_FORMAT James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 12/26] avformat: remove FF_API_AVIOCONTEXT_WRITTEN James Almer
` (20 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
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 1d97d56ac5..b40492703c 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1352,9 +1352,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 86af3ee4a5..abc1699685 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.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 12/26] avformat: remove FF_API_AVIOCONTEXT_WRITTEN
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (10 preceding siblings ...)
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 11/26] avformat: remove FF_API_LAVF_PRIV_OPT James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 13/26] avformat: remove FF_HLS_TS_OPTIONS James Almer
` (19 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
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 4bf6b1fbda..5f13e0622d 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 257535a964..4ad734a3c3 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 abc1699685..044af1ebf6 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.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 13/26] avformat: remove FF_HLS_TS_OPTIONS
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (11 preceding siblings ...)
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 12/26] avformat: remove FF_API_AVIOCONTEXT_WRITTEN James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 14/26] avformat: remove FF_API_AVSTREAM_CLASS James Almer
` (18 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
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 39df9becc7..32491b4534 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 044af1ebf6..057d1ac0fb 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.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 14/26] avformat: remove FF_API_AVSTREAM_CLASS
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (12 preceding siblings ...)
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 13/26] avformat: remove FF_HLS_TS_OPTIONS James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 15/26] avfilter: remove FF_API_SWS_PARAM_OPTION James Almer
` (17 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
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 9eea8639dc..4d4521f639 100644
--- a/fftools/ffmpeg_mux_init.c
+++ b/fftools/ffmpeg_mux_init.c
@@ -1709,18 +1709,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 b40492703c..daa396e5a2 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -948,12 +948,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 0079a06d9a..c7681122cd 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 057d1ac0fb..1db8e7600e 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.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 15/26] avfilter: remove FF_API_SWS_PARAM_OPTION
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (13 preceding siblings ...)
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 14/26] avformat: remove FF_API_AVSTREAM_CLASS James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 16/26] avfilter: remove FF_API_BUFFERSINK_ALLOC James Almer
` (16 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
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 ae8bba19b0..ba17450b93 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 de0cf6e979..655e3d119d 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.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 16/26] avfilter: remove FF_API_BUFFERSINK_ALLOC
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (14 preceding siblings ...)
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 15/26] avfilter: remove FF_API_SWS_PARAM_OPTION James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 17/26] avfilter: remove FF_API_PAD_COUNT James Almer
` (15 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
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 e269cf72d1..306c283f77 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 01e7c747d8..64e08de53e 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 655e3d119d..5a8bf4eda2 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.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 17/26] avfilter: remove FF_API_PAD_COUNT
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (15 preceding siblings ...)
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 16/26] avfilter: remove FF_API_BUFFERSINK_ALLOC James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 18/26] avdevice: remove FF_API_DEVICE_CAPABILITIES James Almer
` (14 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
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 c2ecdffa6f..ed363351ad 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 c2ec7a4b5f..333eeb31c3 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 5a8bf4eda2..cb2238ffdd 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.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 18/26] avdevice: remove FF_API_DEVICE_CAPABILITIES
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (16 preceding siblings ...)
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 17/26] avfilter: remove FF_API_PAD_COUNT James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 19/26] avutil: remove FF_API_D2STR James Almer
` (13 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
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 58996404b3..f3c87a6777 100644
--- a/libavdevice/avdevice.c
+++ b/libavdevice/avdevice.c
@@ -20,12 +20,6 @@
#include "avdevice.h"
#include "internal.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)
{
@@ -42,19 +36,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 185593053f..887fd5e3c8 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 d255ff6992..571257f31d 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.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 19/26] avutil: remove FF_API_D2STR
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (17 preceding siblings ...)
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 18/26] avdevice: remove FF_API_DEVICE_CAPABILITIES James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 20/26] avutil: remove FF_API_DECLARE_ALIGNED James Almer
` (12 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
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 5ddbe9219e..e460b5be7f 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 74aa4cd0e4..e260263763 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 37a2cf1833..bc0bde358d 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 60f96af5df..38769962cc 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.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 20/26] avutil: remove FF_API_DECLARE_ALIGNED
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (18 preceding siblings ...)
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 19/26] avutil: remove FF_API_D2STR James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 21/26] avutil: remove FF_API_COLORSPACE_NAME James Almer
` (11 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
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 4b582dc349..081c4dd46f 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 c9c4fcf1ff..b093b3b5cb 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 955e31a698..2448c606f1 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 38769962cc..6014743947 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.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 21/26] avutil: remove FF_API_COLORSPACE_NAME
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (19 preceding siblings ...)
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 20/26] avutil: remove FF_API_DECLARE_ALIGNED James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 22/26] avutil: remove FF_API_AV_MALLOCZ_ARRAY James Almer
` (10 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
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 fa9b11aa54..3198a50f67 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 bbe909ee2d..1172d013a3 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 6014743947..700af5d874 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.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 22/26] avutil: remove FF_API_AV_MALLOCZ_ARRAY
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (20 preceding siblings ...)
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 21/26] avutil: remove FF_API_COLORSPACE_NAME James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 23/26] avutil/version: postpone the remaining API deprecations James Almer
` (9 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
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 18aff5291f..36b8940a0c 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 b093b3b5cb..62b4ca6e50 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 700af5d874..3bad472227 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.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 23/26] avutil/version: postpone the remaining API deprecations
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (21 preceding siblings ...)
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 22/26] avutil: remove FF_API_AV_MALLOCZ_ARRAY James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 24/26] avcodec/version: " James Almer
` (8 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
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 b9310a2d25..ac650145ef 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 3bad472227..24b9980601 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.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 24/26] avcodec/version: postpone the remaining API deprecations
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (22 preceding siblings ...)
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 23/26] avutil/version: postpone the remaining API deprecations James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 25/26] avformat/version: " James Almer
` (7 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
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 | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
index e162bf708c..dda17fffe2 100644
--- a/libavcodec/version_major.h
+++ b/libavcodec/version_major.h
@@ -37,11 +37,11 @@
* 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_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)
#endif /* AVCODEC_VERSION_MAJOR_H */
--
2.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 25/26] avformat/version: postpone the remaining API deprecations
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (23 preceding siblings ...)
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 24/26] avcodec/version: " James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 26/26] Bump major versions of all libraries James Almer
` (6 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
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 1db8e7600e..b11f811383 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.39.0
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 26/26] Bump major versions of all libraries
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (24 preceding siblings ...)
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 25/26] avformat/version: " James Almer
@ 2023-01-16 13:38 ` James Almer
2023-01-18 19:28 ` [FFmpeg-devel] [PATCH 00/26] Major library version bump Anton Khirnov
` (5 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-16 13:38 UTC (permalink / raw)
To: ffmpeg-devel
Signed-off-by: James Almer <jamrial@gmail.com>
---
doc/APIchanges | 16 ++++++++--------
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, 24 insertions(+), 24 deletions(-)
diff --git a/doc/APIchanges b/doc/APIchanges
index a11acadecd..a2a46778aa 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,14 +2,14 @@ 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
+libavcodec: 2023-01-xx
+libavdevice: 2023-01-xx
+libavfilter: 2023-01-xx
+libavformat: 2023-01-xx
+libpostproc: 2023-01-xx
+libswresample: 2023-01-xx
+libswscale: 2023-01-xx
+libavutil: 2023-01-xx
API changes, most recent first:
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 6b8a1dbb79..8c3d476003 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
#include "version_major.h"
-#define LIBAVCODEC_VERSION_MINOR 56
+#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 dda17fffe2..75d91ac5ca 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 3e654fff89..25befdead1 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 571257f31d..b884fd4224 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 a56ba3bb6d..d5a6bc143a 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -31,7 +31,7 @@
#include "version_major.h"
-#define LIBAVFILTER_VERSION_MINOR 54
+#define LIBAVFILTER_VERSION_MINOR 0
#define LIBAVFILTER_VERSION_MICRO 100
diff --git a/libavfilter/version_major.h b/libavfilter/version_major.h
index cb2238ffdd..899dfdb27d 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 f5a7f579b3..752aac16f7 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -31,7 +31,7 @@
#include "version_major.h"
-#define LIBAVFORMAT_VERSION_MINOR 35
+#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 b11f811383..9ccf40bdc1 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 24b9980601..eef270f66a 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 c258957d4d..bcbdd210c4 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 7afc4dbb72..771e17a9e7 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 9bb3b171a7..148efd83eb 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 2f8418780c..88577a2b42 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.39.0
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (25 preceding siblings ...)
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 26/26] Bump major versions of all libraries James Almer
@ 2023-01-18 19:28 ` Anton Khirnov
2023-01-18 21:23 ` James Almer
2023-01-20 21:23 ` Leo Izen
2023-01-24 15:45 ` Anton Khirnov
` (4 subsequent siblings)
31 siblings, 2 replies; 102+ messages in thread
From: Anton Khirnov @ 2023-01-18 19:28 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Quoting James Almer (2023-01-16 14:38:14)
> It's been a while since the last bump, so it's time to do some cleaning and
> remove deprecated APIs. This will also give us an "Open ABI season" in which we
> can do breaking changes (like changing public struct offsets, public enum
> values, adding fields to structs that have their size tied to the ABI, etc) for
> a few weeks.
Last time this open season lasted something like half a year and only
ended when I arbitrarily said it did.
So I'd suggest to decide right now how long will the instability period
last (6 weeks should be enough for everybody) and write the end date at
the top of doc/APIchanges.
Another thing I'm not entirely happy about is versioning during the bump
and instability. While the remove-then-bump approach does make bisection
easier, it also creates commits that lie about their ABI version.
I wonder if we couldn't come up with a better soltion. One thing that
comes to mind is setting the major version to 0 until the instability
period ends.
> I'm also taking this opportunity to suggest a change in our deprecation period
> policy. Until now it's been a generic two years period, with no concrete reason
> for it other than giving library users "time" to migrate. What we have seen
> however is that users migrate in two cases: As soon as things are deprecated
> when they use git head to get rid of deprecation warnings, or when they have no
> choice (aka, when they want to move their project to a new ffmpeg version that
> no longer has the symbols they depended on).
> In the latter case, any arbitrary amount of time will make no difference
> whatsoever. Projects could right now still be using ffmpeg 4.3 (since that's
> what Debian stable ships) and would not consider moving to 5.1 or any future
> version for the foreseeable future. So the suggestion is to change to a release
> based scheme, which will in some form be time based anyway. Namely, every three
> releases we do a major bump, which will be a good year or so in real world
> terms, in which all API deprecated during that period, as long as it's present
> in a release, is removed. This would also go with the idea of a recurrent LTS
> release, so if we do three releases per major version, it could be x.0 (initial
> release) x.1 (LTS), and x.2 (last release made pre bump).
Sounds good to me.
> If we go the above route, we could also remove API like the old lavu FIFO stuff,
> a deprecation that's slightly less than a year old but effectively present in
> v5.1.
> We'd also need to add all this in writing, because this kind of policy can't
> just be "oh yeah, we do it that way" in random emails.
But folklore is the most time-tested method of transmitting information.
--
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-18 19:28 ` [FFmpeg-devel] [PATCH 00/26] Major library version bump Anton Khirnov
@ 2023-01-18 21:23 ` James Almer
2023-01-19 7:26 ` Anton Khirnov
` (2 more replies)
2023-01-20 21:23 ` Leo Izen
1 sibling, 3 replies; 102+ messages in thread
From: James Almer @ 2023-01-18 21:23 UTC (permalink / raw)
To: ffmpeg-devel
On 1/18/2023 4:28 PM, Anton Khirnov wrote:
> Quoting James Almer (2023-01-16 14:38:14)
>> It's been a while since the last bump, so it's time to do some cleaning and
>> remove deprecated APIs. This will also give us an "Open ABI season" in which we
>> can do breaking changes (like changing public struct offsets, public enum
>> values, adding fields to structs that have their size tied to the ABI, etc) for
>> a few weeks.
>
> Last time this open season lasted something like half a year and only
> ended when I arbitrarily said it did.
>
> So I'd suggest to decide right now how long will the instability period
> last (6 weeks should be enough for everybody) and write the end date at
> the top of doc/APIchanges.
>
> Another thing I'm not entirely happy about is versioning during the bump
> and instability. While the remove-then-bump approach does make bisection
> easier, it also creates commits that lie about their ABI version.
Does it really matter? All the patches will be pushed at the same time,
meaning one git fetch will give you a stable state pre bump and the next
will be right after it.
I think it's a bit farfetched to expect someone to pick a random commit
in the middle of the bump and try to use the resulting compiled
libraries with some program that was linked to some earlier version
libraries.
>
> I wonder if we couldn't come up with a better soltion. One thing that
> comes to mind is setting the major version to 0 until the instability
> period ends.
This could have several undesired effects, mainly for users looking at
that define and not really expecting such value (There are several
projects supporting more than one ffmpeg release and "MAJOR <= xx"
checks are commonplace).
Also, if we are going to code the instability period in some form into
the codebase, might as well make it so it starts with the first removal
commit, or immediately before it, so what you described above is no
longer a concern.
>
>> I'm also taking this opportunity to suggest a change in our deprecation period
>> policy. Until now it's been a generic two years period, with no concrete reason
>> for it other than giving library users "time" to migrate. What we have seen
>> however is that users migrate in two cases: As soon as things are deprecated
>> when they use git head to get rid of deprecation warnings, or when they have no
>> choice (aka, when they want to move their project to a new ffmpeg version that
>> no longer has the symbols they depended on).
>> In the latter case, any arbitrary amount of time will make no difference
>> whatsoever. Projects could right now still be using ffmpeg 4.3 (since that's
>> what Debian stable ships) and would not consider moving to 5.1 or any future
>> version for the foreseeable future. So the suggestion is to change to a release
>> based scheme, which will in some form be time based anyway. Namely, every three
>> releases we do a major bump, which will be a good year or so in real world
>> terms, in which all API deprecated during that period, as long as it's present
>> in a release, is removed. This would also go with the idea of a recurrent LTS
>> release, so if we do three releases per major version, it could be x.0 (initial
>> release) x.1 (LTS), and x.2 (last release made pre bump).
>
> Sounds good to me.
>
>> If we go the above route, we could also remove API like the old lavu FIFO stuff,
>> a deprecation that's slightly less than a year old but effectively present in
>> v5.1.
>> We'd also need to add all this in writing, because this kind of policy can't
>> just be "oh yeah, we do it that way" in random emails.
>
> But folklore is the most time-tested method of transmitting information.
>
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-18 21:23 ` James Almer
@ 2023-01-19 7:26 ` Anton Khirnov
2023-01-19 12:18 ` James Almer
2023-01-20 2:05 ` Michael Niedermayer
2023-01-20 15:07 ` Tomas Härdin
2 siblings, 1 reply; 102+ messages in thread
From: Anton Khirnov @ 2023-01-19 7:26 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Quoting James Almer (2023-01-18 22:23:43)
> On 1/18/2023 4:28 PM, Anton Khirnov wrote:
> > Quoting James Almer (2023-01-16 14:38:14)
> >> It's been a while since the last bump, so it's time to do some cleaning and
> >> remove deprecated APIs. This will also give us an "Open ABI season" in which we
> >> can do breaking changes (like changing public struct offsets, public enum
> >> values, adding fields to structs that have their size tied to the ABI, etc) for
> >> a few weeks.
> >
> > Last time this open season lasted something like half a year and only
> > ended when I arbitrarily said it did.
> >
> > So I'd suggest to decide right now how long will the instability period
> > last (6 weeks should be enough for everybody) and write the end date at
> > the top of doc/APIchanges.
> >
> > Another thing I'm not entirely happy about is versioning during the bump
> > and instability. While the remove-then-bump approach does make bisection
> > easier, it also creates commits that lie about their ABI version.
>
> Does it really matter? All the patches will be pushed at the same time,
> meaning one git fetch will give you a stable state pre bump and the next
> will be right after it.
> I think it's a bit farfetched to expect someone to pick a random commit
> in the middle of the bump and try to use the resulting compiled
> libraries with some program that was linked to some earlier version
> libraries.
I agree that it's probably not a big practical problem, but it is ugly
and goes against our claims of git master being stable.
> > I wonder if we couldn't come up with a better soltion. One thing that
> > comes to mind is setting the major version to 0 until the instability
> > period ends.
>
> This could have several undesired effects, mainly for users looking at
> that define and not really expecting such value (There are several
> projects supporting more than one ffmpeg release and "MAJOR <= xx"
> checks are commonplace).
IMO users who don't expect such a value shouldn't be linking against
unstable API/ABI anyway. We could also set the major version to
something really big, like 999. We'll have to change deprecation macros,
but that should be straightforward.
> Also, if we are going to code the instability period in some form into
> the codebase, might as well make it so it starts with the first removal
> commit, or immediately before it, so what you described above is no
> longer a concern.
I'd rather say the two concerns merge into one, but it's not going away.
There's currently very little user indication that API/ABI are unstable
for several months.
--
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-19 7:26 ` Anton Khirnov
@ 2023-01-19 12:18 ` James Almer
2023-01-19 15:23 ` Anton Khirnov
0 siblings, 1 reply; 102+ messages in thread
From: James Almer @ 2023-01-19 12:18 UTC (permalink / raw)
To: ffmpeg-devel
On 1/19/2023 4:26 AM, Anton Khirnov wrote:
> Quoting James Almer (2023-01-18 22:23:43)
>> On 1/18/2023 4:28 PM, Anton Khirnov wrote:
>>> Quoting James Almer (2023-01-16 14:38:14)
>>>> It's been a while since the last bump, so it's time to do some cleaning and
>>>> remove deprecated APIs. This will also give us an "Open ABI season" in which we
>>>> can do breaking changes (like changing public struct offsets, public enum
>>>> values, adding fields to structs that have their size tied to the ABI, etc) for
>>>> a few weeks.
>>>
>>> Last time this open season lasted something like half a year and only
>>> ended when I arbitrarily said it did.
>>>
>>> So I'd suggest to decide right now how long will the instability period
>>> last (6 weeks should be enough for everybody) and write the end date at
>>> the top of doc/APIchanges.
>>>
>>> Another thing I'm not entirely happy about is versioning during the bump
>>> and instability. While the remove-then-bump approach does make bisection
>>> easier, it also creates commits that lie about their ABI version.
>>
>> Does it really matter? All the patches will be pushed at the same time,
>> meaning one git fetch will give you a stable state pre bump and the next
>> will be right after it.
>> I think it's a bit farfetched to expect someone to pick a random commit
>> in the middle of the bump and try to use the resulting compiled
>> libraries with some program that was linked to some earlier version
>> libraries.
>
> I agree that it's probably not a big practical problem, but it is ugly
> and goes against our claims of git master being stable.
>
>>> I wonder if we couldn't come up with a better soltion. One thing that
>>> comes to mind is setting the major version to 0 until the instability
>>> period ends.
>>
>> This could have several undesired effects, mainly for users looking at
>> that define and not really expecting such value (There are several
>> projects supporting more than one ffmpeg release and "MAJOR <= xx"
>> checks are commonplace).
>
> IMO users who don't expect such a value shouldn't be linking against
> unstable API/ABI anyway. We could also set the major version to
> something really big, like 999. We'll have to change deprecation macros,
> but that should be straightforward.
>
>> Also, if we are going to code the instability period in some form into
>> the codebase, might as well make it so it starts with the first removal
>> commit, or immediately before it, so what you described above is no
>> longer a concern.
>
> I'd rather say the two concerns merge into one, but it's not going away.
> There's currently very little user indication that API/ABI are unstable
> for several months.
How about making minor == 0 mean unstable? Some projects like GCC do it
like this, for example. Said version would not guarantee anything at all
and should not be linked against. Then once the period ends after the
major bump, it's bumped to 1, and the usual "new API, minor bump" rule
kicks in.
This also means that any API addition that takes place during the
unstable period doesn't get it's own version, and they will all strictly
speaking be introduced by minor 1.
As for your concern about first removing then bumping meaning we're
lying about the ABI, the first commit in the set could maybe rollback
minor to 0, then apply the removals, and finally the major bump in the
last commit. It will that way be considered unstable for the whole thing.
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-19 12:18 ` James Almer
@ 2023-01-19 15:23 ` Anton Khirnov
0 siblings, 0 replies; 102+ messages in thread
From: Anton Khirnov @ 2023-01-19 15:23 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Quoting James Almer (2023-01-19 13:18:28)
> On 1/19/2023 4:26 AM, Anton Khirnov wrote:
> > Quoting James Almer (2023-01-18 22:23:43)
> >> On 1/18/2023 4:28 PM, Anton Khirnov wrote:
> >>> Quoting James Almer (2023-01-16 14:38:14)
> >>>> It's been a while since the last bump, so it's time to do some cleaning and
> >>>> remove deprecated APIs. This will also give us an "Open ABI season" in which we
> >>>> can do breaking changes (like changing public struct offsets, public enum
> >>>> values, adding fields to structs that have their size tied to the ABI, etc) for
> >>>> a few weeks.
> >>>
> >>> Last time this open season lasted something like half a year and only
> >>> ended when I arbitrarily said it did.
> >>>
> >>> So I'd suggest to decide right now how long will the instability period
> >>> last (6 weeks should be enough for everybody) and write the end date at
> >>> the top of doc/APIchanges.
> >>>
> >>> Another thing I'm not entirely happy about is versioning during the bump
> >>> and instability. While the remove-then-bump approach does make bisection
> >>> easier, it also creates commits that lie about their ABI version.
> >>
> >> Does it really matter? All the patches will be pushed at the same time,
> >> meaning one git fetch will give you a stable state pre bump and the next
> >> will be right after it.
> >> I think it's a bit farfetched to expect someone to pick a random commit
> >> in the middle of the bump and try to use the resulting compiled
> >> libraries with some program that was linked to some earlier version
> >> libraries.
> >
> > I agree that it's probably not a big practical problem, but it is ugly
> > and goes against our claims of git master being stable.
> >
> >>> I wonder if we couldn't come up with a better soltion. One thing that
> >>> comes to mind is setting the major version to 0 until the instability
> >>> period ends.
> >>
> >> This could have several undesired effects, mainly for users looking at
> >> that define and not really expecting such value (There are several
> >> projects supporting more than one ffmpeg release and "MAJOR <= xx"
> >> checks are commonplace).
> >
> > IMO users who don't expect such a value shouldn't be linking against
> > unstable API/ABI anyway. We could also set the major version to
> > something really big, like 999. We'll have to change deprecation macros,
> > but that should be straightforward.
> >
> >> Also, if we are going to code the instability period in some form into
> >> the codebase, might as well make it so it starts with the first removal
> >> commit, or immediately before it, so what you described above is no
> >> longer a concern.
> >
> > I'd rather say the two concerns merge into one, but it's not going away.
> > There's currently very little user indication that API/ABI are unstable
> > for several months.
>
> How about making minor == 0 mean unstable? Some projects like GCC do it
> like this, for example. Said version would not guarantee anything at all
> and should not be linked against. Then once the period ends after the
> major bump, it's bumped to 1, and the usual "new API, minor bump" rule
> kicks in.
> This also means that any API addition that takes place during the
> unstable period doesn't get it's own version, and they will all strictly
> speaking be introduced by minor 1.
We'd have to watch this carefully, many developers don't pay attention
to major bumps or instability periods and just bump minor anyway.
We should also print a warning in configure that tells the user their
build is unstable.
Otherwise I'm ok with this.
> As for your concern about first removing then bumping meaning we're
> lying about the ABI, the first commit in the set could maybe rollback
> minor to 0, then apply the removals, and finally the major bump in the
> last commit. It will that way be considered unstable for the whole thing.
Works for me.
--
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-18 21:23 ` James Almer
2023-01-19 7:26 ` Anton Khirnov
@ 2023-01-20 2:05 ` Michael Niedermayer
2023-01-21 16:51 ` Anton Khirnov
2023-01-20 15:07 ` Tomas Härdin
2 siblings, 1 reply; 102+ messages in thread
From: Michael Niedermayer @ 2023-01-20 2:05 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 3575 bytes --]
On Wed, Jan 18, 2023 at 06:23:43PM -0300, James Almer wrote:
> On 1/18/2023 4:28 PM, Anton Khirnov wrote:
> > Quoting James Almer (2023-01-16 14:38:14)
> > > It's been a while since the last bump, so it's time to do some cleaning and
> > > remove deprecated APIs. This will also give us an "Open ABI season" in which we
> > > can do breaking changes (like changing public struct offsets, public enum
> > > values, adding fields to structs that have their size tied to the ABI, etc) for
> > > a few weeks.
> >
> > Last time this open season lasted something like half a year and only
> > ended when I arbitrarily said it did.
> >
> > So I'd suggest to decide right now how long will the instability period
> > last (6 weeks should be enough for everybody) and write the end date at
> > the top of doc/APIchanges.
> >
> > Another thing I'm not entirely happy about is versioning during the bump
> > and instability. While the remove-then-bump approach does make bisection
> > easier, it also creates commits that lie about their ABI version.
>
> Does it really matter? All the patches will be pushed at the same time,
> meaning one git fetch will give you a stable state pre bump and the next
> will be right after it.
> I think it's a bit farfetched to expect someone to pick a random commit in
> the middle of the bump and try to use the resulting compiled libraries with
> some program that was linked to some earlier version libraries.
>
> >
> > I wonder if we couldn't come up with a better soltion. One thing that
> > comes to mind is setting the major version to 0 until the instability
> > period ends.
>
> This could have several undesired effects, mainly for users looking at that
> define and not really expecting such value (There are several projects
> supporting more than one ffmpeg release and "MAJOR <= xx" checks are
> commonplace).
API/ABI is defined by major minor patchlevel
these do have reasonable agreed upon meaning i think.
I dont think code pushed to master should break the promise the verions make.
If it breaks it, it should not be pushed. Not with VERY good reason, anything
could have some rare exception if theres a very good reason for the expcetion ...
A user or a script should always be able to checkout a version from master
and its major:minor:patchlevel versions should work as one would expect
I dont see why any exception is needed
A new major API will start with a new major version and 0 in minor obviously
now nothing at that time will depend on that major API version.
And once some other libs or apps depend on the new major API they at the
same time will require a minimum minor version and that minir version obviously
will be after the instability period because you cant really depend on unstable
API/ABI. So nothing would break from anything in that 0..X minor version range
because nothing should depend on that and after X things are after the instability
period.
But we can still even in the instability period use the minor version for our
own inter lib dependancies and handle that in a somewhat clean way by bumping
minor when it is appropriate
PS: iam not sure i fully understood the reason behind why versions should be
set to "wrong" values during some period, so as always i might be missing
something
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.
[-- 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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-18 21:23 ` James Almer
2023-01-19 7:26 ` Anton Khirnov
2023-01-20 2:05 ` Michael Niedermayer
@ 2023-01-20 15:07 ` Tomas Härdin
2 siblings, 0 replies; 102+ messages in thread
From: Tomas Härdin @ 2023-01-20 15:07 UTC (permalink / raw)
To: FFmpeg development discussions and patches
ons 2023-01-18 klockan 18:23 -0300 skrev James Almer:
> On 1/18/2023 4:28 PM, Anton Khirnov wrote:
> > Quoting James Almer (2023-01-16 14:38:14)
> > > It's been a while since the last bump, so it's time to do some
> > > cleaning and
> > > remove deprecated APIs. This will also give us an "Open ABI
> > > season" in which we
> > > can do breaking changes (like changing public struct offsets,
> > > public enum
> > > values, adding fields to structs that have their size tied to the
> > > ABI, etc) for
> > > a few weeks.
> >
> > Last time this open season lasted something like half a year and
> > only
> > ended when I arbitrarily said it did.
> >
> > So I'd suggest to decide right now how long will the instability
> > period
> > last (6 weeks should be enough for everybody) and write the end
> > date at
> > the top of doc/APIchanges.
> >
> > Another thing I'm not entirely happy about is versioning during the
> > bump
> > and instability. While the remove-then-bump approach does make
> > bisection
> > easier, it also creates commits that lie about their ABI version.
>
> Does it really matter? All the patches will be pushed at the same
> time,
> meaning one git fetch will give you a stable state pre bump and the
> next
> will be right after it.
> I think it's a bit farfetched to expect someone to pick a random
> commit
> in the middle of the bump and try to use the resulting compiled
> libraries with some program that was linked to some earlier version
> libraries.
This is easily fixed by having a feature branch for the bumps and
merging it with --no-ff. git bisect is clever enough to skip past such
things
/Tomas
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-18 19:28 ` [FFmpeg-devel] [PATCH 00/26] Major library version bump Anton Khirnov
2023-01-18 21:23 ` James Almer
@ 2023-01-20 21:23 ` Leo Izen
2023-01-21 16:54 ` Anton Khirnov
1 sibling, 1 reply; 102+ messages in thread
From: Leo Izen @ 2023-01-20 21:23 UTC (permalink / raw)
To: ffmpeg-devel
On 1/18/23 14:28, Anton Khirnov wrote:
> Quoting James Almer (2023-01-16 14:38:14)
>> It's been a while since the last bump, so it's time to do some cleaning and
>> remove deprecated APIs. This will also give us an "Open ABI season" in which we
>> can do breaking changes (like changing public struct offsets, public enum
>> values, adding fields to structs that have their size tied to the ABI, etc) for
>> a few weeks.
>
> Last time this open season lasted something like half a year and only
> ended when I arbitrarily said it did.
>
> So I'd suggest to decide right now how long will the instability period
> last (6 weeks should be enough for everybody) and write the end date at
> the top of doc/APIchanges.
>
> Another thing I'm not entirely happy about is versioning during the bump
> and instability. While the remove-then-bump approach does make bisection
> easier, it also creates commits that lie about their ABI version.
>
If the bump comes before the resulting removals, then wouldn't the
removals strictly speaking exist inside the instability period as they
immediately follow a version bump? This sounds like it keeps our promise.
- Leo Izen
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 04/26] avcodec: remove FF_API_THREAD_SAFE_CALLBACKS
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 04/26] avcodec: remove FF_API_THREAD_SAFE_CALLBACKS James Almer
@ 2023-01-20 22:44 ` Michael Niedermayer
2023-01-23 22:05 ` James Almer
0 siblings, 1 reply; 102+ messages in thread
From: Michael Niedermayer @ 2023-01-20 22:44 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 1294 bytes --]
On Mon, Jan 16, 2023 at 10:38:18AM -0300, James Almer wrote:
> 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(-)
breaks build without ptherads
make
LD ffplay_g
libavcodec/libavcodec.a(utils.o): In function `ff_get_format':
libavcodec/utils.c:910: multiple definition of `ff_get_format'
libavcodec/libavcodec.a(decode.o):libavcodec/decode.c:1148: first defined here
collect2: error: ld returned 1 exit status
Makefile:131: recipe for target 'ffplay_g' failed
make: *** [ffplay_g] Error 1
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The day soldiers stop bringing you their problems is the day you have stopped
leading them. They have either lost confidence that you can help or concluded
you do not care. Either case is a failure of leadership. - Colin Powell
[-- 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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-20 2:05 ` Michael Niedermayer
@ 2023-01-21 16:51 ` Anton Khirnov
2023-01-21 19:33 ` Marvin Scholz
2023-01-21 21:36 ` Michael Niedermayer
0 siblings, 2 replies; 102+ messages in thread
From: Anton Khirnov @ 2023-01-21 16:51 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Quoting Michael Niedermayer (2023-01-20 03:05:09)
> PS: iam not sure i fully understood the reason behind why versions should be
> set to "wrong" values during some period, so as always i might be missing
> something
The reason is that after the major bump, the API and ABI are declared to
be unstable for some period, so people can freely
- break ABI, e.g. by reordering struct members
- modify API added during the instability period in an arbitrary way
without a new major bump for every such change, that would be normally
required.
My concern is that the instability period is quite long and there is
very little indication for our users that they cannot depend on the
ABI/API being stable. So I'm proposing to introduce some mechanism to
make this more visible for our callers.
Alternatively, we could just not have an instability period at all.
--
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-20 21:23 ` Leo Izen
@ 2023-01-21 16:54 ` Anton Khirnov
0 siblings, 0 replies; 102+ messages in thread
From: Anton Khirnov @ 2023-01-21 16:54 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Quoting Leo Izen (2023-01-20 22:23:23)
> On 1/18/23 14:28, Anton Khirnov wrote:
> > Quoting James Almer (2023-01-16 14:38:14)
> >> It's been a while since the last bump, so it's time to do some cleaning and
> >> remove deprecated APIs. This will also give us an "Open ABI season" in which we
> >> can do breaking changes (like changing public struct offsets, public enum
> >> values, adding fields to structs that have their size tied to the ABI, etc) for
> >> a few weeks.
> >
> > Last time this open season lasted something like half a year and only
> > ended when I arbitrarily said it did.
> >
> > So I'd suggest to decide right now how long will the instability period
> > last (6 weeks should be enough for everybody) and write the end date at
> > the top of doc/APIchanges.
> >
> > Another thing I'm not entirely happy about is versioning during the bump
> > and instability. While the remove-then-bump approach does make bisection
> > easier, it also creates commits that lie about their ABI version.
> >
>
> If the bump comes before the resulting removals, then wouldn't the
> removals strictly speaking exist inside the instability period as they
> immediately follow a version bump? This sounds like it keeps our promise.
With the way deprecation guards are typically structured, the bump
itself disables all deprecated code atomically. The removals then just
drop dead code. So even without an instability period this would work
"correctly" and that's how I used to do it.
However some people dislike so much code being disabled in a single
commit, since that is harder to bisect if the bump introduces any
issues..
--
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-21 16:51 ` Anton Khirnov
@ 2023-01-21 19:33 ` Marvin Scholz
2023-01-21 20:17 ` Hendrik Leppkes
2023-01-21 21:36 ` Michael Niedermayer
1 sibling, 1 reply; 102+ messages in thread
From: Marvin Scholz @ 2023-01-21 19:33 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On 21 Jan 2023, at 17:51, Anton Khirnov wrote:
> Quoting Michael Niedermayer (2023-01-20 03:05:09)
>> PS: iam not sure i fully understood the reason behind why versions should be
>> set to "wrong" values during some period, so as always i might be missing
>> something
>
> The reason is that after the major bump, the API and ABI are declared to
> be unstable for some period, so people can freely
> - break ABI, e.g. by reordering struct members
> - modify API added during the instability period in an arbitrary way
> without a new major bump for every such change, that would be normally
> required.
>
> My concern is that the instability period is quite long and there is
> very little indication for our users that they cannot depend on the
> ABI/API being stable. So I'm proposing to introduce some mechanism to
> make this more visible for our callers.
I agree that a better way to know when I have an "unstable" version of
ffmpeg would be great. Even as someone loosely following ffmpeg dev
it is not clear to me when instability period ends and if we are
currently in it or not.
(I mean, I was lucky enough to notice this email now this time, but
that was pure luck…)
>
> Alternatively, we could just not have an instability period at all.
>
Not having any instability period at all seems like a bad idea.
> --
> 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".
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-21 19:33 ` Marvin Scholz
@ 2023-01-21 20:17 ` Hendrik Leppkes
2023-01-21 21:30 ` Marvin Scholz
0 siblings, 1 reply; 102+ messages in thread
From: Hendrik Leppkes @ 2023-01-21 20:17 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Sat, Jan 21, 2023 at 8:33 PM Marvin Scholz <epirat07@gmail.com> wrote:
> >
> > Alternatively, we could just not have an instability period at all.
> >
>
> Not having any instability period at all seems like a bad idea.
>
Actually that sounds like the best idea. You would just have to
prepare the bump in a branch and all unstable changes ready to merge
in an instant.
Miss it? Tough. Having months long periods so people can get their
stuff sorted is way too long. Ideally it should be prepared ahead of
time and only a "soft instability" period of maybe two weeks reserved
for bug fixes (don't want to sit on issues for ever), rather then big
changes or new features.
- Hendrik
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-21 20:17 ` Hendrik Leppkes
@ 2023-01-21 21:30 ` Marvin Scholz
2023-01-21 22:47 ` Hendrik Leppkes
0 siblings, 1 reply; 102+ messages in thread
From: Marvin Scholz @ 2023-01-21 21:30 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On 21 Jan 2023, at 21:17, Hendrik Leppkes wrote:
> On Sat, Jan 21, 2023 at 8:33 PM Marvin Scholz <epirat07@gmail.com> wrote:
>>>
>>> Alternatively, we could just not have an instability period at all.
>>>
>>
>> Not having any instability period at all seems like a bad idea.
>>
>
> Actually that sounds like the best idea. You would just have to
> prepare the bump in a branch and all unstable changes ready to merge
> in an instant.
> Miss it? Tough. Having months long periods so people can get their
> stuff sorted is way too long. Ideally it should be prepared ahead of
> time and only a "soft instability" period of maybe two weeks reserved
> for bug fixes (don't want to sit on issues for ever), rather then big
> changes or new features.
>
How would it work? If I now make a branch with a breaking
change, where would I put it and how would I get it merged together with
the other breaking changes?
Or do you mean that there should be a public devel branch where API/ABI
breaking patches can be proposed for that will eventually be merged into
master at a defined point in time together with major bump?
> - Hendrik
> _______________________________________________
> 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".
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-21 16:51 ` Anton Khirnov
2023-01-21 19:33 ` Marvin Scholz
@ 2023-01-21 21:36 ` Michael Niedermayer
2023-01-21 22:00 ` Marton Balint
2023-01-21 22:01 ` Marvin Scholz
1 sibling, 2 replies; 102+ messages in thread
From: Michael Niedermayer @ 2023-01-21 21:36 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 1721 bytes --]
On Sat, Jan 21, 2023 at 05:51:34PM +0100, Anton Khirnov wrote:
> Quoting Michael Niedermayer (2023-01-20 03:05:09)
> > PS: iam not sure i fully understood the reason behind why versions should be
> > set to "wrong" values during some period, so as always i might be missing
> > something
>
> The reason is that after the major bump, the API and ABI are declared to
> be unstable for some period, so people can freely
> - break ABI, e.g. by reordering struct members
> - modify API added during the instability period in an arbitrary way
> without a new major bump for every such change, that would be normally
> required.
>
> My concern is that the instability period is quite long and there is
> very little indication for our users that they cannot depend on the
> ABI/API being stable. So I'm proposing to introduce some mechanism to
> make this more visible for our callers.
>
> Alternatively, we could just not have an instability period at all.
Does anyone plan to use the next bumps instability period for anything ?
If so, i assume theres a good reason why it cannot be done without such
period easily?
If theres noone -> easy solution, we need no instability period ATM.
If theres someone, i would ask that someone how long it needs to be
and write that down in APIchanges. Maybe as in "API is unstable becuase
of X until 2033-11-11
a new #define LIBAVCODEC_UNSTABLE could be added but izt feels a bit
overengeneered. This whole thing is more a exception, isnt it?
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin
[-- 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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-21 21:36 ` Michael Niedermayer
@ 2023-01-21 22:00 ` Marton Balint
2023-01-22 22:54 ` Michael Niedermayer
2023-01-23 17:03 ` Anton Khirnov
2023-01-21 22:01 ` Marvin Scholz
1 sibling, 2 replies; 102+ messages in thread
From: Marton Balint @ 2023-01-21 22:00 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Sat, 21 Jan 2023, Michael Niedermayer wrote:
> On Sat, Jan 21, 2023 at 05:51:34PM +0100, Anton Khirnov wrote:
>> Quoting Michael Niedermayer (2023-01-20 03:05:09)
>>> PS: iam not sure i fully understood the reason behind why versions should be
>>> set to "wrong" values during some period, so as always i might be missing
>>> something
>>
>> The reason is that after the major bump, the API and ABI are declared to
>> be unstable for some period, so people can freely
>> - break ABI, e.g. by reordering struct members
>> - modify API added during the instability period in an arbitrary way
>> without a new major bump for every such change, that would be normally
>> required.
>>
>> My concern is that the instability period is quite long and there is
>> very little indication for our users that they cannot depend on the
>> ABI/API being stable. So I'm proposing to introduce some mechanism to
>> make this more visible for our callers.
>>
>> Alternatively, we could just not have an instability period at all.
>
> Does anyone plan to use the next bumps instability period for anything ?
> If so, i assume theres a good reason why it cannot be done without such
> period easily?
AVCodecContext->frame_number should be changed to int64_t. I guess you
could do something similar which was done for buffer_size_t, but that
seems like a lot of extra work and ifdefry for questionable benefit.
Regards,
Marton
>
> If theres noone -> easy solution, we need no instability period ATM.
> If theres someone, i would ask that someone how long it needs to be
> and write that down in APIchanges. Maybe as in "API is unstable becuase
> of X until 2033-11-11
>
> a new #define LIBAVCODEC_UNSTABLE could be added but izt feels a bit
> overengeneered. This whole thing is more a exception, isnt it?
>
> thx
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> While the State exists there can be no freedom; when there is freedom there
> will be no State. -- Vladimir Lenin
>
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-21 21:36 ` Michael Niedermayer
2023-01-21 22:00 ` Marton Balint
@ 2023-01-21 22:01 ` Marvin Scholz
1 sibling, 0 replies; 102+ messages in thread
From: Marvin Scholz @ 2023-01-21 22:01 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On 21 Jan 2023, at 22:36, Michael Niedermayer wrote:
> On Sat, Jan 21, 2023 at 05:51:34PM +0100, Anton Khirnov wrote:
>> Quoting Michael Niedermayer (2023-01-20 03:05:09)
>>> PS: iam not sure i fully understood the reason behind why versions should be
>>> set to "wrong" values during some period, so as always i might be missing
>>> something
>>
>> The reason is that after the major bump, the API and ABI are declared to
>> be unstable for some period, so people can freely
>> - break ABI, e.g. by reordering struct members
>> - modify API added during the instability period in an arbitrary way
>> without a new major bump for every such change, that would be normally
>> required.
>>
>> My concern is that the instability period is quite long and there is
>> very little indication for our users that they cannot depend on the
>> ABI/API being stable. So I'm proposing to introduce some mechanism to
>> make this more visible for our callers.
>>
>> Alternatively, we could just not have an instability period at all.
>
> Does anyone plan to use the next bumps instability period for anything ?
> If so, i assume theres a good reason why it cannot be done without such
> period easily?
>
> If theres noone -> easy solution, we need no instability period ATM.
> If theres someone, i would ask that someone how long it needs to be
> and write that down in APIchanges. Maybe as in "API is unstable becuase
> of X until 2033-11-11
>
I would like to make av_dict_get return a const
AVDictionaryEntry, just like av_dict_iterate already does.
> a new #define LIBAVCODEC_UNSTABLE could be added but izt feels a bit
> overengeneered. This whole thing is more a exception, isnt it?
>
> thx
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> While the State exists there can be no freedom; when there is freedom there
> will be no State. -- Vladimir Lenin
> _______________________________________________
> 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".
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-21 21:30 ` Marvin Scholz
@ 2023-01-21 22:47 ` Hendrik Leppkes
0 siblings, 0 replies; 102+ messages in thread
From: Hendrik Leppkes @ 2023-01-21 22:47 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Sat, Jan 21, 2023 at 10:30 PM Marvin Scholz <epirat07@gmail.com> wrote:
>
> Or do you mean that there should be a public devel branch where API/ABI
> breaking patches can be proposed for that will eventually be merged into
> master at a defined point in time together with major bump?
>
Yes, I'm talking about one centrally managed branch that contributors
can merge their breaking changes to, and we can test it all in one
piece, and then when the time comes, that one branch would get merged
into master.
- Hendrik
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-21 22:00 ` Marton Balint
@ 2023-01-22 22:54 ` Michael Niedermayer
2023-01-23 17:03 ` Anton Khirnov
1 sibling, 0 replies; 102+ messages in thread
From: Michael Niedermayer @ 2023-01-22 22:54 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 2019 bytes --]
On Sat, Jan 21, 2023 at 11:00:52PM +0100, Marton Balint wrote:
>
>
> On Sat, 21 Jan 2023, Michael Niedermayer wrote:
>
> > On Sat, Jan 21, 2023 at 05:51:34PM +0100, Anton Khirnov wrote:
> > > Quoting Michael Niedermayer (2023-01-20 03:05:09)
> > > > PS: iam not sure i fully understood the reason behind why versions should be
> > > > set to "wrong" values during some period, so as always i might be missing
> > > > something
> > >
> > > The reason is that after the major bump, the API and ABI are declared to
> > > be unstable for some period, so people can freely
> > > - break ABI, e.g. by reordering struct members
> > > - modify API added during the instability period in an arbitrary way
> > > without a new major bump for every such change, that would be normally
> > > required.
> > >
> > > My concern is that the instability period is quite long and there is
> > > very little indication for our users that they cannot depend on the
> > > ABI/API being stable. So I'm proposing to introduce some mechanism to
> > > make this more visible for our callers.
> > >
> > > Alternatively, we could just not have an instability period at all.
> >
> > Does anyone plan to use the next bumps instability period for anything ?
> > If so, i assume theres a good reason why it cannot be done without such
> > period easily?
>
> AVCodecContext->frame_number should be changed to int64_t. I guess you could
Is there a patchset that does that already ?
Iam asking as i think starting work on this after the bump would be the
wrong approuch
Also how long of a instability period do you expect this would need ?
Or maybe the question is who would work on this and have it toward the
top of their todo list.
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Homeopathy is like voting while filling the ballot out with transparent ink.
Sometimes the outcome one wanted occurs. Rarely its worse than filling out
a ballot properly.
[-- 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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-21 22:00 ` Marton Balint
2023-01-22 22:54 ` Michael Niedermayer
@ 2023-01-23 17:03 ` Anton Khirnov
2023-01-23 22:41 ` Marton Balint
1 sibling, 1 reply; 102+ messages in thread
From: Anton Khirnov @ 2023-01-23 17:03 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Quoting Marton Balint (2023-01-21 23:00:52)
>
>
> On Sat, 21 Jan 2023, Michael Niedermayer wrote:
>
> > On Sat, Jan 21, 2023 at 05:51:34PM +0100, Anton Khirnov wrote:
> >> Quoting Michael Niedermayer (2023-01-20 03:05:09)
> >>> PS: iam not sure i fully understood the reason behind why versions should be
> >>> set to "wrong" values during some period, so as always i might be missing
> >>> something
> >>
> >> The reason is that after the major bump, the API and ABI are declared to
> >> be unstable for some period, so people can freely
> >> - break ABI, e.g. by reordering struct members
> >> - modify API added during the instability period in an arbitrary way
> >> without a new major bump for every such change, that would be normally
> >> required.
> >>
> >> My concern is that the instability period is quite long and there is
> >> very little indication for our users that they cannot depend on the
> >> ABI/API being stable. So I'm proposing to introduce some mechanism to
> >> make this more visible for our callers.
> >>
> >> Alternatively, we could just not have an instability period at all.
> >
> > Does anyone plan to use the next bumps instability period for anything ?
> > If so, i assume theres a good reason why it cannot be done without such
> > period easily?
>
> AVCodecContext->frame_number should be changed to int64_t. I guess you
> could do something similar which was done for buffer_size_t, but that
> seems like a lot of extra work and ifdefry for questionable benefit.
Not breaking callers seems like a very solid benefit to me.
--
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 04/26] avcodec: remove FF_API_THREAD_SAFE_CALLBACKS
2023-01-20 22:44 ` Michael Niedermayer
@ 2023-01-23 22:05 ` James Almer
0 siblings, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-23 22:05 UTC (permalink / raw)
To: ffmpeg-devel
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/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 f722ae7632..bef910a787 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2543,11 +2543,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 0ac581d660..c1a4fbf4d0 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1484,27 +1484,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 0abc88737b..3680fc539c 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1593,19 +1593,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 fbe2c97cd6..9f45927390 100644
--- a/libavcodec/encode.c
+++ b/libavcodec/encode.c
@@ -231,10 +231,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;
}
@@ -275,10 +274,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 62a0b18a8a..81c2114378 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 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 2b63a498b9..1e57a81b8b 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -906,11 +906,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 282fcea55e..8550610b4e 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.39.0
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-23 17:03 ` Anton Khirnov
@ 2023-01-23 22:41 ` Marton Balint
2023-01-23 22:50 ` Anton Khirnov
0 siblings, 1 reply; 102+ messages in thread
From: Marton Balint @ 2023-01-23 22:41 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Mon, 23 Jan 2023, Anton Khirnov wrote:
> Quoting Marton Balint (2023-01-21 23:00:52)
>>
>>
>> On Sat, 21 Jan 2023, Michael Niedermayer wrote:
>>
>>> On Sat, Jan 21, 2023 at 05:51:34PM +0100, Anton Khirnov wrote:
>>>> Quoting Michael Niedermayer (2023-01-20 03:05:09)
>>>>> PS: iam not sure i fully understood the reason behind why versions should be
>>>>> set to "wrong" values during some period, so as always i might be missing
>>>>> something
>>>>
>>>> The reason is that after the major bump, the API and ABI are declared to
>>>> be unstable for some period, so people can freely
>>>> - break ABI, e.g. by reordering struct members
>>>> - modify API added during the instability period in an arbitrary way
>>>> without a new major bump for every such change, that would be normally
>>>> required.
>>>>
>>>> My concern is that the instability period is quite long and there is
>>>> very little indication for our users that they cannot depend on the
>>>> ABI/API being stable. So I'm proposing to introduce some mechanism to
>>>> make this more visible for our callers.
>>>>
>>>> Alternatively, we could just not have an instability period at all.
>>>
>>> Does anyone plan to use the next bumps instability period for anything ?
>>> If so, i assume theres a good reason why it cannot be done without such
>>> period easily?
>>
>> AVCodecContext->frame_number should be changed to int64_t. I guess you
>> could do something similar which was done for buffer_size_t, but that
>> seems like a lot of extra work and ifdefry for questionable benefit.
>
> Not breaking callers seems like a very solid benefit to me.
I am not sure if I see your point, during unstable, you can break callers,
and I planned to do the change during unstable.
Regards,
Marton
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-23 22:41 ` Marton Balint
@ 2023-01-23 22:50 ` Anton Khirnov
2023-01-23 23:22 ` Marton Balint
0 siblings, 1 reply; 102+ messages in thread
From: Anton Khirnov @ 2023-01-23 22:50 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Quoting Marton Balint (2023-01-23 23:41:11)
> On Mon, 23 Jan 2023, Anton Khirnov wrote:
> > Quoting Marton Balint (2023-01-21 23:00:52)
> >> AVCodecContext->frame_number should be changed to int64_t. I guess you
> >> could do something similar which was done for buffer_size_t, but that
> >> seems like a lot of extra work and ifdefry for questionable benefit.
> >
> > Not breaking callers seems like a very solid benefit to me.
>
> I am not sure if I see your point, during unstable, you can break callers,
> and I planned to do the change during unstable.
My understanding of this instability period is that it's mainly for ABI
changes like reordering struct fields and such, you're still not allowed
to arbitrarily break random APIs. The entire point of having deprecation
periods is that callers can prepare in advance and never actually be
broken.
--
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-23 22:50 ` Anton Khirnov
@ 2023-01-23 23:22 ` Marton Balint
2023-01-24 0:01 ` Michael Niedermayer
0 siblings, 1 reply; 102+ messages in thread
From: Marton Balint @ 2023-01-23 23:22 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Mon, 23 Jan 2023, Anton Khirnov wrote:
> Quoting Marton Balint (2023-01-23 23:41:11)
>> On Mon, 23 Jan 2023, Anton Khirnov wrote:
>>> Quoting Marton Balint (2023-01-21 23:00:52)
>>>> AVCodecContext->frame_number should be changed to int64_t. I guess you
>>>> could do something similar which was done for buffer_size_t, but that
>>>> seems like a lot of extra work and ifdefry for questionable benefit.
>>>
>>> Not breaking callers seems like a very solid benefit to me.
>>
>> I am not sure if I see your point, during unstable, you can break callers,
>> and I planned to do the change during unstable.
>
> My understanding of this instability period is that it's mainly for ABI
> changes like reordering struct fields and such, you're still not allowed
> to arbitrarily break random APIs. The entire point of having deprecation
> periods is that callers can prepare in advance and never actually be
> broken.
If some fields or API is deprecated, then yes, it makes sense. But if no
deprecation / replacement API is provided, then how will anybody prepare?
For type changes, fields are usually not deprecated. Ifdefs are only used
to prepare the changes for the next API bump. For example, buffer_size_t
was in the codebase for 2 months only.
It is not that big of a deal to make a patch if #ifdefs, I just really
don't see the benefit.
An actual problem however, is that printf() like functions expect type
specifiers, and unlike buffer sizes, there is a good chance the users
sometimes print AVCodecContext->frame_number or
AVFrame->xxx_picture_number, which will become undefined behaviour. And
yes, the compiler will usually warn, but still, type changes can cause
silent breakage. But using #define API guards will not fix this, whenever
you change the type, code will get broken, I am not sure if anything can
be done about it.
Regards,
Marton
>
> --
> 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".
>
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-23 23:22 ` Marton Balint
@ 2023-01-24 0:01 ` Michael Niedermayer
2023-01-24 0:06 ` Marton Balint
0 siblings, 1 reply; 102+ messages in thread
From: Michael Niedermayer @ 2023-01-24 0:01 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 2277 bytes --]
On Tue, Jan 24, 2023 at 12:22:52AM +0100, Marton Balint wrote:
>
>
> On Mon, 23 Jan 2023, Anton Khirnov wrote:
>
> > Quoting Marton Balint (2023-01-23 23:41:11)
> > > On Mon, 23 Jan 2023, Anton Khirnov wrote:
> > > > Quoting Marton Balint (2023-01-21 23:00:52)
> > > > > AVCodecContext->frame_number should be changed to int64_t. I guess you
> > > > > could do something similar which was done for buffer_size_t, but that
> > > > > seems like a lot of extra work and ifdefry for questionable benefit.
> > > >
> > > > Not breaking callers seems like a very solid benefit to me.
> > >
> > > I am not sure if I see your point, during unstable, you can break callers,
> > > and I planned to do the change during unstable.
> >
> > My understanding of this instability period is that it's mainly for ABI
> > changes like reordering struct fields and such, you're still not allowed
> > to arbitrarily break random APIs. The entire point of having deprecation
> > periods is that callers can prepare in advance and never actually be
> > broken.
>
> If some fields or API is deprecated, then yes, it makes sense. But if no
> deprecation / replacement API is provided, then how will anybody prepare?
> For type changes, fields are usually not deprecated. Ifdefs are only used to
> prepare the changes for the next API bump. For example, buffer_size_t was in
> the codebase for 2 months only.
>
> It is not that big of a deal to make a patch if #ifdefs, I just really don't
> see the benefit.
>
> An actual problem however, is that printf() like functions expect type
> specifiers, and unlike buffer sizes, there is a good chance the users
> sometimes print AVCodecContext->frame_number or AVFrame->xxx_picture_number,
> which will become undefined behaviour. And yes, the compiler will usually
> warn, but still, type changes can cause silent breakage. But using #define
> API guards will not fix this, whenever you change the type, code will get
> broken, I am not sure if anything can be done about it.
if you want to avoid this then, new type, new identifer
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus
[-- 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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-24 0:01 ` Michael Niedermayer
@ 2023-01-24 0:06 ` Marton Balint
2023-01-24 7:59 ` Anton Khirnov
0 siblings, 1 reply; 102+ messages in thread
From: Marton Balint @ 2023-01-24 0:06 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Tue, 24 Jan 2023, Michael Niedermayer wrote:
> On Tue, Jan 24, 2023 at 12:22:52AM +0100, Marton Balint wrote:
>>
>>
>> On Mon, 23 Jan 2023, Anton Khirnov wrote:
>>
>>> Quoting Marton Balint (2023-01-23 23:41:11)
>>>> On Mon, 23 Jan 2023, Anton Khirnov wrote:
>>>>> Quoting Marton Balint (2023-01-21 23:00:52)
>>>>>> AVCodecContext->frame_number should be changed to int64_t. I guess you
>>>>>> could do something similar which was done for buffer_size_t, but that
>>>>>> seems like a lot of extra work and ifdefry for questionable benefit.
>>>>>
>>>>> Not breaking callers seems like a very solid benefit to me.
>>>>
>>>> I am not sure if I see your point, during unstable, you can break callers,
>>>> and I planned to do the change during unstable.
>>>
>>> My understanding of this instability period is that it's mainly for ABI
>>> changes like reordering struct fields and such, you're still not allowed
>>> to arbitrarily break random APIs. The entire point of having deprecation
>>> periods is that callers can prepare in advance and never actually be
>>> broken.
>>
>> If some fields or API is deprecated, then yes, it makes sense. But if no
>> deprecation / replacement API is provided, then how will anybody prepare?
>> For type changes, fields are usually not deprecated. Ifdefs are only used to
>> prepare the changes for the next API bump. For example, buffer_size_t was in
>> the codebase for 2 months only.
>>
>> It is not that big of a deal to make a patch if #ifdefs, I just really don't
>> see the benefit.
>>
>> An actual problem however, is that printf() like functions expect type
>> specifiers, and unlike buffer sizes, there is a good chance the users
>> sometimes print AVCodecContext->frame_number or AVFrame->xxx_picture_number,
>> which will become undefined behaviour. And yes, the compiler will usually
>> warn, but still, type changes can cause silent breakage. But using #define
>> API guards will not fix this, whenever you change the type, code will get
>> broken, I am not sure if anything can be done about it.
>
> if you want to avoid this then, new type, new identifer
Sure, but do we want AVFrame->coded_picture_number64,
AVFrame->display_picture_number64 and AVCodecContext->frame_number64?
Regards,
Marton
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-24 0:06 ` Marton Balint
@ 2023-01-24 7:59 ` Anton Khirnov
2023-01-24 19:48 ` Marton Balint
0 siblings, 1 reply; 102+ messages in thread
From: Anton Khirnov @ 2023-01-24 7:59 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Quoting Marton Balint (2023-01-24 01:06:46)
> On Tue, 24 Jan 2023, Michael Niedermayer wrote:
> > On Tue, Jan 24, 2023 at 12:22:52AM +0100, Marton Balint wrote:
> >> On Mon, 23 Jan 2023, Anton Khirnov wrote:
> >>> Quoting Marton Balint (2023-01-23 23:41:11)
> >>>> On Mon, 23 Jan 2023, Anton Khirnov wrote:
> >>>>> Not breaking callers seems like a very solid benefit to me.
> >>>>
> >>>> I am not sure if I see your point, during unstable, you can break callers,
> >>>> and I planned to do the change during unstable.
> >>>
> >>> My understanding of this instability period is that it's mainly for ABI
> >>> changes like reordering struct fields and such, you're still not allowed
> >>> to arbitrarily break random APIs. The entire point of having deprecation
> >>> periods is that callers can prepare in advance and never actually be
> >>> broken.
> >>
> >> If some fields or API is deprecated, then yes, it makes sense. But if no
> >> deprecation / replacement API is provided, then how will anybody prepare?
> >> For type changes, fields are usually not deprecated. Ifdefs are only used to
> >> prepare the changes for the next API bump. For example, buffer_size_t was in
> >> the codebase for 2 months only.
> >>
> >> It is not that big of a deal to make a patch if #ifdefs, I just really don't
> >> see the benefit.
> >>
> >> An actual problem however, is that printf() like functions expect type
> >> specifiers, and unlike buffer sizes, there is a good chance the users
> >> sometimes print AVCodecContext->frame_number or AVFrame->xxx_picture_number,
> >> which will become undefined behaviour. And yes, the compiler will usually
> >> warn, but still, type changes can cause silent breakage. But using #define
> >> API guards will not fix this, whenever you change the type, code will get
> >> broken, I am not sure if anything can be done about it.
> > if you want to avoid this then, new type, new identifer
> Sure, but do we want AVFrame->coded_picture_number64,
> AVFrame->display_picture_number64
Are these even useful for anything? The don't seem like they belong in
AVFrame.
--
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (26 preceding siblings ...)
2023-01-18 19:28 ` [FFmpeg-devel] [PATCH 00/26] Major library version bump Anton Khirnov
@ 2023-01-24 15:45 ` Anton Khirnov
2023-01-25 15:44 ` James Almer
2023-01-27 14:05 ` [FFmpeg-devel] [PATCH 26/31] avcodec/avcodec: Remove AV_CODEC_FLAG2_DROP_FRAME_TIMECODE Andreas Rheinhardt
` (3 subsequent siblings)
31 siblings, 1 reply; 102+ messages in thread
From: Anton Khirnov @ 2023-01-24 15:45 UTC (permalink / raw)
To: FFmpeg development discussions and patches
So to summarize the discussion so far:
* nobody is strongly arguing for an instability period after the bump,
and there are good reasons against it, therefore we should NOT have
one
* the bump can be done either as bump-then-remove or remove-then-bump
* there are advantages and disadvantages for both of those, nobody
expressed a strong preference for either, so you can keep this as
is
Please correct me if I misunderstood or missed something, or somebody
has a new opinion.
--
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-24 7:59 ` Anton Khirnov
@ 2023-01-24 19:48 ` Marton Balint
0 siblings, 0 replies; 102+ messages in thread
From: Marton Balint @ 2023-01-24 19:48 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Tue, 24 Jan 2023, Anton Khirnov wrote:
> Quoting Marton Balint (2023-01-24 01:06:46)
>> On Tue, 24 Jan 2023, Michael Niedermayer wrote:
>>> On Tue, Jan 24, 2023 at 12:22:52AM +0100, Marton Balint wrote:
>>>> On Mon, 23 Jan 2023, Anton Khirnov wrote:
>>>>> Quoting Marton Balint (2023-01-23 23:41:11)
>>>>>> On Mon, 23 Jan 2023, Anton Khirnov wrote:
>>>>>>> Not breaking callers seems like a very solid benefit to me.
>>>>>>
>>>>>> I am not sure if I see your point, during unstable, you can break callers,
>>>>>> and I planned to do the change during unstable.
>>>>>
>>>>> My understanding of this instability period is that it's mainly for ABI
>>>>> changes like reordering struct fields and such, you're still not allowed
>>>>> to arbitrarily break random APIs. The entire point of having deprecation
>>>>> periods is that callers can prepare in advance and never actually be
>>>>> broken.
>>>>
>>>> If some fields or API is deprecated, then yes, it makes sense. But if no
>>>> deprecation / replacement API is provided, then how will anybody prepare?
>>>> For type changes, fields are usually not deprecated. Ifdefs are only used to
>>>> prepare the changes for the next API bump. For example, buffer_size_t was in
>>>> the codebase for 2 months only.
>>>>
>>>> It is not that big of a deal to make a patch if #ifdefs, I just really don't
>>>> see the benefit.
>>>>
>>>> An actual problem however, is that printf() like functions expect type
>>>> specifiers, and unlike buffer sizes, there is a good chance the users
>>>> sometimes print AVCodecContext->frame_number or AVFrame->xxx_picture_number,
>>>> which will become undefined behaviour. And yes, the compiler will usually
>>>> warn, but still, type changes can cause silent breakage. But using #define
>>>> API guards will not fix this, whenever you change the type, code will get
>>>> broken, I am not sure if anything can be done about it.
>>> if you want to avoid this then, new type, new identifer
>> Sure, but do we want AVFrame->coded_picture_number64,
>> AVFrame->display_picture_number64
>
> Are these even useful for anything? The don't seem like they belong in
> AVFrame.
It might have some users as some decoders (Dirac or AVS3-P2) set it based
on bitstream values. Plus mpegvideoenc is also using it for something...
Regards,
Marton
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-24 15:45 ` Anton Khirnov
@ 2023-01-25 15:44 ` James Almer
2023-01-25 20:08 ` Marton Balint
0 siblings, 1 reply; 102+ messages in thread
From: James Almer @ 2023-01-25 15:44 UTC (permalink / raw)
To: ffmpeg-devel
On 1/24/2023 12:45 PM, Anton Khirnov wrote:
> So to summarize the discussion so far:
>
> * nobody is strongly arguing for an instability period after the bump,
> and there are good reasons against it, therefore we should NOT have
> one
>
> * the bump can be done either as bump-then-remove or remove-then-bump
> * there are advantages and disadvantages for both of those, nobody
> expressed a strong preference for either, so you can keep this as
> is
>
> Please correct me if I misunderstood or missed something, or somebody
> has a new opinion.
Since the instability period doesn't seem popular, if anyone has some
patches for ABI changes (enum value or field offset changes, removing
avpriv_ functions we forgot about, etc), then please send them asap so i
can push them all at the same time.
Otherwise, lets just do what we always did but limit it to one week,
after which too bad.
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-25 15:44 ` James Almer
@ 2023-01-25 20:08 ` Marton Balint
2023-01-25 20:44 ` Jean-Baptiste Kempf
0 siblings, 1 reply; 102+ messages in thread
From: Marton Balint @ 2023-01-25 20:08 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Wed, 25 Jan 2023, James Almer wrote:
> On 1/24/2023 12:45 PM, Anton Khirnov wrote:
>> So to summarize the discussion so far:
>>
>> * nobody is strongly arguing for an instability period after the bump,
>> and there are good reasons against it, therefore we should NOT have
>> one
>>
>> * the bump can be done either as bump-then-remove or remove-then-bump
>> * there are advantages and disadvantages for both of those, nobody
>> expressed a strong preference for either, so you can keep this as
>> is
>>
>> Please correct me if I misunderstood or missed something, or somebody
>> has a new opinion.
>
> Since the instability period doesn't seem popular, if anyone has some patches
> for ABI changes (enum value or field offset changes, removing avpriv_
> functions we forgot about, etc), then please send them asap so i can push
> them all at the same time.
Ok, I can send the frame number changes tomorrow. When do you plan to do
the actual bump? I assumed the last 5.x release should be branched first.
Regards,
Marton
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-25 20:08 ` Marton Balint
@ 2023-01-25 20:44 ` Jean-Baptiste Kempf
2023-01-25 21:03 ` Marton Balint
0 siblings, 1 reply; 102+ messages in thread
From: Jean-Baptiste Kempf @ 2023-01-25 20:44 UTC (permalink / raw)
To: ffmpeg-devel
On Wed, 25 Jan 2023, at 21:08, Marton Balint wrote:
> On Wed, 25 Jan 2023, James Almer wrote:
>
>> On 1/24/2023 12:45 PM, Anton Khirnov wrote:
>>> So to summarize the discussion so far:
>>>
>>> * nobody is strongly arguing for an instability period after the bump,
>>> and there are good reasons against it, therefore we should NOT have
>>> one
>>>
>>> * the bump can be done either as bump-then-remove or remove-then-bump
>>> * there are advantages and disadvantages for both of those, nobody
>>> expressed a strong preference for either, so you can keep this as
>>> is
>>>
>>> Please correct me if I misunderstood or missed something, or somebody
>>> has a new opinion.
>>
>> Since the instability period doesn't seem popular, if anyone has some patches
>> for ABI changes (enum value or field offset changes, removing avpriv_
>> functions we forgot about, etc), then please send them asap so i can push
>> them all at the same time.
>
> Ok, I can send the frame number changes tomorrow. When do you plan to do
> the actual bump? I assumed the last 5.x release should be branched first.
Why? 5.1 was already branched out.
I would Bump and prepare 6.0 just after, no?
--
Jean-Baptiste Kempf - President
+33 672 704 734
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-25 20:44 ` Jean-Baptiste Kempf
@ 2023-01-25 21:03 ` Marton Balint
2023-01-25 21:15 ` Jean-Baptiste Kempf
0 siblings, 1 reply; 102+ messages in thread
From: Marton Balint @ 2023-01-25 21:03 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Wed, 25 Jan 2023, Jean-Baptiste Kempf wrote:
> On Wed, 25 Jan 2023, at 21:08, Marton Balint wrote:
>> On Wed, 25 Jan 2023, James Almer wrote:
>>
>>> On 1/24/2023 12:45 PM, Anton Khirnov wrote:
>>>> So to summarize the discussion so far:
>>>>
>>>> * nobody is strongly arguing for an instability period after the bump,
>>>> and there are good reasons against it, therefore we should NOT have
>>>> one
>>>>
>>>> * the bump can be done either as bump-then-remove or remove-then-bump
>>>> * there are advantages and disadvantages for both of those, nobody
>>>> expressed a strong preference for either, so you can keep this as
>>>> is
>>>>
>>>> Please correct me if I misunderstood or missed something, or somebody
>>>> has a new opinion.
>>>
>>> Since the instability period doesn't seem popular, if anyone has some patches
>>> for ABI changes (enum value or field offset changes, removing avpriv_
>>> functions we forgot about, etc), then please send them asap so i can push
>>> them all at the same time.
>>
>> Ok, I can send the frame number changes tomorrow. When do you plan to do
>> the actual bump? I assumed the last 5.x release should be branched first.
>
> Why? 5.1 was already branched out.
And is missing 6 months of development. IMHO it is friendly to
users/packagers to have a release which have the latest features and
API/ABI compatible with older releases. Distros or third party
packagers can provide upgrades without breaking dependant apps.
We followed the same path for the last major bump. Also I find it
better to let things cool down a bit before we do a 6.0 release with the
new major versions, even if the "unstable" period is 1 week only or less.
Regards,
Marton
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-25 21:03 ` Marton Balint
@ 2023-01-25 21:15 ` Jean-Baptiste Kempf
2023-01-25 21:20 ` Paul B Mahol
2023-01-25 22:28 ` Marton Balint
0 siblings, 2 replies; 102+ messages in thread
From: Jean-Baptiste Kempf @ 2023-01-25 21:15 UTC (permalink / raw)
To: ffmpeg-devel
On Wed, 25 Jan 2023, at 22:03, Marton Balint wrote:
> On Wed, 25 Jan 2023, Jean-Baptiste Kempf wrote:
>
>> On Wed, 25 Jan 2023, at 21:08, Marton Balint wrote:
>>> On Wed, 25 Jan 2023, James Almer wrote:
>>>
>>>> On 1/24/2023 12:45 PM, Anton Khirnov wrote:
>>>>> So to summarize the discussion so far:
>>>>>
>>>>> * nobody is strongly arguing for an instability period after the bump,
>>>>> and there are good reasons against it, therefore we should NOT have
>>>>> one
>>>>>
>>>>> * the bump can be done either as bump-then-remove or remove-then-bump
>>>>> * there are advantages and disadvantages for both of those, nobody
>>>>> expressed a strong preference for either, so you can keep this as
>>>>> is
>>>>>
>>>>> Please correct me if I misunderstood or missed something, or somebody
>>>>> has a new opinion.
>>>>
>>>> Since the instability period doesn't seem popular, if anyone has some patches
>>>> for ABI changes (enum value or field offset changes, removing avpriv_
>>>> functions we forgot about, etc), then please send them asap so i can push
>>>> them all at the same time.
>>>
>>> Ok, I can send the frame number changes tomorrow. When do you plan to do
>>> the actual bump? I assumed the last 5.x release should be branched first.
>>
>> Why? 5.1 was already branched out.
>
> And is missing 6 months of development.
So you want us to release both 6.0 and 5.2 at the same time?
I don't get it.
--
Jean-Baptiste Kempf - President
+33 672 704 734
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-25 21:15 ` Jean-Baptiste Kempf
@ 2023-01-25 21:20 ` Paul B Mahol
2023-01-25 21:26 ` Jean-Baptiste Kempf
2023-01-25 22:28 ` Marton Balint
1 sibling, 1 reply; 102+ messages in thread
From: Paul B Mahol @ 2023-01-25 21:20 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On 1/25/23, Jean-Baptiste Kempf <jb@videolan.org> wrote:
> On Wed, 25 Jan 2023, at 22:03, Marton Balint wrote:
>> On Wed, 25 Jan 2023, Jean-Baptiste Kempf wrote:
>>
>>> On Wed, 25 Jan 2023, at 21:08, Marton Balint wrote:
>>>> On Wed, 25 Jan 2023, James Almer wrote:
>>>>
>>>>> On 1/24/2023 12:45 PM, Anton Khirnov wrote:
>>>>>> So to summarize the discussion so far:
>>>>>>
>>>>>> * nobody is strongly arguing for an instability period after the
>>>>>> bump,
>>>>>> and there are good reasons against it, therefore we should NOT
>>>>>> have
>>>>>> one
>>>>>>
>>>>>> * the bump can be done either as bump-then-remove or
>>>>>> remove-then-bump
>>>>>> * there are advantages and disadvantages for both of those,
>>>>>> nobody
>>>>>> expressed a strong preference for either, so you can keep this
>>>>>> as
>>>>>> is
>>>>>>
>>>>>> Please correct me if I misunderstood or missed something, or
>>>>>> somebody
>>>>>> has a new opinion.
>>>>>
>>>>> Since the instability period doesn't seem popular, if anyone has some
>>>>> patches
>>>>> for ABI changes (enum value or field offset changes, removing avpriv_
>>>>> functions we forgot about, etc), then please send them asap so i can
>>>>> push
>>>>> them all at the same time.
>>>>
>>>> Ok, I can send the frame number changes tomorrow. When do you plan to
>>>> do
>>>> the actual bump? I assumed the last 5.x release should be branched
>>>> first.
>>>
>>> Why? 5.1 was already branched out.
>>
>> And is missing 6 months of development.
>
> So you want us to release both 6.0 and 5.2 at the same time?
> I don't get it.
So user do not need to immediately update code that uses old API to
get new fancy features.
>
> --
> Jean-Baptiste Kempf - President
> +33 672 704 734
> _______________________________________________
> 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".
>
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-25 21:20 ` Paul B Mahol
@ 2023-01-25 21:26 ` Jean-Baptiste Kempf
2023-01-25 21:29 ` Paul B Mahol
0 siblings, 1 reply; 102+ messages in thread
From: Jean-Baptiste Kempf @ 2023-01-25 21:26 UTC (permalink / raw)
To: ffmpeg-devel
On Wed, 25 Jan 2023, at 22:20, Paul B Mahol wrote:
> On 1/25/23, Jean-Baptiste Kempf <jb@videolan.org> wrote:
>> On Wed, 25 Jan 2023, at 22:03, Marton Balint wrote:
>>> On Wed, 25 Jan 2023, Jean-Baptiste Kempf wrote:
>>>
>>>> On Wed, 25 Jan 2023, at 21:08, Marton Balint wrote:
>>>>> On Wed, 25 Jan 2023, James Almer wrote:
>>>>>
>>>>>> On 1/24/2023 12:45 PM, Anton Khirnov wrote:
>>>>>>> So to summarize the discussion so far:
>>>>>>>
>>>>>>> * nobody is strongly arguing for an instability period after the
>>>>>>> bump,
>>>>>>> and there are good reasons against it, therefore we should NOT
>>>>>>> have
>>>>>>> one
>>>>>>>
>>>>>>> * the bump can be done either as bump-then-remove or
>>>>>>> remove-then-bump
>>>>>>> * there are advantages and disadvantages for both of those,
>>>>>>> nobody
>>>>>>> expressed a strong preference for either, so you can keep this
>>>>>>> as
>>>>>>> is
>>>>>>>
>>>>>>> Please correct me if I misunderstood or missed something, or
>>>>>>> somebody
>>>>>>> has a new opinion.
>>>>>>
>>>>>> Since the instability period doesn't seem popular, if anyone has some
>>>>>> patches
>>>>>> for ABI changes (enum value or field offset changes, removing avpriv_
>>>>>> functions we forgot about, etc), then please send them asap so i can
>>>>>> push
>>>>>> them all at the same time.
>>>>>
>>>>> Ok, I can send the frame number changes tomorrow. When do you plan to
>>>>> do
>>>>> the actual bump? I assumed the last 5.x release should be branched
>>>>> first.
>>>>
>>>> Why? 5.1 was already branched out.
>>>
>>> And is missing 6 months of development.
>>
>> So you want us to release both 6.0 and 5.2 at the same time?
>> I don't get it.
>
> So user do not need to immediately update code that uses old API to
> get new fancy features.
And when do you stop doing this?
Also, as 5.1 is LTS, is 5.2 LTS too?
--
Jean-Baptiste Kempf - President
+33 672 704 734
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-25 21:26 ` Jean-Baptiste Kempf
@ 2023-01-25 21:29 ` Paul B Mahol
2023-01-25 21:31 ` Jean-Baptiste Kempf
0 siblings, 1 reply; 102+ messages in thread
From: Paul B Mahol @ 2023-01-25 21:29 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On 1/25/23, Jean-Baptiste Kempf <jb@videolan.org> wrote:
>
>
> On Wed, 25 Jan 2023, at 22:20, Paul B Mahol wrote:
>> On 1/25/23, Jean-Baptiste Kempf <jb@videolan.org> wrote:
>>> On Wed, 25 Jan 2023, at 22:03, Marton Balint wrote:
>>>> On Wed, 25 Jan 2023, Jean-Baptiste Kempf wrote:
>>>>
>>>>> On Wed, 25 Jan 2023, at 21:08, Marton Balint wrote:
>>>>>> On Wed, 25 Jan 2023, James Almer wrote:
>>>>>>
>>>>>>> On 1/24/2023 12:45 PM, Anton Khirnov wrote:
>>>>>>>> So to summarize the discussion so far:
>>>>>>>>
>>>>>>>> * nobody is strongly arguing for an instability period after the
>>>>>>>> bump,
>>>>>>>> and there are good reasons against it, therefore we should NOT
>>>>>>>> have
>>>>>>>> one
>>>>>>>>
>>>>>>>> * the bump can be done either as bump-then-remove or
>>>>>>>> remove-then-bump
>>>>>>>> * there are advantages and disadvantages for both of those,
>>>>>>>> nobody
>>>>>>>> expressed a strong preference for either, so you can keep
>>>>>>>> this
>>>>>>>> as
>>>>>>>> is
>>>>>>>>
>>>>>>>> Please correct me if I misunderstood or missed something, or
>>>>>>>> somebody
>>>>>>>> has a new opinion.
>>>>>>>
>>>>>>> Since the instability period doesn't seem popular, if anyone has
>>>>>>> some
>>>>>>> patches
>>>>>>> for ABI changes (enum value or field offset changes, removing
>>>>>>> avpriv_
>>>>>>> functions we forgot about, etc), then please send them asap so i can
>>>>>>> push
>>>>>>> them all at the same time.
>>>>>>
>>>>>> Ok, I can send the frame number changes tomorrow. When do you plan to
>>>>>> do
>>>>>> the actual bump? I assumed the last 5.x release should be branched
>>>>>> first.
>>>>>
>>>>> Why? 5.1 was already branched out.
>>>>
>>>> And is missing 6 months of development.
>>>
>>> So you want us to release both 6.0 and 5.2 at the same time?
>>> I don't get it.
>>
>> So user do not need to immediately update code that uses old API to
>> get new fancy features.
>
> And when do you stop doing this?
After 6.0 tagged.
> Also, as 5.1 is LTS, is 5.2 LTS too?
>
No, its not.
> --
> Jean-Baptiste Kempf - President
> +33 672 704 734
> _______________________________________________
> 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".
>
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-25 21:29 ` Paul B Mahol
@ 2023-01-25 21:31 ` Jean-Baptiste Kempf
2023-01-25 21:34 ` Paul B Mahol
0 siblings, 1 reply; 102+ messages in thread
From: Jean-Baptiste Kempf @ 2023-01-25 21:31 UTC (permalink / raw)
To: ffmpeg-devel
On Wed, 25 Jan 2023, at 22:29, Paul B Mahol wrote:
> On 1/25/23, Jean-Baptiste Kempf <jb@videolan.org> wrote:
>>
>>
>> On Wed, 25 Jan 2023, at 22:20, Paul B Mahol wrote:
>>> On 1/25/23, Jean-Baptiste Kempf <jb@videolan.org> wrote:
>>>> On Wed, 25 Jan 2023, at 22:03, Marton Balint wrote:
>>>>> On Wed, 25 Jan 2023, Jean-Baptiste Kempf wrote:
>>>>>
>>>>>> On Wed, 25 Jan 2023, at 21:08, Marton Balint wrote:
>>>>>>> On Wed, 25 Jan 2023, James Almer wrote:
>>>>>>>
>>>>>>>> On 1/24/2023 12:45 PM, Anton Khirnov wrote:
>>>>>>>>> So to summarize the discussion so far:
>>>>>>>>>
>>>>>>>>> * nobody is strongly arguing for an instability period after the
>>>>>>>>> bump,
>>>>>>>>> and there are good reasons against it, therefore we should NOT
>>>>>>>>> have
>>>>>>>>> one
>>>>>>>>>
>>>>>>>>> * the bump can be done either as bump-then-remove or
>>>>>>>>> remove-then-bump
>>>>>>>>> * there are advantages and disadvantages for both of those,
>>>>>>>>> nobody
>>>>>>>>> expressed a strong preference for either, so you can keep
>>>>>>>>> this
>>>>>>>>> as
>>>>>>>>> is
>>>>>>>>>
>>>>>>>>> Please correct me if I misunderstood or missed something, or
>>>>>>>>> somebody
>>>>>>>>> has a new opinion.
>>>>>>>>
>>>>>>>> Since the instability period doesn't seem popular, if anyone has
>>>>>>>> some
>>>>>>>> patches
>>>>>>>> for ABI changes (enum value or field offset changes, removing
>>>>>>>> avpriv_
>>>>>>>> functions we forgot about, etc), then please send them asap so i can
>>>>>>>> push
>>>>>>>> them all at the same time.
>>>>>>>
>>>>>>> Ok, I can send the frame number changes tomorrow. When do you plan to
>>>>>>> do
>>>>>>> the actual bump? I assumed the last 5.x release should be branched
>>>>>>> first.
>>>>>>
>>>>>> Why? 5.1 was already branched out.
>>>>>
>>>>> And is missing 6 months of development.
>>>>
>>>> So you want us to release both 6.0 and 5.2 at the same time?
>>>> I don't get it.
>>>
>>> So user do not need to immediately update code that uses old API to
>>> get new fancy features.
>>
>> And when do you stop doing this?
>
> After 6.0 tagged.
>
>> Also, as 5.1 is LTS, is 5.2 LTS too?
>>
>
> No, its not.
So, we tag 5.2 out of master?
Then bump, and tag 6.0 too? And then branch out 6.0?
--
Jean-Baptiste Kempf - President
+33 672 704 734
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-25 21:31 ` Jean-Baptiste Kempf
@ 2023-01-25 21:34 ` Paul B Mahol
0 siblings, 0 replies; 102+ messages in thread
From: Paul B Mahol @ 2023-01-25 21:34 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On 1/25/23, Jean-Baptiste Kempf <jb@videolan.org> wrote:
>
>
> On Wed, 25 Jan 2023, at 22:29, Paul B Mahol wrote:
>> On 1/25/23, Jean-Baptiste Kempf <jb@videolan.org> wrote:
>>>
>>>
>>> On Wed, 25 Jan 2023, at 22:20, Paul B Mahol wrote:
>>>> On 1/25/23, Jean-Baptiste Kempf <jb@videolan.org> wrote:
>>>>> On Wed, 25 Jan 2023, at 22:03, Marton Balint wrote:
>>>>>> On Wed, 25 Jan 2023, Jean-Baptiste Kempf wrote:
>>>>>>
>>>>>>> On Wed, 25 Jan 2023, at 21:08, Marton Balint wrote:
>>>>>>>> On Wed, 25 Jan 2023, James Almer wrote:
>>>>>>>>
>>>>>>>>> On 1/24/2023 12:45 PM, Anton Khirnov wrote:
>>>>>>>>>> So to summarize the discussion so far:
>>>>>>>>>>
>>>>>>>>>> * nobody is strongly arguing for an instability period after the
>>>>>>>>>> bump,
>>>>>>>>>> and there are good reasons against it, therefore we should
>>>>>>>>>> NOT
>>>>>>>>>> have
>>>>>>>>>> one
>>>>>>>>>>
>>>>>>>>>> * the bump can be done either as bump-then-remove or
>>>>>>>>>> remove-then-bump
>>>>>>>>>> * there are advantages and disadvantages for both of those,
>>>>>>>>>> nobody
>>>>>>>>>> expressed a strong preference for either, so you can keep
>>>>>>>>>> this
>>>>>>>>>> as
>>>>>>>>>> is
>>>>>>>>>>
>>>>>>>>>> Please correct me if I misunderstood or missed something, or
>>>>>>>>>> somebody
>>>>>>>>>> has a new opinion.
>>>>>>>>>
>>>>>>>>> Since the instability period doesn't seem popular, if anyone has
>>>>>>>>> some
>>>>>>>>> patches
>>>>>>>>> for ABI changes (enum value or field offset changes, removing
>>>>>>>>> avpriv_
>>>>>>>>> functions we forgot about, etc), then please send them asap so i
>>>>>>>>> can
>>>>>>>>> push
>>>>>>>>> them all at the same time.
>>>>>>>>
>>>>>>>> Ok, I can send the frame number changes tomorrow. When do you plan
>>>>>>>> to
>>>>>>>> do
>>>>>>>> the actual bump? I assumed the last 5.x release should be branched
>>>>>>>> first.
>>>>>>>
>>>>>>> Why? 5.1 was already branched out.
>>>>>>
>>>>>> And is missing 6 months of development.
>>>>>
>>>>> So you want us to release both 6.0 and 5.2 at the same time?
>>>>> I don't get it.
>>>>
>>>> So user do not need to immediately update code that uses old API to
>>>> get new fancy features.
>>>
>>> And when do you stop doing this?
>>
>> After 6.0 tagged.
>>
>>> Also, as 5.1 is LTS, is 5.2 LTS too?
>>>
>>
>> No, its not.
>
> So, we tag 5.2 out of master?
> Then bump, and tag 6.0 too? And then branch out 6.0?
Yes, with all old API support removed. This is the new way!
>
> --
> Jean-Baptiste Kempf - President
> +33 672 704 734
> _______________________________________________
> 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".
>
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-25 21:15 ` Jean-Baptiste Kempf
2023-01-25 21:20 ` Paul B Mahol
@ 2023-01-25 22:28 ` Marton Balint
2023-01-25 22:48 ` Jean-Baptiste Kempf
1 sibling, 1 reply; 102+ messages in thread
From: Marton Balint @ 2023-01-25 22:28 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Wed, 25 Jan 2023, Jean-Baptiste Kempf wrote:
> On Wed, 25 Jan 2023, at 22:03, Marton Balint wrote:
>> On Wed, 25 Jan 2023, Jean-Baptiste Kempf wrote:
>>
>>> On Wed, 25 Jan 2023, at 21:08, Marton Balint wrote:
>>>> On Wed, 25 Jan 2023, James Almer wrote:
>>>>
>>>>> On 1/24/2023 12:45 PM, Anton Khirnov wrote:
>>>>>> So to summarize the discussion so far:
>>>>>>
>>>>>> * nobody is strongly arguing for an instability period after the bump,
>>>>>> and there are good reasons against it, therefore we should NOT have
>>>>>> one
>>>>>>
>>>>>> * the bump can be done either as bump-then-remove or remove-then-bump
>>>>>> * there are advantages and disadvantages for both of those, nobody
>>>>>> expressed a strong preference for either, so you can keep this as
>>>>>> is
>>>>>>
>>>>>> Please correct me if I misunderstood or missed something, or somebody
>>>>>> has a new opinion.
>>>>>
>>>>> Since the instability period doesn't seem popular, if anyone has some patches
>>>>> for ABI changes (enum value or field offset changes, removing avpriv_
>>>>> functions we forgot about, etc), then please send them asap so i can push
>>>>> them all at the same time.
>>>>
>>>> Ok, I can send the frame number changes tomorrow. When do you plan to do
>>>> the actual bump? I assumed the last 5.x release should be branched first.
>>>
>>> Why? 5.1 was already branched out.
>>
>> And is missing 6 months of development.
>
> So you want us to release both 6.0 and 5.2 at the same time?
> I don't get it.
I don't see too much benefit in releasing 6.0 right now just because we
bumped API, beacuse API bump typically means API removal, not addition.
So my suggestion is to release 5.2, then bump, then release 6.0 in a few
months. As I said, this allow things to calm down after the bump, which I
find good practice even if we do not have a formal unstable period.
This is quite in line with what James proposed with 3 point releases:
x.0 - first release after API break
x.1 - LTS
x.2 - last release before API break
Regards,
Marton
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-25 22:28 ` Marton Balint
@ 2023-01-25 22:48 ` Jean-Baptiste Kempf
2023-01-25 23:25 ` Marton Balint
0 siblings, 1 reply; 102+ messages in thread
From: Jean-Baptiste Kempf @ 2023-01-25 22:48 UTC (permalink / raw)
To: ffmpeg-devel
On Wed, 25 Jan 2023, at 23:28, Marton Balint wrote:
> On Wed, 25 Jan 2023, Jean-Baptiste Kempf wrote:
>
>> On Wed, 25 Jan 2023, at 22:03, Marton Balint wrote:
>>> On Wed, 25 Jan 2023, Jean-Baptiste Kempf wrote:
>>>
>>>> On Wed, 25 Jan 2023, at 21:08, Marton Balint wrote:
>>>>> On Wed, 25 Jan 2023, James Almer wrote:
>>>>>
>>>>>> On 1/24/2023 12:45 PM, Anton Khirnov wrote:
>>>>>>> So to summarize the discussion so far:
>>>>>>>
>>>>>>> * nobody is strongly arguing for an instability period after the bump,
>>>>>>> and there are good reasons against it, therefore we should NOT have
>>>>>>> one
>>>>>>>
>>>>>>> * the bump can be done either as bump-then-remove or remove-then-bump
>>>>>>> * there are advantages and disadvantages for both of those, nobody
>>>>>>> expressed a strong preference for either, so you can keep this as
>>>>>>> is
>>>>>>>
>>>>>>> Please correct me if I misunderstood or missed something, or somebody
>>>>>>> has a new opinion.
>>>>>>
>>>>>> Since the instability period doesn't seem popular, if anyone has some patches
>>>>>> for ABI changes (enum value or field offset changes, removing avpriv_
>>>>>> functions we forgot about, etc), then please send them asap so i can push
>>>>>> them all at the same time.
>>>>>
>>>>> Ok, I can send the frame number changes tomorrow. When do you plan to do
>>>>> the actual bump? I assumed the last 5.x release should be branched first.
>>>>
>>>> Why? 5.1 was already branched out.
>>>
>>> And is missing 6 months of development.
>>
>> So you want us to release both 6.0 and 5.2 at the same time?
>> I don't get it.
>
> I don't see too much benefit in releasing 6.0 right now just because we
> bumped API, beacuse API bump typically means API removal, not addition.
Because that's what we agreed on?
Do a major release every year in Dec/Jan with an ABI/API breakage at that time.
If you want to do a 5.2, why not, but I don't see the need, especially if 5.1 is the LTS one. But why not...
But not doing what we said about major releases is a big breakage of trust.
--
Jean-Baptiste Kempf - President
+33 672 704 734
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-25 22:48 ` Jean-Baptiste Kempf
@ 2023-01-25 23:25 ` Marton Balint
2023-01-26 22:16 ` Michael Niedermayer
0 siblings, 1 reply; 102+ messages in thread
From: Marton Balint @ 2023-01-25 23:25 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Wed, 25 Jan 2023, Jean-Baptiste Kempf wrote:
> On Wed, 25 Jan 2023, at 23:28, Marton Balint wrote:
>> On Wed, 25 Jan 2023, Jean-Baptiste Kempf wrote:
>>
>>> On Wed, 25 Jan 2023, at 22:03, Marton Balint wrote:
>>>> On Wed, 25 Jan 2023, Jean-Baptiste Kempf wrote:
>>>>
>>>>> On Wed, 25 Jan 2023, at 21:08, Marton Balint wrote:
>>>>>> On Wed, 25 Jan 2023, James Almer wrote:
>>>>>>
>>>>>>> On 1/24/2023 12:45 PM, Anton Khirnov wrote:
>>>>>>>> So to summarize the discussion so far:
>>>>>>>>
>>>>>>>> * nobody is strongly arguing for an instability period after the bump,
>>>>>>>> and there are good reasons against it, therefore we should NOT have
>>>>>>>> one
>>>>>>>>
>>>>>>>> * the bump can be done either as bump-then-remove or remove-then-bump
>>>>>>>> * there are advantages and disadvantages for both of those, nobody
>>>>>>>> expressed a strong preference for either, so you can keep this as
>>>>>>>> is
>>>>>>>>
>>>>>>>> Please correct me if I misunderstood or missed something, or somebody
>>>>>>>> has a new opinion.
>>>>>>>
>>>>>>> Since the instability period doesn't seem popular, if anyone has some patches
>>>>>>> for ABI changes (enum value or field offset changes, removing avpriv_
>>>>>>> functions we forgot about, etc), then please send them asap so i can push
>>>>>>> them all at the same time.
>>>>>>
>>>>>> Ok, I can send the frame number changes tomorrow. When do you plan to do
>>>>>> the actual bump? I assumed the last 5.x release should be branched first.
>>>>>
>>>>> Why? 5.1 was already branched out.
>>>>
>>>> And is missing 6 months of development.
>>>
>>> So you want us to release both 6.0 and 5.2 at the same time?
>>> I don't get it.
>>
>> I don't see too much benefit in releasing 6.0 right now just because we
>> bumped API, beacuse API bump typically means API removal, not addition.
>
> Because that's what we agreed on?
> Do a major release every year in Dec/Jan with an ABI/API breakage at that time.
>
> If you want to do a 5.2, why not, but I don't see the need, especially if 5.1 is the LTS one. But why not...
> But not doing what we said about major releases is a big breakage of trust.
Okay, maybe its just me, but I missed this decision, and I don't remember
any discussions regarding it. Can you give me some pointers?
Thanks,
Marton
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-25 23:25 ` Marton Balint
@ 2023-01-26 22:16 ` Michael Niedermayer
2023-01-26 22:49 ` Jean-Baptiste Kempf
0 siblings, 1 reply; 102+ messages in thread
From: Michael Niedermayer @ 2023-01-26 22:16 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 5390 bytes --]
On Thu, Jan 26, 2023 at 12:25:39AM +0100, Marton Balint wrote:
>
>
> On Wed, 25 Jan 2023, Jean-Baptiste Kempf wrote:
>
> > On Wed, 25 Jan 2023, at 23:28, Marton Balint wrote:
> > > On Wed, 25 Jan 2023, Jean-Baptiste Kempf wrote:
> > >
> > > > On Wed, 25 Jan 2023, at 22:03, Marton Balint wrote:
> > > > > On Wed, 25 Jan 2023, Jean-Baptiste Kempf wrote:
> > > > >
> > > > > > On Wed, 25 Jan 2023, at 21:08, Marton Balint wrote:
> > > > > > > On Wed, 25 Jan 2023, James Almer wrote:
> > > > > > >
> > > > > > > > On 1/24/2023 12:45 PM, Anton Khirnov wrote:
> > > > > > > > > So to summarize the discussion so far:
> > > > > > > > >
> > > > > > > > > * nobody is strongly arguing for an instability period after the bump,
> > > > > > > > > and there are good reasons against it, therefore we should NOT have
> > > > > > > > > one
> > > > > > > > >
> > > > > > > > > * the bump can be done either as bump-then-remove or remove-then-bump
> > > > > > > > > * there are advantages and disadvantages for both of those, nobody
> > > > > > > > > expressed a strong preference for either, so you can keep this as
> > > > > > > > > is
> > > > > > > > >
> > > > > > > > > Please correct me if I misunderstood or missed something, or somebody
> > > > > > > > > has a new opinion.
> > > > > > > >
> > > > > > > > Since the instability period doesn't seem popular, if anyone has some patches
> > > > > > > > for ABI changes (enum value or field offset changes, removing avpriv_
> > > > > > > > functions we forgot about, etc), then please send them asap so i can push
> > > > > > > > them all at the same time.
> > > > > > >
> > > > > > > Ok, I can send the frame number changes tomorrow. When do you plan to do
> > > > > > > the actual bump? I assumed the last 5.x release should be branched first.
> > > > > >
> > > > > > Why? 5.1 was already branched out.
> > > > >
> > > > > And is missing 6 months of development.
> > > >
> > > > So you want us to release both 6.0 and 5.2 at the same time?
> > > > I don't get it.
> > >
> > > I don't see too much benefit in releasing 6.0 right now just because we
> > > bumped API, beacuse API bump typically means API removal, not addition.
> >
> > Because that's what we agreed on?
> > Do a major release every year in Dec/Jan with an ABI/API breakage at that time.
> >
> > If you want to do a 5.2, why not, but I don't see the need, especially if 5.1 is the LTS one. But why not...
I can branch release/5.2 and make a release if theres agreement on that ?
I dont think we should tag a release on master that will make point releases
a mess as we need a branch for them
I can also make a release/6.0 and release after the bump but it feels a bit like
there should be a bit time between the bump and the release so teh codebase is
tested a bit after ABI/API changes
> > But not doing what we said about major releases is a big breakage of trust.
>
> Okay, maybe its just me, but I missed this decision, and I don't remember
> any discussions regarding it. Can you give me some pointers?
I think in general these are the constraints to optimize our release timing
against:
1. We seem to want 2 releases per year
2. If we do a major bump, it should ideally happen after a release not before
to give time for stabilization and to give max features to the old API/ABI
3. The releases which get into distros should be LTS
4. LTS releases should be timed so that they are getting into major distros
5. What gets into major distros should have maximum features and maximum stability
6. We should try to stick to what we said previously
7. We should have a predictable release cycle
Some of these points are easy, some are a bit harder.
to do 4. we (or i) need to know when the window is for distros to pick our release
up, this should ideally leave time for a point release in case theers something major
that needs fixing.
I think someone should document these time windows for major distros somewhere
like on trac so we all know what we are aiming for and why
Now about 6. i asked google about ffmpeg release cycle
it pointed me to a ffmpeg-user post from 2014
https://ffmpeg.org/pipermail/ffmpeg-user/2014-March/020558.html
but that points more to git master than a release cycle
another link goes to wikipedia
"The project publishes a new release every three months on average. While release versions are available from the website for download, FFmpeg developers recommend that users compile the software from source using the latest build from their source code Git version control system"
i have the feeling i will leave that resolution to someone else :)
but iam happy to make releases every 6 or 3 months, later would be more work
of course.
So what do people think ?
when should i branch 5.2, when 6.0 ? and when 6.1 and then 6.2 or 7.0 when ?
also which should be LTS ?
Btw, did we say that we will bump API/ABI in 6.0 or just that we will make
6.0 in dec/jan ?
Iam pretty bad at remembering these plans, my notes say 6.0 in dec 2022 but
that was not done because it would have competed with the LTS for inclusion
in distros
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
What does censorship reveal? It reveals fear. -- Julian Assange
[-- 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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-26 22:16 ` Michael Niedermayer
@ 2023-01-26 22:49 ` Jean-Baptiste Kempf
2023-01-26 23:19 ` Michael Niedermayer
2023-01-27 18:42 ` James Almer
0 siblings, 2 replies; 102+ messages in thread
From: Jean-Baptiste Kempf @ 2023-01-26 22:49 UTC (permalink / raw)
To: Michael Niedermayer, ffmpeg-devel
On Thu, 26 Jan 2023, at 23:16, Michael Niedermayer wrote:
> I think in general these are the constraints to optimize our release timing
> against:
>
> 1. We seem to want 2 releases per year
Yes.
> 2. If we do a major bump, it should ideally happen after a release not
> before to give time for stabilization and to give max features to the old
> API/ABI
We said that one of those release would break ABI and API, and that would be the
one at the dec/jan time
> 3. The releases which get into distros should be LTS
Yes
> 4. LTS releases should be timed so that they are getting into major
> distros
> 5. What gets into major distros should have maximum features and
> maximum stability
> 6. We should try to stick to what we said previously
> 7. We should have a predictable release cycle
> So what do people think ?
> when should i branch 5.2, when 6.0 ? and when 6.1 and then 6.2 or 7.0 when ?
> also which should be LTS ?
We've had this discussion the last time, notably for whether we should make 5.0 an LTS or 5.1 an LTS and we said:
5.0 in jan 2022, 5.1 in July 2022 with LTS
6.0 in jan 2023, 6.1 in July 2023
7.0 in jan 2024, 7.1 in July 2023 with LTS
We said 5.0, 6.0 and 7.0 would be allowed to break API/ABI, aka big-bumps.
We said we could do more 5.x or 6.x releases, if we needed more than 2 releases per year.
We discussed that at several developer meetings, including the last one we had, a few weeks ago.
> Btw, did we say that we will bump API/ABI in 6.0 or just that we will make
> 6.0 in dec/jan ?
Both.
> Iam pretty bad at remembering these plans, my notes say 6.0 in dec 2022 but
> that was not done because it would have competed with the LTS for inclusion
> in distros
No, because distro take a LONG time to integrate releases, because of the software dependencies adaptations.
So, in Feb, they will use the last release of the previous major branch (here, a 5.1).
Tbh, I don't see why we should do a 5.2, seeing that 6.0 would be the same features-set with just the ABI change, aka removing deprecated symbols.
Also, doing a 5.2 which would not be a LTS, while 5.1 is a LTS is not only very weird, but it also goes against what we said last time, that the last of the 5.x would be LTS (similar for 7.1).
I would just merge the bump, then branch 6.0 branch and wait a few weeks before releasing 6.0.
If some people strongly want a 5.2, branch 5.2 before the bump and do a release at the same time.
--
Jean-Baptiste Kempf - President
+33 672 704 734
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-26 22:49 ` Jean-Baptiste Kempf
@ 2023-01-26 23:19 ` Michael Niedermayer
2023-01-26 23:21 ` Jean-Baptiste Kempf
2023-01-27 18:42 ` James Almer
1 sibling, 1 reply; 102+ messages in thread
From: Michael Niedermayer @ 2023-01-26 23:19 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 3111 bytes --]
On Thu, Jan 26, 2023 at 11:49:14PM +0100, Jean-Baptiste Kempf wrote:
> On Thu, 26 Jan 2023, at 23:16, Michael Niedermayer wrote:
> > I think in general these are the constraints to optimize our release timing
> > against:
> >
> > 1. We seem to want 2 releases per year
>
> Yes.
>
> > 2. If we do a major bump, it should ideally happen after a release not
> > before to give time for stabilization and to give max features to the old
> > API/ABI
>
> We said that one of those release would break ABI and API, and that would be the
> one at the dec/jan time
>
> > 3. The releases which get into distros should be LTS
>
> Yes
>
> > 4. LTS releases should be timed so that they are getting into major
> > distros
> > 5. What gets into major distros should have maximum features and
> > maximum stability
> > 6. We should try to stick to what we said previously
> > 7. We should have a predictable release cycle
>
>
> > So what do people think ?
> > when should i branch 5.2, when 6.0 ? and when 6.1 and then 6.2 or 7.0 when ?
> > also which should be LTS ?
>
> We've had this discussion the last time, notably for whether we should make 5.0 an LTS or 5.1 an LTS and we said:
> 5.0 in jan 2022, 5.1 in July 2022 with LTS
> 6.0 in jan 2023, 6.1 in July 2023
> 7.0 in jan 2024, 7.1 in July 2023 with LTS
>
> We said 5.0, 6.0 and 7.0 would be allowed to break API/ABI, aka big-bumps.
>
> We said we could do more 5.x or 6.x releases, if we needed more than 2 releases per year.
>
> We discussed that at several developer meetings, including the last one we had, a few weeks ago.
>
> > Btw, did we say that we will bump API/ABI in 6.0 or just that we will make
> > 6.0 in dec/jan ?
>
> Both.
>
> > Iam pretty bad at remembering these plans, my notes say 6.0 in dec 2022 but
> > that was not done because it would have competed with the LTS for inclusion
> > in distros
>
> No, because distro take a LONG time to integrate releases, because of the software dependencies adaptations.
> So, in Feb, they will use the last release of the previous major branch (here, a 5.1).
>
> Tbh, I don't see why we should do a 5.2, seeing that 6.0 would be the same features-set with just the ABI change, aka removing deprecated symbols.
>
> Also, doing a 5.2 which would not be a LTS, while 5.1 is a LTS is not only very weird, but it also goes against what we said last time, that the last of the 5.x would be LTS (similar for 7.1).
>
> I would just merge the bump, then branch 6.0 branch and wait a few weeks before releasing 6.0.
> If some people strongly want a 5.2, branch 5.2 before the bump and do a release at the same time.
ok
I would suggest one thing, if people want a bump between 2023 6.0 and 2024 7.0
then the bump should happen closer to 6.1 than 7.0
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Whats the most studid thing your enemy could do ? Blow himself up
Whats the most studid thing you could do ? Give up your rights and
freedom because your enemy blew himself up.
[-- 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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-26 23:19 ` Michael Niedermayer
@ 2023-01-26 23:21 ` Jean-Baptiste Kempf
0 siblings, 0 replies; 102+ messages in thread
From: Jean-Baptiste Kempf @ 2023-01-26 23:21 UTC (permalink / raw)
To: ffmpeg-devel
On Fri, 27 Jan 2023, at 00:19, Michael Niedermayer wrote:
> On Thu, Jan 26, 2023 at 11:49:14PM +0100, Jean-Baptiste Kempf wrote:
>> On Thu, 26 Jan 2023, at 23:16, Michael Niedermayer wrote:
>> > I think in general these are the constraints to optimize our release timing
>> > against:
>> >
>> > 1. We seem to want 2 releases per year
>>
>> Yes.
>>
>> > 2. If we do a major bump, it should ideally happen after a release not
>> > before to give time for stabilization and to give max features to the old
>> > API/ABI
>>
>> We said that one of those release would break ABI and API, and that would be the
>> one at the dec/jan time
>>
>> > 3. The releases which get into distros should be LTS
>>
>> Yes
>>
>> > 4. LTS releases should be timed so that they are getting into major
>> > distros
>> > 5. What gets into major distros should have maximum features and
>> > maximum stability
>> > 6. We should try to stick to what we said previously
>> > 7. We should have a predictable release cycle
>>
>>
>> > So what do people think ?
>> > when should i branch 5.2, when 6.0 ? and when 6.1 and then 6.2 or 7.0 when ?
>> > also which should be LTS ?
>>
>> We've had this discussion the last time, notably for whether we should make 5.0 an LTS or 5.1 an LTS and we said:
>> 5.0 in jan 2022, 5.1 in July 2022 with LTS
>> 6.0 in jan 2023, 6.1 in July 2023
>> 7.0 in jan 2024, 7.1 in July 2023 with LTS
>>
>> We said 5.0, 6.0 and 7.0 would be allowed to break API/ABI, aka big-bumps.
>>
>> We said we could do more 5.x or 6.x releases, if we needed more than 2 releases per year.
>>
>> We discussed that at several developer meetings, including the last one we had, a few weeks ago.
>>
>> > Btw, did we say that we will bump API/ABI in 6.0 or just that we will make
>> > 6.0 in dec/jan ?
>>
>> Both.
>>
>> > Iam pretty bad at remembering these plans, my notes say 6.0 in dec 2022 but
>> > that was not done because it would have competed with the LTS for inclusion
>> > in distros
>>
>> No, because distro take a LONG time to integrate releases, because of the software dependencies adaptations.
>> So, in Feb, they will use the last release of the previous major branch (here, a 5.1).
>>
>> Tbh, I don't see why we should do a 5.2, seeing that 6.0 would be the same features-set with just the ABI change, aka removing deprecated symbols.
>>
>> Also, doing a 5.2 which would not be a LTS, while 5.1 is a LTS is not only very weird, but it also goes against what we said last time, that the last of the 5.x would be LTS (similar for 7.1).
>>
>> I would just merge the bump, then branch 6.0 branch and wait a few weeks before releasing 6.0.
>> If some people strongly want a 5.2, branch 5.2 before the bump and do a release at the same time.
>
> ok
> I would suggest one thing, if people want a bump between 2023 6.0 and 2024 7.0
> then the bump should happen closer to 6.1 than 7.0
That is a very fair point, and we should do that next time, to avoid the current mess.
I'm probably partly at fault, here. Sorry.
--
Jean-Baptiste Kempf - President
+33 672 704 734
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 26/31] avcodec/avcodec: Remove AV_CODEC_FLAG2_DROP_FRAME_TIMECODE
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (27 preceding siblings ...)
2023-01-24 15:45 ` Anton Khirnov
@ 2023-01-27 14:05 ` Andreas Rheinhardt
[not found] ` <20230127140600.2831578-1-andreas.rheinhardt@outlook.com>
` (2 subsequent siblings)
31 siblings, 0 replies; 102+ messages in thread
From: Andreas Rheinhardt @ 2023-01-27 14:05 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
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>
---
libavcodec/avcodec.h | 5 -----
libavcodec/mpeg12enc.c | 1 -
2 files changed, 6 deletions(-)
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index e2582f2484..4a9f9957d2 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -301,11 +301,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 a6663a158b..b93e5ca767 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.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 102+ messages in thread
* [FFmpeg-devel] [PATCH 27/31] avformat/avformat: Remove AVOutputFormat.data_codec
[not found] ` <20230127140600.2831578-1-andreas.rheinhardt@outlook.com>
@ 2023-01-27 14:05 ` Andreas Rheinhardt
2023-01-27 14:05 ` [FFmpeg-devel] [PATCH 28/31] avformat/avformat: Move codecpar up in AVStream Andreas Rheinhardt
` (3 subsequent siblings)
4 siblings, 0 replies; 102+ messages in thread
From: Andreas Rheinhardt @ 2023-01-27 14:05 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
No AVOutputFormat has this set.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
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 daa396e5a2..020906c94d 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 4b1f3c2986..76f25ab5a6 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 764c834fa2..55e58ae9d6 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.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 102+ messages in thread
* [FFmpeg-devel] [PATCH 28/31] avformat/avformat: Move codecpar up in AVStream
[not found] ` <20230127140600.2831578-1-andreas.rheinhardt@outlook.com>
2023-01-27 14:05 ` [FFmpeg-devel] [PATCH 27/31] avformat/avformat: Remove AVOutputFormat.data_codec Andreas Rheinhardt
@ 2023-01-27 14:05 ` Andreas Rheinhardt
2023-01-27 14:05 ` [FFmpeg-devel] [PATCH 29/31] avcodec: Make avcodec_decode_subtitle2 accept a const AVPacket* Andreas Rheinhardt
` (2 subsequent siblings)
4 siblings, 0 replies; 102+ messages in thread
From: Andreas Rheinhardt @ 2023-01-27 14:05 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
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>
---
libavformat/avformat.h | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 020906c94d..38578a08e4 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -960,6 +960,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;
/**
@@ -1095,17 +1106,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.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 102+ messages in thread
* [FFmpeg-devel] [PATCH 29/31] avcodec: Make avcodec_decode_subtitle2 accept a const AVPacket*
[not found] ` <20230127140600.2831578-1-andreas.rheinhardt@outlook.com>
2023-01-27 14:05 ` [FFmpeg-devel] [PATCH 27/31] avformat/avformat: Remove AVOutputFormat.data_codec Andreas Rheinhardt
2023-01-27 14:05 ` [FFmpeg-devel] [PATCH 28/31] avformat/avformat: Move codecpar up in AVStream Andreas Rheinhardt
@ 2023-01-27 14:05 ` Andreas Rheinhardt
2023-01-27 14:05 ` [FFmpeg-devel] [PATCH 30/31] avformat/demux: Avoid stack packet when decoding frame Andreas Rheinhardt
2023-01-27 14:06 ` [FFmpeg-devel] [PATCH 31/31] avformat/avformat: Move AVOutputFormat internals out of public header Andreas Rheinhardt
4 siblings, 0 replies; 102+ messages in thread
From: Andreas Rheinhardt @ 2023-01-27 14:05 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
doc/APIchanges | 3 +++
fftools/ffmpeg.c | 4 ++--
fftools/ffprobe.c | 2 +-
libavcodec/avcodec.h | 3 +--
libavcodec/decode.c | 9 ++++-----
libavcodec/version.h | 2 +-
tools/target_dec_fuzzer.c | 4 ++--
7 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/doc/APIchanges b/doc/APIchanges
index a11acadecd..d4c37b9040 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -14,6 +14,9 @@ libavutil: 2021-04-27
API changes, most recent first:
+2023-01-25 - xxxxxxxxxx - lavc 59.58.100 - avcodec.h
+ avcodec_decode_subtitle2() now accepts const AVPacket*.
+
2023-01-13 - xxxxxxxxxx - lavu 57.44.100 - ambient_viewing_environment.h frame.h
Adds a new structure for holding H.274 Ambient Viewing Environment metadata,
AVAmbientViewingEnvironment.
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index bef910a787..a916f9fe3e 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2199,8 +2199,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 5cfc2d9f87..db37ec52f4 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 4a9f9957d2..cb4f7a8514 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2504,8 +2504,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 96889f7dea..c37d607e27 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -771,8 +771,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;
@@ -852,8 +852,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;
@@ -873,7 +872,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/libavcodec/version.h b/libavcodec/version.h
index dfd3d5d7e5..7ac8d2b2fe 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
#include "version_major.h"
-#define LIBAVCODEC_VERSION_MINOR 57
+#define LIBAVCODEC_VERSION_MINOR 58
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index a20345db5c..8e89b613c0 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.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 102+ messages in thread
* [FFmpeg-devel] [PATCH 30/31] avformat/demux: Avoid stack packet when decoding frame
[not found] ` <20230127140600.2831578-1-andreas.rheinhardt@outlook.com>
` (2 preceding siblings ...)
2023-01-27 14:05 ` [FFmpeg-devel] [PATCH 29/31] avcodec: Make avcodec_decode_subtitle2 accept a const AVPacket* Andreas Rheinhardt
@ 2023-01-27 14:05 ` Andreas Rheinhardt
2023-01-27 14:06 ` [FFmpeg-devel] [PATCH 31/31] avformat/avformat: Move AVOutputFormat internals out of public header Andreas Rheinhardt
4 siblings, 0 replies; 102+ messages in thread
From: Andreas Rheinhardt @ 2023-01-27 14:05 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Possible now that avcodec_decode_subtitle2() accepts a const AVPacket*.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
I don't like postponing FF_API_INIT_PACKET. Will look into this.
libavformat/demux.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/libavformat/demux.c b/libavformat/demux.c
index a973a08731..c39919b978 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.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 102+ messages in thread
* [FFmpeg-devel] [PATCH 31/31] avformat/avformat: Move AVOutputFormat internals out of public header
[not found] ` <20230127140600.2831578-1-andreas.rheinhardt@outlook.com>
` (3 preceding siblings ...)
2023-01-27 14:05 ` [FFmpeg-devel] [PATCH 30/31] avformat/demux: Avoid stack packet when decoding frame Andreas Rheinhardt
@ 2023-01-27 14:06 ` Andreas Rheinhardt
4 siblings, 0 replies; 102+ messages in thread
From: Andreas Rheinhardt @ 2023-01-27 14:06 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
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>
---
To do the same for AVInputFormat would require ffplay stop checking
whether a read_seek callback exists; this has been added in
73b2043d727029ecde19c1d92bda8411f18b8e55.
At the same time, we should also fix the lavf flags -- some of them
like AVFMT_NOGENSEARCH are leaking implementation details that
the user should not care about.
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 6e88c32223..b1a6eca3b3 100755
--- a/configure
+++ b/configure
@@ -4003,9 +4003,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)
@@ -7951,9 +7951,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 22323a0a44..8a90fcb5d7 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 e461829d03..62a20c7ba4 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 27a1fd4a78..aa49e2c992 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 f3c87a6777..38110ddfdb 100644
--- a/libavdevice/avdevice.c
+++ b/libavdevice/avdevice.c
@@ -19,13 +19,14 @@
#include "libavutil/avassert.h"
#include "avdevice.h"
#include "internal.h"
+#include "libavformat/mux.h"
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,
@@ -42,7 +43,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);
@@ -53,7 +54,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 5536fd036e..6af1649137 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 990fbb8168..f7e315057f 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 77233880e7..7f3e8e5935 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 b2140c80be..06750bbba1 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 704f434c53..c125e6c0e9 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 038401c680..3d8323233f 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 a9023153f1..342a253dc0 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 0cf58fdc6a..578e287a41 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 b1006461b7..8e8f911996 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 348c289bea..441f854121 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 a66f2542b7..23b20fc8b7 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 5f2461cc6c..b5e9640544 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 bdaf5c2c3e..11a5b18d57 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 bf8afe2078..756fe8e875 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_xmv_demuxer;
@@ -506,7 +507,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;
@@ -546,7 +547,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;
@@ -562,19 +563,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)
@@ -596,7 +599,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 40e4890a38..8c6066a59c 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 88f07ce0ba..b6615d8295 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 28d4879b19..e1b1ffd42e 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 a3ddc08e83..ccb8e22437 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 cddb148d50..a0af916f14 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 39a60a0dde..5f38b68b6a 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 aedc7c4a32..2c74200b7d 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 47240fc0a8..244c7e7a27 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 1600f0a02b..85a1e53371 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 b29cfc4aaf..9dd388040f 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 f7c47d5333..3bf2150258 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 ecb2cc5311..a2767836b3 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 38578a08e4..b986aacc78 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 14115b3e2b..a61e5c3109 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 9efb4ac070..c3b9cf4d3d 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 b8317cd5ed..67be59806c 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 3953a5ced3..9e5fd780c1 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 400c5acbdb..f0f7b89253 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 9f40dd4ec0..1779bdd91c 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 8e725a0d3f..52865eacb5 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 2e252449e9..2d84b16650 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 11947aa493..29d2dc47ac 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 f27ac1ac50..ef076407b5 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 c125a97b0d..ebadeef645 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 80c0c84612..0f12d88b0f 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 ebb7294175..9033dba692 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 37ee10bb13..1df7e2bcf2 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 d7930f4a6e..a8beec7750 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 128ae8ebc0..81d9b6100d 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 ab79903e31..ce306a6c49 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 b52ff4dd39..bfa7deb598 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 0f971c039a..7495924722 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 1aaba0b306..17ee2f7e9f 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 a8f340ac46..080a873ee8 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 32491b4534..dcc363b42e 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -3180,19 +3180,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 d684f67707..caa3ba4965 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 57dd7f024e..9baf9ad1b1 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 26336ef2ac..6b5bb33b62 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 c05f37e22b..9b8ec06cea 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 ce837fefc7..f575064e8f 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 df1494b2b8..ceeab2b305 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 ed5ec90ce9..47b4efbcd1 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 f0548bb282..fa0f9fdaa2 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 7c3816ab82..9487e7dd0e 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 6fd36d1484..8eec632c54 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 2d6ca33e38..d66be9a8fa 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 2deb4284e8..113541bd9a 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 4db5e70161..950309981b 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 27c7d7a68b..dde431ab7d 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 3f20d5bc0b..5cac4381f4 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 8d31317838..87ee7a921f 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 91874fa14e..5e81f72a59 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 3ab4bd3f9b..c06e308296 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 48d39e6a7d..00ad426086 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 c5e5d1e286..81ace8e9ee 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 b2b5be63b4..04de05ec17 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 1bfcaf795f..c2de45400c 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 55e58ae9d6..3e63b8039a 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 58c551c83c..a29d678098 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 3deca5a7ed..60bde2a069 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 ff81ee34aa..a5198c7ca9 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 458b2a9bdc..2e582d0754 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 246f5195fb..6d0b47465d 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 0cf497989a..7f71644308 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 267fce252d..78fadda967 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 1fba092b88..0d001224cb 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 858b53f6c6..fe22e22812 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 ce629a8095..a8d296a154 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 fdc759c179..0d6403a048 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 21b204381b..3d444ccbfd 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 8eb9d3b92a..28839b837f 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 2b924ba6e7..ea7865ecf2 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 42d56fccd6..ba06dc655d 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 80e4bf851c..eb629b342c 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 edba08cf9b..56907c96f7 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 ade6d5723b..66e6313934 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 ac01f97df5..062b4a3fae 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 2861f828b4..ca38674626 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 7f6171edd3..30dc59e0f8 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 c45d8a5321..4af92fefa2 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 75b892087f..f9ac69539b 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 dd408dd096..960b2ea574 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 1938582bb3..c7f7e065dc 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 fc8069f7b5..212994be50 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 99990616d3..4c37ef6e5b 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 4bc95026f5..89b916deeb 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 59c2bbba7b..8739a17715 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 3531a8f909..c12c090934 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 916ed0cbab..494a83f507 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 f8f2274556..0d6c4a2072 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 8a5c29201a..b3f5bdc9b5 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 fcff80c4bf..1337045325 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 a2401eff5a..84a871e478 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 62dca62b06..c0e5621646 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 0dca2f7996..9d9190f252 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 fca0ee3120..fc6b08e0cd 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.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 00/26] Major library version bump
2023-01-26 22:49 ` Jean-Baptiste Kempf
2023-01-26 23:19 ` Michael Niedermayer
@ 2023-01-27 18:42 ` James Almer
1 sibling, 0 replies; 102+ messages in thread
From: James Almer @ 2023-01-27 18:42 UTC (permalink / raw)
To: ffmpeg-devel
On 1/26/2023 7:49 PM, Jean-Baptiste Kempf wrote:
> Tbh, I don't see why we should do a 5.2, seeing that 6.0 would be the same features-set with just the ABI change, aka removing deprecated symbols.
>
> Also, doing a 5.2 which would not be a LTS, while 5.1 is a LTS is not only very weird, but it also goes against what we said last time, that the last of the 5.x would be LTS (similar for 7.1).
The idea of making one last release before the major bump was to give
users "stuck" with a given soname something with the latest development.
For example, Debian will allegedly ship 5.1 with bookworm (soft freeze
is in two weeks). Users could then drop 5.2 libraries on their system
without having to also recompile every single package that depends on
ffmpeg.
This used to be the case when our release schedule was not really set in
stone and a release was considered LTS when distros happened to ship it.
So i guess that yes, from now we should effectively make the LTS the
last release of a given soname, and do the bump soon after it. An
hypothetical 5.2 would not get support for too long and eventually it
will become less secure to drop them into a bookworm system just to get
some extra features added in the past few months.
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 32/32] avutil/{color_utils, csp}: merge color_utils into csp and expose API
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (29 preceding siblings ...)
[not found] ` <20230127140600.2831578-1-andreas.rheinhardt@outlook.com>
@ 2023-01-28 13:58 ` Leo Izen
2023-01-29 11:08 ` Anton Khirnov
` (2 more replies)
2023-01-29 10:17 ` [FFmpeg-devel] [PATCH 1/3] lavu/fifo: remove FF_API_FIFO_PEEK2 Anton Khirnov
31 siblings, 3 replies; 102+ messages in thread
From: Leo Izen @ 2023-01-28 13:58 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Leo Izen
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>
---
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 +-
10 files changed, 221 insertions(+), 304 deletions(-)
delete mode 100644 libavutil/color_utils.c
delete mode 100644 libavutil/color_utils.h
diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index 6a0af96ce4..2f1766c17b 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 fd370fb310..5443f178bc 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 0ce684342e..e97150f55f 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 8d31317838..6182dc7f58 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 29b06665f5..dc9012f9a8 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 5e221fb798..0000000000
--- 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 9529006452..0000000000
--- 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 98fc83c1da..7ef822c60b 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 18ef208adf..73bce52bc0 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 4bdc550330..95fb3c1d56 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.39.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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 1/3] lavu/fifo: remove FF_API_FIFO_PEEK2
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
` (30 preceding siblings ...)
2023-01-28 13:58 ` [FFmpeg-devel] [PATCH 32/32] avutil/{color_utils, csp}: merge color_utils into csp and expose API Leo Izen
@ 2023-01-29 10:17 ` Anton Khirnov
2023-01-29 10:17 ` [FFmpeg-devel] [PATCH 2/3] lavu/fifo: uninline deprecated av_fifo_peek2() Anton Khirnov
2023-01-29 10:17 ` [FFmpeg-devel] [PATCH 3/3] lavu/fifo: mark all AVFifoBuffer members as deprecated Anton Khirnov
31 siblings, 2 replies; 102+ messages in thread
From: Anton Khirnov @ 2023-01-29 10:17 UTC (permalink / raw)
To: ffmpeg-devel
It is a part of the deprecated FIFO API which will be removed in its
entirety, so there is little point in having a separate guard for this
function.
---
libavutil/fifo.h | 2 --
libavutil/version.h | 1 -
2 files changed, 3 deletions(-)
diff --git a/libavutil/fifo.h b/libavutil/fifo.h
index 70f9376d97..0a1ea70a60 100644
--- a/libavutil/fifo.h
+++ b/libavutil/fifo.h
@@ -416,7 +416,6 @@ int av_fifo_grow(AVFifoBuffer *f, unsigned int additional_space);
attribute_deprecated
void av_fifo_drain(AVFifoBuffer *f, int size);
-#if FF_API_FIFO_PEEK2
/**
* Return a pointer to the data stored in a FIFO buffer at a certain offset.
* The FIFO buffer is not modified.
@@ -439,7 +438,6 @@ static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs)
return ptr;
}
#endif
-#endif
/**
* @}
diff --git a/libavutil/version.h b/libavutil/version.h
index 60f96af5df..9474c1c24d 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -109,7 +109,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)
#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)
--
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 2/3] lavu/fifo: uninline deprecated av_fifo_peek2()
2023-01-29 10:17 ` [FFmpeg-devel] [PATCH 1/3] lavu/fifo: remove FF_API_FIFO_PEEK2 Anton Khirnov
@ 2023-01-29 10:17 ` Anton Khirnov
2023-01-29 16:11 ` Andreas Rheinhardt
2023-01-29 10:17 ` [FFmpeg-devel] [PATCH 3/3] lavu/fifo: mark all AVFifoBuffer members as deprecated Anton Khirnov
1 sibling, 1 reply; 102+ messages in thread
From: Anton Khirnov @ 2023-01-29 10:17 UTC (permalink / raw)
To: ffmpeg-devel
Will allow to mark AVFifoBuffer fields as deprecated without triggering
spurious warnings.
---
libavutil/fifo.c | 10 ++++++++++
libavutil/fifo.h | 10 +---------
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/libavutil/fifo.c b/libavutil/fifo.c
index 51a5af6f39..5b114fc808 100644
--- a/libavutil/fifo.c
+++ b/libavutil/fifo.c
@@ -506,5 +506,15 @@ void av_fifo_drain(AVFifoBuffer *f, int size)
f->rptr -= f->end - f->buffer;
f->rndx += size;
}
+
+uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs)
+{
+ uint8_t *ptr = f->rptr + offs;
+ if (ptr >= f->end)
+ ptr = f->buffer + (ptr - f->end);
+ else if (ptr < f->buffer)
+ ptr = f->end - (f->buffer - ptr);
+ return ptr;
+}
FF_ENABLE_DEPRECATION_WARNINGS
#endif
diff --git a/libavutil/fifo.h b/libavutil/fifo.h
index 0a1ea70a60..ed86800da4 100644
--- a/libavutil/fifo.h
+++ b/libavutil/fifo.h
@@ -428,15 +428,7 @@ void av_fifo_drain(AVFifoBuffer *f, int size);
* @deprecated use the new AVFifo-API with av_fifo_peek() or av_fifo_peek_to_cb()
*/
attribute_deprecated
-static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs)
-{
- uint8_t *ptr = f->rptr + offs;
- if (ptr >= f->end)
- ptr = f->buffer + (ptr - f->end);
- else if (ptr < f->buffer)
- ptr = f->end - (f->buffer - ptr);
- return ptr;
-}
+uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs);
#endif
/**
--
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH 3/3] lavu/fifo: mark all AVFifoBuffer members as deprecated
2023-01-29 10:17 ` [FFmpeg-devel] [PATCH 1/3] lavu/fifo: remove FF_API_FIFO_PEEK2 Anton Khirnov
2023-01-29 10:17 ` [FFmpeg-devel] [PATCH 2/3] lavu/fifo: uninline deprecated av_fifo_peek2() Anton Khirnov
@ 2023-01-29 10:17 ` Anton Khirnov
1 sibling, 0 replies; 102+ messages in thread
From: Anton Khirnov @ 2023-01-29 10:17 UTC (permalink / raw)
To: ffmpeg-devel
---
libavutil/fifo.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavutil/fifo.h b/libavutil/fifo.h
index ed86800da4..2e0c600dd3 100644
--- a/libavutil/fifo.h
+++ b/libavutil/fifo.h
@@ -242,8 +242,11 @@ void av_fifo_freep2(AVFifo **f);
#if FF_API_FIFO_OLD_API
typedef struct AVFifoBuffer {
+ attribute_deprecated
uint8_t *buffer;
+ attribute_deprecated
uint8_t *rptr, *wptr, *end;
+ attribute_deprecated
uint32_t rndx, wndx;
} AVFifoBuffer;
--
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 32/32] avutil/{color_utils, csp}: merge color_utils into csp and expose API
2023-01-28 13:58 ` [FFmpeg-devel] [PATCH 32/32] avutil/{color_utils, csp}: merge color_utils into csp and expose API Leo Izen
@ 2023-01-29 11:08 ` Anton Khirnov
2023-01-30 16:50 ` [FFmpeg-devel] [PATCH v2] " Leo Izen
2023-02-02 7:02 ` [FFmpeg-devel] [PATCH major bump 0/6] Fix HDR vivid support Zhao Zhili
[not found] ` <20230202070208.1962086-1-quinkblack@foxmail.com>
2 siblings, 1 reply; 102+ messages in thread
From: Anton Khirnov @ 2023-01-29 11:08 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Leo Izen
Quoting Leo Izen (2023-01-28 14:58:18)
> diff --git a/libavutil/csp.h b/libavutil/csp.h
> index 18ef208adf..73bce52bc0 100644
> --- a/libavutil/csp.h
> +++ b/libavutil/csp.h
New public identifiers should still get an entry in doc/APIchanges, so
users can check when they were added.
--
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH 2/3] lavu/fifo: uninline deprecated av_fifo_peek2()
2023-01-29 10:17 ` [FFmpeg-devel] [PATCH 2/3] lavu/fifo: uninline deprecated av_fifo_peek2() Anton Khirnov
@ 2023-01-29 16:11 ` Andreas Rheinhardt
0 siblings, 0 replies; 102+ messages in thread
From: Andreas Rheinhardt @ 2023-01-29 16:11 UTC (permalink / raw)
To: ffmpeg-devel
Anton Khirnov:
> Will allow to mark AVFifoBuffer fields as deprecated without triggering
> spurious warnings.
> ---
> libavutil/fifo.c | 10 ++++++++++
> libavutil/fifo.h | 10 +---------
> 2 files changed, 11 insertions(+), 9 deletions(-)
>
> diff --git a/libavutil/fifo.c b/libavutil/fifo.c
> index 51a5af6f39..5b114fc808 100644
> --- a/libavutil/fifo.c
> +++ b/libavutil/fifo.c
> @@ -506,5 +506,15 @@ void av_fifo_drain(AVFifoBuffer *f, int size)
> f->rptr -= f->end - f->buffer;
> f->rndx += size;
> }
> +
> +uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs)
> +{
> + uint8_t *ptr = f->rptr + offs;
> + if (ptr >= f->end)
> + ptr = f->buffer + (ptr - f->end);
> + else if (ptr < f->buffer)
> + ptr = f->end - (f->buffer - ptr);
> + return ptr;
> +}
> FF_ENABLE_DEPRECATION_WARNINGS
> #endif
> diff --git a/libavutil/fifo.h b/libavutil/fifo.h
> index 0a1ea70a60..ed86800da4 100644
> --- a/libavutil/fifo.h
> +++ b/libavutil/fifo.h
> @@ -428,15 +428,7 @@ void av_fifo_drain(AVFifoBuffer *f, int size);
> * @deprecated use the new AVFifo-API with av_fifo_peek() or av_fifo_peek_to_cb()
> */
> attribute_deprecated
> -static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs)
> -{
> - uint8_t *ptr = f->rptr + offs;
> - if (ptr >= f->end)
> - ptr = f->buffer + (ptr - f->end);
> - else if (ptr < f->buffer)
> - ptr = f->end - (f->buffer - ptr);
> - return ptr;
> -}
> +uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs);
> #endif
>
> /**
Why is this part of the major bump patchset? Can't it be applied at any
time? (As long as we don't change the implementation of the old FIFO
API, of course.)
- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 102+ messages in thread
* [FFmpeg-devel] [PATCH v2] avutil/{color_utils, csp}: merge color_utils into csp and expose API
2023-01-29 11:08 ` Anton Khirnov
@ 2023-01-30 16:50 ` Leo Izen
2023-01-30 17:08 ` Zhao Zhili
0 siblings, 1 reply; 102+ messages in thread
From: Leo Izen @ 2023-01-30 16:50 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Leo Izen
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>
---
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 bc52a07964..f28eb59ed3 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -14,6 +14,10 @@ libavutil: 2021-04-27
API changes, most recent first:
+2023-01-30 - xxxxxxxxxx - lavu 57.44.100 - csp.h
+ Add av_csp_approximate_trc_gamma() and av_csp_trc_func_from_id().
+ Add av_csp_trc_function.
+
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/libavcodec/exr.c b/libavcodec/exr.c
index 6a0af96ce4..2f1766c17b 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 fd370fb310..5443f178bc 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 2393161c3b..ac27eebf3a 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 8d31317838..6182dc7f58 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 29b06665f5..dc9012f9a8 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 5e221fb798..0000000000
--- 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 9529006452..0000000000
--- 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 98fc83c1da..7ef822c60b 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 18ef208adf..73bce52bc0 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 4bdc550330..95fb3c1d56 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.39.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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2] avutil/{color_utils, csp}: merge color_utils into csp and expose API
2023-01-30 16:50 ` [FFmpeg-devel] [PATCH v2] " Leo Izen
@ 2023-01-30 17:08 ` Zhao Zhili
2023-01-30 17:12 ` Paul B Mahol
2023-01-30 18:22 ` Leo Izen
0 siblings, 2 replies; 102+ messages in thread
From: Zhao Zhili @ 2023-01-30 17:08 UTC (permalink / raw)
To: 'FFmpeg development discussions and patches'; +Cc: 'Leo Izen'
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Leo Izen
> Sent: 2023年1月31日 0:50
> To: ffmpeg-devel@ffmpeg.org
> Cc: Leo Izen <leo.izen@gmail.com>
> Subject: [FFmpeg-devel] [PATCH v2] avutil/{color_utils, csp}: merge color_utils into csp and expose API
>
> 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.
Isn't it break old libavcodec which linked to the new libavutil?
>
> Signed-off-by: Leo Izen <leo.izen@gmail.com>
> ---
> 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 bc52a07964..f28eb59ed3 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -14,6 +14,10 @@ libavutil: 2021-04-27
>
> API changes, most recent first:
>
> +2023-01-30 - xxxxxxxxxx - lavu 57.44.100 - csp.h
> + Add av_csp_approximate_trc_gamma() and av_csp_trc_func_from_id().
> + Add av_csp_trc_function.
> +
> 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/libavcodec/exr.c b/libavcodec/exr.c
> index 6a0af96ce4..2f1766c17b 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 fd370fb310..5443f178bc 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 2393161c3b..ac27eebf3a 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 8d31317838..6182dc7f58 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 29b06665f5..dc9012f9a8 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 5e221fb798..0000000000
> --- 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 9529006452..0000000000
> --- 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 98fc83c1da..7ef822c60b 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 18ef208adf..73bce52bc0 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 4bdc550330..95fb3c1d56 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.39.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".
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2] avutil/{color_utils, csp}: merge color_utils into csp and expose API
2023-01-30 17:08 ` Zhao Zhili
@ 2023-01-30 17:12 ` Paul B Mahol
2023-01-30 18:22 ` Leo Izen
1 sibling, 0 replies; 102+ messages in thread
From: Paul B Mahol @ 2023-01-30 17:12 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Leo Izen
On 1/30/23, Zhao Zhili <quinkblack@foxmail.com> wrote:
>
>
>> -----Original Message-----
>> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Leo Izen
>> Sent: 2023年1月31日 0:50
>> To: ffmpeg-devel@ffmpeg.org
>> Cc: Leo Izen <leo.izen@gmail.com>
>> Subject: [FFmpeg-devel] [PATCH v2] avutil/{color_utils, csp}: merge
>> color_utils into csp and expose API
>>
>> 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.
>
> Isn't it break old libavcodec which linked to the new libavutil?
Yes it is, thats why according to Anton it can not be pushed as is.
>
>>
>> Signed-off-by: Leo Izen <leo.izen@gmail.com>
>> ---
>> 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 bc52a07964..f28eb59ed3 100644
>> --- a/doc/APIchanges
>> +++ b/doc/APIchanges
>> @@ -14,6 +14,10 @@ libavutil: 2021-04-27
>>
>> API changes, most recent first:
>>
>> +2023-01-30 - xxxxxxxxxx - lavu 57.44.100 - csp.h
>> + Add av_csp_approximate_trc_gamma() and av_csp_trc_func_from_id().
>> + Add av_csp_trc_function.
>> +
>> 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/libavcodec/exr.c b/libavcodec/exr.c
>> index 6a0af96ce4..2f1766c17b 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 fd370fb310..5443f178bc 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 2393161c3b..ac27eebf3a 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 8d31317838..6182dc7f58 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 29b06665f5..dc9012f9a8 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 5e221fb798..0000000000
>> --- 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 9529006452..0000000000
>> --- 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 98fc83c1da..7ef822c60b 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 18ef208adf..73bce52bc0 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 4bdc550330..95fb3c1d56 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.39.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".
>
> _______________________________________________
> 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".
>
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2] avutil/{color_utils, csp}: merge color_utils into csp and expose API
2023-01-30 17:08 ` Zhao Zhili
2023-01-30 17:12 ` Paul B Mahol
@ 2023-01-30 18:22 ` Leo Izen
2023-01-31 2:20 ` "zhilizhao(赵志立)"
1 sibling, 1 reply; 102+ messages in thread
From: Leo Izen @ 2023-01-30 18:22 UTC (permalink / raw)
To: 'FFmpeg development discussions and patches'
On 1/30/23 12:08, Zhao Zhili wrote:
>
>
>> -----Original Message-----
>> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Leo Izen
>> Sent: 2023年1月31日 0:50
>> To: ffmpeg-devel@ffmpeg.org
>> Cc: Leo Izen <leo.izen@gmail.com>
>> Subject: [FFmpeg-devel] [PATCH v2] avutil/{color_utils, csp}: merge color_utils into csp and expose API
>>
>> 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.
>
> Isn't it break old libavcodec which linked to the new libavutil?
>
That's why it's in the major version bump thread.
- Leo Izen (thebombzen)
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2] avutil/{color_utils, csp}: merge color_utils into csp and expose API
2023-01-30 18:22 ` Leo Izen
@ 2023-01-31 2:20 ` "zhilizhao(赵志立)"
0 siblings, 0 replies; 102+ messages in thread
From: "zhilizhao(赵志立)" @ 2023-01-31 2:20 UTC (permalink / raw)
To: FFmpeg development discussions and patches
> On Jan 31, 2023, at 02:22, Leo Izen <leo.izen@gmail.com> wrote:
>
> On 1/30/23 12:08, Zhao Zhili wrote:
>>> -----Original Message-----
>>> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Leo Izen
>>> Sent: 2023年1月31日 0:50
>>> To: ffmpeg-devel@ffmpeg.org
>>> Cc: Leo Izen <leo.izen@gmail.com>
>>> Subject: [FFmpeg-devel] [PATCH v2] avutil/{color_utils, csp}: merge color_utils into csp and expose API
>>>
>>> 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.
>> Isn't it break old libavcodec which linked to the new libavutil?
>
> That's why it's in the major version bump thread.
OK then. Didn’t notice that because email client didn’t show thread correctly.
>
> - Leo Izen (thebombzen)
>
>
> _______________________________________________
> 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".
_______________________________________________
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] 102+ messages in thread
* [FFmpeg-devel] [PATCH major bump 0/6] Fix HDR vivid support
2023-01-28 13:58 ` [FFmpeg-devel] [PATCH 32/32] avutil/{color_utils, csp}: merge color_utils into csp and expose API Leo Izen
2023-01-29 11:08 ` Anton Khirnov
@ 2023-02-02 7:02 ` Zhao Zhili
2023-02-02 8:00 ` Lance Wang
[not found] ` <20230202070208.1962086-1-quinkblack@foxmail.com>
2 siblings, 1 reply; 102+ messages in thread
From: Zhao Zhili @ 2023-02-02 7:02 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Zhao Zhili
From: Zhao Zhili <zhilizhao@tencent.com>
Only patch 1/6 needs to go with major version bump.
Zhao Zhili (6):
libavutil/hdr_dynamic_vivid_metadata: fix
AVHDRVividColorToneMappingParams
libavcodec/dynamic_hdr_vivid: fix start code check
avcodec/dynamic_hdr_vivid: fix base_param_Delta
avcodec/dynamic_hdr_vivid: fix base_enable_flag control
avcodec/dynamic_hdr_vivid: reindent after the previous commit
fftools/ffprobe: fix print_dynamic_hdr_vivid
fftools/ffprobe.c | 16 +++++----
libavcodec/dynamic_hdr_vivid.c | 49 ++++++++++++--------------
libavfilter/vf_showinfo.c | 17 ++++-----
libavutil/hdr_dynamic_vivid_metadata.h | 12 +++----
4 files changed, 46 insertions(+), 48 deletions(-)
--
2.25.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] 102+ messages in thread
* [FFmpeg-devel] [PATCH major bump 1/6] libavutil/hdr_dynamic_vivid_metadata: fix AVHDRVividColorToneMappingParams
[not found] ` <20230202070208.1962086-1-quinkblack@foxmail.com>
@ 2023-02-02 7:02 ` Zhao Zhili
2023-02-02 8:16 ` Anton Khirnov
2023-02-02 7:02 ` [FFmpeg-devel] [PATCH major bump 2/6] libavcodec/dynamic_hdr_vivid: fix start code check Zhao Zhili
` (4 subsequent siblings)
5 siblings, 1 reply; 102+ messages in thread
From: Zhao Zhili @ 2023-02-02 7:02 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Zhao Zhili
From: Zhao Zhili <zhilizhao@tencent.com>
There are two group of three_Spline params. Fix the struct
definition and usecases inside libavcodec, libavfilter and ffprobe.
Co-Author: Houxiang ZHU <zhuhouxiang@theuwa.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
fftools/ffprobe.c | 14 ++++++++------
libavcodec/dynamic_hdr_vivid.c | 20 +++++++++-----------
libavfilter/vf_showinfo.c | 17 +++++++++--------
libavutil/hdr_dynamic_vivid_metadata.h | 12 ++++++------
4 files changed, 32 insertions(+), 31 deletions(-)
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index dfa7ff1b24..a853c70f56 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -2246,14 +2246,16 @@ static void print_dynamic_hdr_vivid(WriterContext *w, const AVDynamicHDRVivid *m
print_int("3Spline_enable_flag", tm_params->three_Spline_enable_flag);
if (tm_params->three_Spline_enable_flag) {
print_int("3Spline_num", tm_params->three_Spline_num);
- print_int("3Spline_TH_mode", tm_params->three_Spline_TH_mode);
for (int j = 0; j < tm_params->three_Spline_num; j++) {
- print_q("3Spline_TH_enable_MB", tm_params->three_Spline_TH_enable_MB, '/');
- print_q("3Spline_TH_enable", tm_params->three_Spline_TH_enable, '/');
- print_q("3Spline_TH_Delta1", tm_params->three_Spline_TH_Delta1, '/');
- print_q("3Spline_TH_Delta2", tm_params->three_Spline_TH_Delta2, '/');
- print_q("3Spline_enable_Strength", tm_params->three_Spline_enable_Strength, '/');
+ print_int("3Spline_TH_mode", tm_params->three_Spline_TH_mode[j]);
+ if (tm_params->three_Spline_TH_mode[j] == 0 || tm_params->three_Spline_TH_mode[j] == 2) {
+ print_q("3Spline_TH_enable_MB", tm_params->three_Spline_TH_enable_MB[j], '/');
+ }
+ print_q("3Spline_TH_enable", tm_params->three_Spline_TH_enable[j], '/');
+ print_q("3Spline_TH_Delta1", tm_params->three_Spline_TH_Delta1[j], '/');
+ print_q("3Spline_TH_Delta2", tm_params->three_Spline_TH_Delta2[j], '/');
+ print_q("3Spline_enable_Strength", tm_params->three_Spline_enable_Strength[j], '/');
}
}
}
diff --git a/libavcodec/dynamic_hdr_vivid.c b/libavcodec/dynamic_hdr_vivid.c
index d689669dec..f7a41ed2d5 100644
--- a/libavcodec/dynamic_hdr_vivid.c
+++ b/libavcodec/dynamic_hdr_vivid.c
@@ -101,23 +101,21 @@ int ff_parse_itu_t_t35_to_dynamic_hdr_vivid(AVDynamicHDRVivid *s, const uint8_t
if (get_bits_left(gb) < 1 + tm_params->three_Spline_num * (2 + 12 + 28 + 1))
return AVERROR_INVALIDDATA;
tm_params->three_Spline_num = get_bits(gb, 1) + 1;
+ if (tm_params->three_Spline_num > FF_ARRAY_ELEMS(tm_params->three_Spline_TH_mode))
+ return AVERROR_INVALIDDATA;
for (int j = 0; j < tm_params->three_Spline_num; j++) {
- tm_params->three_Spline_TH_mode = get_bits(gb, 2);
- if (tm_params->three_Spline_TH_mode == 0 || tm_params->three_Spline_TH_mode == 2) {
+ tm_params->three_Spline_TH_mode[j] = get_bits(gb, 2);
+ if (tm_params->three_Spline_TH_mode[j] == 0 || tm_params->three_Spline_TH_mode[j] == 2) {
if (get_bits_left(gb) < 8)
return AVERROR_INVALIDDATA;
- tm_params->three_Spline_TH_enable_MB = (AVRational){get_bits(gb, 8), 255};
+ tm_params->three_Spline_TH_enable_MB[j] = (AVRational){get_bits(gb, 8), 255};
}
- tm_params->three_Spline_TH_enable = (AVRational){get_bits(gb, 12), 4095};
- tm_params->three_Spline_TH_Delta1 = (AVRational){get_bits(gb, 10), 1023};
- tm_params->three_Spline_TH_Delta2 = (AVRational){get_bits(gb, 10), 1023};
- tm_params->three_Spline_enable_Strength = (AVRational){get_bits(gb, 8), 255};
+ tm_params->three_Spline_TH_enable[j] = (AVRational){get_bits(gb, 12), 4095};
+ tm_params->three_Spline_TH_Delta1[j] = (AVRational){get_bits(gb, 10), 1023};
+ tm_params->three_Spline_TH_Delta2[j] = (AVRational){get_bits(gb, 10), 1023};
+ tm_params->three_Spline_enable_Strength[j] = (AVRational){get_bits(gb, 8), 255};
}
- } else {
- tm_params->three_Spline_num = 1;
- tm_params->three_Spline_TH_mode = 0;
}
-
}
}
}
diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c
index e55625b338..05829289a5 100644
--- a/libavfilter/vf_showinfo.c
+++ b/libavfilter/vf_showinfo.c
@@ -354,19 +354,20 @@ static void dump_dynamic_hdr_vivid(AVFilterContext *ctx, AVFrameSideData *sd)
av_log(ctx, AV_LOG_INFO, "3Spline_enable_flag[%d][%d]: %d, ",
w, i, tm_params->three_Spline_enable_flag);
if (tm_params->three_Spline_enable_flag) {
- av_log(ctx, AV_LOG_INFO, "3Spline_TH_mode[%d][%d]: %d, ", w, i, tm_params->three_Spline_TH_mode);
-
for (int j = 0; j < tm_params->three_Spline_num; j++) {
- av_log(ctx, AV_LOG_INFO, "3Spline_TH_enable_MB[%d][%d][%d]: %.4f, ",
- w, i, j, av_q2d(tm_params->three_Spline_TH_enable_MB));
+ av_log(ctx, AV_LOG_INFO, "3Spline_TH_mode[%d][%d]: %d, ", w, i, tm_params->three_Spline_TH_mode[j]);
+ if (tm_params->three_Spline_TH_mode[j] == 0 || tm_params->three_Spline_TH_mode[j] == 2) {
+ av_log(ctx, AV_LOG_INFO, "3Spline_TH_enable_MB[%d][%d][%d]: %.4f, ",
+ w, i, j, av_q2d(tm_params->three_Spline_TH_enable_MB[j]));
+ }
av_log(ctx, AV_LOG_INFO, "3Spline_TH_enable[%d][%d][%d]: %.4f, ",
- w, i, j, av_q2d(tm_params->three_Spline_TH_enable));
+ w, i, j, av_q2d(tm_params->three_Spline_TH_enable[j]));
av_log(ctx, AV_LOG_INFO, "3Spline_TH_Delta1[%d][%d][%d]: %.4f, ",
- w, i, j, av_q2d(tm_params->three_Spline_TH_Delta1));
+ w, i, j, av_q2d(tm_params->three_Spline_TH_Delta1[j]));
av_log(ctx, AV_LOG_INFO, "3Spline_TH_Delta2[%d][%d][%d]: %.4f, ",
- w, i, j, av_q2d(tm_params->three_Spline_TH_Delta2));
+ w, i, j, av_q2d(tm_params->three_Spline_TH_Delta2[j]));
av_log(ctx, AV_LOG_INFO, "3Spline_enable_Strength[%d][%d][%d]: %.4f, ",
- w, i, j, av_q2d(tm_params->three_Spline_enable_Strength));
+ w, i, j, av_q2d(tm_params->three_Spline_enable_Strength[j]));
}
}
}
diff --git a/libavutil/hdr_dynamic_vivid_metadata.h b/libavutil/hdr_dynamic_vivid_metadata.h
index a34f83072c..4ceddc539d 100644
--- a/libavutil/hdr_dynamic_vivid_metadata.h
+++ b/libavutil/hdr_dynamic_vivid_metadata.h
@@ -126,42 +126,42 @@ typedef struct AVHDRVividColorToneMappingParams {
* The mode of three Spline. the value shall be in the range
* of 0 to 3, inclusive.
*/
- int three_Spline_TH_mode;
+ int three_Spline_TH_mode[2];
/**
* three_Spline_TH_enable_MB is in the range of 0.0 to 1.0, inclusive
* and in multiples of 1.0/255.
*
*/
- AVRational three_Spline_TH_enable_MB;
+ AVRational three_Spline_TH_enable_MB[2];
/**
* 3Spline_TH_enable of three Spline.
* The value shall be in the range of 0.0 to 1.0, inclusive.
* and in multiples of 1.0/4095.
*/
- AVRational three_Spline_TH_enable;
+ AVRational three_Spline_TH_enable[2];
/**
* 3Spline_TH_Delta1 of three Spline.
* The value shall be in the range of 0.0 to 0.25, inclusive,
* and in multiples of 0.25/1023.
*/
- AVRational three_Spline_TH_Delta1;
+ AVRational three_Spline_TH_Delta1[2];
/**
* 3Spline_TH_Delta2 of three Spline.
* The value shall be in the range of 0.0 to 0.25, inclusive,
* and in multiples of 0.25/1023.
*/
- AVRational three_Spline_TH_Delta2;
+ AVRational three_Spline_TH_Delta2[2];
/**
* 3Spline_enable_Strength of three Spline.
* The value shall be in the range of 0.0 to 1.0, inclusive,
* and in multiples of 1.0/255.
*/
- AVRational three_Spline_enable_Strength;
+ AVRational three_Spline_enable_Strength[2];
} AVHDRVividColorToneMappingParams;
--
2.25.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] 102+ messages in thread
* [FFmpeg-devel] [PATCH major bump 2/6] libavcodec/dynamic_hdr_vivid: fix start code check
[not found] ` <20230202070208.1962086-1-quinkblack@foxmail.com>
2023-02-02 7:02 ` [FFmpeg-devel] [PATCH major bump 1/6] libavutil/hdr_dynamic_vivid_metadata: fix AVHDRVividColorToneMappingParams Zhao Zhili
@ 2023-02-02 7:02 ` Zhao Zhili
2023-02-02 7:02 ` [FFmpeg-devel] [PATCH major bump 3/6] avcodec/dynamic_hdr_vivid: fix base_param_Delta Zhao Zhili
` (3 subsequent siblings)
5 siblings, 0 replies; 102+ messages in thread
From: Zhao Zhili @ 2023-02-02 7:02 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Zhao Zhili
From: Zhao Zhili <zhilizhao@tencent.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
libavcodec/dynamic_hdr_vivid.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavcodec/dynamic_hdr_vivid.c b/libavcodec/dynamic_hdr_vivid.c
index f7a41ed2d5..4bc1cd3c70 100644
--- a/libavcodec/dynamic_hdr_vivid.c
+++ b/libavcodec/dynamic_hdr_vivid.c
@@ -46,7 +46,8 @@ int ff_parse_itu_t_t35_to_dynamic_hdr_vivid(AVDynamicHDRVivid *s, const uint8_t
return AVERROR_INVALIDDATA;
s->system_start_code = get_bits(gb, 8);
- if (s->system_start_code == 0x01) {
+ // T/UWA 005.1-2022, table 11
+ if (s->system_start_code >= 0x01 && s->system_start_code <= 0x07) {
s->num_windows = 1;
if (get_bits_left(gb) < 12 * 4 * s->num_windows)
--
2.25.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] 102+ messages in thread
* [FFmpeg-devel] [PATCH major bump 3/6] avcodec/dynamic_hdr_vivid: fix base_param_Delta
[not found] ` <20230202070208.1962086-1-quinkblack@foxmail.com>
2023-02-02 7:02 ` [FFmpeg-devel] [PATCH major bump 1/6] libavutil/hdr_dynamic_vivid_metadata: fix AVHDRVividColorToneMappingParams Zhao Zhili
2023-02-02 7:02 ` [FFmpeg-devel] [PATCH major bump 2/6] libavcodec/dynamic_hdr_vivid: fix start code check Zhao Zhili
@ 2023-02-02 7:02 ` Zhao Zhili
2023-02-02 7:02 ` [FFmpeg-devel] [PATCH major bump 4/6] avcodec/dynamic_hdr_vivid: fix base_enable_flag control Zhao Zhili
` (2 subsequent siblings)
5 siblings, 0 replies; 102+ messages in thread
From: Zhao Zhili @ 2023-02-02 7:02 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Zhao Zhili
From: Zhao Zhili <zhilizhao@tencent.com>
It conflicts the comments. The operation based on Delta_enable_mode
can be applied by user during tone mapping.
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
libavcodec/dynamic_hdr_vivid.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/libavcodec/dynamic_hdr_vivid.c b/libavcodec/dynamic_hdr_vivid.c
index 4bc1cd3c70..a5ac0ce0c4 100644
--- a/libavcodec/dynamic_hdr_vivid.c
+++ b/libavcodec/dynamic_hdr_vivid.c
@@ -90,10 +90,7 @@ int ff_parse_itu_t_t35_to_dynamic_hdr_vivid(AVDynamicHDRVivid *s, const uint8_t
tm_params->base_param_k2 = get_bits(gb, 2);
tm_params->base_param_k3 = get_bits(gb, 4);
tm_params->base_param_Delta_enable_mode = get_bits(gb, 3);
- if (tm_params->base_param_Delta_enable_mode == 2 || tm_params->base_param_Delta_enable_mode == 6)
- tm_params->base_param_Delta = (AVRational){get_bits(gb, 7) * -1, base_param_Delta_den};
- else
- tm_params->base_param_Delta = (AVRational){get_bits(gb, 7), base_param_Delta_den};
+ tm_params->base_param_Delta = (AVRational){get_bits(gb, 7), base_param_Delta_den};
if (get_bits_left(gb) < 1)
return AVERROR_INVALIDDATA;
--
2.25.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] 102+ messages in thread
* [FFmpeg-devel] [PATCH major bump 4/6] avcodec/dynamic_hdr_vivid: fix base_enable_flag control
[not found] ` <20230202070208.1962086-1-quinkblack@foxmail.com>
` (2 preceding siblings ...)
2023-02-02 7:02 ` [FFmpeg-devel] [PATCH major bump 3/6] avcodec/dynamic_hdr_vivid: fix base_param_Delta Zhao Zhili
@ 2023-02-02 7:02 ` Zhao Zhili
2023-02-02 7:02 ` [FFmpeg-devel] [PATCH major bump 5/6] avcodec/dynamic_hdr_vivid: reindent after the previous commit Zhao Zhili
2023-02-02 7:02 ` [FFmpeg-devel] [PATCH major bump 6/6] fftools/ffprobe: fix print_dynamic_hdr_vivid Zhao Zhili
5 siblings, 0 replies; 102+ messages in thread
From: Zhao Zhili @ 2023-02-02 7:02 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Zhao Zhili
From: Zhao Zhili <zhilizhao@tencent.com>
The base_enable_flag is parallel to three_Spline_enable_flag. The
typesetting of the specification is very misleading.
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
libavcodec/dynamic_hdr_vivid.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/libavcodec/dynamic_hdr_vivid.c b/libavcodec/dynamic_hdr_vivid.c
index a5ac0ce0c4..4ebcc3f4c1 100644
--- a/libavcodec/dynamic_hdr_vivid.c
+++ b/libavcodec/dynamic_hdr_vivid.c
@@ -91,7 +91,7 @@ int ff_parse_itu_t_t35_to_dynamic_hdr_vivid(AVDynamicHDRVivid *s, const uint8_t
tm_params->base_param_k3 = get_bits(gb, 4);
tm_params->base_param_Delta_enable_mode = get_bits(gb, 3);
tm_params->base_param_Delta = (AVRational){get_bits(gb, 7), base_param_Delta_den};
-
+ }
if (get_bits_left(gb) < 1)
return AVERROR_INVALIDDATA;
tm_params->three_Spline_enable_flag = get_bits(gb, 1);
@@ -114,7 +114,6 @@ int ff_parse_itu_t_t35_to_dynamic_hdr_vivid(AVDynamicHDRVivid *s, const uint8_t
tm_params->three_Spline_enable_Strength[j] = (AVRational){get_bits(gb, 8), 255};
}
}
- }
}
}
--
2.25.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] 102+ messages in thread
* [FFmpeg-devel] [PATCH major bump 5/6] avcodec/dynamic_hdr_vivid: reindent after the previous commit
[not found] ` <20230202070208.1962086-1-quinkblack@foxmail.com>
` (3 preceding siblings ...)
2023-02-02 7:02 ` [FFmpeg-devel] [PATCH major bump 4/6] avcodec/dynamic_hdr_vivid: fix base_enable_flag control Zhao Zhili
@ 2023-02-02 7:02 ` Zhao Zhili
2023-02-02 7:02 ` [FFmpeg-devel] [PATCH major bump 6/6] fftools/ffprobe: fix print_dynamic_hdr_vivid Zhao Zhili
5 siblings, 0 replies; 102+ messages in thread
From: Zhao Zhili @ 2023-02-02 7:02 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Zhao Zhili
From: Zhao Zhili <zhilizhao@tencent.com>
---
libavcodec/dynamic_hdr_vivid.c | 38 +++++++++++++++++-----------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/libavcodec/dynamic_hdr_vivid.c b/libavcodec/dynamic_hdr_vivid.c
index 4ebcc3f4c1..710f9dd9c6 100644
--- a/libavcodec/dynamic_hdr_vivid.c
+++ b/libavcodec/dynamic_hdr_vivid.c
@@ -92,28 +92,28 @@ int ff_parse_itu_t_t35_to_dynamic_hdr_vivid(AVDynamicHDRVivid *s, const uint8_t
tm_params->base_param_Delta_enable_mode = get_bits(gb, 3);
tm_params->base_param_Delta = (AVRational){get_bits(gb, 7), base_param_Delta_den};
}
- if (get_bits_left(gb) < 1)
+ if (get_bits_left(gb) < 1)
+ return AVERROR_INVALIDDATA;
+ tm_params->three_Spline_enable_flag = get_bits(gb, 1);
+ if (tm_params->three_Spline_enable_flag) {
+ if (get_bits_left(gb) < 1 + tm_params->three_Spline_num * (2 + 12 + 28 + 1))
+ return AVERROR_INVALIDDATA;
+ tm_params->three_Spline_num = get_bits(gb, 1) + 1;
+ if (tm_params->three_Spline_num > FF_ARRAY_ELEMS(tm_params->three_Spline_TH_mode))
return AVERROR_INVALIDDATA;
- tm_params->three_Spline_enable_flag = get_bits(gb, 1);
- if (tm_params->three_Spline_enable_flag) {
- if (get_bits_left(gb) < 1 + tm_params->three_Spline_num * (2 + 12 + 28 + 1))
- return AVERROR_INVALIDDATA;
- tm_params->three_Spline_num = get_bits(gb, 1) + 1;
- if (tm_params->three_Spline_num > FF_ARRAY_ELEMS(tm_params->three_Spline_TH_mode))
- return AVERROR_INVALIDDATA;
- for (int j = 0; j < tm_params->three_Spline_num; j++) {
- tm_params->three_Spline_TH_mode[j] = get_bits(gb, 2);
- if (tm_params->three_Spline_TH_mode[j] == 0 || tm_params->three_Spline_TH_mode[j] == 2) {
- if (get_bits_left(gb) < 8)
- return AVERROR_INVALIDDATA;
- tm_params->three_Spline_TH_enable_MB[j] = (AVRational){get_bits(gb, 8), 255};
- }
- tm_params->three_Spline_TH_enable[j] = (AVRational){get_bits(gb, 12), 4095};
- tm_params->three_Spline_TH_Delta1[j] = (AVRational){get_bits(gb, 10), 1023};
- tm_params->three_Spline_TH_Delta2[j] = (AVRational){get_bits(gb, 10), 1023};
- tm_params->three_Spline_enable_Strength[j] = (AVRational){get_bits(gb, 8), 255};
+ for (int j = 0; j < tm_params->three_Spline_num; j++) {
+ tm_params->three_Spline_TH_mode[j] = get_bits(gb, 2);
+ if (tm_params->three_Spline_TH_mode[j] == 0 || tm_params->three_Spline_TH_mode[j] == 2) {
+ if (get_bits_left(gb) < 8)
+ return AVERROR_INVALIDDATA;
+ tm_params->three_Spline_TH_enable_MB[j] = (AVRational){get_bits(gb, 8), 255};
}
+ tm_params->three_Spline_TH_enable[j] = (AVRational){get_bits(gb, 12), 4095};
+ tm_params->three_Spline_TH_Delta1[j] = (AVRational){get_bits(gb, 10), 1023};
+ tm_params->three_Spline_TH_Delta2[j] = (AVRational){get_bits(gb, 10), 1023};
+ tm_params->three_Spline_enable_Strength[j] = (AVRational){get_bits(gb, 8), 255};
}
+ }
}
}
--
2.25.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] 102+ messages in thread
* [FFmpeg-devel] [PATCH major bump 6/6] fftools/ffprobe: fix print_dynamic_hdr_vivid
[not found] ` <20230202070208.1962086-1-quinkblack@foxmail.com>
` (4 preceding siblings ...)
2023-02-02 7:02 ` [FFmpeg-devel] [PATCH major bump 5/6] avcodec/dynamic_hdr_vivid: reindent after the previous commit Zhao Zhili
@ 2023-02-02 7:02 ` Zhao Zhili
5 siblings, 0 replies; 102+ messages in thread
From: Zhao Zhili @ 2023-02-02 7:02 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Zhao Zhili
From: Zhao Zhili <zhilizhao@tencent.com>
Don't print tone_mapping_param_num if tone_mapping_mode_flag is
disabled.
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
fftools/ffprobe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index a853c70f56..65e1db5b68 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -2221,8 +2221,8 @@ static void print_dynamic_hdr_vivid(WriterContext *w, const AVDynamicHDRVivid *m
const AVHDRVividColorTransformParams *params = &metadata->params[n];
print_int("tone_mapping_mode_flag", params->tone_mapping_mode_flag);
- print_int("tone_mapping_param_num", params->tone_mapping_param_num);
if (params->tone_mapping_mode_flag) {
+ print_int("tone_mapping_param_num", params->tone_mapping_param_num);
for (int i = 0; i < params->tone_mapping_param_num; i++) {
const AVHDRVividColorToneMappingParams *tm_params = ¶ms->tm_params[i];
--
2.25.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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH major bump 0/6] Fix HDR vivid support
2023-02-02 7:02 ` [FFmpeg-devel] [PATCH major bump 0/6] Fix HDR vivid support Zhao Zhili
@ 2023-02-02 8:00 ` Lance Wang
0 siblings, 0 replies; 102+ messages in thread
From: Lance Wang @ 2023-02-02 8:00 UTC (permalink / raw)
To: FFmpeg development discussions and patches
The patchset lgtm. thanks.
On Thu, Feb 2, 2023 at 3:11 PM Zhao Zhili <quinkblack@foxmail.com> wrote:
> From: Zhao Zhili <zhilizhao@tencent.com>
>
> Only patch 1/6 needs to go with major version bump.
>
> Zhao Zhili (6):
> libavutil/hdr_dynamic_vivid_metadata: fix
> AVHDRVividColorToneMappingParams
> libavcodec/dynamic_hdr_vivid: fix start code check
> avcodec/dynamic_hdr_vivid: fix base_param_Delta
> avcodec/dynamic_hdr_vivid: fix base_enable_flag control
> avcodec/dynamic_hdr_vivid: reindent after the previous commit
> fftools/ffprobe: fix print_dynamic_hdr_vivid
>
> fftools/ffprobe.c | 16 +++++----
> libavcodec/dynamic_hdr_vivid.c | 49 ++++++++++++--------------
> libavfilter/vf_showinfo.c | 17 ++++-----
> libavutil/hdr_dynamic_vivid_metadata.h | 12 +++----
> 4 files changed, 46 insertions(+), 48 deletions(-)
>
> --
> 2.25.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".
>
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH major bump 1/6] libavutil/hdr_dynamic_vivid_metadata: fix AVHDRVividColorToneMappingParams
2023-02-02 7:02 ` [FFmpeg-devel] [PATCH major bump 1/6] libavutil/hdr_dynamic_vivid_metadata: fix AVHDRVividColorToneMappingParams Zhao Zhili
@ 2023-02-02 8:16 ` Anton Khirnov
2023-02-02 8:52 ` "zhilizhao(赵志立)"
0 siblings, 1 reply; 102+ messages in thread
From: Anton Khirnov @ 2023-02-02 8:16 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Zhao Zhili
Quoting Zhao Zhili (2023-02-02 08:02:03)
> From: Zhao Zhili <zhilizhao@tencent.com>
>
> There are two group of three_Spline params. Fix the struct
> definition and usecases inside libavcodec, libavfilter and ffprobe.
>
> Co-Author: Houxiang ZHU <zhuhouxiang@theuwa.com>
> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
> ---
> diff --git a/libavutil/hdr_dynamic_vivid_metadata.h b/libavutil/hdr_dynamic_vivid_metadata.h
> index a34f83072c..4ceddc539d 100644
> --- a/libavutil/hdr_dynamic_vivid_metadata.h
> +++ b/libavutil/hdr_dynamic_vivid_metadata.h
> @@ -126,42 +126,42 @@ typedef struct AVHDRVividColorToneMappingParams {
> * The mode of three Spline. the value shall be in the range
> * of 0 to 3, inclusive.
> */
> - int three_Spline_TH_mode;
> + int three_Spline_TH_mode[2];
>
> /**
> * three_Spline_TH_enable_MB is in the range of 0.0 to 1.0, inclusive
> * and in multiples of 1.0/255.
> *
> */
> - AVRational three_Spline_TH_enable_MB;
> + AVRational three_Spline_TH_enable_MB[2];
>
> /**
> * 3Spline_TH_enable of three Spline.
> * The value shall be in the range of 0.0 to 1.0, inclusive.
> * and in multiples of 1.0/4095.
> */
> - AVRational three_Spline_TH_enable;
> + AVRational three_Spline_TH_enable[2];
>
> /**
> * 3Spline_TH_Delta1 of three Spline.
> * The value shall be in the range of 0.0 to 0.25, inclusive,
> * and in multiples of 0.25/1023.
> */
> - AVRational three_Spline_TH_Delta1;
> + AVRational three_Spline_TH_Delta1[2];
>
> /**
> * 3Spline_TH_Delta2 of three Spline.
> * The value shall be in the range of 0.0 to 0.25, inclusive,
> * and in multiples of 0.25/1023.
> */
> - AVRational three_Spline_TH_Delta2;
> + AVRational three_Spline_TH_Delta2[2];
>
> /**
> * 3Spline_enable_Strength of three Spline.
> * The value shall be in the range of 0.0 to 1.0, inclusive,
> * and in multiples of 1.0/255.
> */
> - AVRational three_Spline_enable_Strength;
> + AVRational three_Spline_enable_Strength[2];
> } AVHDRVividColorToneMappingParams;
A major bump is not for breaking APIs however you like, only for things
that were scheduled in advance that our callers could have prepared for.
You should add new fields, not change existing ones.
Also, the documentation and doc/APIchanges need to be updated.
--
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH major bump 1/6] libavutil/hdr_dynamic_vivid_metadata: fix AVHDRVividColorToneMappingParams
2023-02-02 8:16 ` Anton Khirnov
@ 2023-02-02 8:52 ` "zhilizhao(赵志立)"
2023-02-03 14:28 ` Anton Khirnov
0 siblings, 1 reply; 102+ messages in thread
From: "zhilizhao(赵志立)" @ 2023-02-02 8:52 UTC (permalink / raw)
To: FFmpeg development discussions and patches
> On Feb 2, 2023, at 16:16, Anton Khirnov <anton@khirnov.net> wrote:
>
> Quoting Zhao Zhili (2023-02-02 08:02:03)
>> From: Zhao Zhili <zhilizhao@tencent.com>
>>
>> There are two group of three_Spline params. Fix the struct
>> definition and usecases inside libavcodec, libavfilter and ffprobe.
>>
>> Co-Author: Houxiang ZHU <zhuhouxiang@theuwa.com>
>> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
>> ---
>> diff --git a/libavutil/hdr_dynamic_vivid_metadata.h b/libavutil/hdr_dynamic_vivid_metadata.h
>> index a34f83072c..4ceddc539d 100644
>> --- a/libavutil/hdr_dynamic_vivid_metadata.h
>> +++ b/libavutil/hdr_dynamic_vivid_metadata.h
>> @@ -126,42 +126,42 @@ typedef struct AVHDRVividColorToneMappingParams {
>> * The mode of three Spline. the value shall be in the range
>> * of 0 to 3, inclusive.
>> */
>> - int three_Spline_TH_mode;
>> + int three_Spline_TH_mode[2];
>>
>> /**
>> * three_Spline_TH_enable_MB is in the range of 0.0 to 1.0, inclusive
>> * and in multiples of 1.0/255.
>> *
>> */
>> - AVRational three_Spline_TH_enable_MB;
>> + AVRational three_Spline_TH_enable_MB[2];
>>
>> /**
>> * 3Spline_TH_enable of three Spline.
>> * The value shall be in the range of 0.0 to 1.0, inclusive.
>> * and in multiples of 1.0/4095.
>> */
>> - AVRational three_Spline_TH_enable;
>> + AVRational three_Spline_TH_enable[2];
>>
>> /**
>> * 3Spline_TH_Delta1 of three Spline.
>> * The value shall be in the range of 0.0 to 0.25, inclusive,
>> * and in multiples of 0.25/1023.
>> */
>> - AVRational three_Spline_TH_Delta1;
>> + AVRational three_Spline_TH_Delta1[2];
>>
>> /**
>> * 3Spline_TH_Delta2 of three Spline.
>> * The value shall be in the range of 0.0 to 0.25, inclusive,
>> * and in multiples of 0.25/1023.
>> */
>> - AVRational three_Spline_TH_Delta2;
>> + AVRational three_Spline_TH_Delta2[2];
>>
>> /**
>> * 3Spline_enable_Strength of three Spline.
>> * The value shall be in the range of 0.0 to 1.0, inclusive,
>> * and in multiples of 1.0/255.
>> */
>> - AVRational three_Spline_enable_Strength;
>> + AVRational three_Spline_enable_Strength[2];
>> } AVHDRVividColorToneMappingParams;
>
> A major bump is not for breaking APIs however you like, only for things
> that were scheduled in advance that our callers could have prepared for.
> You should add new fields, not change existing ones.
> Also, the documentation and doc/APIchanges need to be updated.
Adding new fields works, but very ugly.
The code never work if three_Spline_num > 1. Breaking API to let user
notice that may not be a bad thing in this specific situation.
>
> --
> 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".
_______________________________________________
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] 102+ messages in thread
* Re: [FFmpeg-devel] [PATCH major bump 1/6] libavutil/hdr_dynamic_vivid_metadata: fix AVHDRVividColorToneMappingParams
2023-02-02 8:52 ` "zhilizhao(赵志立)"
@ 2023-02-03 14:28 ` Anton Khirnov
0 siblings, 0 replies; 102+ messages in thread
From: Anton Khirnov @ 2023-02-03 14:28 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Quoting zhilizhao(赵志立) (2023-02-02 09:52:43)
> > On Feb 2, 2023, at 16:16, Anton Khirnov <anton@khirnov.net> wrote:
> >
> > A major bump is not for breaking APIs however you like, only for things
> > that were scheduled in advance that our callers could have prepared for.
> > You should add new fields, not change existing ones.
> > Also, the documentation and doc/APIchanges need to be updated.
>
> Adding new fields works, but very ugly.
>
> The code never work if three_Spline_num > 1. Breaking API to let user
> notice that may not be a bad thing in this specific situation.
Sorry, I disagree. If it could have worked at all - and IIUC it did when
three_Spline_num == 1 - then we should maintain compatibility. The
deprecation notice will notify developers just as well, while
compilation breakage just annoys users who are unable to fix it.
Constant compilation breakage on upgrading to new major versions is one
of the main reasons many of our users bundle old versions of our
libraries with their code. We should avoid unscheduled breakage whenever
possible.
--
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] 102+ messages in thread
end of thread, other threads:[~2023-02-03 14:29 UTC | newest]
Thread overview: 102+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-16 13:38 [FFmpeg-devel] [PATCH 00/26] Major library version bump James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 01/26] avcodec: remove FF_API_OPENH264_SLICE_MODE James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 02/26] avcodec: remove FF_API_OPENH264_CABAC James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 03/26] avcodec: remove FF_API_UNUSED_CODEC_CAPS James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 04/26] avcodec: remove FF_API_THREAD_SAFE_CALLBACKS James Almer
2023-01-20 22:44 ` Michael Niedermayer
2023-01-23 22:05 ` James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 05/26] avcodec: remove FF_API_DEBUG_MV James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 06/26] avcodec: remove FF_API_GET_FRAME_CLASS James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 07/26] avcodec: remove FF_API_AUTO_THREADS James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 08/26] avcodec: remove FF_API_AVCTX_TIMEBASE James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 09/26] avcodec: remove FF_API_FLAG_TRUNCATED James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 10/26] avcodec: remove FF_API_SUB_TEXT_FORMAT James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 11/26] avformat: remove FF_API_LAVF_PRIV_OPT James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 12/26] avformat: remove FF_API_AVIOCONTEXT_WRITTEN James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 13/26] avformat: remove FF_HLS_TS_OPTIONS James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 14/26] avformat: remove FF_API_AVSTREAM_CLASS James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 15/26] avfilter: remove FF_API_SWS_PARAM_OPTION James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 16/26] avfilter: remove FF_API_BUFFERSINK_ALLOC James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 17/26] avfilter: remove FF_API_PAD_COUNT James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 18/26] avdevice: remove FF_API_DEVICE_CAPABILITIES James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 19/26] avutil: remove FF_API_D2STR James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 20/26] avutil: remove FF_API_DECLARE_ALIGNED James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 21/26] avutil: remove FF_API_COLORSPACE_NAME James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 22/26] avutil: remove FF_API_AV_MALLOCZ_ARRAY James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 23/26] avutil/version: postpone the remaining API deprecations James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 24/26] avcodec/version: " James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 25/26] avformat/version: " James Almer
2023-01-16 13:38 ` [FFmpeg-devel] [PATCH 26/26] Bump major versions of all libraries James Almer
2023-01-18 19:28 ` [FFmpeg-devel] [PATCH 00/26] Major library version bump Anton Khirnov
2023-01-18 21:23 ` James Almer
2023-01-19 7:26 ` Anton Khirnov
2023-01-19 12:18 ` James Almer
2023-01-19 15:23 ` Anton Khirnov
2023-01-20 2:05 ` Michael Niedermayer
2023-01-21 16:51 ` Anton Khirnov
2023-01-21 19:33 ` Marvin Scholz
2023-01-21 20:17 ` Hendrik Leppkes
2023-01-21 21:30 ` Marvin Scholz
2023-01-21 22:47 ` Hendrik Leppkes
2023-01-21 21:36 ` Michael Niedermayer
2023-01-21 22:00 ` Marton Balint
2023-01-22 22:54 ` Michael Niedermayer
2023-01-23 17:03 ` Anton Khirnov
2023-01-23 22:41 ` Marton Balint
2023-01-23 22:50 ` Anton Khirnov
2023-01-23 23:22 ` Marton Balint
2023-01-24 0:01 ` Michael Niedermayer
2023-01-24 0:06 ` Marton Balint
2023-01-24 7:59 ` Anton Khirnov
2023-01-24 19:48 ` Marton Balint
2023-01-21 22:01 ` Marvin Scholz
2023-01-20 15:07 ` Tomas Härdin
2023-01-20 21:23 ` Leo Izen
2023-01-21 16:54 ` Anton Khirnov
2023-01-24 15:45 ` Anton Khirnov
2023-01-25 15:44 ` James Almer
2023-01-25 20:08 ` Marton Balint
2023-01-25 20:44 ` Jean-Baptiste Kempf
2023-01-25 21:03 ` Marton Balint
2023-01-25 21:15 ` Jean-Baptiste Kempf
2023-01-25 21:20 ` Paul B Mahol
2023-01-25 21:26 ` Jean-Baptiste Kempf
2023-01-25 21:29 ` Paul B Mahol
2023-01-25 21:31 ` Jean-Baptiste Kempf
2023-01-25 21:34 ` Paul B Mahol
2023-01-25 22:28 ` Marton Balint
2023-01-25 22:48 ` Jean-Baptiste Kempf
2023-01-25 23:25 ` Marton Balint
2023-01-26 22:16 ` Michael Niedermayer
2023-01-26 22:49 ` Jean-Baptiste Kempf
2023-01-26 23:19 ` Michael Niedermayer
2023-01-26 23:21 ` Jean-Baptiste Kempf
2023-01-27 18:42 ` James Almer
2023-01-27 14:05 ` [FFmpeg-devel] [PATCH 26/31] avcodec/avcodec: Remove AV_CODEC_FLAG2_DROP_FRAME_TIMECODE Andreas Rheinhardt
[not found] ` <20230127140600.2831578-1-andreas.rheinhardt@outlook.com>
2023-01-27 14:05 ` [FFmpeg-devel] [PATCH 27/31] avformat/avformat: Remove AVOutputFormat.data_codec Andreas Rheinhardt
2023-01-27 14:05 ` [FFmpeg-devel] [PATCH 28/31] avformat/avformat: Move codecpar up in AVStream Andreas Rheinhardt
2023-01-27 14:05 ` [FFmpeg-devel] [PATCH 29/31] avcodec: Make avcodec_decode_subtitle2 accept a const AVPacket* Andreas Rheinhardt
2023-01-27 14:05 ` [FFmpeg-devel] [PATCH 30/31] avformat/demux: Avoid stack packet when decoding frame Andreas Rheinhardt
2023-01-27 14:06 ` [FFmpeg-devel] [PATCH 31/31] avformat/avformat: Move AVOutputFormat internals out of public header Andreas Rheinhardt
2023-01-28 13:58 ` [FFmpeg-devel] [PATCH 32/32] avutil/{color_utils, csp}: merge color_utils into csp and expose API Leo Izen
2023-01-29 11:08 ` Anton Khirnov
2023-01-30 16:50 ` [FFmpeg-devel] [PATCH v2] " Leo Izen
2023-01-30 17:08 ` Zhao Zhili
2023-01-30 17:12 ` Paul B Mahol
2023-01-30 18:22 ` Leo Izen
2023-01-31 2:20 ` "zhilizhao(赵志立)"
2023-02-02 7:02 ` [FFmpeg-devel] [PATCH major bump 0/6] Fix HDR vivid support Zhao Zhili
2023-02-02 8:00 ` Lance Wang
[not found] ` <20230202070208.1962086-1-quinkblack@foxmail.com>
2023-02-02 7:02 ` [FFmpeg-devel] [PATCH major bump 1/6] libavutil/hdr_dynamic_vivid_metadata: fix AVHDRVividColorToneMappingParams Zhao Zhili
2023-02-02 8:16 ` Anton Khirnov
2023-02-02 8:52 ` "zhilizhao(赵志立)"
2023-02-03 14:28 ` Anton Khirnov
2023-02-02 7:02 ` [FFmpeg-devel] [PATCH major bump 2/6] libavcodec/dynamic_hdr_vivid: fix start code check Zhao Zhili
2023-02-02 7:02 ` [FFmpeg-devel] [PATCH major bump 3/6] avcodec/dynamic_hdr_vivid: fix base_param_Delta Zhao Zhili
2023-02-02 7:02 ` [FFmpeg-devel] [PATCH major bump 4/6] avcodec/dynamic_hdr_vivid: fix base_enable_flag control Zhao Zhili
2023-02-02 7:02 ` [FFmpeg-devel] [PATCH major bump 5/6] avcodec/dynamic_hdr_vivid: reindent after the previous commit Zhao Zhili
2023-02-02 7:02 ` [FFmpeg-devel] [PATCH major bump 6/6] fftools/ffprobe: fix print_dynamic_hdr_vivid Zhao Zhili
2023-01-29 10:17 ` [FFmpeg-devel] [PATCH 1/3] lavu/fifo: remove FF_API_FIFO_PEEK2 Anton Khirnov
2023-01-29 10:17 ` [FFmpeg-devel] [PATCH 2/3] lavu/fifo: uninline deprecated av_fifo_peek2() Anton Khirnov
2023-01-29 16:11 ` Andreas Rheinhardt
2023-01-29 10:17 ` [FFmpeg-devel] [PATCH 3/3] lavu/fifo: mark all AVFifoBuffer members as deprecated 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