aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/codec.h
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2024-04-03 22:19:28 +0200
committerNiklas Haas <git@haasn.dev>2024-09-08 13:59:25 +0200
commit3305767560a6303f474fffa3afb10c500059b455 (patch)
treec94bba9e72eebcbf78288a7e1c02f2797dd58854 /libavcodec/codec.h
parent703288cec6522655e8533c89efa3cd6df9613b99 (diff)
downloadffmpeg-3305767560a6303f474fffa3afb10c500059b455.tar.gz
avcodec: add avcodec_get_supported_config()
This replaces the myriad of existing lists in AVCodec by a unified API call, allowing us to (ultimately) trim down the sizeof(AVCodec) quite substantially, while also making this more trivially extensible. In addition to the already covered lists, add two new entries for color space and color range, mirroring the newly added negotiable fields in libavfilter. Once the deprecation period passes for the existing public fields, the rough plan is to move the commonly used fields (such as pix_fmt/sample_fmt) into FFCodec, possibly as a union of audio and video configuration types, and then implement the rarely used fields with custom callbacks.
Diffstat (limited to 'libavcodec/codec.h')
-rw-r--r--libavcodec/codec.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/libavcodec/codec.h b/libavcodec/codec.h
index 6f9b42760d..f7541ffc42 100644
--- a/libavcodec/codec.h
+++ b/libavcodec/codec.h
@@ -205,10 +205,19 @@ typedef struct AVCodec {
*/
int capabilities;
uint8_t max_lowres; ///< maximum value for lowres supported by the decoder
- const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0}
- const enum AVPixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1
- const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
- const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
+
+ /**
+ * Deprecated codec capabilities.
+ */
+ attribute_deprecated
+ const AVRational *supported_framerates; ///< @deprecated use avcodec_get_supported_config()
+ attribute_deprecated
+ const enum AVPixelFormat *pix_fmts; ///< @deprecated use avcodec_get_supported_config()
+ attribute_deprecated
+ const int *supported_samplerates; ///< @deprecated use avcodec_get_supported_config()
+ attribute_deprecated
+ const enum AVSampleFormat *sample_fmts; ///< @deprecated use avcodec_get_supported_config()
+
const AVClass *priv_class; ///< AVClass for the private context
const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {AV_PROFILE_UNKNOWN}
@@ -226,7 +235,9 @@ typedef struct AVCodec {
/**
* Array of supported channel layouts, terminated with a zeroed layout.
+ * @deprecated use avcodec_get_supported_config()
*/
+ attribute_deprecated
const AVChannelLayout *ch_layouts;
} AVCodec;