* [FFmpeg-devel] [PATCH] avformat/avformat: Avoid including codec.h, frame.h
@ 2023-09-02 11:31 Andreas Rheinhardt
2023-09-02 16:21 ` [FFmpeg-devel] [PATCH 2/7] avcodec/defs: Add AV_PROFILE_* defines, deprecate FF_PROFILE_* defines Andreas Rheinhardt
` (11 more replies)
0 siblings, 12 replies; 20+ messages in thread
From: Andreas Rheinhardt @ 2023-09-02 11:31 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
AVCodec is only ever used as an incomplete type (i.e. via a pointer
to an AVCodec) in avformat.h and it is not really part of the core
of avformat.h or libavformat; almost none of our internal users
make use of it (and none make use of hwcontext.h, which is implicitly
included). So switch to use struct AVCodec, but continue to include
codec.h for external users for compatibility.
Also, do the same for AVFrame and frame.h, which is implicitly included
by codec.h (via lavu/hwcontext.h).
Also, remove an unnecessary inclusion of <time.h>.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavdevice/alsa_enc.c | 1 +
libavdevice/opengl_enc.c | 1 +
libavdevice/pulse_audio_enc.c | 1 +
libavdevice/xv.c | 1 +
libavformat/asfdec_o.c | 2 ++
libavformat/avformat.c | 2 ++
libavformat/avformat.h | 29 ++++++++++++++++-------------
libavformat/dashdec.c | 1 +
libavformat/dashenc.c | 1 +
libavformat/dhav.c | 2 ++
libavformat/ftp.c | 1 +
libavformat/hlsenc.c | 1 +
libavformat/hlsplaylist.c | 1 +
libavformat/http.c | 1 +
libavformat/img2enc.c | 2 ++
libavformat/internal.h | 4 ++--
libavformat/mlvdec.c | 2 ++
libavformat/mux.c | 2 ++
libavformat/mux.h | 2 +-
libavformat/mxfdec.c | 1 +
libavformat/uncodedframecrcenc.c | 1 +
libavformat/wavenc.c | 1 +
libavformat/webmdashenc.c | 1 +
libavformat/wtvdec.c | 1 +
libavformat/yuv4mpegenc.c | 1 +
25 files changed, 47 insertions(+), 16 deletions(-)
diff --git a/libavdevice/alsa_enc.c b/libavdevice/alsa_enc.c
index 62a20c7ba4..4c7805065e 100644
--- a/libavdevice/alsa_enc.c
+++ b/libavdevice/alsa_enc.c
@@ -39,6 +39,7 @@
#include <alsa/asoundlib.h>
+#include "libavutil/frame.h"
#include "libavutil/internal.h"
#include "libavutil/time.h"
diff --git a/libavdevice/opengl_enc.c b/libavdevice/opengl_enc.c
index 1b0cf5aa8f..80feda7072 100644
--- a/libavdevice/opengl_enc.c
+++ b/libavdevice/opengl_enc.c
@@ -49,6 +49,7 @@
#endif
#include "libavutil/common.h"
+#include "libavutil/frame.h"
#include "libavutil/pixdesc.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
diff --git a/libavdevice/pulse_audio_enc.c b/libavdevice/pulse_audio_enc.c
index 3d8323233f..9e594c6424 100644
--- a/libavdevice/pulse_audio_enc.c
+++ b/libavdevice/pulse_audio_enc.c
@@ -26,6 +26,7 @@
#include "libavformat/mux.h"
#include "libavformat/version.h"
#include "libavutil/channel_layout.h"
+#include "libavutil/frame.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "libavutil/time.h"
diff --git a/libavdevice/xv.c b/libavdevice/xv.c
index 441f854121..b3d79d57a8 100644
--- a/libavdevice/xv.c
+++ b/libavdevice/xv.c
@@ -32,6 +32,7 @@
#include <X11/extensions/Xvlib.h>
#include <sys/shm.h>
+#include "libavutil/frame.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h"
diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c
index 2b407c016f..10942ecfa0 100644
--- a/libavformat/asfdec_o.c
+++ b/libavformat/asfdec_o.c
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <time.h>
+
#include "libavutil/attributes.h"
#include "libavutil/common.h"
#include "libavutil/dict.h"
diff --git a/libavformat/avformat.c b/libavformat/avformat.c
index 356b4de931..7ff0cf3429 100644
--- a/libavformat/avformat.c
+++ b/libavformat/avformat.c
@@ -23,12 +23,14 @@
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
+#include "libavutil/frame.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/pixfmt.h"
#include "libavutil/samplefmt.h"
#include "libavcodec/avcodec.h"
+#include "libavcodec/codec.h"
#include "libavcodec/bsf.h"
#include "libavcodec/codec_desc.h"
#include "libavcodec/packet_internal.h"
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 1916aa2dc5..10ee3c87c6 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -307,10 +307,8 @@
* @}
*/
-#include <time.h>
#include <stdio.h> /* FILE */
-#include "libavcodec/codec.h"
#include "libavcodec/codec_par.h"
#include "libavcodec/defs.h"
#include "libavcodec/packet.h"
@@ -325,10 +323,13 @@
* to avoid unnecessary rebuilds. When included externally, keep including
* the full version information. */
#include "libavformat/version.h"
+
+#include "libavutil/frame.h"
+#include "libavcodec/codec.h"
#endif
struct AVFormatContext;
-
+struct AVFrame;
struct AVDeviceInfoList;
/**
@@ -1569,7 +1570,7 @@ typedef struct AVFormatContext {
* the same codec_id.
* Demuxing: Set by user
*/
- const AVCodec *video_codec;
+ const struct AVCodec *video_codec;
/**
* Forced audio codec.
@@ -1577,7 +1578,7 @@ typedef struct AVFormatContext {
* the same codec_id.
* Demuxing: Set by user
*/
- const AVCodec *audio_codec;
+ const struct AVCodec *audio_codec;
/**
* Forced subtitle codec.
@@ -1585,7 +1586,7 @@ typedef struct AVFormatContext {
* the same codec_id.
* Demuxing: Set by user
*/
- const AVCodec *subtitle_codec;
+ const struct AVCodec *subtitle_codec;
/**
* Forced data codec.
@@ -1593,7 +1594,7 @@ typedef struct AVFormatContext {
* the same codec_id.
* Demuxing: Set by user
*/
- const AVCodec *data_codec;
+ const struct AVCodec *data_codec;
/**
* Number of bytes to be written as padding in a metadata header.
@@ -1842,7 +1843,7 @@ const AVClass *av_stream_get_class(void);
*
* @return newly created stream or NULL on error.
*/
-AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c);
+AVStream *avformat_new_stream(AVFormatContext *s, const struct AVCodec *c);
/**
* Wrap an existing array as stream side data.
@@ -2076,7 +2077,7 @@ int av_find_best_stream(AVFormatContext *ic,
enum AVMediaType type,
int wanted_stream_nb,
int related_stream,
- const AVCodec **decoder_ret,
+ const struct AVCodec **decoder_ret,
int flags);
/**
@@ -2352,7 +2353,7 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt);
* See av_interleaved_write_uncoded_frame() for details.
*/
int av_write_uncoded_frame(AVFormatContext *s, int stream_index,
- AVFrame *frame);
+ struct AVFrame *frame);
/**
* Write an uncoded frame to an output media file.
@@ -2371,7 +2372,7 @@ int av_write_uncoded_frame(AVFormatContext *s, int stream_index,
* @return >=0 for success, a negative code on error
*/
int av_interleaved_write_uncoded_frame(AVFormatContext *s, int stream_index,
- AVFrame *frame);
+ struct AVFrame *frame);
/**
* Test whether a muxer supports uncoded frame.
@@ -2759,7 +2760,8 @@ const struct AVCodecTag *avformat_get_mov_audio_tags(void);
* @param frame the frame with the aspect ratio to be determined
* @return the guessed (valid) sample_aspect_ratio, 0/1 if no idea
*/
-AVRational av_guess_sample_aspect_ratio(AVFormatContext *format, AVStream *stream, AVFrame *frame);
+AVRational av_guess_sample_aspect_ratio(AVFormatContext *format, AVStream *stream,
+ struct AVFrame *frame);
/**
* Guess the frame rate, based on both the container and codec information.
@@ -2769,7 +2771,8 @@ AVRational av_guess_sample_aspect_ratio(AVFormatContext *format, AVStream *strea
* @param frame the frame for which the frame rate should be determined, may be NULL
* @return the guessed (valid) frame rate, 0/1 if no idea
*/
-AVRational av_guess_frame_rate(AVFormatContext *ctx, AVStream *stream, AVFrame *frame);
+AVRational av_guess_frame_rate(AVFormatContext *ctx, AVStream *stream,
+ struct AVFrame *frame);
/**
* Check if the stream st contained in s is matched by the stream specifier
diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 29d4680c68..f4af625814 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <libxml/parser.h>
+#include <time.h>
#include "libavutil/bprint.h"
#include "libavutil/opt.h"
#include "libavutil/time.h"
diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 17fe5f430c..69ceae2cbf 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -22,6 +22,7 @@
#include "config.h"
#include "config_components.h"
+#include <time.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
diff --git a/libavformat/dhav.c b/libavformat/dhav.c
index 4e720f2a26..2ec4857f29 100644
--- a/libavformat/dhav.c
+++ b/libavformat/dhav.c
@@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <time.h>
+
#include "libavutil/parseutils.h"
#include "avio_internal.h"
#include "avformat.h"
diff --git a/libavformat/ftp.c b/libavformat/ftp.c
index 883668b37b..f9b069a59e 100644
--- a/libavformat/ftp.c
+++ b/libavformat/ftp.c
@@ -19,6 +19,7 @@
*/
#include <string.h>
+#include <time.h>
#include "libavutil/avstring.h"
#include "libavutil/internal.h"
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 27d97f5f72..004bd25359 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -23,6 +23,7 @@
#include "config.h"
#include "config_components.h"
#include <stdint.h>
+#include <time.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
diff --git a/libavformat/hlsplaylist.c b/libavformat/hlsplaylist.c
index 0e1dcc087f..2bf05f3c7c 100644
--- a/libavformat/hlsplaylist.c
+++ b/libavformat/hlsplaylist.c
@@ -22,6 +22,7 @@
#include "config.h"
#include <stdint.h>
+#include <time.h>
#include "libavutil/time_internal.h"
diff --git a/libavformat/http.c b/libavformat/http.c
index fd931c2d8e..c0fe7c36d9 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -22,6 +22,7 @@
#include "config.h"
#include "config_components.h"
+#include <time.h>
#if CONFIG_ZLIB
#include <zlib.h>
#endif /* CONFIG_ZLIB */
diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c
index 9b8ec06cea..526a11e5ee 100644
--- a/libavformat/img2enc.c
+++ b/libavformat/img2enc.c
@@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <time.h>
+
#include "config_components.h"
#include "libavutil/intreadwrite.h"
diff --git a/libavformat/internal.h b/libavformat/internal.h
index 53e70ccb53..051e8e2893 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -566,8 +566,8 @@ void ff_parse_key_value(const char *str, ff_parse_key_val_cb callback_get_buf,
enum AVCodecID ff_guess_image2_codec(const char *filename);
-const AVCodec *ff_find_decoder(AVFormatContext *s, const AVStream *st,
- enum AVCodecID codec_id);
+const struct AVCodec *ff_find_decoder(AVFormatContext *s, const AVStream *st,
+ enum AVCodecID codec_id);
/**
* Set the time base and wrapping info for a given stream. This will be used
diff --git a/libavformat/mlvdec.c b/libavformat/mlvdec.c
index db3b77bb9b..b706898cb3 100644
--- a/libavformat/mlvdec.c
+++ b/libavformat/mlvdec.c
@@ -24,6 +24,8 @@
* Magic Lantern Video (MLV) demuxer
*/
+#include <time.h>
+
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/rational.h"
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 415bd3948f..fff8094341 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -24,12 +24,14 @@
#include "mux.h"
#include "version.h"
#include "libavcodec/bsf.h"
+#include "libavcodec/codec_desc.h"
#include "libavcodec/internal.h"
#include "libavcodec/packet_internal.h"
#include "libavutil/opt.h"
#include "libavutil/dict.h"
#include "libavutil/timestamp.h"
#include "libavutil/avassert.h"
+#include "libavutil/frame.h"
#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
diff --git a/libavformat/mux.h b/libavformat/mux.h
index c2de45400c..9de5c2852a 100644
--- a/libavformat/mux.h
+++ b/libavformat/mux.h
@@ -96,7 +96,7 @@ typedef struct FFOutputFormat {
* by setting the pointer to NULL.
*/
int (*write_uncoded_frame)(AVFormatContext *, int stream_index,
- AVFrame **frame, unsigned flags);
+ struct AVFrame **frame, unsigned flags);
/**
* Returns device list with it properties.
* @see avdevice_list_devices() for more details.
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 34230ece98..110b69b7c1 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -45,6 +45,7 @@
*/
#include <inttypes.h>
+#include <time.h>
#include "libavutil/aes.h"
#include "libavutil/avstring.h"
diff --git a/libavformat/uncodedframecrcenc.c b/libavformat/uncodedframecrcenc.c
index 4c37ef6e5b..529b2f36cb 100644
--- a/libavformat/uncodedframecrcenc.c
+++ b/libavformat/uncodedframecrcenc.c
@@ -21,6 +21,7 @@
#include "libavutil/adler32.h"
#include "libavutil/avassert.h"
#include "libavutil/bprint.h"
+#include "libavutil/frame.h"
#include "libavutil/imgutils.h"
#include "libavutil/pixdesc.h"
#include "libavformat/mux.h"
diff --git a/libavformat/wavenc.c b/libavformat/wavenc.c
index c12c090934..82acb9ef0f 100644
--- a/libavformat/wavenc.c
+++ b/libavformat/wavenc.c
@@ -32,6 +32,7 @@
#include <stdint.h>
#include <string.h>
+#include <time.h>
#include "libavutil/avstring.h"
#include "libavutil/dict.h"
diff --git a/libavformat/webmdashenc.c b/libavformat/webmdashenc.c
index 0d6c4a2072..31ea3c6e8c 100644
--- a/libavformat/webmdashenc.c
+++ b/libavformat/webmdashenc.c
@@ -29,6 +29,7 @@
#include <float.h>
#include <stdint.h>
#include <string.h>
+#include <time.h>
#include "avformat.h"
#include "matroska.h"
diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c
index 98128b7201..b29ea7a923 100644
--- a/libavformat/wtvdec.c
+++ b/libavformat/wtvdec.c
@@ -26,6 +26,7 @@
*/
#include <inttypes.h>
+#include <time.h>
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
diff --git a/libavformat/yuv4mpegenc.c b/libavformat/yuv4mpegenc.c
index 968ba2fa13..1d641eb9e4 100644
--- a/libavformat/yuv4mpegenc.c
+++ b/libavformat/yuv4mpegenc.c
@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/frame.h"
#include "libavutil/pixdesc.h"
#include "avformat.h"
#include "internal.h"
--
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] 20+ messages in thread
* [FFmpeg-devel] [PATCH 2/7] avcodec/defs: Add AV_PROFILE_* defines, deprecate FF_PROFILE_* defines
2023-09-02 11:31 [FFmpeg-devel] [PATCH] avformat/avformat: Avoid including codec.h, frame.h Andreas Rheinhardt
@ 2023-09-02 16:21 ` Andreas Rheinhardt
2023-09-02 16:21 ` [FFmpeg-devel] [PATCH 3/7] avformat/mux: Only write HEADER marker if format has .write_header Andreas Rheinhardt
` (10 subsequent siblings)
11 siblings, 0 replies; 20+ messages in thread
From: Andreas Rheinhardt @ 2023-09-02 16:21 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
These defines are also used in other contexts than just AVCodecContext
ones, e.g. in libavformat. Furthermore, given that these defines are
public, the AV-prefix is the right one, so deprecate (and not just move)
the FF-macros.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
Missing version update.
doc/APIchanges | 4 +
fftools/ffprobe.c | 2 +-
libavcodec/aacdec_template.c | 8 +-
libavcodec/aacenc.c | 14 +-
libavcodec/aacenc_ltp.c | 4 +-
libavcodec/aacenc_pred.c | 2 +-
libavcodec/aacenc_tns.c | 2 +-
libavcodec/aacenctab.h | 8 +-
libavcodec/aacsbr_template.c | 2 +-
libavcodec/ac3dec.c | 2 +-
libavcodec/amfenc_av1.c | 4 +-
libavcodec/amfenc_h264.c | 12 +-
libavcodec/amfenc_hevc.c | 4 +-
libavcodec/audiotoolboxenc.c | 22 +--
libavcodec/avcodec.h | 10 ++
libavcodec/cbs_av1.c | 2 +-
libavcodec/cbs_av1_syntax_template.c | 12 +-
libavcodec/codec.h | 2 +-
libavcodec/codec_desc.h | 2 +-
libavcodec/codec_par.c | 4 +-
libavcodec/dca_core.c | 8 +-
libavcodec/dca_lbr.c | 2 +-
libavcodec/dca_parser.c | 16 +-
libavcodec/dca_xll.c | 6 +-
libavcodec/defs.h | 135 +++++++++++++++
libavcodec/dnxhddata.c | 14 +-
libavcodec/dnxhddec.c | 14 +-
libavcodec/dnxhdenc.c | 36 ++--
libavcodec/dxva2.c | 38 ++---
libavcodec/h264_parse.c | 14 +-
libavcodec/hevc_ps.c | 12 +-
libavcodec/hevcdec.c | 2 +-
libavcodec/jpeg2000dec.c | 4 +-
libavcodec/libaomdec.c | 18 +-
libavcodec/libaomenc.c | 14 +-
libavcodec/libaribb24.c | 24 +--
libavcodec/libaribcaption.c | 12 +-
libavcodec/libfdk-aacenc.c | 28 ++--
libavcodec/libopenh264enc.c | 38 ++---
libavcodec/libsvtav1.c | 12 +-
libavcodec/libvpxdec.c | 16 +-
libavcodec/libvpxenc.c | 2 +-
libavcodec/libx264.c | 12 +-
libavcodec/mediacodec_wrapper.c | 76 ++++-----
libavcodec/mediacodecenc.c | 28 ++--
libavcodec/mfenc.c | 4 +-
libavcodec/mjpegdec.c | 10 +-
libavcodec/mlpdec.c | 2 +-
libavcodec/mpeg12enc.c | 16 +-
libavcodec/mpeg4videodec.c | 6 +-
libavcodec/mpeg4videoenc.c | 4 +-
libavcodec/nvenc.c | 24 +--
libavcodec/nvenc_hevc.c | 2 +-
libavcodec/omx.c | 16 +-
libavcodec/options_table.h | 6 +-
libavcodec/profiles.c | 240 +++++++++++++--------------
libavcodec/profiles.h | 46 ++---
libavcodec/proresdec2.c | 14 +-
libavcodec/proresenc_anatoliy.c | 36 ++--
libavcodec/sbcenc.c | 4 +-
libavcodec/utils.c | 8 +-
libavcodec/v4l2_m2m_enc.c | 36 ++--
libavcodec/vaapi_decode.c | 4 +-
libavcodec/vaapi_encode.c | 4 +-
libavcodec/vaapi_encode.h | 4 +-
libavcodec/vaapi_encode_h264.c | 72 ++++----
libavcodec/vaapi_encode_h265.c | 42 ++---
libavcodec/vaapi_encode_mjpeg.c | 10 +-
libavcodec/vaapi_encode_mpeg2.c | 16 +-
libavcodec/vaapi_encode_vp8.c | 2 +-
libavcodec/vaapi_encode_vp9.c | 10 +-
libavcodec/vaapi_hevc.c | 18 +-
libavcodec/vdpau_av1.c | 6 +-
libavcodec/vdpau_h264.c | 22 +--
libavcodec/vdpau_hevc.c | 8 +-
libavcodec/vdpau_mpeg12.c | 4 +-
libavcodec/vdpau_mpeg4.c | 6 +-
libavcodec/vdpau_vc1.c | 6 +-
libavcodec/vdpau_vp9.c | 8 +-
libavcodec/version_major.h | 1 +
libavcodec/videotoolboxenc.c | 78 ++++-----
libavcodec/vulkan_decode.c | 8 +-
libavformat/av1.c | 10 +-
libavformat/hlsenc.c | 14 +-
libavformat/matroskadec.c | 8 +-
libavformat/matroskaenc.c | 6 +-
libavformat/movenc.c | 8 +-
libavformat/mpegts.c | 9 +-
libavformat/mpegtsenc.c | 8 +-
libavformat/mxfdec.c | 5 +-
libavformat/mxfenc.c | 14 +-
libavformat/vpcc.c | 14 +-
92 files changed, 877 insertions(+), 725 deletions(-)
diff --git a/doc/APIchanges b/doc/APIchanges
index dbaec30aac..a5da7cfb31 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,10 @@ The last version increases of all libraries were on 2023-02-09
API changes, most recent first:
+2023-09-02 - xxxxxxxxxx - lavc 58.xx.100 - defs.h
+ Add AV_PROFILE_* and AV_LEVEL_* replacements in defs.h for the
+ defines from avcodec.h. The latter are deprecated.
+
2023-09-02 - xxxxxxxxxx - lavu 58.19.100 - executor.h
Add AVExecutor API
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index 4fcfe1164b..c20f464623 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -3020,7 +3020,7 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
if (!do_bitexact && (profile = avcodec_profile_name(par->codec_id, par->profile)))
print_str("profile", profile);
else {
- if (par->profile != FF_PROFILE_UNKNOWN) {
+ if (par->profile != AV_PROFILE_UNKNOWN) {
char profile_num[12];
snprintf(profile_num, sizeof(profile_num), "%d", par->profile);
print_str("profile", profile_num);
diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
index e8dcd460a0..f8039e490b 100644
--- a/libavcodec/aacdec_template.c
+++ b/libavcodec/aacdec_template.c
@@ -2486,12 +2486,12 @@ static int decode_extension_payload(AACContext *ac, GetBitContext *gb, int cnt,
ac->avctx->ch_layout.nb_channels == 1) {
ac->oc[1].m4ac.sbr = 1;
ac->oc[1].m4ac.ps = 1;
- ac->avctx->profile = FF_PROFILE_AAC_HE_V2;
+ ac->avctx->profile = AV_PROFILE_AAC_HE_V2;
output_configure(ac, ac->oc[1].layout_map, ac->oc[1].layout_map_tags,
ac->oc[1].status, 1);
} else {
ac->oc[1].m4ac.sbr = 1;
- ac->avctx->profile = FF_PROFILE_AAC_HE;
+ ac->avctx->profile = AV_PROFILE_AAC_HE;
}
res = AAC_RENAME(ff_decode_sbr_extension)(ac, &che->sbr, gb, crc_flag, cnt, elem_type);
if (ac->oc[1].m4ac.ps == 1 && !ac->warned_he_aac_mono) {
@@ -3080,7 +3080,7 @@ static int aac_decode_er_frame(AVCodecContext *avctx, void *data,
if ((err = frame_configure_elements(avctx)) < 0)
return err;
- // The FF_PROFILE_AAC_* defines are all object_type - 1
+ // The AV_PROFILE_AAC_* defines are all object_type - 1
// This may lead to an undefined profile being signaled
ac->avctx->profile = aot - 1;
@@ -3163,7 +3163,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, AVFrame *frame,
if ((err = frame_configure_elements(avctx)) < 0)
goto fail;
- // The FF_PROFILE_AAC_* defines are all object_type - 1
+ // The AV_PROFILE_AAC_* defines are all object_type - 1
// This may lead to an undefined profile being signaled
ac->avctx->profile = ac->oc[1].m4ac.object_type - 1;
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index f48f057022..2a34685aec 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -1307,13 +1307,13 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
avctx->bit_rate);
/* Profile and option setting */
- avctx->profile = avctx->profile == FF_PROFILE_UNKNOWN ? FF_PROFILE_AAC_LOW :
+ avctx->profile = avctx->profile == AV_PROFILE_UNKNOWN ? AV_PROFILE_AAC_LOW :
avctx->profile;
for (i = 0; i < FF_ARRAY_ELEMS(aacenc_profiles); i++)
if (avctx->profile == aacenc_profiles[i])
break;
- if (avctx->profile == FF_PROFILE_MPEG2_AAC_LOW) {
- avctx->profile = FF_PROFILE_AAC_LOW;
+ if (avctx->profile == AV_PROFILE_MPEG2_AAC_LOW) {
+ avctx->profile = AV_PROFILE_AAC_LOW;
ERROR_IF(s->options.pred,
"Main prediction unavailable in the \"mpeg2_aac_low\" profile\n");
ERROR_IF(s->options.ltp,
@@ -1321,22 +1321,22 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
WARN_IF(s->options.pns,
"PNS unavailable in the \"mpeg2_aac_low\" profile, turning off\n");
s->options.pns = 0;
- } else if (avctx->profile == FF_PROFILE_AAC_LTP) {
+ } else if (avctx->profile == AV_PROFILE_AAC_LTP) {
s->options.ltp = 1;
ERROR_IF(s->options.pred,
"Main prediction unavailable in the \"aac_ltp\" profile\n");
- } else if (avctx->profile == FF_PROFILE_AAC_MAIN) {
+ } else if (avctx->profile == AV_PROFILE_AAC_MAIN) {
s->options.pred = 1;
ERROR_IF(s->options.ltp,
"LTP prediction unavailable in the \"aac_main\" profile\n");
} else if (s->options.ltp) {
- avctx->profile = FF_PROFILE_AAC_LTP;
+ avctx->profile = AV_PROFILE_AAC_LTP;
WARN_IF(1,
"Chainging profile to \"aac_ltp\"\n");
ERROR_IF(s->options.pred,
"Main prediction unavailable in the \"aac_ltp\" profile\n");
} else if (s->options.pred) {
- avctx->profile = FF_PROFILE_AAC_MAIN;
+ avctx->profile = AV_PROFILE_AAC_MAIN;
WARN_IF(1,
"Chainging profile to \"aac_main\"\n");
ERROR_IF(s->options.ltp,
diff --git a/libavcodec/aacenc_ltp.c b/libavcodec/aacenc_ltp.c
index f7fb85bbf8..f3075f0e71 100644
--- a/libavcodec/aacenc_ltp.c
+++ b/libavcodec/aacenc_ltp.c
@@ -37,7 +37,7 @@ void ff_aac_encode_ltp_info(AACEncContext *s, SingleChannelElement *sce,
{
int i;
IndividualChannelStream *ics = &sce->ics;
- if (s->profile != FF_PROFILE_AAC_LTP || !ics->predictor_present)
+ if (s->profile != AV_PROFILE_AAC_LTP || !ics->predictor_present)
return;
if (common_window)
put_bits(&s->pb, 1, 0);
@@ -119,7 +119,7 @@ void ff_aac_update_ltp(AACEncContext *s, SingleChannelElement *sce)
float *pred_signal = &sce->ltp_state[0];
const float *samples = &s->planar_samples[s->cur_channel][1024];
- if (s->profile != FF_PROFILE_AAC_LTP)
+ if (s->profile != AV_PROFILE_AAC_LTP)
return;
/* Calculate lag */
diff --git a/libavcodec/aacenc_pred.c b/libavcodec/aacenc_pred.c
index 447444cb82..f87fcd5a00 100644
--- a/libavcodec/aacenc_pred.c
+++ b/libavcodec/aacenc_pred.c
@@ -335,7 +335,7 @@ void ff_aac_encode_main_pred(AACEncContext *s, SingleChannelElement *sce)
IndividualChannelStream *ics = &sce->ics;
const int pmax = FFMIN(ics->max_sfb, ff_aac_pred_sfb_max[s->samplerate_index]);
- if (s->profile != FF_PROFILE_AAC_MAIN ||
+ if (s->profile != AV_PROFILE_AAC_MAIN ||
!ics->predictor_present)
return;
diff --git a/libavcodec/aacenc_tns.c b/libavcodec/aacenc_tns.c
index 195ff5e2b7..8dc6dfcf62 100644
--- a/libavcodec/aacenc_tns.c
+++ b/libavcodec/aacenc_tns.c
@@ -167,7 +167,7 @@ void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce)
const int c_bits = is8 ? TNS_Q_BITS_IS8 == 4 : TNS_Q_BITS == 4;
const int sfb_start = av_clip(tns_min_sfb[is8][s->samplerate_index], 0, mmm);
const int sfb_end = av_clip(sce->ics.num_swb, 0, mmm);
- const int order = is8 ? 7 : s->profile == FF_PROFILE_AAC_LOW ? 12 : TNS_MAX_ORDER;
+ const int order = is8 ? 7 : s->profile == AV_PROFILE_AAC_LOW ? 12 : TNS_MAX_ORDER;
const int slant = sce->ics.window_sequence[0] == LONG_STOP_SEQUENCE ? 1 :
sce->ics.window_sequence[0] == LONG_START_SEQUENCE ? 0 : 2;
const int sfb_len = sfb_end - sfb_start;
diff --git a/libavcodec/aacenctab.h b/libavcodec/aacenctab.h
index 2d96621945..20e47ea900 100644
--- a/libavcodec/aacenctab.h
+++ b/libavcodec/aacenctab.h
@@ -124,10 +124,10 @@ static const unsigned char aac_maxval_cb[] = {
};
static const int aacenc_profiles[] = {
- FF_PROFILE_AAC_MAIN,
- FF_PROFILE_AAC_LOW,
- FF_PROFILE_AAC_LTP,
- FF_PROFILE_MPEG2_AAC_LOW,
+ AV_PROFILE_AAC_MAIN,
+ AV_PROFILE_AAC_LOW,
+ AV_PROFILE_AAC_LTP,
+ AV_PROFILE_MPEG2_AAC_LOW,
};
#endif /* AVCODEC_AACENCTAB_H */
diff --git a/libavcodec/aacsbr_template.c b/libavcodec/aacsbr_template.c
index cdca402f04..b33ffd4295 100644
--- a/libavcodec/aacsbr_template.c
+++ b/libavcodec/aacsbr_template.c
@@ -973,7 +973,7 @@ static void read_sbr_extension(AACContext *ac, SpectralBandReplication *sbr,
*num_bits_left = 0;
} else {
*num_bits_left -= ff_ps_read_data(ac->avctx, gb, &sbr->ps.common, *num_bits_left);
- ac->avctx->profile = FF_PROFILE_AAC_HE_V2;
+ ac->avctx->profile = AV_PROFILE_AAC_HE_V2;
// ensure the warning is not printed if PS extension is present
ac->warned_he_aac_mono = 1;
}
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index 8c63f015f4..ee50138605 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -1714,7 +1714,7 @@ skip:
if (!err) {
avctx->sample_rate = s->sample_rate;
avctx->bit_rate = s->bit_rate + s->prev_bit_rate;
- avctx->profile = s->eac3_extension_type_a == 1 ? FF_PROFILE_EAC3_DDP_ATMOS : FF_PROFILE_UNKNOWN;
+ avctx->profile = s->eac3_extension_type_a == 1 ? AV_PROFILE_EAC3_DDP_ATMOS : AV_PROFILE_UNKNOWN;
}
if (!avctx->sample_rate) {
diff --git a/libavcodec/amfenc_av1.c b/libavcodec/amfenc_av1.c
index 30c0a9fad2..8f13aea29e 100644
--- a/libavcodec/amfenc_av1.c
+++ b/libavcodec/amfenc_av1.c
@@ -192,7 +192,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_FRAMERATE, framerate);
switch (avctx->profile) {
- case FF_PROFILE_AV1_MAIN:
+ case AV_PROFILE_AV1_MAIN:
profile = AMF_VIDEO_ENCODER_AV1_PROFILE_MAIN;
break;
default:
@@ -204,7 +204,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_PROFILE, profile);
profile_level = avctx->level;
- if (profile_level == FF_LEVEL_UNKNOWN) {
+ if (profile_level == AV_LEVEL_UNKNOWN) {
profile_level = ctx->level;
}
if (profile_level != 0) {
diff --git a/libavcodec/amfenc_h264.c b/libavcodec/amfenc_h264.c
index 2380aa4e90..bd544d12df 100644
--- a/libavcodec/amfenc_h264.c
+++ b/libavcodec/amfenc_h264.c
@@ -223,19 +223,19 @@ FF_ENABLE_DEPRECATION_WARNINGS
AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_FRAMERATE, framerate);
switch (avctx->profile) {
- case FF_PROFILE_H264_BASELINE:
+ case AV_PROFILE_H264_BASELINE:
profile = AMF_VIDEO_ENCODER_PROFILE_BASELINE;
break;
- case FF_PROFILE_H264_MAIN:
+ case AV_PROFILE_H264_MAIN:
profile = AMF_VIDEO_ENCODER_PROFILE_MAIN;
break;
- case FF_PROFILE_H264_HIGH:
+ case AV_PROFILE_H264_HIGH:
profile = AMF_VIDEO_ENCODER_PROFILE_HIGH;
break;
- case FF_PROFILE_H264_CONSTRAINED_BASELINE:
+ case AV_PROFILE_H264_CONSTRAINED_BASELINE:
profile = AMF_VIDEO_ENCODER_PROFILE_CONSTRAINED_BASELINE;
break;
- case (FF_PROFILE_H264_HIGH | FF_PROFILE_H264_CONSTRAINED):
+ case (AV_PROFILE_H264_HIGH | AV_PROFILE_H264_CONSTRAINED):
profile = AMF_VIDEO_ENCODER_PROFILE_CONSTRAINED_HIGH;
break;
}
@@ -246,7 +246,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_PROFILE, profile);
profile_level = avctx->level;
- if (profile_level == FF_LEVEL_UNKNOWN) {
+ if (profile_level == AV_LEVEL_UNKNOWN) {
profile_level = ctx->level;
}
if (profile_level != 0) {
diff --git a/libavcodec/amfenc_hevc.c b/libavcodec/amfenc_hevc.c
index dd232cc8ac..352564a301 100644
--- a/libavcodec/amfenc_hevc.c
+++ b/libavcodec/amfenc_hevc.c
@@ -184,7 +184,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_FRAMERATE, framerate);
switch (avctx->profile) {
- case FF_PROFILE_HEVC_MAIN:
+ case AV_PROFILE_HEVC_MAIN:
profile = AMF_VIDEO_ENCODER_HEVC_PROFILE_MAIN;
break;
default:
@@ -198,7 +198,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_TIER, ctx->tier);
profile_level = avctx->level;
- if (profile_level == FF_LEVEL_UNKNOWN) {
+ if (profile_level == AV_LEVEL_UNKNOWN) {
profile_level = ctx->level;
}
if (profile_level != 0) {
diff --git a/libavcodec/audiotoolboxenc.c b/libavcodec/audiotoolboxenc.c
index 46aca4c7ff..1b4e2a6c43 100644
--- a/libavcodec/audiotoolboxenc.c
+++ b/libavcodec/audiotoolboxenc.c
@@ -60,17 +60,17 @@ static UInt32 ffat_get_format_id(enum AVCodecID codec, int profile)
switch (codec) {
case AV_CODEC_ID_AAC:
switch (profile) {
- case FF_PROFILE_AAC_LOW:
+ case AV_PROFILE_AAC_LOW:
default:
return kAudioFormatMPEG4AAC;
- case FF_PROFILE_AAC_HE:
+ case AV_PROFILE_AAC_HE:
return kAudioFormatMPEG4AAC_HE;
- case FF_PROFILE_AAC_HE_V2:
+ case AV_PROFILE_AAC_HE_V2:
return kAudioFormatMPEG4AAC_HE_V2;
- case FF_PROFILE_AAC_LD:
+ case AV_PROFILE_AAC_LD:
return kAudioFormatMPEG4AAC_LD;
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
- case FF_PROFILE_AAC_ELD:
+ case AV_PROFILE_AAC_ELD:
return kAudioFormatMPEG4AAC_ELD;
#endif
}
@@ -586,12 +586,12 @@ static av_cold int ffat_close_encoder(AVCodecContext *avctx)
}
static const AVProfile aac_profiles[] = {
- { FF_PROFILE_AAC_LOW, "LC" },
- { FF_PROFILE_AAC_HE, "HE-AAC" },
- { FF_PROFILE_AAC_HE_V2, "HE-AACv2" },
- { FF_PROFILE_AAC_LD, "LD" },
- { FF_PROFILE_AAC_ELD, "ELD" },
- { FF_PROFILE_UNKNOWN },
+ { AV_PROFILE_AAC_LOW, "LC" },
+ { AV_PROFILE_AAC_HE, "HE-AAC" },
+ { AV_PROFILE_AAC_HE_V2, "HE-AACv2" },
+ { AV_PROFILE_AAC_LD, "LD" },
+ { AV_PROFILE_AAC_ELD, "ELD" },
+ { AV_PROFILE_UNKNOWN },
};
#define AE AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 649411ac79..172b669c87 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1587,8 +1587,12 @@ typedef struct AVCodecContext {
* profile
* - encoding: Set by user.
* - decoding: Set by libavcodec.
+ * See the AV_PROFILE_* defines in defs.h.
*/
int profile;
+#if FF_API_FF_PROFILE_LEVEL
+ /** @deprecated The following defines are deprecated; use AV_PROFILE_*
+ * in defs.h instead. */
#define FF_PROFILE_UNKNOWN -99
#define FF_PROFILE_RESERVED -100
@@ -1719,14 +1723,20 @@ typedef struct AVCodecContext {
#define FF_PROFILE_EVC_BASELINE 0
#define FF_PROFILE_EVC_MAIN 1
+#endif
/**
* level
* - encoding: Set by user.
* - decoding: Set by libavcodec.
+ * See AV_LEVEL_* in defs.h.
*/
int level;
+#if FF_API_FF_PROFILE_LEVEL
+ /** @deprecated The following define is deprecated; use AV_LEVEL_UNKOWN
+ * in defs.h instead. */
#define FF_LEVEL_UNKNOWN -99
+#endif
/**
* Skip loop filtering for selected frames.
diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c
index 452e022b36..7fb5bd8b42 100644
--- a/libavcodec/cbs_av1.c
+++ b/libavcodec/cbs_av1.c
@@ -20,10 +20,10 @@
#include "libavutil/opt.h"
#include "libavutil/pixfmt.h"
-#include "avcodec.h"
#include "cbs.h"
#include "cbs_internal.h"
#include "cbs_av1.h"
+#include "defs.h"
static int cbs_av1_read_uvlc(CodedBitstreamContext *ctx, GetBitContext *gbc,
diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c
index a747e17784..6f09c4e410 100644
--- a/libavcodec/cbs_av1_syntax_template.c
+++ b/libavcodec/cbs_av1_syntax_template.c
@@ -82,7 +82,7 @@ static int FUNC(color_config)(CodedBitstreamContext *ctx, RWContext *rw,
flag(high_bitdepth);
- if (seq_profile == FF_PROFILE_AV1_PROFESSIONAL &&
+ if (seq_profile == AV_PROFILE_AV1_PROFESSIONAL &&
current->high_bitdepth) {
flag(twelve_bit);
priv->bit_depth = current->twelve_bit ? 12 : 10;
@@ -90,7 +90,7 @@ static int FUNC(color_config)(CodedBitstreamContext *ctx, RWContext *rw,
priv->bit_depth = current->high_bitdepth ? 10 : 8;
}
- if (seq_profile == FF_PROFILE_AV1_HIGH)
+ if (seq_profile == AV_PROFILE_AV1_HIGH)
infer(mono_chrome, 0);
else
flag(mono_chrome);
@@ -126,10 +126,10 @@ static int FUNC(color_config)(CodedBitstreamContext *ctx, RWContext *rw,
} else {
flag(color_range);
- if (seq_profile == FF_PROFILE_AV1_MAIN) {
+ if (seq_profile == AV_PROFILE_AV1_MAIN) {
infer(subsampling_x, 1);
infer(subsampling_y, 1);
- } else if (seq_profile == FF_PROFILE_AV1_HIGH) {
+ } else if (seq_profile == AV_PROFILE_AV1_HIGH) {
infer(subsampling_x, 0);
infer(subsampling_y, 0);
} else {
@@ -190,8 +190,8 @@ static int FUNC(sequence_header_obu)(CodedBitstreamContext *ctx, RWContext *rw,
HEADER("Sequence Header");
- fc(3, seq_profile, FF_PROFILE_AV1_MAIN,
- FF_PROFILE_AV1_PROFESSIONAL);
+ fc(3, seq_profile, AV_PROFILE_AV1_MAIN,
+ AV_PROFILE_AV1_PROFESSIONAL);
flag(still_picture);
flag(reduced_still_picture_header);
diff --git a/libavcodec/codec.h b/libavcodec/codec.h
index 7a932d75dd..8034f1a53c 100644
--- a/libavcodec/codec.h
+++ b/libavcodec/codec.h
@@ -217,7 +217,7 @@ typedef struct AVCodec {
const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
#endif
const AVClass *priv_class; ///< AVClass for the private context
- const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
+ const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {AV_PROFILE_UNKNOWN}
/**
* Group name of the codec implementation.
diff --git a/libavcodec/codec_desc.h b/libavcodec/codec_desc.h
index dd4491112b..96afd20208 100644
--- a/libavcodec/codec_desc.h
+++ b/libavcodec/codec_desc.h
@@ -60,7 +60,7 @@ typedef struct AVCodecDescriptor {
const char *const *mime_types;
/**
* If non-NULL, an array of profiles recognized for this codec.
- * Terminated with FF_PROFILE_UNKNOWN.
+ * Terminated with AV_PROFILE_UNKNOWN.
*/
const struct AVProfile *profiles;
} AVCodecDescriptor;
diff --git a/libavcodec/codec_par.c b/libavcodec/codec_par.c
index a38a475dc7..e4e4cd48d3 100644
--- a/libavcodec/codec_par.c
+++ b/libavcodec/codec_par.c
@@ -47,8 +47,8 @@ static void codec_parameters_reset(AVCodecParameters *par)
par->chroma_location = AVCHROMA_LOC_UNSPECIFIED;
par->sample_aspect_ratio = (AVRational){ 0, 1 };
par->framerate = (AVRational){ 0, 1 };
- par->profile = FF_PROFILE_UNKNOWN;
- par->level = FF_LEVEL_UNKNOWN;
+ par->profile = AV_PROFILE_UNKNOWN;
+ par->level = AV_LEVEL_UNKNOWN;
}
AVCodecParameters *avcodec_parameters_alloc(void)
diff --git a/libavcodec/dca_core.c b/libavcodec/dca_core.c
index c50d005a56..6abd3513a9 100644
--- a/libavcodec/dca_core.c
+++ b/libavcodec/dca_core.c
@@ -2386,13 +2386,13 @@ int ff_dca_core_filter_frame(DCACoreDecoder *s, AVFrame *frame)
// Set profile, bit rate, etc
if (s->ext_audio_mask & DCA_EXSS_MASK)
- avctx->profile = FF_PROFILE_DTS_HD_HRA;
+ avctx->profile = AV_PROFILE_DTS_HD_HRA;
else if (s->ext_audio_mask & (DCA_CSS_XXCH | DCA_CSS_XCH))
- avctx->profile = FF_PROFILE_DTS_ES;
+ avctx->profile = AV_PROFILE_DTS_ES;
else if (s->ext_audio_mask & DCA_CSS_X96)
- avctx->profile = FF_PROFILE_DTS_96_24;
+ avctx->profile = AV_PROFILE_DTS_96_24;
else
- avctx->profile = FF_PROFILE_DTS;
+ avctx->profile = AV_PROFILE_DTS;
if (s->bit_rate > 3 && !(s->ext_audio_mask & DCA_EXSS_MASK))
avctx->bit_rate = s->bit_rate;
diff --git a/libavcodec/dca_lbr.c b/libavcodec/dca_lbr.c
index bef0054dbe..c9c5c0f856 100644
--- a/libavcodec/dca_lbr.c
+++ b/libavcodec/dca_lbr.c
@@ -1744,7 +1744,7 @@ int ff_dca_lbr_filter_frame(DCALbrDecoder *s, AVFrame *frame)
avctx->sample_rate = s->sample_rate;
avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
avctx->bits_per_raw_sample = 0;
- avctx->profile = FF_PROFILE_DTS_EXPRESS;
+ avctx->profile = AV_PROFILE_DTS_EXPRESS;
avctx->bit_rate = s->bit_rate_scaled;
if (s->flags & LBR_FLAG_LFE_PRESENT) {
diff --git a/libavcodec/dca_parser.c b/libavcodec/dca_parser.c
index 3148397b7d..eb0ef55d46 100644
--- a/libavcodec/dca_parser.c
+++ b/libavcodec/dca_parser.c
@@ -228,7 +228,7 @@ static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf,
*sample_rate = ff_dca_sampling_freqs[pc1->sr_code];
*duration = 1024 << ff_dca_freq_ranges[pc1->sr_code];
- *profile = FF_PROFILE_DTS_EXPRESS;
+ *profile = AV_PROFILE_DTS_EXPRESS;
return 0;
}
@@ -253,7 +253,7 @@ static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf,
*sample_rate = asset->max_sample_rate;
*duration = (1 + (*sample_rate > 96000)) << nsamples_log2;
- *profile = FF_PROFILE_DTS_HD_MA;
+ *profile = AV_PROFILE_DTS_HD_MA;
return 0;
}
@@ -268,18 +268,18 @@ static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf,
*duration = h.npcmblocks * DCA_PCMBLOCK_SAMPLES;
*sample_rate = ff_dca_sample_rates[h.sr_code];
- if (*profile != FF_PROFILE_UNKNOWN)
+ if (*profile != AV_PROFILE_UNKNOWN)
return 0;
- *profile = FF_PROFILE_DTS;
+ *profile = AV_PROFILE_DTS;
if (h.ext_audio_present) {
switch (h.ext_audio_type) {
case DCA_EXT_AUDIO_XCH:
case DCA_EXT_AUDIO_XXCH:
- *profile = FF_PROFILE_DTS_ES;
+ *profile = AV_PROFILE_DTS_ES;
break;
case DCA_EXT_AUDIO_X96:
- *profile = FF_PROFILE_DTS_96_24;
+ *profile = AV_PROFILE_DTS_96_24;
break;
}
}
@@ -296,9 +296,9 @@ static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf,
return 0;
if (asset->extension_mask & DCA_EXSS_XLL)
- *profile = FF_PROFILE_DTS_HD_MA;
+ *profile = AV_PROFILE_DTS_HD_MA;
else if (asset->extension_mask & (DCA_EXSS_XBR | DCA_EXSS_XXCH | DCA_EXSS_X96))
- *profile = FF_PROFILE_DTS_HD_HRA;
+ *profile = AV_PROFILE_DTS_HD_HRA;
return 0;
}
diff --git a/libavcodec/dca_xll.c b/libavcodec/dca_xll.c
index b8cf37a35f..15f9bd9196 100644
--- a/libavcodec/dca_xll.c
+++ b/libavcodec/dca_xll.c
@@ -1446,11 +1446,11 @@ int ff_dca_xll_filter_frame(DCAXllDecoder *s, AVFrame *frame)
}
if (s->x_imax_syncword_present) {
- avctx->profile = FF_PROFILE_DTS_HD_MA_X_IMAX;
+ avctx->profile = AV_PROFILE_DTS_HD_MA_X_IMAX;
} else if (s->x_syncword_present) {
- avctx->profile = FF_PROFILE_DTS_HD_MA_X;
+ avctx->profile = AV_PROFILE_DTS_HD_MA_X;
} else {
- avctx->profile = FF_PROFILE_DTS_HD_MA;
+ avctx->profile = AV_PROFILE_DTS_HD_MA;
}
avctx->bits_per_raw_sample = p->storage_bit_res;
diff --git a/libavcodec/defs.h b/libavcodec/defs.h
index fbe3254db2..ceed8d5e16 100644
--- a/libavcodec/defs.h
+++ b/libavcodec/defs.h
@@ -61,6 +61,141 @@
#define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions
#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
+
+#define AV_PROFILE_UNKNOWN -99
+#define AV_PROFILE_RESERVED -100
+
+#define AV_PROFILE_AAC_MAIN 0
+#define AV_PROFILE_AAC_LOW 1
+#define AV_PROFILE_AAC_SSR 2
+#define AV_PROFILE_AAC_LTP 3
+#define AV_PROFILE_AAC_HE 4
+#define AV_PROFILE_AAC_HE_V2 28
+#define AV_PROFILE_AAC_LD 22
+#define AV_PROFILE_AAC_ELD 38
+#define AV_PROFILE_MPEG2_AAC_LOW 128
+#define AV_PROFILE_MPEG2_AAC_HE 131
+
+#define AV_PROFILE_DNXHD 0
+#define AV_PROFILE_DNXHR_LB 1
+#define AV_PROFILE_DNXHR_SQ 2
+#define AV_PROFILE_DNXHR_HQ 3
+#define AV_PROFILE_DNXHR_HQX 4
+#define AV_PROFILE_DNXHR_444 5
+
+#define AV_PROFILE_DTS 20
+#define AV_PROFILE_DTS_ES 30
+#define AV_PROFILE_DTS_96_24 40
+#define AV_PROFILE_DTS_HD_HRA 50
+#define AV_PROFILE_DTS_HD_MA 60
+#define AV_PROFILE_DTS_EXPRESS 70
+#define AV_PROFILE_DTS_HD_MA_X 61
+#define AV_PROFILE_DTS_HD_MA_X_IMAX 62
+
+#define AV_PROFILE_EAC3_DDP_ATMOS 30
+
+#define AV_PROFILE_TRUEHD_ATMOS 30
+
+#define AV_PROFILE_MPEG2_422 0
+#define AV_PROFILE_MPEG2_HIGH 1
+#define AV_PROFILE_MPEG2_SS 2
+#define AV_PROFILE_MPEG2_SNR_SCALABLE 3
+#define AV_PROFILE_MPEG2_MAIN 4
+#define AV_PROFILE_MPEG2_SIMPLE 5
+
+#define AV_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag
+#define AV_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag
+
+#define AV_PROFILE_H264_BASELINE 66
+#define AV_PROFILE_H264_CONSTRAINED_BASELINE (66|AV_PROFILE_H264_CONSTRAINED)
+#define AV_PROFILE_H264_MAIN 77
+#define AV_PROFILE_H264_EXTENDED 88
+#define AV_PROFILE_H264_HIGH 100
+#define AV_PROFILE_H264_HIGH_10 110
+#define AV_PROFILE_H264_HIGH_10_INTRA (110|AV_PROFILE_H264_INTRA)
+#define AV_PROFILE_H264_MULTIVIEW_HIGH 118
+#define AV_PROFILE_H264_HIGH_422 122
+#define AV_PROFILE_H264_HIGH_422_INTRA (122|AV_PROFILE_H264_INTRA)
+#define AV_PROFILE_H264_STEREO_HIGH 128
+#define AV_PROFILE_H264_HIGH_444 144
+#define AV_PROFILE_H264_HIGH_444_PREDICTIVE 244
+#define AV_PROFILE_H264_HIGH_444_INTRA (244|AV_PROFILE_H264_INTRA)
+#define AV_PROFILE_H264_CAVLC_444 44
+
+#define AV_PROFILE_VC1_SIMPLE 0
+#define AV_PROFILE_VC1_MAIN 1
+#define AV_PROFILE_VC1_COMPLEX 2
+#define AV_PROFILE_VC1_ADVANCED 3
+
+#define AV_PROFILE_MPEG4_SIMPLE 0
+#define AV_PROFILE_MPEG4_SIMPLE_SCALABLE 1
+#define AV_PROFILE_MPEG4_CORE 2
+#define AV_PROFILE_MPEG4_MAIN 3
+#define AV_PROFILE_MPEG4_N_BIT 4
+#define AV_PROFILE_MPEG4_SCALABLE_TEXTURE 5
+#define AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6
+#define AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7
+#define AV_PROFILE_MPEG4_HYBRID 8
+#define AV_PROFILE_MPEG4_ADVANCED_REAL_TIME 9
+#define AV_PROFILE_MPEG4_CORE_SCALABLE 10
+#define AV_PROFILE_MPEG4_ADVANCED_CODING 11
+#define AV_PROFILE_MPEG4_ADVANCED_CORE 12
+#define AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13
+#define AV_PROFILE_MPEG4_SIMPLE_STUDIO 14
+#define AV_PROFILE_MPEG4_ADVANCED_SIMPLE 15
+
+#define AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 1
+#define AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 2
+#define AV_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION 32768
+#define AV_PROFILE_JPEG2000_DCINEMA_2K 3
+#define AV_PROFILE_JPEG2000_DCINEMA_4K 4
+
+#define AV_PROFILE_VP9_0 0
+#define AV_PROFILE_VP9_1 1
+#define AV_PROFILE_VP9_2 2
+#define AV_PROFILE_VP9_3 3
+
+#define AV_PROFILE_HEVC_MAIN 1
+#define AV_PROFILE_HEVC_MAIN_10 2
+#define AV_PROFILE_HEVC_MAIN_STILL_PICTURE 3
+#define AV_PROFILE_HEVC_REXT 4
+#define AV_PROFILE_HEVC_SCC 9
+
+#define AV_PROFILE_VVC_MAIN_10 1
+#define AV_PROFILE_VVC_MAIN_10_444 33
+
+#define AV_PROFILE_AV1_MAIN 0
+#define AV_PROFILE_AV1_HIGH 1
+#define AV_PROFILE_AV1_PROFESSIONAL 2
+
+#define AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT 0xc0
+#define AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT 0xc1
+#define AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT 0xc2
+#define AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS 0xc3
+#define AV_PROFILE_MJPEG_JPEG_LS 0xf7
+
+#define AV_PROFILE_SBC_MSBC 1
+
+#define AV_PROFILE_PRORES_PROXY 0
+#define AV_PROFILE_PRORES_LT 1
+#define AV_PROFILE_PRORES_STANDARD 2
+#define AV_PROFILE_PRORES_HQ 3
+#define AV_PROFILE_PRORES_4444 4
+#define AV_PROFILE_PRORES_XQ 5
+
+#define AV_PROFILE_ARIB_PROFILE_A 0
+#define AV_PROFILE_ARIB_PROFILE_C 1
+
+#define AV_PROFILE_KLVA_SYNC 0
+#define AV_PROFILE_KLVA_ASYNC 1
+
+#define AV_PROFILE_EVC_BASELINE 0
+#define AV_PROFILE_EVC_MAIN 1
+
+
+#define AV_LEVEL_UNKNOWN -99
+
+
/**
* @ingroup lavc_decoding
*/
diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c
index d52abe87dd..ce06d77f18 100644
--- a/libavcodec/dnxhddata.c
+++ b/libavcodec/dnxhddata.c
@@ -22,7 +22,7 @@
#include <stddef.h>
#include "libavutil/log.h"
#include "libavutil/macros.h"
-#include "avcodec.h"
+#include "defs.h"
#include "dnxhddata.h"
/* The quantization tables below are in zigzag order! */
@@ -1110,15 +1110,15 @@ int ff_dnxhd_get_hr_frame_size(int cid, int w, int h)
static int dnxhd_find_hr_cid(AVCodecContext *avctx)
{
switch (avctx->profile) {
- case FF_PROFILE_DNXHR_444:
+ case AV_PROFILE_DNXHR_444:
return 1270;
- case FF_PROFILE_DNXHR_HQX:
+ case AV_PROFILE_DNXHR_HQX:
return 1271;
- case FF_PROFILE_DNXHR_HQ:
+ case AV_PROFILE_DNXHR_HQ:
return 1272;
- case FF_PROFILE_DNXHR_SQ:
+ case AV_PROFILE_DNXHR_SQ:
return 1273;
- case FF_PROFILE_DNXHR_LB:
+ case AV_PROFILE_DNXHR_LB:
return 1274;
}
return 0;
@@ -1129,7 +1129,7 @@ int ff_dnxhd_find_cid(AVCodecContext *avctx, int bit_depth)
int i, j;
int mbs = avctx->bit_rate / 1000000;
- if (avctx->profile != FF_PROFILE_DNXHD)
+ if (avctx->profile != AV_PROFILE_DNXHD)
return dnxhd_find_hr_cid(avctx);
if (!mbs)
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 834390b93b..5c49a43c8d 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -160,17 +160,17 @@ static int dnxhd_get_profile(int cid)
{
switch(cid) {
case 1270:
- return FF_PROFILE_DNXHR_444;
+ return AV_PROFILE_DNXHR_444;
case 1271:
- return FF_PROFILE_DNXHR_HQX;
+ return AV_PROFILE_DNXHR_HQX;
case 1272:
- return FF_PROFILE_DNXHR_HQ;
+ return AV_PROFILE_DNXHR_HQ;
case 1273:
- return FF_PROFILE_DNXHR_SQ;
+ return AV_PROFILE_DNXHR_SQ;
case 1274:
- return FF_PROFILE_DNXHR_LB;
+ return AV_PROFILE_DNXHR_LB;
}
- return FF_PROFILE_DNXHD;
+ return AV_PROFILE_DNXHD;
}
static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
@@ -262,7 +262,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
ctx->decode_dct_block = dnxhd_decode_dct_block_12;
ctx->pix_fmt = AV_PIX_FMT_YUV422P12;
} else if (bitdepth == 10) {
- if (ctx->avctx->profile == FF_PROFILE_DNXHR_HQX)
+ if (ctx->avctx->profile == AV_PROFILE_DNXHR_HQX)
ctx->decode_dct_block = dnxhd_decode_dct_block_10_444;
else
ctx->decode_dct_block = dnxhd_decode_dct_block_10;
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index a1852fa6b7..f52a2e9918 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -54,19 +54,19 @@ static const AVOption options[] = {
offsetof(DNXHDEncContext, intra_quant_bias), AV_OPT_TYPE_INT,
{ .i64 = 0 }, INT_MIN, INT_MAX, VE },
{ "profile", NULL, offsetof(DNXHDEncContext, profile), AV_OPT_TYPE_INT,
- { .i64 = FF_PROFILE_DNXHD },
- FF_PROFILE_DNXHD, FF_PROFILE_DNXHR_444, VE, "profile" },
- { "dnxhd", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHD },
+ { .i64 = AV_PROFILE_DNXHD },
+ AV_PROFILE_DNXHD, AV_PROFILE_DNXHR_444, VE, "profile" },
+ { "dnxhd", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHD },
0, 0, VE, "profile" },
- { "dnxhr_444", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHR_444 },
+ { "dnxhr_444", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHR_444 },
0, 0, VE, "profile" },
- { "dnxhr_hqx", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHR_HQX },
+ { "dnxhr_hqx", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHR_HQX },
0, 0, VE, "profile" },
- { "dnxhr_hq", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHR_HQ },
+ { "dnxhr_hq", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHR_HQ },
0, 0, VE, "profile" },
- { "dnxhr_sq", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHR_SQ },
+ { "dnxhr_sq", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHR_SQ },
0, 0, VE, "profile" },
- { "dnxhr_lb", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHR_LB },
+ { "dnxhr_lb", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHR_LB },
0, 0, VE, "profile" },
{ NULL }
};
@@ -367,30 +367,30 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
break;
}
- if ((ctx->profile == FF_PROFILE_DNXHR_444 && (avctx->pix_fmt != AV_PIX_FMT_YUV444P10 &&
+ if ((ctx->profile == AV_PROFILE_DNXHR_444 && (avctx->pix_fmt != AV_PIX_FMT_YUV444P10 &&
avctx->pix_fmt != AV_PIX_FMT_GBRP10)) ||
- (ctx->profile != FF_PROFILE_DNXHR_444 && (avctx->pix_fmt == AV_PIX_FMT_YUV444P10 ||
+ (ctx->profile != AV_PROFILE_DNXHR_444 && (avctx->pix_fmt == AV_PIX_FMT_YUV444P10 ||
avctx->pix_fmt == AV_PIX_FMT_GBRP10))) {
av_log(avctx, AV_LOG_ERROR,
"pixel format is incompatible with DNxHD profile\n");
return AVERROR(EINVAL);
}
- if (ctx->profile == FF_PROFILE_DNXHR_HQX && avctx->pix_fmt != AV_PIX_FMT_YUV422P10) {
+ if (ctx->profile == AV_PROFILE_DNXHR_HQX && avctx->pix_fmt != AV_PIX_FMT_YUV422P10) {
av_log(avctx, AV_LOG_ERROR,
"pixel format is incompatible with DNxHR HQX profile\n");
return AVERROR(EINVAL);
}
- if ((ctx->profile == FF_PROFILE_DNXHR_LB ||
- ctx->profile == FF_PROFILE_DNXHR_SQ ||
- ctx->profile == FF_PROFILE_DNXHR_HQ) && avctx->pix_fmt != AV_PIX_FMT_YUV422P) {
+ if ((ctx->profile == AV_PROFILE_DNXHR_LB ||
+ ctx->profile == AV_PROFILE_DNXHR_SQ ||
+ ctx->profile == AV_PROFILE_DNXHR_HQ) && avctx->pix_fmt != AV_PIX_FMT_YUV422P) {
av_log(avctx, AV_LOG_ERROR,
"pixel format is incompatible with DNxHR LB/SQ/HQ profile\n");
return AVERROR(EINVAL);
}
- ctx->is_444 = ctx->profile == FF_PROFILE_DNXHR_444;
+ ctx->is_444 = ctx->profile == AV_PROFILE_DNXHR_444;
avctx->profile = ctx->profile;
ctx->cid = ff_dnxhd_find_cid(avctx, ctx->bit_depth);
if (!ctx->cid) {
@@ -426,13 +426,13 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
ff_pixblockdsp_init(&ctx->m.pdsp, avctx);
ff_dct_encode_init(&ctx->m);
- if (ctx->profile != FF_PROFILE_DNXHD)
+ if (ctx->profile != AV_PROFILE_DNXHD)
ff_videodsp_init(&ctx->m.vdsp, ctx->bit_depth);
if (!ctx->m.dct_quantize)
ctx->m.dct_quantize = ff_dct_quantize_c;
- if (ctx->is_444 || ctx->profile == FF_PROFILE_DNXHR_HQX) {
+ if (ctx->is_444 || ctx->profile == AV_PROFILE_DNXHR_HQX) {
ctx->m.dct_quantize = dnxhd_10bit_dct_quantize_444;
ctx->get_pixels_8x4_sym = dnxhd_10bit_get_pixels_8x4_sym;
ctx->block_width_l2 = 4;
@@ -457,7 +457,7 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
ctx->m.mb_height /= 2;
}
- if (ctx->interlaced && ctx->profile != FF_PROFILE_DNXHD) {
+ if (ctx->interlaced && ctx->profile != AV_PROFILE_DNXHD) {
av_log(avctx, AV_LOG_ERROR,
"Interlaced encoding is not supported for DNxHR profiles.\n");
return AVERROR(EINVAL);
diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c
index 568d686f39..d7bc587562 100644
--- a/libavcodec/dxva2.c
+++ b/libavcodec/dxva2.c
@@ -53,28 +53,28 @@ DEFINE_GUID(ff_IID_IDirectXVideoDecoderService, 0xfc51a551,0xd5e7,0x11d9,0xaf,0x
typedef struct dxva_mode {
const GUID *guid;
enum AVCodecID codec;
- // List of supported profiles, terminated by a FF_PROFILE_UNKNOWN entry.
+ // List of supported profiles, terminated by a AV_PROFILE_UNKNOWN entry.
// If NULL, don't check profile.
const int *profiles;
} dxva_mode;
-static const int prof_mpeg2_main[] = {FF_PROFILE_MPEG2_SIMPLE,
- FF_PROFILE_MPEG2_MAIN,
- FF_PROFILE_UNKNOWN};
-static const int prof_h264_high[] = {FF_PROFILE_H264_CONSTRAINED_BASELINE,
- FF_PROFILE_H264_MAIN,
- FF_PROFILE_H264_HIGH,
- FF_PROFILE_UNKNOWN};
-static const int prof_hevc_main[] = {FF_PROFILE_HEVC_MAIN,
- FF_PROFILE_UNKNOWN};
-static const int prof_hevc_main10[] = {FF_PROFILE_HEVC_MAIN_10,
- FF_PROFILE_UNKNOWN};
-static const int prof_vp9_profile0[] = {FF_PROFILE_VP9_0,
- FF_PROFILE_UNKNOWN};
-static const int prof_vp9_profile2[] = {FF_PROFILE_VP9_2,
- FF_PROFILE_UNKNOWN};
-static const int prof_av1_profile0[] = {FF_PROFILE_AV1_MAIN,
- FF_PROFILE_UNKNOWN};
+static const int prof_mpeg2_main[] = {AV_PROFILE_MPEG2_SIMPLE,
+ AV_PROFILE_MPEG2_MAIN,
+ AV_PROFILE_UNKNOWN};
+static const int prof_h264_high[] = {AV_PROFILE_H264_CONSTRAINED_BASELINE,
+ AV_PROFILE_H264_MAIN,
+ AV_PROFILE_H264_HIGH,
+ AV_PROFILE_UNKNOWN};
+static const int prof_hevc_main[] = {AV_PROFILE_HEVC_MAIN,
+ AV_PROFILE_UNKNOWN};
+static const int prof_hevc_main10[] = {AV_PROFILE_HEVC_MAIN_10,
+ AV_PROFILE_UNKNOWN};
+static const int prof_vp9_profile0[] = {AV_PROFILE_VP9_0,
+ AV_PROFILE_UNKNOWN};
+static const int prof_vp9_profile2[] = {AV_PROFILE_VP9_2,
+ AV_PROFILE_UNKNOWN};
+static const int prof_av1_profile0[] = {AV_PROFILE_AV1_MAIN,
+ AV_PROFILE_UNKNOWN};
static const dxva_mode dxva_modes[] = {
/* MPEG-2 */
@@ -199,7 +199,7 @@ static int dxva_check_codec_compatibility(AVCodecContext *avctx, const dxva_mode
if (mode->profiles && !(avctx->hwaccel_flags & AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH)) {
int i, found = 0;
- for (i = 0; mode->profiles[i] != FF_PROFILE_UNKNOWN; i++) {
+ for (i = 0; mode->profiles[i] != AV_PROFILE_UNKNOWN; i++) {
if (avctx->profile == mode->profiles[i]) {
found = 1;
break;
diff --git a/libavcodec/h264_parse.c b/libavcodec/h264_parse.c
index 97ddf0e437..3378650fd5 100644
--- a/libavcodec/h264_parse.c
+++ b/libavcodec/h264_parse.c
@@ -526,22 +526,22 @@ int ff_h264_decode_extradata(const uint8_t *data, int size, H264ParamSets *ps,
*
* @param sps SPS
*
- * @return profile as defined by FF_PROFILE_H264_*
+ * @return profile as defined by AV_PROFILE_H264_*
*/
int ff_h264_get_profile(const SPS *sps)
{
int profile = sps->profile_idc;
switch (sps->profile_idc) {
- case FF_PROFILE_H264_BASELINE:
+ case AV_PROFILE_H264_BASELINE:
// constraint_set1_flag set to 1
- profile |= (sps->constraint_set_flags & 1 << 1) ? FF_PROFILE_H264_CONSTRAINED : 0;
+ profile |= (sps->constraint_set_flags & 1 << 1) ? AV_PROFILE_H264_CONSTRAINED : 0;
break;
- case FF_PROFILE_H264_HIGH_10:
- case FF_PROFILE_H264_HIGH_422:
- case FF_PROFILE_H264_HIGH_444_PREDICTIVE:
+ case AV_PROFILE_H264_HIGH_10:
+ case AV_PROFILE_H264_HIGH_422:
+ case AV_PROFILE_H264_HIGH_444_PREDICTIVE:
// constraint_set3_flag set to 1
- profile |= (sps->constraint_set_flags & 1 << 3) ? FF_PROFILE_H264_INTRA : 0;
+ profile |= (sps->constraint_set_flags & 1 << 3) ? AV_PROFILE_H264_INTRA : 0;
break;
}
diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
index 1db2d3a242..bdd623507d 100644
--- a/libavcodec/hevc_ps.c
+++ b/libavcodec/hevc_ps.c
@@ -250,15 +250,15 @@ static int decode_profile_tier_level(GetBitContext *gb, AVCodecContext *avctx,
ptl->profile_space = get_bits(gb, 2);
ptl->tier_flag = get_bits1(gb);
ptl->profile_idc = get_bits(gb, 5);
- if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN)
+ if (ptl->profile_idc == AV_PROFILE_HEVC_MAIN)
av_log(avctx, AV_LOG_DEBUG, "Main profile bitstream\n");
- else if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN_10)
+ else if (ptl->profile_idc == AV_PROFILE_HEVC_MAIN_10)
av_log(avctx, AV_LOG_DEBUG, "Main 10 profile bitstream\n");
- else if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN_STILL_PICTURE)
+ else if (ptl->profile_idc == AV_PROFILE_HEVC_MAIN_STILL_PICTURE)
av_log(avctx, AV_LOG_DEBUG, "Main Still Picture profile bitstream\n");
- else if (ptl->profile_idc == FF_PROFILE_HEVC_REXT)
+ else if (ptl->profile_idc == AV_PROFILE_HEVC_REXT)
av_log(avctx, AV_LOG_DEBUG, "Range Extension profile bitstream\n");
- else if (ptl->profile_idc == FF_PROFILE_HEVC_SCC)
+ else if (ptl->profile_idc == AV_PROFILE_HEVC_SCC)
av_log(avctx, AV_LOG_DEBUG, "Screen Content Coding Extension profile bitstream\n");
else
av_log(avctx, AV_LOG_WARNING, "Unknown HEVC profile: %d\n", ptl->profile_idc);
@@ -1968,7 +1968,7 @@ int ff_hevc_decode_nal_pps(GetBitContext *gb, AVCodecContext *avctx,
pps->pps_scc_extension_flag = get_bits1(gb);
skip_bits(gb, 4); // pps_extension_4bits
- if (sps->ptl.general_ptl.profile_idc >= FF_PROFILE_HEVC_REXT && pps->pps_range_extensions_flag) {
+ if (sps->ptl.general_ptl.profile_idc >= AV_PROFILE_HEVC_REXT && pps->pps_range_extensions_flag) {
if ((ret = pps_range_extensions(gb, avctx, pps, sps)) < 0)
goto err;
}
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index df40c91ba6..abdf19a15e 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -3082,7 +3082,7 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal)
if (ret < 0)
goto fail;
} else {
- if (s->avctx->profile == FF_PROFILE_HEVC_SCC) {
+ if (s->avctx->profile == AV_PROFILE_HEVC_SCC) {
av_log(s->avctx, AV_LOG_ERROR,
"SCC profile is not yet implemented in hevc native decoder.\n");
ret = AVERROR_PATCHWELCOME;
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index d6f2a5938e..7d1a222f71 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -312,8 +312,8 @@ static int get_siz(Jpeg2000DecoderContext *s)
if (ret < 0)
return ret;
- if (s->avctx->profile == FF_PROFILE_JPEG2000_DCINEMA_2K ||
- s->avctx->profile == FF_PROFILE_JPEG2000_DCINEMA_4K) {
+ if (s->avctx->profile == AV_PROFILE_JPEG2000_DCINEMA_2K ||
+ s->avctx->profile == AV_PROFILE_JPEG2000_DCINEMA_4K) {
possible_fmts = xyz_pix_fmts;
possible_fmts_nb = FF_ARRAY_ELEMS(xyz_pix_fmts);
} else {
diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c
index 767c216aa9..695d901051 100644
--- a/libavcodec/libaomdec.c
+++ b/libavcodec/libaomdec.c
@@ -78,17 +78,17 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
if (img->bit_depth == 8) {
avctx->pix_fmt = img->monochrome ?
AV_PIX_FMT_GRAY8 : AV_PIX_FMT_YUV420P;
- avctx->profile = FF_PROFILE_AV1_MAIN;
+ avctx->profile = AV_PROFILE_AV1_MAIN;
return 0;
} else if (img->bit_depth == 10) {
avctx->pix_fmt = img->monochrome ?
AV_PIX_FMT_GRAY10 : AV_PIX_FMT_YUV420P10;
- avctx->profile = FF_PROFILE_AV1_MAIN;
+ avctx->profile = AV_PROFILE_AV1_MAIN;
return 0;
} else if (img->bit_depth == 12) {
avctx->pix_fmt = img->monochrome ?
AV_PIX_FMT_GRAY12 : AV_PIX_FMT_YUV420P12;
- avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
+ avctx->profile = AV_PROFILE_AV1_PROFESSIONAL;
return 0;
} else {
return AVERROR_INVALIDDATA;
@@ -97,15 +97,15 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
case AOM_IMG_FMT_I42216:
if (img->bit_depth == 8) {
avctx->pix_fmt = AV_PIX_FMT_YUV422P;
- avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
+ avctx->profile = AV_PROFILE_AV1_PROFESSIONAL;
return 0;
} else if (img->bit_depth == 10) {
avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
- avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
+ avctx->profile = AV_PROFILE_AV1_PROFESSIONAL;
return 0;
} else if (img->bit_depth == 12) {
avctx->pix_fmt = AV_PIX_FMT_YUV422P12;
- avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
+ avctx->profile = AV_PROFILE_AV1_PROFESSIONAL;
return 0;
} else {
return AVERROR_INVALIDDATA;
@@ -115,18 +115,18 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
if (img->bit_depth == 8) {
avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
AV_PIX_FMT_GBRP : AV_PIX_FMT_YUV444P;
- avctx->profile = FF_PROFILE_AV1_HIGH;
+ avctx->profile = AV_PROFILE_AV1_HIGH;
return 0;
} else if (img->bit_depth == 10) {
avctx->pix_fmt = AV_PIX_FMT_YUV444P10;
avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
AV_PIX_FMT_GBRP10 : AV_PIX_FMT_YUV444P10;
- avctx->profile = FF_PROFILE_AV1_HIGH;
+ avctx->profile = AV_PROFILE_AV1_HIGH;
return 0;
} else if (img->bit_depth == 12) {
avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
AV_PIX_FMT_GBRP12 : AV_PIX_FMT_YUV444P12;
- avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
+ avctx->profile = AV_PROFILE_AV1_PROFESSIONAL;
return 0;
} else {
return AVERROR_INVALIDDATA;
diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
index f29cb0784a..72d602a797 100644
--- a/libavcodec/libaomenc.c
+++ b/libavcodec/libaomenc.c
@@ -451,16 +451,16 @@ static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps,
enccfg->monochrome = 1;
/* Fall-through */
case AV_PIX_FMT_YUV420P:
- enccfg->g_profile = FF_PROFILE_AV1_MAIN;
+ enccfg->g_profile = AV_PROFILE_AV1_MAIN;
*img_fmt = AOM_IMG_FMT_I420;
return 0;
case AV_PIX_FMT_YUV422P:
- enccfg->g_profile = FF_PROFILE_AV1_PROFESSIONAL;
+ enccfg->g_profile = AV_PROFILE_AV1_PROFESSIONAL;
*img_fmt = AOM_IMG_FMT_I422;
return 0;
case AV_PIX_FMT_YUV444P:
case AV_PIX_FMT_GBRP:
- enccfg->g_profile = FF_PROFILE_AV1_HIGH;
+ enccfg->g_profile = AV_PROFILE_AV1_HIGH;
*img_fmt = AOM_IMG_FMT_I444;
return 0;
case AV_PIX_FMT_GRAY10:
@@ -471,7 +471,7 @@ static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps,
case AV_PIX_FMT_YUV420P12:
if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) {
enccfg->g_profile =
- enccfg->g_bit_depth == 10 ? FF_PROFILE_AV1_MAIN : FF_PROFILE_AV1_PROFESSIONAL;
+ enccfg->g_bit_depth == 10 ? AV_PROFILE_AV1_MAIN : AV_PROFILE_AV1_PROFESSIONAL;
*img_fmt = AOM_IMG_FMT_I42016;
*flags |= AOM_CODEC_USE_HIGHBITDEPTH;
return 0;
@@ -480,7 +480,7 @@ static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps,
case AV_PIX_FMT_YUV422P10:
case AV_PIX_FMT_YUV422P12:
if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) {
- enccfg->g_profile = FF_PROFILE_AV1_PROFESSIONAL;
+ enccfg->g_profile = AV_PROFILE_AV1_PROFESSIONAL;
*img_fmt = AOM_IMG_FMT_I42216;
*flags |= AOM_CODEC_USE_HIGHBITDEPTH;
return 0;
@@ -492,7 +492,7 @@ static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps,
case AV_PIX_FMT_GBRP12:
if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) {
enccfg->g_profile =
- enccfg->g_bit_depth == 10 ? FF_PROFILE_AV1_HIGH : FF_PROFILE_AV1_PROFESSIONAL;
+ enccfg->g_bit_depth == 10 ? AV_PROFILE_AV1_HIGH : AV_PROFILE_AV1_PROFESSIONAL;
*img_fmt = AOM_IMG_FMT_I44416;
*flags |= AOM_CODEC_USE_HIGHBITDEPTH;
return 0;
@@ -842,7 +842,7 @@ static av_cold int aom_init(AVCodecContext *avctx,
/* 0-3: For non-zero values the encoder increasingly optimizes for reduced
* complexity playback on low powered devices at the expense of encode
* quality. */
- if (avctx->profile != FF_PROFILE_UNKNOWN)
+ if (avctx->profile != AV_PROFILE_UNKNOWN)
enccfg.g_profile = avctx->profile;
enccfg.g_error_resilient = ctx->error_resilient;
diff --git a/libavcodec/libaribb24.c b/libavcodec/libaribb24.c
index e3e244be99..8032536b22 100644
--- a/libavcodec/libaribb24.c
+++ b/libavcodec/libaribb24.c
@@ -49,13 +49,13 @@ static unsigned int get_profile_font_size(AVCodecContext *avctx)
Libaribb24Context *b24 = avctx->priv_data;
int profile = avctx->profile;
- if (profile == FF_PROFILE_UNKNOWN)
+ if (profile == AV_PROFILE_UNKNOWN)
profile = b24->default_profile;
switch (profile) {
- case FF_PROFILE_ARIB_PROFILE_A:
+ case AV_PROFILE_ARIB_PROFILE_A:
return 36;
- case FF_PROFILE_ARIB_PROFILE_C:
+ case AV_PROFILE_ARIB_PROFILE_C:
return 18;
default:
return 0;
@@ -75,15 +75,15 @@ static int libaribb24_generate_ass_header(AVCodecContext *avctx)
unsigned int font_size = 0;
int profile = avctx->profile;
- if (profile == FF_PROFILE_UNKNOWN)
+ if (profile == AV_PROFILE_UNKNOWN)
profile = b24->default_profile;
switch (profile) {
- case FF_PROFILE_ARIB_PROFILE_A:
+ case AV_PROFILE_ARIB_PROFILE_A:
plane_width = 960;
plane_height = 540;
break;
- case FF_PROFILE_ARIB_PROFILE_C:
+ case AV_PROFILE_ARIB_PROFILE_C:
plane_width = 320;
plane_height = 180;
break;
@@ -172,14 +172,14 @@ static int libaribb24_init(AVCodecContext *avctx)
goto init_fail;
}
- if (profile == FF_PROFILE_UNKNOWN)
+ if (profile == AV_PROFILE_UNKNOWN)
profile = b24->default_profile;
switch (profile) {
- case FF_PROFILE_ARIB_PROFILE_A:
+ case AV_PROFILE_ARIB_PROFILE_A:
arib_dec_init = arib_initialize_decoder_a_profile;
break;
- case FF_PROFILE_ARIB_PROFILE_C:
+ case AV_PROFILE_ARIB_PROFILE_C:
arib_dec_init = arib_initialize_decoder_c_profile;
break;
default:
@@ -390,9 +390,9 @@ static const AVOption options[] = {
{ "aribb24-skip-ruby-text", "skip ruby text blocks during decoding",
OFFSET(aribb24_skip_ruby), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, SD },
{ "default_profile", "default profile to use if not specified in the stream parameters",
- OFFSET(default_profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, FF_PROFILE_ARIB_PROFILE_C, SD, "profile" },
- {"a", "Profile A", 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_ARIB_PROFILE_A}, INT_MIN, INT_MAX, SD, "profile"},
- {"c", "Profile C", 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_ARIB_PROFILE_C}, INT_MIN, INT_MAX, SD, "profile"},
+ OFFSET(default_profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, AV_PROFILE_ARIB_PROFILE_C, SD, "profile" },
+ {"a", "Profile A", 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_ARIB_PROFILE_A}, INT_MIN, INT_MAX, SD, "profile"},
+ {"c", "Profile C", 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_ARIB_PROFILE_C}, INT_MIN, INT_MAX, SD, "profile"},
{ NULL }
};
diff --git a/libavcodec/libaribcaption.c b/libavcodec/libaribcaption.c
index 747ca8a2e4..8a8c8f8cfd 100644
--- a/libavcodec/libaribcaption.c
+++ b/libavcodec/libaribcaption.c
@@ -452,7 +452,7 @@ static int aribcaption_trans_bitmap_subtitle(ARIBCaptionContext *ctx)
goto fail;
}
- if (ctx->avctx->profile == FF_PROFILE_ARIB_PROFILE_C) {
+ if (ctx->avctx->profile == AV_PROFILE_ARIB_PROFILE_C) {
/* ARIB TR-B14 version 3.8 Fascicle 1-(2/2) Volume 3 [Section 4] */
/* No position information is provided for profile C */
rect->x = (ctx->frame_width - rect->w) / 2;
@@ -594,7 +594,7 @@ static int aribcaption_trans_ass_subtitle(ARIBCaptionContext *ctx)
/* ARIB TR-B14 version 3.8 Fascicle 1-(2/2) Volume 3 [Section 4] */
/* No position information is provided for profile C */
- if (ctx->avctx->profile == FF_PROFILE_ARIB_PROFILE_C)
+ if (ctx->avctx->profile == AV_PROFILE_ARIB_PROFILE_C)
single_rect = true;
sub->format = 1; /* text */
@@ -606,7 +606,7 @@ static int aribcaption_trans_ass_subtitle(ARIBCaptionContext *ctx)
av_bprint_init(&buf, ARIBC_BPRINT_SIZE_INIT, ARIBC_BPRINT_SIZE_MAX);
- if (single_rect && ctx->avctx->profile != FF_PROFILE_ARIB_PROFILE_C) {
+ if (single_rect && ctx->avctx->profile != AV_PROFILE_ARIB_PROFILE_C) {
int x, y, rx, ry;
x = ctx->plane_width;
y = ctx->plane_height;
@@ -660,7 +660,7 @@ static int aribcaption_trans_ass_subtitle(ARIBCaptionContext *ctx)
for (int j = 0; j < region->char_count; j++) {
aribcc_caption_char_t *ch = ®ion->chars[j];
- if (ctx->avctx->profile != FF_PROFILE_ARIB_PROFILE_C) {
+ if (ctx->avctx->profile != AV_PROFILE_ARIB_PROFILE_C) {
if (ch->char_horizontal_spacing != char_horizontal_spacing) {
av_bprintf(&buf, "{\\fsp%d}", (region->is_ruby) ?
ch->char_horizontal_spacing / 2 :
@@ -960,14 +960,14 @@ static int aribcaption_init(AVCodecContext *avctx)
ctx->avctx = avctx;
switch (avctx->profile) {
- case FF_PROFILE_ARIB_PROFILE_A:
+ case AV_PROFILE_ARIB_PROFILE_A:
profile = ARIBCC_PROFILE_A;
/* assume 960x540 at initial state */
ctx->plane_width = 960;
ctx->plane_height = 540;
ctx->font_size = 36;
break;
- case FF_PROFILE_ARIB_PROFILE_C:
+ case AV_PROFILE_ARIB_PROFILE_C:
profile = ARIBCC_PROFILE_C;
ctx->plane_width = 320;
ctx->plane_height = 180;
diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c
index e08c6a0c6c..d400ac2e7c 100644
--- a/libavcodec/libfdk-aacenc.c
+++ b/libavcodec/libfdk-aacenc.c
@@ -179,7 +179,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
AACENC_InfoStruct info = { 0 };
CHANNEL_MODE mode;
AACENC_ERROR err;
- int aot = FF_PROFILE_AAC_LOW + 1;
+ int aot = AV_PROFILE_AAC_LOW + 1;
int sce = 0, cpe = 0;
if ((err = aacEncOpen(&s->handle, 0, avctx->ch_layout.nb_channels)) != AACENC_OK) {
@@ -188,7 +188,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
goto error;
}
- if (avctx->profile != FF_PROFILE_UNKNOWN)
+ if (avctx->profile != AV_PROFILE_UNKNOWN)
aot = avctx->profile + 1;
if ((err = aacEncoder_SetParam(s->handle, AACENC_AOT, aot)) != AACENC_OK) {
@@ -197,7 +197,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
goto error;
}
- if (aot == FF_PROFILE_AAC_ELD + 1 && s->eld_sbr) {
+ if (aot == AV_PROFILE_AAC_ELD + 1 && s->eld_sbr) {
if ((err = aacEncoder_SetParam(s->handle, AACENC_SBR_MODE,
1)) != AACENC_OK) {
av_log(avctx, AV_LOG_ERROR, "Unable to enable SBR for ELD: %s\n",
@@ -227,7 +227,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
case 2:
#if FDKENC_VER_AT_LEAST(4, 0) // 4.0.0
// (profile + 1) to map from profile range to AOT range
- if (aot == FF_PROFILE_AAC_ELD + 1 && s->eld_v2) {
+ if (aot == AV_PROFILE_AAC_ELD + 1 && s->eld_v2) {
if ((err = aacEncoder_SetParam(s->handle, AACENC_CHANNELMODE,
128)) != AACENC_OK) {
av_log(avctx, AV_LOG_ERROR, "Unable to enable ELDv2: %s\n",
@@ -310,14 +310,14 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
}
} else {
if (avctx->bit_rate <= 0) {
- if (avctx->profile == FF_PROFILE_AAC_HE_V2) {
+ if (avctx->profile == AV_PROFILE_AAC_HE_V2) {
sce = 1;
cpe = 0;
}
avctx->bit_rate = (96*sce + 128*cpe) * avctx->sample_rate / 44;
- if (avctx->profile == FF_PROFILE_AAC_HE ||
- avctx->profile == FF_PROFILE_AAC_HE_V2 ||
- avctx->profile == FF_PROFILE_MPEG2_AAC_HE ||
+ if (avctx->profile == AV_PROFILE_AAC_HE ||
+ avctx->profile == AV_PROFILE_AAC_HE_V2 ||
+ avctx->profile == AV_PROFILE_MPEG2_AAC_HE ||
s->eld_sbr)
avctx->bit_rate /= 2;
}
@@ -544,12 +544,12 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
}
static const AVProfile profiles[] = {
- { FF_PROFILE_AAC_LOW, "LC" },
- { FF_PROFILE_AAC_HE, "HE-AAC" },
- { FF_PROFILE_AAC_HE_V2, "HE-AACv2" },
- { FF_PROFILE_AAC_LD, "LD" },
- { FF_PROFILE_AAC_ELD, "ELD" },
- { FF_PROFILE_UNKNOWN },
+ { AV_PROFILE_AAC_LOW, "LC" },
+ { AV_PROFILE_AAC_HE, "HE-AAC" },
+ { AV_PROFILE_AAC_HE_V2, "HE-AACv2" },
+ { AV_PROFILE_AAC_LD, "LD" },
+ { AV_PROFILE_AAC_ELD, "ELD" },
+ { AV_PROFILE_UNKNOWN },
};
static const FFCodecDefault aac_encode_defaults[] = {
diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c
index 5b59af6f94..3f05bee388 100644
--- a/libavcodec/libopenh264enc.c
+++ b/libavcodec/libopenh264enc.c
@@ -61,11 +61,11 @@ typedef struct SVCContext {
#define DEPRECATED AV_OPT_FLAG_DEPRECATED
static const AVOption options[] = {
{ "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" },
+ { "profile", "set profile restrictions", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 0xffff, VE, "profile" },
#define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, { .i64 = value }, 0, 0, VE, "profile"
- { PROFILE("constrained_baseline", FF_PROFILE_H264_CONSTRAINED_BASELINE) },
- { PROFILE("main", FF_PROFILE_H264_MAIN) },
- { PROFILE("high", FF_PROFILE_H264_HIGH) },
+ { PROFILE("constrained_baseline", AV_PROFILE_H264_CONSTRAINED_BASELINE) },
+ { PROFILE("main", AV_PROFILE_H264_MAIN) },
+ { PROFILE("high", AV_PROFILE_H264_HIGH) },
#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 },
@@ -177,12 +177,12 @@ FF_ENABLE_DEPRECATION_WARNINGS
param.iMultipleThreadIdc = avctx->thread_count;
/* Allow specifying the libopenh264 profile through AVCodecContext. */
- if (FF_PROFILE_UNKNOWN == s->profile &&
- FF_PROFILE_UNKNOWN != avctx->profile)
+ if (AV_PROFILE_UNKNOWN == s->profile &&
+ AV_PROFILE_UNKNOWN != avctx->profile)
switch (avctx->profile) {
- case FF_PROFILE_H264_HIGH:
- case FF_PROFILE_H264_MAIN:
- case FF_PROFILE_H264_CONSTRAINED_BASELINE:
+ case AV_PROFILE_H264_HIGH:
+ case AV_PROFILE_H264_MAIN:
+ case AV_PROFILE_H264_CONSTRAINED_BASELINE:
s->profile = avctx->profile;
break;
default:
@@ -191,34 +191,34 @@ FF_ENABLE_DEPRECATION_WARNINGS
break;
}
- if (s->profile == FF_PROFILE_UNKNOWN && s->coder >= 0)
- s->profile = s->coder == 0 ? FF_PROFILE_H264_CONSTRAINED_BASELINE :
+ if (s->profile == AV_PROFILE_UNKNOWN && s->coder >= 0)
+ s->profile = s->coder == 0 ? AV_PROFILE_H264_CONSTRAINED_BASELINE :
#if OPENH264_VER_AT_LEAST(1, 8)
- FF_PROFILE_H264_HIGH;
+ AV_PROFILE_H264_HIGH;
#else
- FF_PROFILE_H264_MAIN;
+ AV_PROFILE_H264_MAIN;
#endif
switch (s->profile) {
- case FF_PROFILE_H264_HIGH:
+ case AV_PROFILE_H264_HIGH:
av_log(avctx, AV_LOG_VERBOSE, "Using %s, "
"select EProfileIdc PRO_HIGH in libopenh264.\n",
param.iEntropyCodingModeFlag ? "CABAC" : "CAVLC");
break;
- case FF_PROFILE_H264_MAIN:
+ case AV_PROFILE_H264_MAIN:
av_log(avctx, AV_LOG_VERBOSE, "Using %s, "
"select EProfileIdc PRO_MAIN in libopenh264.\n",
param.iEntropyCodingModeFlag ? "CABAC" : "CAVLC");
break;
- case FF_PROFILE_H264_CONSTRAINED_BASELINE:
- case FF_PROFILE_UNKNOWN:
- s->profile = FF_PROFILE_H264_CONSTRAINED_BASELINE;
+ case AV_PROFILE_H264_CONSTRAINED_BASELINE:
+ case AV_PROFILE_UNKNOWN:
+ s->profile = AV_PROFILE_H264_CONSTRAINED_BASELINE;
param.iEntropyCodingModeFlag = 0;
av_log(avctx, AV_LOG_VERBOSE, "Using CAVLC, "
"select EProfileIdc PRO_BASELINE in libopenh264.\n");
break;
default:
- s->profile = FF_PROFILE_H264_CONSTRAINED_BASELINE;
+ s->profile = AV_PROFILE_H264_CONSTRAINED_BASELINE;
param.iEntropyCodingModeFlag = 0;
av_log(avctx, AV_LOG_WARNING, "Unsupported profile, "
"select EProfileIdc PRO_BASELINE in libopenh264.\n");
diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
index f2b73361d8..c35412319b 100644
--- a/libavcodec/libsvtav1.c
+++ b/libavcodec/libsvtav1.c
@@ -236,10 +236,10 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param,
}
#endif
- if (avctx->profile != FF_PROFILE_UNKNOWN)
+ if (avctx->profile != AV_PROFILE_UNKNOWN)
param->profile = avctx->profile;
- if (avctx->level != FF_LEVEL_UNKNOWN)
+ if (avctx->level != AV_LEVEL_UNKNOWN)
param->level = avctx->level;
// gop_size == 1 case is handled when encoding each frame by setting
@@ -310,12 +310,12 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
if ((param->encoder_color_format == EB_YUV422 || param->encoder_bit_depth > 10)
- && param->profile != FF_PROFILE_AV1_PROFESSIONAL ) {
+ && param->profile != AV_PROFILE_AV1_PROFESSIONAL ) {
av_log(avctx, AV_LOG_WARNING, "Forcing Professional profile\n");
- param->profile = FF_PROFILE_AV1_PROFESSIONAL;
- } else if (param->encoder_color_format == EB_YUV444 && param->profile != FF_PROFILE_AV1_HIGH) {
+ param->profile = AV_PROFILE_AV1_PROFESSIONAL;
+ } else if (param->encoder_color_format == EB_YUV444 && param->profile != AV_PROFILE_AV1_HIGH) {
av_log(avctx, AV_LOG_WARNING, "Forcing High profile\n");
- param->profile = FF_PROFILE_AV1_HIGH;
+ param->profile = AV_PROFILE_AV1_HIGH;
}
avctx->bit_rate = param->rate_control_mode > 0 ?
diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
index f480545ae0..40c8caf887 100644
--- a/libavcodec/libvpxdec.c
+++ b/libavcodec/libvpxdec.c
@@ -127,26 +127,26 @@ static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img,
switch (img->fmt) {
case VPX_IMG_FMT_I420:
if (avctx->codec_id == AV_CODEC_ID_VP9)
- avctx->profile = FF_PROFILE_VP9_0;
+ avctx->profile = AV_PROFILE_VP9_0;
avctx->pix_fmt =
has_alpha_channel ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P;
return 0;
#if CONFIG_LIBVPX_VP9_DECODER
case VPX_IMG_FMT_I422:
- avctx->profile = FF_PROFILE_VP9_1;
+ avctx->profile = AV_PROFILE_VP9_1;
avctx->pix_fmt = AV_PIX_FMT_YUV422P;
return 0;
case VPX_IMG_FMT_I440:
- avctx->profile = FF_PROFILE_VP9_1;
+ avctx->profile = AV_PROFILE_VP9_1;
avctx->pix_fmt = AV_PIX_FMT_YUV440P;
return 0;
case VPX_IMG_FMT_I444:
- avctx->profile = FF_PROFILE_VP9_1;
+ avctx->profile = AV_PROFILE_VP9_1;
avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
AV_PIX_FMT_GBRP : AV_PIX_FMT_YUV444P;
return 0;
case VPX_IMG_FMT_I42016:
- avctx->profile = FF_PROFILE_VP9_2;
+ avctx->profile = AV_PROFILE_VP9_2;
if (img->bit_depth == 10) {
avctx->pix_fmt = AV_PIX_FMT_YUV420P10;
return 0;
@@ -157,7 +157,7 @@ static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img,
return AVERROR_INVALIDDATA;
}
case VPX_IMG_FMT_I42216:
- avctx->profile = FF_PROFILE_VP9_3;
+ avctx->profile = AV_PROFILE_VP9_3;
if (img->bit_depth == 10) {
avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
return 0;
@@ -168,7 +168,7 @@ static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img,
return AVERROR_INVALIDDATA;
}
case VPX_IMG_FMT_I44016:
- avctx->profile = FF_PROFILE_VP9_3;
+ avctx->profile = AV_PROFILE_VP9_3;
if (img->bit_depth == 10) {
avctx->pix_fmt = AV_PIX_FMT_YUV440P10;
return 0;
@@ -179,7 +179,7 @@ static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img,
return AVERROR_INVALIDDATA;
}
case VPX_IMG_FMT_I44416:
- avctx->profile = FF_PROFILE_VP9_3;
+ avctx->profile = AV_PROFILE_VP9_3;
if (img->bit_depth == 10) {
avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
AV_PIX_FMT_GBRP10 : AV_PIX_FMT_YUV444P10;
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 7a545527a9..61986cd3ff 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -1145,7 +1145,7 @@ static av_cold int vpx_init(AVCodecContext *avctx,
/* 0-3: For non-zero values the encoder increasingly optimizes for reduced
complexity playback on low powered devices at the expense of encode
quality. */
- if (avctx->profile != FF_PROFILE_UNKNOWN)
+ if (avctx->profile != AV_PROFILE_UNKNOWN)
enccfg.g_profile = avctx->profile;
enccfg.g_error_resilient = ctx->error_resilient || ctx->flags & VP8F_ERROR_RESILIENT;
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index ce849d6c9a..77515209b9 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -1048,22 +1048,22 @@ static av_cold int X264_init(AVCodecContext *avctx)
/* Allow specifying the x264 profile through AVCodecContext. */
if (!x4->profile)
switch (avctx->profile) {
- case FF_PROFILE_H264_BASELINE:
+ case AV_PROFILE_H264_BASELINE:
x4->profile = "baseline";
break;
- case FF_PROFILE_H264_HIGH:
+ case AV_PROFILE_H264_HIGH:
x4->profile = "high";
break;
- case FF_PROFILE_H264_HIGH_10:
+ case AV_PROFILE_H264_HIGH_10:
x4->profile = "high10";
break;
- case FF_PROFILE_H264_HIGH_422:
+ case AV_PROFILE_H264_HIGH_422:
x4->profile = "high422";
break;
- case FF_PROFILE_H264_HIGH_444:
+ case AV_PROFILE_H264_HIGH_444:
x4->profile = "high444";
break;
- case FF_PROFILE_H264_MAIN:
+ case AV_PROFILE_H264_MAIN:
x4->profile = "main";
break;
default:
diff --git a/libavcodec/mediacodec_wrapper.c b/libavcodec/mediacodec_wrapper.c
index eb69ad7eaf..0880ddd3ef 100644
--- a/libavcodec/mediacodec_wrapper.c
+++ b/libavcodec/mediacodec_wrapper.c
@@ -365,82 +365,82 @@ int ff_AMediaCodecProfile_getProfileFromAVCodecContext(AVCodecContext *avctx)
if (avctx->codec_id == AV_CODEC_ID_H264) {
switch(avctx->profile) {
- case FF_PROFILE_H264_BASELINE:
+ case AV_PROFILE_H264_BASELINE:
return AVCProfileBaseline;
- case FF_PROFILE_H264_CONSTRAINED_BASELINE:
+ case AV_PROFILE_H264_CONSTRAINED_BASELINE:
return AVCProfileConstrainedBaseline;
- case FF_PROFILE_H264_MAIN:
+ case AV_PROFILE_H264_MAIN:
return AVCProfileMain;
break;
- case FF_PROFILE_H264_EXTENDED:
+ case AV_PROFILE_H264_EXTENDED:
return AVCProfileExtended;
- case FF_PROFILE_H264_HIGH:
+ case AV_PROFILE_H264_HIGH:
return AVCProfileHigh;
- case FF_PROFILE_H264_HIGH_10:
- case FF_PROFILE_H264_HIGH_10_INTRA:
+ case AV_PROFILE_H264_HIGH_10:
+ case AV_PROFILE_H264_HIGH_10_INTRA:
return AVCProfileHigh10;
- case FF_PROFILE_H264_HIGH_422:
- case FF_PROFILE_H264_HIGH_422_INTRA:
+ case AV_PROFILE_H264_HIGH_422:
+ case AV_PROFILE_H264_HIGH_422_INTRA:
return AVCProfileHigh422;
- case FF_PROFILE_H264_HIGH_444:
- case FF_PROFILE_H264_HIGH_444_INTRA:
- case FF_PROFILE_H264_HIGH_444_PREDICTIVE:
+ case AV_PROFILE_H264_HIGH_444:
+ case AV_PROFILE_H264_HIGH_444_INTRA:
+ case AV_PROFILE_H264_HIGH_444_PREDICTIVE:
return AVCProfileHigh444;
}
} else if (avctx->codec_id == AV_CODEC_ID_HEVC) {
switch (avctx->profile) {
- case FF_PROFILE_HEVC_MAIN:
+ case AV_PROFILE_HEVC_MAIN:
return HEVCProfileMain;
- case FF_PROFILE_HEVC_MAIN_STILL_PICTURE:
+ case AV_PROFILE_HEVC_MAIN_STILL_PICTURE:
return HEVCProfileMainStill;
- case FF_PROFILE_HEVC_MAIN_10:
+ case AV_PROFILE_HEVC_MAIN_10:
return HEVCProfileMain10;
}
} else if (avctx->codec_id == AV_CODEC_ID_VP9) {
switch (avctx->profile) {
- case FF_PROFILE_VP9_0:
+ case AV_PROFILE_VP9_0:
return VP9Profile0;
- case FF_PROFILE_VP9_1:
+ case AV_PROFILE_VP9_1:
return VP9Profile1;
- case FF_PROFILE_VP9_2:
+ case AV_PROFILE_VP9_2:
return VP9Profile2;
- case FF_PROFILE_VP9_3:
+ case AV_PROFILE_VP9_3:
return VP9Profile3;
}
} else if(avctx->codec_id == AV_CODEC_ID_MPEG4) {
switch (avctx->profile)
{
- case FF_PROFILE_MPEG4_SIMPLE:
+ case AV_PROFILE_MPEG4_SIMPLE:
return MPEG4ProfileSimple;
- case FF_PROFILE_MPEG4_SIMPLE_SCALABLE:
+ case AV_PROFILE_MPEG4_SIMPLE_SCALABLE:
return MPEG4ProfileSimpleScalable;
- case FF_PROFILE_MPEG4_CORE:
+ case AV_PROFILE_MPEG4_CORE:
return MPEG4ProfileCore;
- case FF_PROFILE_MPEG4_MAIN:
+ case AV_PROFILE_MPEG4_MAIN:
return MPEG4ProfileMain;
- case FF_PROFILE_MPEG4_N_BIT:
+ case AV_PROFILE_MPEG4_N_BIT:
return MPEG4ProfileNbit;
- case FF_PROFILE_MPEG4_SCALABLE_TEXTURE:
+ case AV_PROFILE_MPEG4_SCALABLE_TEXTURE:
return MPEG4ProfileScalableTexture;
- case FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION:
+ case AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION:
return MPEG4ProfileSimpleFBA;
- case FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE:
+ case AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE:
return MPEG4ProfileBasicAnimated;
- case FF_PROFILE_MPEG4_HYBRID:
+ case AV_PROFILE_MPEG4_HYBRID:
return MPEG4ProfileHybrid;
- case FF_PROFILE_MPEG4_ADVANCED_REAL_TIME:
+ case AV_PROFILE_MPEG4_ADVANCED_REAL_TIME:
return MPEG4ProfileAdvancedRealTime;
- case FF_PROFILE_MPEG4_CORE_SCALABLE:
+ case AV_PROFILE_MPEG4_CORE_SCALABLE:
return MPEG4ProfileCoreScalable;
- case FF_PROFILE_MPEG4_ADVANCED_CODING:
+ case AV_PROFILE_MPEG4_ADVANCED_CODING:
return MPEG4ProfileAdvancedCoding;
- case FF_PROFILE_MPEG4_ADVANCED_CORE:
+ case AV_PROFILE_MPEG4_ADVANCED_CORE:
return MPEG4ProfileAdvancedCore;
- case FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE:
+ case AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE:
return MPEG4ProfileAdvancedScalable;
- case FF_PROFILE_MPEG4_ADVANCED_SIMPLE:
+ case AV_PROFILE_MPEG4_ADVANCED_SIMPLE:
return MPEG4ProfileAdvancedSimple;
- case FF_PROFILE_MPEG4_SIMPLE_STUDIO:
+ case AV_PROFILE_MPEG4_SIMPLE_STUDIO:
// Studio profiles are not supported by mediacodec.
default:
break;
@@ -448,10 +448,10 @@ int ff_AMediaCodecProfile_getProfileFromAVCodecContext(AVCodecContext *avctx)
} else if(avctx->codec_id == AV_CODEC_ID_AV1) {
switch (avctx->profile)
{
- case FF_PROFILE_AV1_MAIN:
+ case AV_PROFILE_AV1_MAIN:
return AV1ProfileMain8;
- case FF_PROFILE_AV1_HIGH:
- case FF_PROFILE_AV1_PROFESSIONAL:
+ case AV_PROFILE_AV1_HIGH:
+ case AV_PROFILE_AV1_PROFESSIONAL:
default:
break;
}
diff --git a/libavcodec/mediacodecenc.c b/libavcodec/mediacodecenc.c
index 1da705d113..485ab7b4ed 100644
--- a/libavcodec/mediacodecenc.c
+++ b/libavcodec/mediacodecenc.c
@@ -660,14 +660,14 @@ enum MediaCodecAvcLevel {
static const AVOption h264_options[] = {
COMMON_OPTION
- FF_AVCTX_PROFILE_OPTION("baseline", NULL, VIDEO, FF_PROFILE_H264_BASELINE)
- FF_AVCTX_PROFILE_OPTION("constrained_baseline", NULL, VIDEO, FF_PROFILE_H264_CONSTRAINED_BASELINE)
- FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, FF_PROFILE_H264_MAIN)
- FF_AVCTX_PROFILE_OPTION("extended", NULL, VIDEO, FF_PROFILE_H264_EXTENDED)
- FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, FF_PROFILE_H264_HIGH)
- FF_AVCTX_PROFILE_OPTION("high10", NULL, VIDEO, FF_PROFILE_H264_HIGH_10)
- FF_AVCTX_PROFILE_OPTION("high422", NULL, VIDEO, FF_PROFILE_H264_HIGH_422)
- FF_AVCTX_PROFILE_OPTION("high444", NULL, VIDEO, FF_PROFILE_H264_HIGH_444)
+ FF_AVCTX_PROFILE_OPTION("baseline", NULL, VIDEO, AV_PROFILE_H264_BASELINE)
+ FF_AVCTX_PROFILE_OPTION("constrained_baseline", NULL, VIDEO, AV_PROFILE_H264_CONSTRAINED_BASELINE)
+ FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, AV_PROFILE_H264_MAIN)
+ FF_AVCTX_PROFILE_OPTION("extended", NULL, VIDEO, AV_PROFILE_H264_EXTENDED)
+ FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, AV_PROFILE_H264_HIGH)
+ FF_AVCTX_PROFILE_OPTION("high10", NULL, VIDEO, AV_PROFILE_H264_HIGH_10)
+ FF_AVCTX_PROFILE_OPTION("high422", NULL, VIDEO, AV_PROFILE_H264_HIGH_422)
+ FF_AVCTX_PROFILE_OPTION("high444", NULL, VIDEO, AV_PROFILE_H264_HIGH_444)
{ "level", "Specify level",
OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" },
@@ -732,8 +732,8 @@ enum MediaCodecHevcLevel {
static const AVOption hevc_options[] = {
COMMON_OPTION
- FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, FF_PROFILE_HEVC_MAIN)
- FF_AVCTX_PROFILE_OPTION("main10", NULL, VIDEO, FF_PROFILE_HEVC_MAIN_10)
+ FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, AV_PROFILE_HEVC_MAIN)
+ FF_AVCTX_PROFILE_OPTION("main10", NULL, VIDEO, AV_PROFILE_HEVC_MAIN_10)
{ "level", "Specify tier and level",
OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" },
@@ -846,10 +846,10 @@ enum MediaCodecVP9Level {
static const AVOption vp9_options[] = {
COMMON_OPTION
- FF_AVCTX_PROFILE_OPTION("profile0", NULL, VIDEO, FF_PROFILE_VP9_0)
- FF_AVCTX_PROFILE_OPTION("profile1", NULL, VIDEO, FF_PROFILE_VP9_1)
- FF_AVCTX_PROFILE_OPTION("profile2", NULL, VIDEO, FF_PROFILE_VP9_2)
- FF_AVCTX_PROFILE_OPTION("profile3", NULL, VIDEO, FF_PROFILE_VP9_3)
+ FF_AVCTX_PROFILE_OPTION("profile0", NULL, VIDEO, AV_PROFILE_VP9_0)
+ FF_AVCTX_PROFILE_OPTION("profile1", NULL, VIDEO, AV_PROFILE_VP9_1)
+ FF_AVCTX_PROFILE_OPTION("profile2", NULL, VIDEO, AV_PROFILE_VP9_2)
+ FF_AVCTX_PROFILE_OPTION("profile3", NULL, VIDEO, AV_PROFILE_VP9_3)
{ "level", "Specify tier and level",
OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" },
diff --git a/libavcodec/mfenc.c b/libavcodec/mfenc.c
index 8d950a3109..3c50a6c074 100644
--- a/libavcodec/mfenc.c
+++ b/libavcodec/mfenc.c
@@ -672,10 +672,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (avctx->codec_id == AV_CODEC_ID_H264) {
UINT32 profile = ff_eAVEncH264VProfile_Base;
switch (avctx->profile) {
- case FF_PROFILE_H264_MAIN:
+ case AV_PROFILE_H264_MAIN:
profile = ff_eAVEncH264VProfile_Main;
break;
- case FF_PROFILE_H264_HIGH:
+ case AV_PROFILE_H264_HIGH:
profile = ff_eAVEncH264VProfile_High;
break;
}
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index cef8625791..24f24b1a5b 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -2485,9 +2485,9 @@ redo_for_pal8:
case SOF0:
case SOF1:
if (start_code == SOF0)
- s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT;
+ s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT;
else
- s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT;
+ s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT;
s->lossless = 0;
s->ls = 0;
s->progressive = 0;
@@ -2495,7 +2495,7 @@ redo_for_pal8:
goto fail;
break;
case SOF2:
- s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT;
+ s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT;
s->lossless = 0;
s->ls = 0;
s->progressive = 1;
@@ -2503,7 +2503,7 @@ redo_for_pal8:
goto fail;
break;
case SOF3:
- s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_LOSSLESS;
+ s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS;
s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS;
s->lossless = 1;
s->ls = 0;
@@ -2512,7 +2512,7 @@ redo_for_pal8:
goto fail;
break;
case SOF48:
- s->avctx->profile = FF_PROFILE_MJPEG_JPEG_LS;
+ s->avctx->profile = AV_PROFILE_MJPEG_JPEG_LS;
s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS;
s->lossless = 1;
s->ls = 1;
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index 966ee0f0a2..4357165d4e 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -398,7 +398,7 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb)
*/
if (m->avctx->codec_id == AV_CODEC_ID_TRUEHD
&& m->num_substreams == 4 && m->substream_info >> 7 == 1) {
- m->avctx->profile = FF_PROFILE_TRUEHD_ATMOS;
+ m->avctx->profile = AV_PROFILE_TRUEHD_ATMOS;
}
/* limit to decoding 3 substreams, as the 4th is used by Dolby Atmos for non-audio data */
diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c
index 4aa45e9e86..0135623c0e 100644
--- a/libavcodec/mpeg12enc.c
+++ b/libavcodec/mpeg12enc.c
@@ -203,23 +203,23 @@ static av_cold int encode_init(AVCodecContext *avctx)
}
}
- if (avctx->profile == FF_PROFILE_UNKNOWN) {
- if (avctx->level != FF_LEVEL_UNKNOWN) {
+ if (avctx->profile == AV_PROFILE_UNKNOWN) {
+ if (avctx->level != AV_LEVEL_UNKNOWN) {
av_log(avctx, AV_LOG_ERROR, "Set profile and level\n");
return AVERROR(EINVAL);
}
/* Main or 4:2:2 */
- avctx->profile = avctx->pix_fmt == AV_PIX_FMT_YUV420P ? FF_PROFILE_MPEG2_MAIN
- : FF_PROFILE_MPEG2_422;
+ avctx->profile = avctx->pix_fmt == AV_PIX_FMT_YUV420P ? AV_PROFILE_MPEG2_MAIN
+ : AV_PROFILE_MPEG2_422;
}
- if (avctx->level == FF_LEVEL_UNKNOWN) {
- if (avctx->profile == FF_PROFILE_MPEG2_422) { /* 4:2:2 */
+ if (avctx->level == AV_LEVEL_UNKNOWN) {
+ if (avctx->profile == AV_PROFILE_MPEG2_422) { /* 4:2:2 */
if (avctx->width <= 720 && avctx->height <= 608)
avctx->level = 5; /* Main */
else
avctx->level = 2; /* High */
} else {
- if (avctx->profile != FF_PROFILE_MPEG2_HIGH &&
+ if (avctx->profile != AV_PROFILE_MPEG2_HIGH &&
avctx->pix_fmt != AV_PIX_FMT_YUV420P) {
av_log(avctx, AV_LOG_ERROR,
"Only High(1) and 4:2:2(0) profiles support 4:2:2 color sampling\n");
@@ -366,7 +366,7 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s)
put_header(s, EXT_START_CODE);
put_bits(&s->pb, 4, 1); // seq ext
- put_bits(&s->pb, 1, s->avctx->profile == FF_PROFILE_MPEG2_422); // escx 1 for 4:2:2 profile
+ put_bits(&s->pb, 1, s->avctx->profile == AV_PROFILE_MPEG2_422); // escx 1 for 4:2:2 profile
put_bits(&s->pb, 3, s->avctx->profile); // profile
put_bits(&s->pb, 4, s->avctx->level); // level
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 30aec5e529..142e56c03c 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -2564,10 +2564,10 @@ static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb)
*/
if (ctx->vo_type == CORE_STUDIO_VO_TYPE ||
ctx->vo_type == SIMPLE_STUDIO_VO_TYPE) {
- if (s->avctx->profile != FF_PROFILE_UNKNOWN && s->avctx->profile != FF_PROFILE_MPEG4_SIMPLE_STUDIO)
+ if (s->avctx->profile != AV_PROFILE_UNKNOWN && s->avctx->profile != AV_PROFILE_MPEG4_SIMPLE_STUDIO)
return AVERROR_INVALIDDATA;
s->studio_profile = 1;
- s->avctx->profile = FF_PROFILE_MPEG4_SIMPLE_STUDIO;
+ s->avctx->profile = AV_PROFILE_MPEG4_SIMPLE_STUDIO;
return decode_studio_vol_header(ctx, gb);
} else if (s->studio_profile) {
return AVERROR_PATCHWELCOME;
@@ -3605,7 +3605,7 @@ int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb,
} else if (startcode == VOS_STARTCODE) {
int profile, level;
mpeg4_decode_profile_level(s, gb, &profile, &level);
- if (profile == FF_PROFILE_MPEG4_SIMPLE_STUDIO &&
+ if (profile == AV_PROFILE_MPEG4_SIMPLE_STUDIO &&
(level > 0 && level < 9)) {
s->studio_profile = 1;
next_start_code_studio(gb);
diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c
index 777635c40c..d1e50612dd 100644
--- a/libavcodec/mpeg4videoenc.c
+++ b/libavcodec/mpeg4videoenc.c
@@ -916,7 +916,7 @@ static void mpeg4_encode_visual_object_header(MpegEncContext *s)
int profile_and_level_indication;
int vo_ver_id;
- if (s->avctx->profile != FF_PROFILE_UNKNOWN) {
+ if (s->avctx->profile != AV_PROFILE_UNKNOWN) {
profile_and_level_indication = s->avctx->profile << 4;
} else if (s->max_b_frames || s->quarter_sample) {
profile_and_level_indication = 0xF0; // adv simple
@@ -924,7 +924,7 @@ static void mpeg4_encode_visual_object_header(MpegEncContext *s)
profile_and_level_indication = 0x00; // simple
}
- if (s->avctx->level != FF_LEVEL_UNKNOWN)
+ if (s->avctx->level != AV_LEVEL_UNKNOWN)
profile_and_level_indication |= s->avctx->level;
else
profile_and_level_indication |= 1; // level 1
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 1e83ea9734..7184a9efa3 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -1219,19 +1219,19 @@ static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx)
switch(ctx->profile) {
case NV_ENC_H264_PROFILE_BASELINE:
cc->profileGUID = NV_ENC_H264_PROFILE_BASELINE_GUID;
- avctx->profile = FF_PROFILE_H264_BASELINE;
+ avctx->profile = AV_PROFILE_H264_BASELINE;
break;
case NV_ENC_H264_PROFILE_MAIN:
cc->profileGUID = NV_ENC_H264_PROFILE_MAIN_GUID;
- avctx->profile = FF_PROFILE_H264_MAIN;
+ avctx->profile = AV_PROFILE_H264_MAIN;
break;
case NV_ENC_H264_PROFILE_HIGH:
cc->profileGUID = NV_ENC_H264_PROFILE_HIGH_GUID;
- avctx->profile = FF_PROFILE_H264_HIGH;
+ avctx->profile = AV_PROFILE_H264_HIGH;
break;
case NV_ENC_H264_PROFILE_HIGH_444P:
cc->profileGUID = NV_ENC_H264_PROFILE_HIGH_444_GUID;
- avctx->profile = FF_PROFILE_H264_HIGH_444_PREDICTIVE;
+ avctx->profile = AV_PROFILE_H264_HIGH_444_PREDICTIVE;
break;
}
}
@@ -1239,10 +1239,10 @@ static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx)
// force setting profile as high444p if input is AV_PIX_FMT_YUV444P
if (IS_YUV444(ctx->data_pix_fmt)) {
cc->profileGUID = NV_ENC_H264_PROFILE_HIGH_444_GUID;
- avctx->profile = FF_PROFILE_H264_HIGH_444_PREDICTIVE;
+ avctx->profile = AV_PROFILE_H264_HIGH_444_PREDICTIVE;
}
- h264->chromaFormatIDC = avctx->profile == FF_PROFILE_H264_HIGH_444_PREDICTIVE ? 3 : 1;
+ h264->chromaFormatIDC = avctx->profile == AV_PROFILE_H264_HIGH_444_PREDICTIVE ? 3 : 1;
h264->level = ctx->level;
@@ -1335,28 +1335,28 @@ static av_cold int nvenc_setup_hevc_config(AVCodecContext *avctx)
switch (ctx->profile) {
case NV_ENC_HEVC_PROFILE_MAIN:
cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN_GUID;
- avctx->profile = FF_PROFILE_HEVC_MAIN;
+ avctx->profile = AV_PROFILE_HEVC_MAIN;
break;
case NV_ENC_HEVC_PROFILE_MAIN_10:
cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN10_GUID;
- avctx->profile = FF_PROFILE_HEVC_MAIN_10;
+ avctx->profile = AV_PROFILE_HEVC_MAIN_10;
break;
case NV_ENC_HEVC_PROFILE_REXT:
cc->profileGUID = NV_ENC_HEVC_PROFILE_FREXT_GUID;
- avctx->profile = FF_PROFILE_HEVC_REXT;
+ avctx->profile = AV_PROFILE_HEVC_REXT;
break;
}
// force setting profile as main10 if input is 10 bit
if (IS_10BIT(ctx->data_pix_fmt)) {
cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN10_GUID;
- avctx->profile = FF_PROFILE_HEVC_MAIN_10;
+ avctx->profile = AV_PROFILE_HEVC_MAIN_10;
}
// force setting profile as rext if input is yuv444
if (IS_YUV444(ctx->data_pix_fmt)) {
cc->profileGUID = NV_ENC_HEVC_PROFILE_FREXT_GUID;
- avctx->profile = FF_PROFILE_HEVC_REXT;
+ avctx->profile = AV_PROFILE_HEVC_REXT;
}
hevc->chromaFormatIDC = IS_YUV444(ctx->data_pix_fmt) ? 3 : 1;
@@ -1407,7 +1407,7 @@ static av_cold int nvenc_setup_av1_config(AVCodecContext *avctx)
return AVERROR(ENOTSUP);
} else {
cc->profileGUID = NV_ENC_AV1_PROFILE_MAIN_GUID;
- avctx->profile = FF_PROFILE_AV1_MAIN;
+ avctx->profile = AV_PROFILE_AV1_MAIN;
}
if (ctx->dpb_size >= 0) {
diff --git a/libavcodec/nvenc_hevc.c b/libavcodec/nvenc_hevc.c
index e606655e7e..e88f7e9783 100644
--- a/libavcodec/nvenc_hevc.c
+++ b/libavcodec/nvenc_hevc.c
@@ -57,7 +57,7 @@ static const AVOption options[] = {
{ "ull", "Ultra low latency", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TUNING_INFO_ULTRA_LOW_LATENCY }, 0, 0, VE, "tune" },
{ "lossless", "Lossless", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TUNING_INFO_LOSSLESS }, 0, 0, VE, "tune" },
#endif
- { "profile", "Set the encoding profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = NV_ENC_HEVC_PROFILE_MAIN }, NV_ENC_HEVC_PROFILE_MAIN, FF_PROFILE_HEVC_REXT, VE, "profile" },
+ { "profile", "Set the encoding profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = NV_ENC_HEVC_PROFILE_MAIN }, NV_ENC_HEVC_PROFILE_MAIN, AV_PROFILE_HEVC_REXT, VE, "profile" },
{ "main", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_HEVC_PROFILE_MAIN }, 0, 0, VE, "profile" },
{ "main10", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_HEVC_PROFILE_MAIN_10 }, 0, 0, VE, "profile" },
{ "rext", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_HEVC_PROFILE_REXT }, 0, 0, VE, "profile" },
diff --git a/libavcodec/omx.c b/libavcodec/omx.c
index 6e667971ea..8d6519d141 100644
--- a/libavcodec/omx.c
+++ b/libavcodec/omx.c
@@ -531,14 +531,14 @@ static av_cold int omx_component_init(AVCodecContext *avctx, const char *role)
CHECK(err);
avc.nBFrames = 0;
avc.nPFrames = avctx->gop_size - 1;
- switch (s->profile == FF_PROFILE_UNKNOWN ? avctx->profile : s->profile) {
- case FF_PROFILE_H264_BASELINE:
+ switch (s->profile == AV_PROFILE_UNKNOWN ? avctx->profile : s->profile) {
+ case AV_PROFILE_H264_BASELINE:
avc.eProfile = OMX_VIDEO_AVCProfileBaseline;
break;
- case FF_PROFILE_H264_MAIN:
+ case AV_PROFILE_H264_MAIN:
avc.eProfile = OMX_VIDEO_AVCProfileMain;
break;
- case FF_PROFILE_H264_HIGH:
+ case AV_PROFILE_H264_HIGH:
avc.eProfile = OMX_VIDEO_AVCProfileHigh;
break;
default:
@@ -919,10 +919,10 @@ static const AVOption options[] = {
{ "omx_libname", "OpenMAX library name", OFFSET(libname), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VDE },
{ "omx_libprefix", "OpenMAX library prefix", OFFSET(libprefix), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VDE },
{ "zerocopy", "Try to avoid copying input frames if possible", OFFSET(input_zerocopy), AV_OPT_TYPE_INT, { .i64 = CONFIG_OMX_RPI }, 0, 1, VE },
- { "profile", "Set the encoding profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, FF_PROFILE_H264_HIGH, VE, "profile" },
- { "baseline", "", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_BASELINE }, 0, 0, VE, "profile" },
- { "main", "", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_MAIN }, 0, 0, VE, "profile" },
- { "high", "", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_HIGH }, 0, 0, VE, "profile" },
+ { "profile", "Set the encoding profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, AV_PROFILE_H264_HIGH, VE, "profile" },
+ { "baseline", "", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_BASELINE }, 0, 0, VE, "profile" },
+ { "main", "", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_MAIN }, 0, 0, VE, "profile" },
+ { "high", "", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_HIGH }, 0, 0, VE, "profile" },
{ NULL }
};
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index bb4b894b06..47e4a313bc 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -223,9 +223,9 @@ static const AVOption avcodec_options[] = {
{"nssew", "nsse weight", OFFSET(nsse_weight), AV_OPT_TYPE_INT, {.i64 = 8 }, INT_MIN, INT_MAX, V|E},
{"skip_top", "number of macroblock rows at the top which are skipped", OFFSET(skip_top), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|D},
{"skip_bottom", "number of macroblock rows at the bottom which are skipped", OFFSET(skip_bottom), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|D},
-{"profile", NULL, OFFSET(profile), AV_OPT_TYPE_INT, {.i64 = FF_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E|CC, "avctx.profile"},
-{"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "avctx.profile"},
-{"main10", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_HEVC_MAIN_10 }, INT_MIN, INT_MAX, V|E, "avctx.profile"},
+{"profile", NULL, OFFSET(profile), AV_OPT_TYPE_INT, {.i64 = AV_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E|CC, "avctx.profile"},
+{"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "avctx.profile"},
+{"main10", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_HEVC_MAIN_10 }, INT_MIN, INT_MAX, V|E, "avctx.profile"},
{"level", NULL, OFFSET(level), AV_OPT_TYPE_INT, {.i64 = FF_LEVEL_UNKNOWN }, INT_MIN, INT_MAX, V|A|E|CC, "avctx.level"},
{"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_LEVEL_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "avctx.level"},
{"lowres", "decode at 1= 1/2, 2=1/4, 3=1/8 resolutions", OFFSET(lowres), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, V|A|D},
diff --git a/libavcodec/profiles.c b/libavcodec/profiles.c
index c646a3f54d..5bb8f150e6 100644
--- a/libavcodec/profiles.c
+++ b/libavcodec/profiles.c
@@ -24,180 +24,180 @@
#if !CONFIG_SMALL
const AVProfile ff_aac_profiles[] = {
- { FF_PROFILE_AAC_LOW, "LC" },
- { FF_PROFILE_AAC_HE, "HE-AAC" },
- { FF_PROFILE_AAC_HE_V2, "HE-AACv2" },
- { FF_PROFILE_AAC_LD, "LD" },
- { FF_PROFILE_AAC_ELD, "ELD" },
- { FF_PROFILE_AAC_MAIN, "Main" },
- { FF_PROFILE_AAC_SSR, "SSR" },
- { FF_PROFILE_AAC_LTP, "LTP" },
- { FF_PROFILE_UNKNOWN },
+ { AV_PROFILE_AAC_LOW, "LC" },
+ { AV_PROFILE_AAC_HE, "HE-AAC" },
+ { AV_PROFILE_AAC_HE_V2, "HE-AACv2" },
+ { AV_PROFILE_AAC_LD, "LD" },
+ { AV_PROFILE_AAC_ELD, "ELD" },
+ { AV_PROFILE_AAC_MAIN, "Main" },
+ { AV_PROFILE_AAC_SSR, "SSR" },
+ { AV_PROFILE_AAC_LTP, "LTP" },
+ { AV_PROFILE_UNKNOWN },
};
const AVProfile ff_dca_profiles[] = {
- { FF_PROFILE_DTS, "DTS" },
- { FF_PROFILE_DTS_ES, "DTS-ES" },
- { FF_PROFILE_DTS_96_24, "DTS 96/24" },
- { FF_PROFILE_DTS_HD_HRA, "DTS-HD HRA" },
- { FF_PROFILE_DTS_HD_MA, "DTS-HD MA" },
- { FF_PROFILE_DTS_HD_MA_X, "DTS-HD MA + DTS:X" },
- { FF_PROFILE_DTS_HD_MA_X_IMAX, "DTS-HD MA + DTS:X IMAX" },
- { FF_PROFILE_DTS_EXPRESS, "DTS Express" },
- { FF_PROFILE_UNKNOWN },
+ { AV_PROFILE_DTS, "DTS" },
+ { AV_PROFILE_DTS_ES, "DTS-ES" },
+ { AV_PROFILE_DTS_96_24, "DTS 96/24" },
+ { AV_PROFILE_DTS_HD_HRA, "DTS-HD HRA" },
+ { AV_PROFILE_DTS_HD_MA, "DTS-HD MA" },
+ { AV_PROFILE_DTS_HD_MA_X, "DTS-HD MA + DTS:X" },
+ { AV_PROFILE_DTS_HD_MA_X_IMAX, "DTS-HD MA + DTS:X IMAX" },
+ { AV_PROFILE_DTS_EXPRESS, "DTS Express" },
+ { AV_PROFILE_UNKNOWN },
};
const AVProfile ff_eac3_profiles[] = {
- { FF_PROFILE_EAC3_DDP_ATMOS, "Dolby Digital Plus + Dolby Atmos"},
- { FF_PROFILE_UNKNOWN },
+ { AV_PROFILE_EAC3_DDP_ATMOS, "Dolby Digital Plus + Dolby Atmos"},
+ { AV_PROFILE_UNKNOWN },
};
const AVProfile ff_truehd_profiles[] = {
- { FF_PROFILE_TRUEHD_ATMOS, "Dolby TrueHD + Dolby Atmos"},
- { FF_PROFILE_UNKNOWN },
+ { AV_PROFILE_TRUEHD_ATMOS, "Dolby TrueHD + Dolby Atmos"},
+ { AV_PROFILE_UNKNOWN },
};
const AVProfile ff_dnxhd_profiles[] = {
- { FF_PROFILE_DNXHD, "DNXHD"},
- { FF_PROFILE_DNXHR_LB, "DNXHR LB"},
- { FF_PROFILE_DNXHR_SQ, "DNXHR SQ"},
- { FF_PROFILE_DNXHR_HQ, "DNXHR HQ" },
- { FF_PROFILE_DNXHR_HQX, "DNXHR HQX"},
- { FF_PROFILE_DNXHR_444, "DNXHR 444"},
- { FF_PROFILE_UNKNOWN },
+ { AV_PROFILE_DNXHD, "DNXHD"},
+ { AV_PROFILE_DNXHR_LB, "DNXHR LB"},
+ { AV_PROFILE_DNXHR_SQ, "DNXHR SQ"},
+ { AV_PROFILE_DNXHR_HQ, "DNXHR HQ" },
+ { AV_PROFILE_DNXHR_HQX, "DNXHR HQX"},
+ { AV_PROFILE_DNXHR_444, "DNXHR 444"},
+ { AV_PROFILE_UNKNOWN },
};
const AVProfile ff_h264_profiles[] = {
- { FF_PROFILE_H264_BASELINE, "Baseline" },
- { FF_PROFILE_H264_CONSTRAINED_BASELINE, "Constrained Baseline" },
- { FF_PROFILE_H264_MAIN, "Main" },
- { FF_PROFILE_H264_EXTENDED, "Extended" },
- { FF_PROFILE_H264_HIGH, "High" },
- { FF_PROFILE_H264_HIGH_10, "High 10" },
- { FF_PROFILE_H264_HIGH_10_INTRA, "High 10 Intra" },
- { FF_PROFILE_H264_HIGH_422, "High 4:2:2" },
- { FF_PROFILE_H264_HIGH_422_INTRA, "High 4:2:2 Intra" },
- { FF_PROFILE_H264_HIGH_444, "High 4:4:4" },
- { FF_PROFILE_H264_HIGH_444_PREDICTIVE, "High 4:4:4 Predictive" },
- { FF_PROFILE_H264_HIGH_444_INTRA, "High 4:4:4 Intra" },
- { FF_PROFILE_H264_CAVLC_444, "CAVLC 4:4:4" },
- { FF_PROFILE_H264_MULTIVIEW_HIGH, "Multiview High" },
- { FF_PROFILE_H264_STEREO_HIGH, "Stereo High" },
- { FF_PROFILE_UNKNOWN },
+ { AV_PROFILE_H264_BASELINE, "Baseline" },
+ { AV_PROFILE_H264_CONSTRAINED_BASELINE, "Constrained Baseline" },
+ { AV_PROFILE_H264_MAIN, "Main" },
+ { AV_PROFILE_H264_EXTENDED, "Extended" },
+ { AV_PROFILE_H264_HIGH, "High" },
+ { AV_PROFILE_H264_HIGH_10, "High 10" },
+ { AV_PROFILE_H264_HIGH_10_INTRA, "High 10 Intra" },
+ { AV_PROFILE_H264_HIGH_422, "High 4:2:2" },
+ { AV_PROFILE_H264_HIGH_422_INTRA, "High 4:2:2 Intra" },
+ { AV_PROFILE_H264_HIGH_444, "High 4:4:4" },
+ { AV_PROFILE_H264_HIGH_444_PREDICTIVE, "High 4:4:4 Predictive" },
+ { AV_PROFILE_H264_HIGH_444_INTRA, "High 4:4:4 Intra" },
+ { AV_PROFILE_H264_CAVLC_444, "CAVLC 4:4:4" },
+ { AV_PROFILE_H264_MULTIVIEW_HIGH, "Multiview High" },
+ { AV_PROFILE_H264_STEREO_HIGH, "Stereo High" },
+ { AV_PROFILE_UNKNOWN },
};
const AVProfile ff_vvc_profiles[] = {
- { FF_PROFILE_VVC_MAIN_10, "Main 10" },
- { FF_PROFILE_VVC_MAIN_10_444, "Main 10 4:4:4" },
- { FF_PROFILE_UNKNOWN },
+ { AV_PROFILE_VVC_MAIN_10, "Main 10" },
+ { AV_PROFILE_VVC_MAIN_10_444, "Main 10 4:4:4" },
+ { AV_PROFILE_UNKNOWN },
};
const AVProfile ff_hevc_profiles[] = {
- { FF_PROFILE_HEVC_MAIN, "Main" },
- { FF_PROFILE_HEVC_MAIN_10, "Main 10" },
- { FF_PROFILE_HEVC_MAIN_STILL_PICTURE, "Main Still Picture" },
- { FF_PROFILE_HEVC_REXT, "Rext" },
- { FF_PROFILE_HEVC_SCC, "Scc" },
- { FF_PROFILE_UNKNOWN },
+ { AV_PROFILE_HEVC_MAIN, "Main" },
+ { AV_PROFILE_HEVC_MAIN_10, "Main 10" },
+ { AV_PROFILE_HEVC_MAIN_STILL_PICTURE, "Main Still Picture" },
+ { AV_PROFILE_HEVC_REXT, "Rext" },
+ { AV_PROFILE_HEVC_SCC, "Scc" },
+ { AV_PROFILE_UNKNOWN },
};
const AVProfile ff_jpeg2000_profiles[] = {
- { FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0, "JPEG 2000 codestream restriction 0" },
- { FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1, "JPEG 2000 codestream restriction 1" },
- { FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION, "JPEG 2000 no codestream restrictions" },
- { FF_PROFILE_JPEG2000_DCINEMA_2K, "JPEG 2000 digital cinema 2K" },
- { FF_PROFILE_JPEG2000_DCINEMA_4K, "JPEG 2000 digital cinema 4K" },
- { FF_PROFILE_UNKNOWN },
+ { AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0, "JPEG 2000 codestream restriction 0" },
+ { AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1, "JPEG 2000 codestream restriction 1" },
+ { AV_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION, "JPEG 2000 no codestream restrictions" },
+ { AV_PROFILE_JPEG2000_DCINEMA_2K, "JPEG 2000 digital cinema 2K" },
+ { AV_PROFILE_JPEG2000_DCINEMA_4K, "JPEG 2000 digital cinema 4K" },
+ { AV_PROFILE_UNKNOWN },
};
const AVProfile ff_mpeg2_video_profiles[] = {
- { FF_PROFILE_MPEG2_422, "4:2:2" },
- { FF_PROFILE_MPEG2_HIGH, "High" },
- { FF_PROFILE_MPEG2_SS, "Spatially Scalable" },
- { FF_PROFILE_MPEG2_SNR_SCALABLE, "SNR Scalable" },
- { FF_PROFILE_MPEG2_MAIN, "Main" },
- { FF_PROFILE_MPEG2_SIMPLE, "Simple" },
- { FF_PROFILE_RESERVED, "Reserved" },
- { FF_PROFILE_UNKNOWN },
+ { AV_PROFILE_MPEG2_422, "4:2:2" },
+ { AV_PROFILE_MPEG2_HIGH, "High" },
+ { AV_PROFILE_MPEG2_SS, "Spatially Scalable" },
+ { AV_PROFILE_MPEG2_SNR_SCALABLE, "SNR Scalable" },
+ { AV_PROFILE_MPEG2_MAIN, "Main" },
+ { AV_PROFILE_MPEG2_SIMPLE, "Simple" },
+ { AV_PROFILE_RESERVED, "Reserved" },
+ { AV_PROFILE_UNKNOWN },
};
const AVProfile ff_mpeg4_video_profiles[] = {
- { FF_PROFILE_MPEG4_SIMPLE, "Simple Profile" },
- { FF_PROFILE_MPEG4_SIMPLE_SCALABLE, "Simple Scalable Profile" },
- { FF_PROFILE_MPEG4_CORE, "Core Profile" },
- { FF_PROFILE_MPEG4_MAIN, "Main Profile" },
- { FF_PROFILE_MPEG4_N_BIT, "N-bit Profile" },
- { FF_PROFILE_MPEG4_SCALABLE_TEXTURE, "Scalable Texture Profile" },
- { FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION, "Simple Face Animation Profile" },
- { FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE, "Basic Animated Texture Profile" },
- { FF_PROFILE_MPEG4_HYBRID, "Hybrid Profile" },
- { FF_PROFILE_MPEG4_ADVANCED_REAL_TIME, "Advanced Real Time Simple Profile" },
- { FF_PROFILE_MPEG4_CORE_SCALABLE, "Code Scalable Profile" },
- { FF_PROFILE_MPEG4_ADVANCED_CODING, "Advanced Coding Profile" },
- { FF_PROFILE_MPEG4_ADVANCED_CORE, "Advanced Core Profile" },
- { FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE, "Advanced Scalable Texture Profile" },
- { FF_PROFILE_MPEG4_SIMPLE_STUDIO, "Simple Studio Profile" },
- { FF_PROFILE_MPEG4_ADVANCED_SIMPLE, "Advanced Simple Profile" },
- { FF_PROFILE_UNKNOWN },
+ { AV_PROFILE_MPEG4_SIMPLE, "Simple Profile" },
+ { AV_PROFILE_MPEG4_SIMPLE_SCALABLE, "Simple Scalable Profile" },
+ { AV_PROFILE_MPEG4_CORE, "Core Profile" },
+ { AV_PROFILE_MPEG4_MAIN, "Main Profile" },
+ { AV_PROFILE_MPEG4_N_BIT, "N-bit Profile" },
+ { AV_PROFILE_MPEG4_SCALABLE_TEXTURE, "Scalable Texture Profile" },
+ { AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION, "Simple Face Animation Profile" },
+ { AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE, "Basic Animated Texture Profile" },
+ { AV_PROFILE_MPEG4_HYBRID, "Hybrid Profile" },
+ { AV_PROFILE_MPEG4_ADVANCED_REAL_TIME, "Advanced Real Time Simple Profile" },
+ { AV_PROFILE_MPEG4_CORE_SCALABLE, "Code Scalable Profile" },
+ { AV_PROFILE_MPEG4_ADVANCED_CODING, "Advanced Coding Profile" },
+ { AV_PROFILE_MPEG4_ADVANCED_CORE, "Advanced Core Profile" },
+ { AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE, "Advanced Scalable Texture Profile" },
+ { AV_PROFILE_MPEG4_SIMPLE_STUDIO, "Simple Studio Profile" },
+ { AV_PROFILE_MPEG4_ADVANCED_SIMPLE, "Advanced Simple Profile" },
+ { AV_PROFILE_UNKNOWN },
};
const AVProfile ff_vc1_profiles[] = {
- { FF_PROFILE_VC1_SIMPLE, "Simple" },
- { FF_PROFILE_VC1_MAIN, "Main" },
- { FF_PROFILE_VC1_COMPLEX, "Complex" },
- { FF_PROFILE_VC1_ADVANCED, "Advanced" },
- { FF_PROFILE_UNKNOWN },
+ { AV_PROFILE_VC1_SIMPLE, "Simple" },
+ { AV_PROFILE_VC1_MAIN, "Main" },
+ { AV_PROFILE_VC1_COMPLEX, "Complex" },
+ { AV_PROFILE_VC1_ADVANCED, "Advanced" },
+ { AV_PROFILE_UNKNOWN },
};
const AVProfile ff_vp9_profiles[] = {
- { FF_PROFILE_VP9_0, "Profile 0" },
- { FF_PROFILE_VP9_1, "Profile 1" },
- { FF_PROFILE_VP9_2, "Profile 2" },
- { FF_PROFILE_VP9_3, "Profile 3" },
- { FF_PROFILE_UNKNOWN },
+ { AV_PROFILE_VP9_0, "Profile 0" },
+ { AV_PROFILE_VP9_1, "Profile 1" },
+ { AV_PROFILE_VP9_2, "Profile 2" },
+ { AV_PROFILE_VP9_3, "Profile 3" },
+ { AV_PROFILE_UNKNOWN },
};
const AVProfile ff_av1_profiles[] = {
- { FF_PROFILE_AV1_MAIN, "Main" },
- { FF_PROFILE_AV1_HIGH, "High" },
- { FF_PROFILE_AV1_PROFESSIONAL, "Professional" },
- { FF_PROFILE_UNKNOWN },
+ { AV_PROFILE_AV1_MAIN, "Main" },
+ { AV_PROFILE_AV1_HIGH, "High" },
+ { AV_PROFILE_AV1_PROFESSIONAL, "Professional" },
+ { AV_PROFILE_UNKNOWN },
};
const AVProfile ff_sbc_profiles[] = {
- { FF_PROFILE_SBC_MSBC, "mSBC" },
- { FF_PROFILE_UNKNOWN },
+ { AV_PROFILE_SBC_MSBC, "mSBC" },
+ { AV_PROFILE_UNKNOWN },
};
const AVProfile ff_prores_profiles[] = {
- { FF_PROFILE_PRORES_PROXY, "Proxy" },
- { FF_PROFILE_PRORES_LT, "LT" },
- { FF_PROFILE_PRORES_STANDARD, "Standard" },
- { FF_PROFILE_PRORES_HQ, "HQ" },
- { FF_PROFILE_PRORES_4444, "4444" },
- { FF_PROFILE_PRORES_XQ, "XQ" },
- { FF_PROFILE_UNKNOWN }
+ { AV_PROFILE_PRORES_PROXY, "Proxy" },
+ { AV_PROFILE_PRORES_LT, "LT" },
+ { AV_PROFILE_PRORES_STANDARD, "Standard" },
+ { AV_PROFILE_PRORES_HQ, "HQ" },
+ { AV_PROFILE_PRORES_4444, "4444" },
+ { AV_PROFILE_PRORES_XQ, "XQ" },
+ { AV_PROFILE_UNKNOWN }
};
const AVProfile ff_mjpeg_profiles[] = {
- { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, "Baseline" },
- { FF_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT, "Sequential" },
- { FF_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT, "Progressive" },
- { FF_PROFILE_MJPEG_HUFFMAN_LOSSLESS, "Lossless" },
- { FF_PROFILE_MJPEG_JPEG_LS, "JPEG LS" },
- { FF_PROFILE_UNKNOWN }
+ { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, "Baseline" },
+ { AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT, "Sequential" },
+ { AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT, "Progressive" },
+ { AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS, "Lossless" },
+ { AV_PROFILE_MJPEG_JPEG_LS, "JPEG LS" },
+ { AV_PROFILE_UNKNOWN }
};
const AVProfile ff_arib_caption_profiles[] = {
- { FF_PROFILE_ARIB_PROFILE_A, "Profile A" },
- { FF_PROFILE_ARIB_PROFILE_C, "Profile C" },
- { FF_PROFILE_UNKNOWN }
+ { AV_PROFILE_ARIB_PROFILE_A, "Profile A" },
+ { AV_PROFILE_ARIB_PROFILE_C, "Profile C" },
+ { AV_PROFILE_UNKNOWN }
};
const AVProfile ff_evc_profiles[] = {
- { FF_PROFILE_EVC_BASELINE, "Baseline" },
- { FF_PROFILE_EVC_MAIN, "Main" },
- { FF_PROFILE_UNKNOWN },
+ { AV_PROFILE_EVC_BASELINE, "Baseline" },
+ { AV_PROFILE_EVC_MAIN, "Main" },
+ { AV_PROFILE_UNKNOWN },
};
#endif /* !CONFIG_SMALL */
diff --git a/libavcodec/profiles.h b/libavcodec/profiles.h
index c0eacae5c1..270430a48b 100644
--- a/libavcodec/profiles.h
+++ b/libavcodec/profiles.h
@@ -26,35 +26,35 @@
{name, description, 0, AV_OPT_TYPE_CONST, {.i64 = value }, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_## type ##_PARAM, "avctx.profile"},
#define FF_AAC_PROFILE_OPTS \
- FF_AVCTX_PROFILE_OPTION("aac_main", NULL, AUDIO, FF_PROFILE_AAC_MAIN)\
- FF_AVCTX_PROFILE_OPTION("aac_low", NULL, AUDIO, FF_PROFILE_AAC_LOW)\
- FF_AVCTX_PROFILE_OPTION("aac_ssr", NULL, AUDIO, FF_PROFILE_AAC_SSR)\
- FF_AVCTX_PROFILE_OPTION("aac_ltp", NULL, AUDIO, FF_PROFILE_AAC_LTP)\
- FF_AVCTX_PROFILE_OPTION("aac_he", NULL, AUDIO, FF_PROFILE_AAC_HE)\
- FF_AVCTX_PROFILE_OPTION("aac_he_v2", NULL, AUDIO, FF_PROFILE_AAC_HE_V2)\
- FF_AVCTX_PROFILE_OPTION("aac_ld", NULL, AUDIO, FF_PROFILE_AAC_LD)\
- FF_AVCTX_PROFILE_OPTION("aac_eld", NULL, AUDIO, FF_PROFILE_AAC_ELD)\
- FF_AVCTX_PROFILE_OPTION("mpeg2_aac_low", NULL, AUDIO, FF_PROFILE_MPEG2_AAC_LOW)\
- FF_AVCTX_PROFILE_OPTION("mpeg2_aac_he", NULL, AUDIO, FF_PROFILE_MPEG2_AAC_HE)\
+ FF_AVCTX_PROFILE_OPTION("aac_main", NULL, AUDIO, AV_PROFILE_AAC_MAIN)\
+ FF_AVCTX_PROFILE_OPTION("aac_low", NULL, AUDIO, AV_PROFILE_AAC_LOW)\
+ FF_AVCTX_PROFILE_OPTION("aac_ssr", NULL, AUDIO, AV_PROFILE_AAC_SSR)\
+ FF_AVCTX_PROFILE_OPTION("aac_ltp", NULL, AUDIO, AV_PROFILE_AAC_LTP)\
+ FF_AVCTX_PROFILE_OPTION("aac_he", NULL, AUDIO, AV_PROFILE_AAC_HE)\
+ FF_AVCTX_PROFILE_OPTION("aac_he_v2", NULL, AUDIO, AV_PROFILE_AAC_HE_V2)\
+ FF_AVCTX_PROFILE_OPTION("aac_ld", NULL, AUDIO, AV_PROFILE_AAC_LD)\
+ FF_AVCTX_PROFILE_OPTION("aac_eld", NULL, AUDIO, AV_PROFILE_AAC_ELD)\
+ FF_AVCTX_PROFILE_OPTION("mpeg2_aac_low", NULL, AUDIO, AV_PROFILE_MPEG2_AAC_LOW)\
+ FF_AVCTX_PROFILE_OPTION("mpeg2_aac_he", NULL, AUDIO, AV_PROFILE_MPEG2_AAC_HE)\
#define FF_MPEG4_PROFILE_OPTS \
- FF_AVCTX_PROFILE_OPTION("mpeg4_sp", NULL, VIDEO, FF_PROFILE_MPEG4_SIMPLE)\
- FF_AVCTX_PROFILE_OPTION("mpeg4_core", NULL, VIDEO, FF_PROFILE_MPEG4_CORE)\
- FF_AVCTX_PROFILE_OPTION("mpeg4_main", NULL, VIDEO, FF_PROFILE_MPEG4_MAIN)\
- FF_AVCTX_PROFILE_OPTION("mpeg4_asp", NULL, VIDEO, FF_PROFILE_MPEG4_ADVANCED_SIMPLE)\
+ FF_AVCTX_PROFILE_OPTION("mpeg4_sp", NULL, VIDEO, AV_PROFILE_MPEG4_SIMPLE)\
+ FF_AVCTX_PROFILE_OPTION("mpeg4_core", NULL, VIDEO, AV_PROFILE_MPEG4_CORE)\
+ FF_AVCTX_PROFILE_OPTION("mpeg4_main", NULL, VIDEO, AV_PROFILE_MPEG4_MAIN)\
+ FF_AVCTX_PROFILE_OPTION("mpeg4_asp", NULL, VIDEO, AV_PROFILE_MPEG4_ADVANCED_SIMPLE)\
#define FF_MPEG2_PROFILE_OPTS \
- FF_AVCTX_PROFILE_OPTION("422", NULL, VIDEO, FF_PROFILE_MPEG2_422)\
- FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, FF_PROFILE_MPEG2_HIGH)\
- FF_AVCTX_PROFILE_OPTION("ss", NULL, VIDEO, FF_PROFILE_MPEG2_SS)\
- FF_AVCTX_PROFILE_OPTION("snr", NULL, VIDEO, FF_PROFILE_MPEG2_SNR_SCALABLE)\
- FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, FF_PROFILE_MPEG2_MAIN)\
- FF_AVCTX_PROFILE_OPTION("simple", NULL, VIDEO, FF_PROFILE_MPEG2_SIMPLE)\
+ FF_AVCTX_PROFILE_OPTION("422", NULL, VIDEO, AV_PROFILE_MPEG2_422)\
+ FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, AV_PROFILE_MPEG2_HIGH)\
+ FF_AVCTX_PROFILE_OPTION("ss", NULL, VIDEO, AV_PROFILE_MPEG2_SS)\
+ FF_AVCTX_PROFILE_OPTION("snr", NULL, VIDEO, AV_PROFILE_MPEG2_SNR_SCALABLE)\
+ FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, AV_PROFILE_MPEG2_MAIN)\
+ FF_AVCTX_PROFILE_OPTION("simple", NULL, VIDEO, AV_PROFILE_MPEG2_SIMPLE)\
#define FF_AV1_PROFILE_OPTS \
- FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, FF_PROFILE_AV1_MAIN)\
- FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, FF_PROFILE_AV1_HIGH)\
- FF_AVCTX_PROFILE_OPTION("professional", NULL, VIDEO, FF_PROFILE_AV1_PROFESSIONAL)\
+ FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, AV_PROFILE_AV1_MAIN)\
+ FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, AV_PROFILE_AV1_HIGH)\
+ FF_AVCTX_PROFILE_OPTION("professional", NULL, VIDEO, AV_PROFILE_AV1_PROFESSIONAL)\
extern const AVProfile ff_aac_profiles[];
extern const AVProfile ff_dca_profiles[];
diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c
index ae5838eca4..9297860946 100644
--- a/libavcodec/proresdec2.c
+++ b/libavcodec/proresdec2.c
@@ -141,27 +141,27 @@ static av_cold int decode_init(AVCodecContext *avctx)
switch (avctx->codec_tag) {
case MKTAG('a','p','c','o'):
- avctx->profile = FF_PROFILE_PRORES_PROXY;
+ avctx->profile = AV_PROFILE_PRORES_PROXY;
break;
case MKTAG('a','p','c','s'):
- avctx->profile = FF_PROFILE_PRORES_LT;
+ avctx->profile = AV_PROFILE_PRORES_LT;
break;
case MKTAG('a','p','c','n'):
- avctx->profile = FF_PROFILE_PRORES_STANDARD;
+ avctx->profile = AV_PROFILE_PRORES_STANDARD;
break;
case MKTAG('a','p','c','h'):
- avctx->profile = FF_PROFILE_PRORES_HQ;
+ avctx->profile = AV_PROFILE_PRORES_HQ;
break;
case MKTAG('a','p','4','h'):
- avctx->profile = FF_PROFILE_PRORES_4444;
+ avctx->profile = AV_PROFILE_PRORES_4444;
avctx->bits_per_raw_sample = 12;
break;
case MKTAG('a','p','4','x'):
- avctx->profile = FF_PROFILE_PRORES_XQ;
+ avctx->profile = AV_PROFILE_PRORES_XQ;
avctx->bits_per_raw_sample = 12;
break;
default:
- avctx->profile = FF_PROFILE_UNKNOWN;
+ avctx->profile = AV_PROFILE_UNKNOWN;
av_log(avctx, AV_LOG_WARNING, "Unknown prores profile %d\n", avctx->codec_tag);
}
diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index c701275e5d..e7114f1646 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -41,13 +41,13 @@
#define DEFAULT_SLICE_MB_WIDTH 8
static const AVProfile profiles[] = {
- { FF_PROFILE_PRORES_PROXY, "apco"},
- { FF_PROFILE_PRORES_LT, "apcs"},
- { FF_PROFILE_PRORES_STANDARD, "apcn"},
- { FF_PROFILE_PRORES_HQ, "apch"},
- { FF_PROFILE_PRORES_4444, "ap4h"},
- { FF_PROFILE_PRORES_XQ, "ap4x"},
- { FF_PROFILE_UNKNOWN }
+ { AV_PROFILE_PRORES_PROXY, "apco"},
+ { AV_PROFILE_PRORES_LT, "apcs"},
+ { AV_PROFILE_PRORES_STANDARD, "apcn"},
+ { AV_PROFILE_PRORES_HQ, "apch"},
+ { AV_PROFILE_PRORES_4444, "ap4h"},
+ { AV_PROFILE_PRORES_XQ, "ap4x"},
+ { AV_PROFILE_UNKNOWN }
};
static const int qp_start_table[] = { 8, 3, 2, 1, 1, 1};
@@ -771,7 +771,7 @@ static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
bytestream_put_be16(&buf, avctx->width);
bytestream_put_be16(&buf, avctx->height);
frame_flags = 0x82; /* 422 not interlaced */
- if (avctx->profile >= FF_PROFILE_PRORES_4444) /* 4444 or 4444 Xq */
+ if (avctx->profile >= AV_PROFILE_PRORES_4444) /* 4444 or 4444 Xq */
frame_flags |= 0x40; /* 444 chroma */
if (ctx->is_interlaced) {
if ((pict->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST) || !(pict->flags & AV_FRAME_FLAG_INTERLACED)) {
@@ -795,7 +795,7 @@ static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
pict->color_trc, valid_trc, 0);
*buf++ = int_from_list_or_default(avctx, "frame colorspace",
pict->colorspace, valid_colorspace, 0);
- if (avctx->profile >= FF_PROFILE_PRORES_4444) {
+ if (avctx->profile >= AV_PROFILE_PRORES_4444) {
if (avctx->pix_fmt == AV_PIX_FMT_YUV444P10) {
*buf++ = 0xA0;/* src b64a and no alpha */
} else {
@@ -871,40 +871,40 @@ static av_cold int prores_encode_init(AVCodecContext *avctx)
return AVERROR(EINVAL);
}
- if (avctx->profile == FF_PROFILE_UNKNOWN) {
+ if (avctx->profile == AV_PROFILE_UNKNOWN) {
if (avctx->pix_fmt == AV_PIX_FMT_YUV422P10) {
- avctx->profile = FF_PROFILE_PRORES_STANDARD;
+ avctx->profile = AV_PROFILE_PRORES_STANDARD;
av_log(avctx, AV_LOG_INFO,
"encoding with ProRes standard (apcn) profile\n");
} else if (avctx->pix_fmt == AV_PIX_FMT_YUV444P10) {
- avctx->profile = FF_PROFILE_PRORES_4444;
+ avctx->profile = AV_PROFILE_PRORES_4444;
av_log(avctx, AV_LOG_INFO,
"encoding with ProRes 4444 (ap4h) profile\n");
} else if (avctx->pix_fmt == AV_PIX_FMT_YUVA444P10) {
- avctx->profile = FF_PROFILE_PRORES_4444;
+ avctx->profile = AV_PROFILE_PRORES_4444;
av_log(avctx, AV_LOG_INFO,
"encoding with ProRes 4444+ (ap4h) profile\n");
}
- } else if (avctx->profile < FF_PROFILE_PRORES_PROXY
- || avctx->profile > FF_PROFILE_PRORES_XQ) {
+ } else if (avctx->profile < AV_PROFILE_PRORES_PROXY
+ || avctx->profile > AV_PROFILE_PRORES_XQ) {
av_log(
avctx,
AV_LOG_ERROR,
"unknown profile %d, use [0 - apco, 1 - apcs, 2 - apcn (default), 3 - apch, 4 - ap4h, 5 - ap4x]\n",
avctx->profile);
return AVERROR(EINVAL);
- } else if ((avctx->pix_fmt == AV_PIX_FMT_YUV422P10) && (avctx->profile > FF_PROFILE_PRORES_HQ)){
+ } else if ((avctx->pix_fmt == AV_PIX_FMT_YUV422P10) && (avctx->profile > AV_PROFILE_PRORES_HQ)){
av_log(avctx, AV_LOG_ERROR,
"encoding with ProRes 444/Xq (ap4h/ap4x) profile, need YUV444P10 input\n");
return AVERROR(EINVAL);
} else if ((avctx->pix_fmt == AV_PIX_FMT_YUV444P10 || avctx->pix_fmt == AV_PIX_FMT_YUVA444P10)
- && (avctx->profile < FF_PROFILE_PRORES_4444)){
+ && (avctx->profile < AV_PROFILE_PRORES_4444)){
av_log(avctx, AV_LOG_ERROR,
"encoding with ProRes Proxy/LT/422/422 HQ (apco, apcs, apcn, ap4h) profile, need YUV422P10 input\n");
return AVERROR(EINVAL);
}
- if (avctx->profile < FF_PROFILE_PRORES_4444) { /* 422 versions */
+ if (avctx->profile < AV_PROFILE_PRORES_4444) { /* 422 versions */
ctx->is_422 = 1;
if ((avctx->height & 0xf) || (avctx->width & 0xf)) {
ctx->fill_y = av_malloc(4 * (DEFAULT_SLICE_MB_WIDTH << 8));
diff --git a/libavcodec/sbcenc.c b/libavcodec/sbcenc.c
index fccb0e3ea3..45eb9a9a5e 100644
--- a/libavcodec/sbcenc.c
+++ b/libavcodec/sbcenc.c
@@ -198,7 +198,7 @@ static int sbc_encode_init(AVCodecContext *avctx)
SBCEncContext *sbc = avctx->priv_data;
struct sbc_frame *frame = &sbc->frame;
- if (avctx->profile == FF_PROFILE_SBC_MSBC)
+ if (avctx->profile == AV_PROFILE_SBC_MSBC)
sbc->msbc = 1;
if (sbc->msbc) {
@@ -332,7 +332,7 @@ static const AVOption options[] = {
OFFSET(max_delay), AV_OPT_TYPE_DURATION, {.i64 = 13000}, 1000,13000, AE },
{ "msbc", "use mSBC mode (wideband speech mono SBC)",
OFFSET(msbc), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AE },
- FF_AVCTX_PROFILE_OPTION("msbc", NULL, AUDIO, FF_PROFILE_SBC_MSBC)
+ FF_AVCTX_PROFILE_OPTION("msbc", NULL, AUDIO, AV_PROFILE_SBC_MSBC)
{ NULL },
};
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index bd4131db62..06955272da 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -434,10 +434,10 @@ const char *avcodec_get_name(enum AVCodecID id)
const char *av_get_profile_name(const AVCodec *codec, int profile)
{
const AVProfile *p;
- if (profile == FF_PROFILE_UNKNOWN || !codec->profiles)
+ if (profile == AV_PROFILE_UNKNOWN || !codec->profiles)
return NULL;
- for (p = codec->profiles; p->profile != FF_PROFILE_UNKNOWN; p++)
+ for (p = codec->profiles; p->profile != AV_PROFILE_UNKNOWN; p++)
if (p->profile == profile)
return p->name;
@@ -449,10 +449,10 @@ const char *avcodec_profile_name(enum AVCodecID codec_id, int profile)
const AVCodecDescriptor *desc = avcodec_descriptor_get(codec_id);
const AVProfile *p;
- if (profile == FF_PROFILE_UNKNOWN || !desc || !desc->profiles)
+ if (profile == AV_PROFILE_UNKNOWN || !desc || !desc->profiles)
return NULL;
- for (p = desc->profiles; p->profile != FF_PROFILE_UNKNOWN; p++)
+ for (p = desc->profiles; p->profile != AV_PROFILE_UNKNOWN; p++)
if (p->profile == profile)
return p->name;
diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c
index 9a0837ecf3..e08db5d5d3 100644
--- a/libavcodec/v4l2_m2m_enc.c
+++ b/libavcodec/v4l2_m2m_enc.c
@@ -103,17 +103,17 @@ static inline unsigned int v4l2_h264_profile_from_ff(int p)
unsigned int ffmpeg_val;
unsigned int v4l2_val;
} profile[] = {
- { FF_PROFILE_H264_CONSTRAINED_BASELINE, MPEG_VIDEO(H264_PROFILE_CONSTRAINED_BASELINE) },
- { FF_PROFILE_H264_HIGH_444_PREDICTIVE, MPEG_VIDEO(H264_PROFILE_HIGH_444_PREDICTIVE) },
- { FF_PROFILE_H264_HIGH_422_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_422_INTRA) },
- { FF_PROFILE_H264_HIGH_444_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_444_INTRA) },
- { FF_PROFILE_H264_HIGH_10_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_10_INTRA) },
- { FF_PROFILE_H264_HIGH_422, MPEG_VIDEO(H264_PROFILE_HIGH_422) },
- { FF_PROFILE_H264_BASELINE, MPEG_VIDEO(H264_PROFILE_BASELINE) },
- { FF_PROFILE_H264_EXTENDED, MPEG_VIDEO(H264_PROFILE_EXTENDED) },
- { FF_PROFILE_H264_HIGH_10, MPEG_VIDEO(H264_PROFILE_HIGH_10) },
- { FF_PROFILE_H264_MAIN, MPEG_VIDEO(H264_PROFILE_MAIN) },
- { FF_PROFILE_H264_HIGH, MPEG_VIDEO(H264_PROFILE_HIGH) },
+ { AV_PROFILE_H264_CONSTRAINED_BASELINE, MPEG_VIDEO(H264_PROFILE_CONSTRAINED_BASELINE) },
+ { AV_PROFILE_H264_HIGH_444_PREDICTIVE, MPEG_VIDEO(H264_PROFILE_HIGH_444_PREDICTIVE) },
+ { AV_PROFILE_H264_HIGH_422_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_422_INTRA) },
+ { AV_PROFILE_H264_HIGH_444_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_444_INTRA) },
+ { AV_PROFILE_H264_HIGH_10_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_10_INTRA) },
+ { AV_PROFILE_H264_HIGH_422, MPEG_VIDEO(H264_PROFILE_HIGH_422) },
+ { AV_PROFILE_H264_BASELINE, MPEG_VIDEO(H264_PROFILE_BASELINE) },
+ { AV_PROFILE_H264_EXTENDED, MPEG_VIDEO(H264_PROFILE_EXTENDED) },
+ { AV_PROFILE_H264_HIGH_10, MPEG_VIDEO(H264_PROFILE_HIGH_10) },
+ { AV_PROFILE_H264_MAIN, MPEG_VIDEO(H264_PROFILE_MAIN) },
+ { AV_PROFILE_H264_HIGH, MPEG_VIDEO(H264_PROFILE_HIGH) },
};
int i;
@@ -130,11 +130,11 @@ static inline int v4l2_mpeg4_profile_from_ff(int p)
unsigned int ffmpeg_val;
unsigned int v4l2_val;
} profile[] = {
- { FF_PROFILE_MPEG4_ADVANCED_CODING, MPEG_VIDEO(MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY) },
- { FF_PROFILE_MPEG4_ADVANCED_SIMPLE, MPEG_VIDEO(MPEG4_PROFILE_ADVANCED_SIMPLE) },
- { FF_PROFILE_MPEG4_SIMPLE_SCALABLE, MPEG_VIDEO(MPEG4_PROFILE_SIMPLE_SCALABLE) },
- { FF_PROFILE_MPEG4_SIMPLE, MPEG_VIDEO(MPEG4_PROFILE_SIMPLE) },
- { FF_PROFILE_MPEG4_CORE, MPEG_VIDEO(MPEG4_PROFILE_CORE) },
+ { AV_PROFILE_MPEG4_ADVANCED_CODING, MPEG_VIDEO(MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY) },
+ { AV_PROFILE_MPEG4_ADVANCED_SIMPLE, MPEG_VIDEO(MPEG4_PROFILE_ADVANCED_SIMPLE) },
+ { AV_PROFILE_MPEG4_SIMPLE_SCALABLE, MPEG_VIDEO(MPEG4_PROFILE_SIMPLE_SCALABLE) },
+ { AV_PROFILE_MPEG4_SIMPLE, MPEG_VIDEO(MPEG4_PROFILE_SIMPLE) },
+ { AV_PROFILE_MPEG4_CORE, MPEG_VIDEO(MPEG4_PROFILE_CORE) },
};
int i;
@@ -206,7 +206,7 @@ static int v4l2_prepare_encoder(V4L2m2mContext *s)
switch (avctx->codec_id) {
case AV_CODEC_ID_H264:
- if (avctx->profile != FF_PROFILE_UNKNOWN) {
+ if (avctx->profile != AV_PROFILE_UNKNOWN) {
val = v4l2_h264_profile_from_ff(avctx->profile);
if (val < 0)
av_log(avctx, AV_LOG_WARNING, "h264 profile not found\n");
@@ -219,7 +219,7 @@ static int v4l2_prepare_encoder(V4L2m2mContext *s)
qmax = 51;
break;
case AV_CODEC_ID_MPEG4:
- if (avctx->profile != FF_PROFILE_UNKNOWN) {
+ if (avctx->profile != AV_PROFILE_UNKNOWN) {
val = v4l2_mpeg4_profile_from_ff(avctx->profile);
if (val < 0)
av_log(avctx, AV_LOG_WARNING, "mpeg4 profile not found\n");
diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
index dd55cbd6f1..10b4284db0 100644
--- a/libavcodec/vaapi_decode.c
+++ b/libavcodec/vaapi_decode.c
@@ -390,7 +390,7 @@ static const struct {
VAProfile va_profile;
VAProfile (*profile_parser)(AVCodecContext *avctx);
} vaapi_profile_map[] = {
-#define MAP(c, p, v, ...) { AV_CODEC_ID_ ## c, FF_PROFILE_ ## p, VAProfile ## v, __VA_ARGS__ }
+#define MAP(c, p, v, ...) { AV_CODEC_ID_ ## c, AV_PROFILE_ ## p, VAProfile ## v, __VA_ARGS__ }
MAP(MPEG2VIDEO, MPEG2_SIMPLE, MPEG2Simple ),
MAP(MPEG2VIDEO, MPEG2_MAIN, MPEG2Main ),
MAP(H263, UNKNOWN, H263Baseline),
@@ -497,7 +497,7 @@ static int vaapi_decode_make_config(AVCodecContext *avctx,
if (avctx->codec_id != vaapi_profile_map[i].codec_id)
continue;
if (avctx->profile == vaapi_profile_map[i].codec_profile ||
- vaapi_profile_map[i].codec_profile == FF_PROFILE_UNKNOWN)
+ vaapi_profile_map[i].codec_profile == AV_PROFILE_UNKNOWN)
profile_match = 1;
va_profile = vaapi_profile_map[i].profile_parser ?
diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index bfca315a7a..0316fe5c18 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -1414,7 +1414,7 @@ static av_cold int vaapi_encode_profile_entrypoint(AVCodecContext *avctx)
av_assert0(ctx->codec->profiles);
for (i = 0; (ctx->codec->profiles[i].av_profile !=
- FF_PROFILE_UNKNOWN); i++) {
+ AV_PROFILE_UNKNOWN); i++) {
profile = &ctx->codec->profiles[i];
if (depth != profile->depth ||
desc->nb_components != profile->nb_components)
@@ -1424,7 +1424,7 @@ static av_cold int vaapi_encode_profile_entrypoint(AVCodecContext *avctx)
desc->log2_chroma_h != profile->log2_chroma_h))
continue;
if (avctx->profile != profile->av_profile &&
- avctx->profile != FF_PROFILE_UNKNOWN)
+ avctx->profile != AV_PROFILE_UNKNOWN)
continue;
#if VA_CHECK_VERSION(1, 0, 0)
diff --git a/libavcodec/vaapi_encode.h b/libavcodec/vaapi_encode.h
index a1e639f56b..bd25cd5c95 100644
--- a/libavcodec/vaapi_encode.h
+++ b/libavcodec/vaapi_encode.h
@@ -134,7 +134,7 @@ typedef struct VAAPIEncodePicture {
} VAAPIEncodePicture;
typedef struct VAAPIEncodeProfile {
- // lavc profile value (FF_PROFILE_*).
+ // lavc profile value (AV_PROFILE_*).
int av_profile;
// Supported bit depth.
int depth;
@@ -384,7 +384,7 @@ enum {
typedef struct VAAPIEncodeType {
// List of supported profiles and corresponding VAAPI profiles.
- // (Must end with FF_PROFILE_UNKNOWN.)
+ // (Must end with AV_PROFILE_UNKNOWN.)
const VAAPIEncodeProfile *profiles;
// Codec feature flags.
diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c
index 9ad017d540..09e1300113 100644
--- a/libavcodec/vaapi_encode_h264.c
+++ b/libavcodec/vaapi_encode_h264.c
@@ -322,15 +322,15 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx)
sps->profile_idc = avctx->profile & 0xff;
- if (avctx->profile == FF_PROFILE_H264_CONSTRAINED_BASELINE ||
- avctx->profile == FF_PROFILE_H264_MAIN)
+ if (avctx->profile == AV_PROFILE_H264_CONSTRAINED_BASELINE ||
+ avctx->profile == AV_PROFILE_H264_MAIN)
sps->constraint_set1_flag = 1;
- if (avctx->profile == FF_PROFILE_H264_HIGH || avctx->profile == FF_PROFILE_H264_HIGH_10)
+ if (avctx->profile == AV_PROFILE_H264_HIGH || avctx->profile == AV_PROFILE_H264_HIGH_10)
sps->constraint_set3_flag = ctx->gop_size == 1;
- if (avctx->profile == FF_PROFILE_H264_MAIN ||
- avctx->profile == FF_PROFILE_H264_HIGH || avctx->profile == FF_PROFILE_H264_HIGH_10) {
+ if (avctx->profile == AV_PROFILE_H264_MAIN ||
+ avctx->profile == AV_PROFILE_H264_HIGH || avctx->profile == AV_PROFILE_H264_HIGH_10) {
sps->constraint_set4_flag = 1;
sps->constraint_set5_flag = ctx->b_per_p == 0;
}
@@ -340,7 +340,7 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx)
else
priv->dpb_frames = 1 + ctx->max_b_depth;
- if (avctx->level != FF_LEVEL_UNKNOWN) {
+ if (avctx->level != AV_LEVEL_UNKNOWN) {
sps->level_idc = avctx->level;
} else {
const H264LevelDescriptor *level;
@@ -512,9 +512,9 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx)
pps->seq_parameter_set_id = 0;
pps->entropy_coding_mode_flag =
- !(sps->profile_idc == FF_PROFILE_H264_BASELINE ||
- sps->profile_idc == FF_PROFILE_H264_EXTENDED ||
- sps->profile_idc == FF_PROFILE_H264_CAVLC_444);
+ !(sps->profile_idc == AV_PROFILE_H264_BASELINE ||
+ sps->profile_idc == AV_PROFILE_H264_EXTENDED ||
+ sps->profile_idc == AV_PROFILE_H264_CAVLC_444);
if (!priv->coder && pps->entropy_coding_mode_flag)
pps->entropy_coding_mode_flag = 0;
@@ -523,9 +523,9 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx)
pps->pic_init_qp_minus26 = priv->fixed_qp_idr - 26;
- if (sps->profile_idc == FF_PROFILE_H264_BASELINE ||
- sps->profile_idc == FF_PROFILE_H264_EXTENDED ||
- sps->profile_idc == FF_PROFILE_H264_MAIN) {
+ if (sps->profile_idc == AV_PROFILE_H264_BASELINE ||
+ sps->profile_idc == AV_PROFILE_H264_EXTENDED ||
+ sps->profile_idc == AV_PROFILE_H264_MAIN) {
pps->more_rbsp_data = 0;
} else {
pps->more_rbsp_data = 1;
@@ -1159,13 +1159,13 @@ static av_cold int vaapi_encode_h264_configure(AVCodecContext *avctx)
static const VAAPIEncodeProfile vaapi_encode_h264_profiles[] = {
#if VA_CHECK_VERSION(1, 18, 0)
- { FF_PROFILE_H264_HIGH_10, 10, 3, 1, 1, VAProfileH264High10 },
+ { AV_PROFILE_H264_HIGH_10, 10, 3, 1, 1, VAProfileH264High10 },
#endif
- { FF_PROFILE_H264_HIGH, 8, 3, 1, 1, VAProfileH264High },
- { FF_PROFILE_H264_MAIN, 8, 3, 1, 1, VAProfileH264Main },
- { FF_PROFILE_H264_CONSTRAINED_BASELINE,
+ { AV_PROFILE_H264_HIGH, 8, 3, 1, 1, VAProfileH264High },
+ { AV_PROFILE_H264_MAIN, 8, 3, 1, 1, VAProfileH264Main },
+ { AV_PROFILE_H264_CONSTRAINED_BASELINE,
8, 3, 1, 1, VAProfileH264ConstrainedBaseline },
- { FF_PROFILE_UNKNOWN }
+ { AV_PROFILE_UNKNOWN }
};
static const VAAPIEncodeType vaapi_encode_type_h264 = {
@@ -1207,40 +1207,40 @@ static av_cold int vaapi_encode_h264_init(AVCodecContext *avctx)
ctx->codec = &vaapi_encode_type_h264;
- if (avctx->profile == FF_PROFILE_UNKNOWN)
+ if (avctx->profile == AV_PROFILE_UNKNOWN)
avctx->profile = priv->profile;
- if (avctx->level == FF_LEVEL_UNKNOWN)
+ if (avctx->level == AV_LEVEL_UNKNOWN)
avctx->level = priv->level;
if (avctx->compression_level == FF_COMPRESSION_DEFAULT)
avctx->compression_level = priv->quality;
// Reject unsupported profiles.
switch (avctx->profile) {
- case FF_PROFILE_H264_BASELINE:
+ case AV_PROFILE_H264_BASELINE:
av_log(avctx, AV_LOG_WARNING, "H.264 baseline profile is not "
"supported, using constrained baseline profile instead.\n");
- avctx->profile = FF_PROFILE_H264_CONSTRAINED_BASELINE;
+ avctx->profile = AV_PROFILE_H264_CONSTRAINED_BASELINE;
break;
- case FF_PROFILE_H264_EXTENDED:
+ case AV_PROFILE_H264_EXTENDED:
av_log(avctx, AV_LOG_ERROR, "H.264 extended profile "
"is not supported.\n");
return AVERROR_PATCHWELCOME;
- case FF_PROFILE_H264_HIGH_10_INTRA:
+ case AV_PROFILE_H264_HIGH_10_INTRA:
av_log(avctx, AV_LOG_ERROR, "H.264 high 10 intra profile "
"is not supported.\n");
return AVERROR_PATCHWELCOME;
- case FF_PROFILE_H264_HIGH_422:
- case FF_PROFILE_H264_HIGH_422_INTRA:
- case FF_PROFILE_H264_HIGH_444:
- case FF_PROFILE_H264_HIGH_444_PREDICTIVE:
- case FF_PROFILE_H264_HIGH_444_INTRA:
- case FF_PROFILE_H264_CAVLC_444:
+ case AV_PROFILE_H264_HIGH_422:
+ case AV_PROFILE_H264_HIGH_422_INTRA:
+ case AV_PROFILE_H264_HIGH_444:
+ case AV_PROFILE_H264_HIGH_444_PREDICTIVE:
+ case AV_PROFILE_H264_HIGH_444_INTRA:
+ case AV_PROFILE_H264_CAVLC_444:
av_log(avctx, AV_LOG_ERROR, "H.264 non-4:2:0 profiles "
"are not supported.\n");
return AVERROR_PATCHWELCOME;
}
- if (avctx->level != FF_LEVEL_UNKNOWN && avctx->level & ~0xff) {
+ if (avctx->level != AV_LEVEL_UNKNOWN && avctx->level & ~0xff) {
av_log(avctx, AV_LOG_ERROR, "Invalid level %d: must fit "
"in 8-bit unsigned integer.\n", avctx->level);
return AVERROR(EINVAL);
@@ -1313,19 +1313,19 @@ static const AVOption vaapi_encode_h264_options[] = {
{ "profile", "Set profile (profile_idc and constraint_set*_flag)",
OFFSET(profile), AV_OPT_TYPE_INT,
- { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, 0xffff, FLAGS, "profile" },
+ { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 0xffff, FLAGS, "profile" },
#define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \
{ .i64 = value }, 0, 0, FLAGS, "profile"
- { PROFILE("constrained_baseline", FF_PROFILE_H264_CONSTRAINED_BASELINE) },
- { PROFILE("main", FF_PROFILE_H264_MAIN) },
- { PROFILE("high", FF_PROFILE_H264_HIGH) },
- { PROFILE("high10", FF_PROFILE_H264_HIGH_10) },
+ { PROFILE("constrained_baseline", AV_PROFILE_H264_CONSTRAINED_BASELINE) },
+ { PROFILE("main", AV_PROFILE_H264_MAIN) },
+ { PROFILE("high", AV_PROFILE_H264_HIGH) },
+ { PROFILE("high10", AV_PROFILE_H264_HIGH_10) },
#undef PROFILE
{ "level", "Set level (level_idc)",
OFFSET(level), AV_OPT_TYPE_INT,
- { .i64 = FF_LEVEL_UNKNOWN }, FF_LEVEL_UNKNOWN, 0xff, FLAGS, "level" },
+ { .i64 = AV_LEVEL_UNKNOWN }, AV_LEVEL_UNKNOWN, 0xff, FLAGS, "level" },
#define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \
{ .i64 = value }, 0, 0, FLAGS, "level"
diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c
index aa7e532f9a..efa59aecf5 100644
--- a/libavcodec/vaapi_encode_h265.c
+++ b/libavcodec/vaapi_encode_h265.c
@@ -346,7 +346,7 @@ static int vaapi_encode_h265_init_sequence_params(AVCodecContext *avctx)
ptl->general_lower_bit_rate_constraint_flag = 1;
- if (avctx->level != FF_LEVEL_UNKNOWN) {
+ if (avctx->level != AV_LEVEL_UNKNOWN) {
ptl->general_level_idc = avctx->level;
} else {
const H265LevelDescriptor *level;
@@ -1290,22 +1290,22 @@ static av_cold int vaapi_encode_h265_configure(AVCodecContext *avctx)
}
static const VAAPIEncodeProfile vaapi_encode_h265_profiles[] = {
- { FF_PROFILE_HEVC_MAIN, 8, 3, 1, 1, VAProfileHEVCMain },
- { FF_PROFILE_HEVC_REXT, 8, 3, 1, 1, VAProfileHEVCMain },
+ { AV_PROFILE_HEVC_MAIN, 8, 3, 1, 1, VAProfileHEVCMain },
+ { AV_PROFILE_HEVC_REXT, 8, 3, 1, 1, VAProfileHEVCMain },
#if VA_CHECK_VERSION(0, 37, 0)
- { FF_PROFILE_HEVC_MAIN_10, 10, 3, 1, 1, VAProfileHEVCMain10 },
- { FF_PROFILE_HEVC_REXT, 10, 3, 1, 1, VAProfileHEVCMain10 },
+ { AV_PROFILE_HEVC_MAIN_10, 10, 3, 1, 1, VAProfileHEVCMain10 },
+ { AV_PROFILE_HEVC_REXT, 10, 3, 1, 1, VAProfileHEVCMain10 },
#endif
#if VA_CHECK_VERSION(1, 2, 0)
- { FF_PROFILE_HEVC_REXT, 12, 3, 1, 1, VAProfileHEVCMain12 },
- { FF_PROFILE_HEVC_REXT, 8, 3, 1, 0, VAProfileHEVCMain422_10 },
- { FF_PROFILE_HEVC_REXT, 10, 3, 1, 0, VAProfileHEVCMain422_10 },
- { FF_PROFILE_HEVC_REXT, 12, 3, 1, 0, VAProfileHEVCMain422_12 },
- { FF_PROFILE_HEVC_REXT, 8, 3, 0, 0, VAProfileHEVCMain444 },
- { FF_PROFILE_HEVC_REXT, 10, 3, 0, 0, VAProfileHEVCMain444_10 },
- { FF_PROFILE_HEVC_REXT, 12, 3, 0, 0, VAProfileHEVCMain444_12 },
+ { AV_PROFILE_HEVC_REXT, 12, 3, 1, 1, VAProfileHEVCMain12 },
+ { AV_PROFILE_HEVC_REXT, 8, 3, 1, 0, VAProfileHEVCMain422_10 },
+ { AV_PROFILE_HEVC_REXT, 10, 3, 1, 0, VAProfileHEVCMain422_10 },
+ { AV_PROFILE_HEVC_REXT, 12, 3, 1, 0, VAProfileHEVCMain422_12 },
+ { AV_PROFILE_HEVC_REXT, 8, 3, 0, 0, VAProfileHEVCMain444 },
+ { AV_PROFILE_HEVC_REXT, 10, 3, 0, 0, VAProfileHEVCMain444_10 },
+ { AV_PROFILE_HEVC_REXT, 12, 3, 0, 0, VAProfileHEVCMain444_12 },
#endif
- { FF_PROFILE_UNKNOWN }
+ { AV_PROFILE_UNKNOWN }
};
static const VAAPIEncodeType vaapi_encode_type_h265 = {
@@ -1348,12 +1348,12 @@ static av_cold int vaapi_encode_h265_init(AVCodecContext *avctx)
ctx->codec = &vaapi_encode_type_h265;
- if (avctx->profile == FF_PROFILE_UNKNOWN)
+ if (avctx->profile == AV_PROFILE_UNKNOWN)
avctx->profile = priv->profile;
- if (avctx->level == FF_LEVEL_UNKNOWN)
+ if (avctx->level == AV_LEVEL_UNKNOWN)
avctx->level = priv->level;
- if (avctx->level != FF_LEVEL_UNKNOWN && avctx->level & ~0xff) {
+ if (avctx->level != AV_LEVEL_UNKNOWN && avctx->level & ~0xff) {
av_log(avctx, AV_LOG_ERROR, "Invalid level %d: must fit "
"in 8-bit unsigned integer.\n", avctx->level);
return AVERROR(EINVAL);
@@ -1395,13 +1395,13 @@ static const AVOption vaapi_encode_h265_options[] = {
{ "profile", "Set profile (general_profile_idc)",
OFFSET(profile), AV_OPT_TYPE_INT,
- { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, 0xff, FLAGS, "profile" },
+ { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 0xff, FLAGS, "profile" },
#define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \
{ .i64 = value }, 0, 0, FLAGS, "profile"
- { PROFILE("main", FF_PROFILE_HEVC_MAIN) },
- { PROFILE("main10", FF_PROFILE_HEVC_MAIN_10) },
- { PROFILE("rext", FF_PROFILE_HEVC_REXT) },
+ { PROFILE("main", AV_PROFILE_HEVC_MAIN) },
+ { PROFILE("main10", AV_PROFILE_HEVC_MAIN_10) },
+ { PROFILE("rext", AV_PROFILE_HEVC_REXT) },
#undef PROFILE
{ "tier", "Set tier (general_tier_flag)",
@@ -1414,7 +1414,7 @@ static const AVOption vaapi_encode_h265_options[] = {
{ "level", "Set level (general_level_idc)",
OFFSET(level), AV_OPT_TYPE_INT,
- { .i64 = FF_LEVEL_UNKNOWN }, FF_LEVEL_UNKNOWN, 0xff, FLAGS, "level" },
+ { .i64 = AV_LEVEL_UNKNOWN }, AV_LEVEL_UNKNOWN, 0xff, FLAGS, "level" },
#define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \
{ .i64 = value }, 0, 0, FLAGS, "level"
diff --git a/libavcodec/vaapi_encode_mjpeg.c b/libavcodec/vaapi_encode_mjpeg.c
index cb7588b94b..c17747e3a9 100644
--- a/libavcodec/vaapi_encode_mjpeg.c
+++ b/libavcodec/vaapi_encode_mjpeg.c
@@ -480,15 +480,15 @@ static av_cold int vaapi_encode_mjpeg_configure(AVCodecContext *avctx)
}
static const VAAPIEncodeProfile vaapi_encode_mjpeg_profiles[] = {
- { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT,
+ { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT,
8, 1, 0, 0, VAProfileJPEGBaseline },
- { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT,
+ { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT,
8, 3, 1, 1, VAProfileJPEGBaseline },
- { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT,
+ { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT,
8, 3, 1, 0, VAProfileJPEGBaseline },
- { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT,
+ { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT,
8, 3, 0, 0, VAProfileJPEGBaseline },
- { FF_PROFILE_UNKNOWN }
+ { AV_PROFILE_UNKNOWN }
};
static const VAAPIEncodeType vaapi_encode_type_mjpeg = {
diff --git a/libavcodec/vaapi_encode_mpeg2.c b/libavcodec/vaapi_encode_mpeg2.c
index 9261d19a83..2edb0c3586 100644
--- a/libavcodec/vaapi_encode_mpeg2.c
+++ b/libavcodec/vaapi_encode_mpeg2.c
@@ -558,9 +558,9 @@ static av_cold int vaapi_encode_mpeg2_configure(AVCodecContext *avctx)
}
static const VAAPIEncodeProfile vaapi_encode_mpeg2_profiles[] = {
- { FF_PROFILE_MPEG2_MAIN, 8, 3, 1, 1, VAProfileMPEG2Main },
- { FF_PROFILE_MPEG2_SIMPLE, 8, 3, 1, 1, VAProfileMPEG2Simple },
- { FF_PROFILE_UNKNOWN }
+ { AV_PROFILE_MPEG2_MAIN, 8, 3, 1, 1, VAProfileMPEG2Main },
+ { AV_PROFILE_MPEG2_SIMPLE, 8, 3, 1, 1, VAProfileMPEG2Simple },
+ { AV_PROFILE_UNKNOWN }
};
static const VAAPIEncodeType vaapi_encode_type_mpeg2 = {
@@ -595,9 +595,9 @@ static av_cold int vaapi_encode_mpeg2_init(AVCodecContext *avctx)
ctx->codec = &vaapi_encode_type_mpeg2;
- if (avctx->profile == FF_PROFILE_UNKNOWN)
+ if (avctx->profile == AV_PROFILE_UNKNOWN)
avctx->profile = priv->profile;
- if (avctx->level == FF_LEVEL_UNKNOWN)
+ if (avctx->level == AV_LEVEL_UNKNOWN)
avctx->level = priv->level;
// Reject unknown levels (these are required to set f_code for
@@ -644,12 +644,12 @@ static const AVOption vaapi_encode_mpeg2_options[] = {
{ "profile", "Set profile (in profile_and_level_indication)",
OFFSET(profile), AV_OPT_TYPE_INT,
- { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, 7, FLAGS, "profile" },
+ { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 7, FLAGS, "profile" },
#define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \
{ .i64 = value }, 0, 0, FLAGS, "profile"
- { PROFILE("simple", FF_PROFILE_MPEG2_SIMPLE) },
- { PROFILE("main", FF_PROFILE_MPEG2_MAIN) },
+ { PROFILE("simple", AV_PROFILE_MPEG2_SIMPLE) },
+ { PROFILE("main", AV_PROFILE_MPEG2_MAIN) },
#undef PROFILE
{ "level", "Set level (in profile_and_level_indication)",
diff --git a/libavcodec/vaapi_encode_vp8.c b/libavcodec/vaapi_encode_vp8.c
index ae6a8d313c..ea8abb2418 100644
--- a/libavcodec/vaapi_encode_vp8.c
+++ b/libavcodec/vaapi_encode_vp8.c
@@ -180,7 +180,7 @@ static av_cold int vaapi_encode_vp8_configure(AVCodecContext *avctx)
static const VAAPIEncodeProfile vaapi_encode_vp8_profiles[] = {
{ 0 /* VP8 has no profiles */, 8, 3, 1, 1, VAProfileVP8Version0_3 },
- { FF_PROFILE_UNKNOWN }
+ { AV_PROFILE_UNKNOWN }
};
static const VAAPIEncodeType vaapi_encode_type_vp8 = {
diff --git a/libavcodec/vaapi_encode_vp9.c b/libavcodec/vaapi_encode_vp9.c
index af1353cea8..87429881f1 100644
--- a/libavcodec/vaapi_encode_vp9.c
+++ b/libavcodec/vaapi_encode_vp9.c
@@ -227,11 +227,11 @@ static av_cold int vaapi_encode_vp9_configure(AVCodecContext *avctx)
}
static const VAAPIEncodeProfile vaapi_encode_vp9_profiles[] = {
- { FF_PROFILE_VP9_0, 8, 3, 1, 1, VAProfileVP9Profile0 },
- { FF_PROFILE_VP9_1, 8, 3, 0, 0, VAProfileVP9Profile1 },
- { FF_PROFILE_VP9_2, 10, 3, 1, 1, VAProfileVP9Profile2 },
- { FF_PROFILE_VP9_3, 10, 3, 0, 0, VAProfileVP9Profile3 },
- { FF_PROFILE_UNKNOWN }
+ { AV_PROFILE_VP9_0, 8, 3, 1, 1, VAProfileVP9Profile0 },
+ { AV_PROFILE_VP9_1, 8, 3, 0, 0, VAProfileVP9Profile1 },
+ { AV_PROFILE_VP9_2, 10, 3, 1, 1, VAProfileVP9Profile2 },
+ { AV_PROFILE_VP9_3, 10, 3, 0, 0, VAProfileVP9Profile3 },
+ { AV_PROFILE_UNKNOWN }
};
static const VAAPIEncodeType vaapi_encode_type_vp9 = {
diff --git a/libavcodec/vaapi_hevc.c b/libavcodec/vaapi_hevc.c
index d464fda18c..3bdd2dd1b8 100644
--- a/libavcodec/vaapi_hevc.c
+++ b/libavcodec/vaapi_hevc.c
@@ -227,8 +227,8 @@ static int vaapi_hevc_start_frame(AVCodecContext *avctx,
}
#if VA_CHECK_VERSION(1, 2, 0)
- if (avctx->profile == FF_PROFILE_HEVC_REXT ||
- avctx->profile == FF_PROFILE_HEVC_SCC) {
+ if (avctx->profile == AV_PROFILE_HEVC_REXT ||
+ avctx->profile == AV_PROFILE_HEVC_SCC) {
pic->pic_param.rext = (VAPictureParameterBufferHEVCRext) {
.range_extension_pic_fields.bits = {
.transform_skip_rotation_enabled_flag = sps->transform_skip_rotation_enabled_flag,
@@ -262,7 +262,7 @@ static int vaapi_hevc_start_frame(AVCodecContext *avctx,
sps->sps_num_palette_predictor_initializers :
0);
- if (avctx->profile == FF_PROFILE_HEVC_SCC) {
+ if (avctx->profile == AV_PROFILE_HEVC_SCC) {
pic->pic_param.scc = (VAPictureParameterBufferHEVCScc) {
.screen_content_pic_fields.bits = {
.pps_curr_pic_ref_enabled_flag = pps->pps_curr_pic_ref_enabled_flag,
@@ -294,7 +294,7 @@ static int vaapi_hevc_start_frame(AVCodecContext *avctx,
}
#endif
- pic_param_size = avctx->profile >= FF_PROFILE_HEVC_REXT ?
+ pic_param_size = avctx->profile >= AV_PROFILE_HEVC_REXT ?
sizeof(pic->pic_param) : sizeof(VAPictureParameterBufferHEVC);
err = ff_vaapi_decode_make_param_buffer(avctx, &pic->pic,
@@ -347,7 +347,7 @@ static int vaapi_hevc_end_frame(AVCodecContext *avctx)
VASliceParameterBufferHEVC *last_slice_param = (VASliceParameterBufferHEVC *)&pic->last_slice_param;
int ret;
- int slice_param_size = avctx->profile >= FF_PROFILE_HEVC_REXT ?
+ int slice_param_size = avctx->profile >= AV_PROFILE_HEVC_REXT ?
sizeof(pic->last_slice_param) : sizeof(VASliceParameterBufferHEVC);
if (pic->last_size) {
@@ -377,10 +377,10 @@ static void fill_pred_weight_table(AVCodecContext *avctx,
{
int i;
#if VA_CHECK_VERSION(1, 2, 0)
- int is_rext = avctx->profile >= FF_PROFILE_HEVC_REXT;
+ int is_rext = avctx->profile >= AV_PROFILE_HEVC_REXT;
#else
int is_rext = 0;
- if (avctx->profile >= FF_PROFILE_HEVC_REXT)
+ if (avctx->profile >= AV_PROFILE_HEVC_REXT)
av_log(avctx, AV_LOG_WARNING, "Please consider to update to VAAPI 1.2.0 "
"or above, which can support REXT related setting correctly.\n");
#endif
@@ -461,7 +461,7 @@ static int vaapi_hevc_decode_slice(AVCodecContext *avctx,
VAAPIDecodePictureHEVC *pic = h->ref->hwaccel_picture_private;
VASliceParameterBufferHEVC *last_slice_param = (VASliceParameterBufferHEVC *)&pic->last_slice_param;
- int slice_param_size = avctx->profile >= FF_PROFILE_HEVC_REXT ?
+ int slice_param_size = avctx->profile >= AV_PROFILE_HEVC_REXT ?
sizeof(pic->last_slice_param) : sizeof(VASliceParameterBufferHEVC);
int nb_list = (sh->slice_type == HEVC_SLICE_B) ?
@@ -526,7 +526,7 @@ static int vaapi_hevc_decode_slice(AVCodecContext *avctx,
fill_pred_weight_table(avctx, h, sh, last_slice_param);
#if VA_CHECK_VERSION(1, 2, 0)
- if (avctx->profile >= FF_PROFILE_HEVC_REXT) {
+ if (avctx->profile >= AV_PROFILE_HEVC_REXT) {
pic->last_slice_param.rext = (VASliceParameterBufferHEVCRext) {
.slice_ext_flags.bits = {
.cu_chroma_qp_offset_enabled_flag = sh->cu_chroma_qp_offset_enabled_flag,
diff --git a/libavcodec/vdpau_av1.c b/libavcodec/vdpau_av1.c
index 0ae62301cb..80923092b9 100644
--- a/libavcodec/vdpau_av1.c
+++ b/libavcodec/vdpau_av1.c
@@ -337,13 +337,13 @@ static int vdpau_av1_init(AVCodecContext *avctx)
uint32_t level = avctx->level;
switch (avctx->profile) {
- case FF_PROFILE_AV1_MAIN:
+ case AV_PROFILE_AV1_MAIN:
profile = VDP_DECODER_PROFILE_AV1_MAIN;
break;
- case FF_PROFILE_AV1_HIGH:
+ case AV_PROFILE_AV1_HIGH:
profile = VDP_DECODER_PROFILE_AV1_HIGH;
break;
- case FF_PROFILE_AV1_PROFESSIONAL:
+ case AV_PROFILE_AV1_PROFESSIONAL:
profile = VDP_DECODER_PROFILE_AV1_PROFESSIONAL;
break;
default:
diff --git a/libavcodec/vdpau_h264.c b/libavcodec/vdpau_h264.c
index 8694292fe3..9c08e4048c 100644
--- a/libavcodec/vdpau_h264.c
+++ b/libavcodec/vdpau_h264.c
@@ -219,35 +219,35 @@ static int vdpau_h264_init(AVCodecContext *avctx)
VdpDecoderProfile profile;
uint32_t level = avctx->level;
- switch (avctx->profile & ~FF_PROFILE_H264_INTRA) {
- case FF_PROFILE_H264_BASELINE:
+ switch (avctx->profile & ~AV_PROFILE_H264_INTRA) {
+ case AV_PROFILE_H264_BASELINE:
profile = VDP_DECODER_PROFILE_H264_BASELINE;
break;
- case FF_PROFILE_H264_CONSTRAINED_BASELINE:
+ case AV_PROFILE_H264_CONSTRAINED_BASELINE:
#ifdef VDP_DECODER_PROFILE_H264_CONSTRAINED_BASELINE
profile = VDP_DECODER_PROFILE_H264_CONSTRAINED_BASELINE;
break;
#endif
- case FF_PROFILE_H264_MAIN:
+ case AV_PROFILE_H264_MAIN:
profile = VDP_DECODER_PROFILE_H264_MAIN;
break;
- case FF_PROFILE_H264_HIGH:
+ case AV_PROFILE_H264_HIGH:
profile = VDP_DECODER_PROFILE_H264_HIGH;
break;
#ifdef VDP_DECODER_PROFILE_H264_EXTENDED
- case FF_PROFILE_H264_EXTENDED:
+ case AV_PROFILE_H264_EXTENDED:
profile = VDP_DECODER_PROFILE_H264_EXTENDED;
break;
#endif
- case FF_PROFILE_H264_HIGH_10:
+ case AV_PROFILE_H264_HIGH_10:
/* XXX: High 10 can be treated as High so long as only 8 bits per
* format are supported. */
profile = VDP_DECODER_PROFILE_H264_HIGH;
break;
#ifdef VDP_DECODER_PROFILE_H264_HIGH_444_PREDICTIVE
- case FF_PROFILE_H264_HIGH_422:
- case FF_PROFILE_H264_HIGH_444_PREDICTIVE:
- case FF_PROFILE_H264_CAVLC_444:
+ case AV_PROFILE_H264_HIGH_422:
+ case AV_PROFILE_H264_HIGH_444_PREDICTIVE:
+ case AV_PROFILE_H264_CAVLC_444:
profile = VDP_DECODER_PROFILE_H264_HIGH_444_PREDICTIVE;
break;
#endif
@@ -255,7 +255,7 @@ static int vdpau_h264_init(AVCodecContext *avctx)
return AVERROR(ENOTSUP);
}
- if ((avctx->profile & FF_PROFILE_H264_INTRA) && avctx->level == 11)
+ if ((avctx->profile & AV_PROFILE_H264_INTRA) && avctx->level == 11)
level = VDP_DECODER_LEVEL_H264_1b;
return ff_vdpau_common_init(avctx, profile, level);
diff --git a/libavcodec/vdpau_hevc.c b/libavcodec/vdpau_hevc.c
index fea98805d5..4cd7ce5621 100644
--- a/libavcodec/vdpau_hevc.c
+++ b/libavcodec/vdpau_hevc.c
@@ -519,16 +519,16 @@ static int vdpau_hevc_init(AVCodecContext *avctx)
int ret;
switch (avctx->profile) {
- case FF_PROFILE_HEVC_MAIN:
+ case AV_PROFILE_HEVC_MAIN:
profile = VDP_DECODER_PROFILE_HEVC_MAIN;
break;
- case FF_PROFILE_HEVC_MAIN_10:
+ case AV_PROFILE_HEVC_MAIN_10:
profile = VDP_DECODER_PROFILE_HEVC_MAIN_10;
break;
- case FF_PROFILE_HEVC_MAIN_STILL_PICTURE:
+ case AV_PROFILE_HEVC_MAIN_STILL_PICTURE:
profile = VDP_DECODER_PROFILE_HEVC_MAIN_STILL;
break;
- case FF_PROFILE_HEVC_REXT:
+ case AV_PROFILE_HEVC_REXT:
ret = vdpau_hevc_parse_rext_profile(avctx, &profile);
if (ret)
return AVERROR(ENOTSUP);
diff --git a/libavcodec/vdpau_mpeg12.c b/libavcodec/vdpau_mpeg12.c
index a5f21ca3a5..bbf76eb469 100644
--- a/libavcodec/vdpau_mpeg12.c
+++ b/libavcodec/vdpau_mpeg12.c
@@ -128,10 +128,10 @@ static int vdpau_mpeg2_init(AVCodecContext *avctx)
VdpDecoderProfile profile;
switch (avctx->profile) {
- case FF_PROFILE_MPEG2_MAIN:
+ case AV_PROFILE_MPEG2_MAIN:
profile = VDP_DECODER_PROFILE_MPEG2_MAIN;
break;
- case FF_PROFILE_MPEG2_SIMPLE:
+ case AV_PROFILE_MPEG2_SIMPLE:
profile = VDP_DECODER_PROFILE_MPEG2_SIMPLE;
break;
default:
diff --git a/libavcodec/vdpau_mpeg4.c b/libavcodec/vdpau_mpeg4.c
index 0c3852efdf..055426b95b 100644
--- a/libavcodec/vdpau_mpeg4.c
+++ b/libavcodec/vdpau_mpeg4.c
@@ -95,13 +95,13 @@ static int vdpau_mpeg4_init(AVCodecContext *avctx)
VdpDecoderProfile profile;
switch (avctx->profile) {
- case FF_PROFILE_MPEG4_SIMPLE:
+ case AV_PROFILE_MPEG4_SIMPLE:
profile = VDP_DECODER_PROFILE_MPEG4_PART2_SP;
break;
// As any ASP decoder must be able to decode SP, this
// should be a safe fallback if profile is unknown/unspecified.
- case FF_PROFILE_UNKNOWN:
- case FF_PROFILE_MPEG4_ADVANCED_SIMPLE:
+ case AV_PROFILE_UNKNOWN:
+ case AV_PROFILE_MPEG4_ADVANCED_SIMPLE:
profile = VDP_DECODER_PROFILE_MPEG4_PART2_ASP;
break;
default:
diff --git a/libavcodec/vdpau_vc1.c b/libavcodec/vdpau_vc1.c
index a7ab36e431..4e5ee14428 100644
--- a/libavcodec/vdpau_vc1.c
+++ b/libavcodec/vdpau_vc1.c
@@ -121,13 +121,13 @@ static int vdpau_vc1_init(AVCodecContext *avctx)
VdpDecoderProfile profile;
switch (avctx->profile) {
- case FF_PROFILE_VC1_SIMPLE:
+ case AV_PROFILE_VC1_SIMPLE:
profile = VDP_DECODER_PROFILE_VC1_SIMPLE;
break;
- case FF_PROFILE_VC1_MAIN:
+ case AV_PROFILE_VC1_MAIN:
profile = VDP_DECODER_PROFILE_VC1_MAIN;
break;
- case FF_PROFILE_VC1_ADVANCED:
+ case AV_PROFILE_VC1_ADVANCED:
profile = VDP_DECODER_PROFILE_VC1_ADVANCED;
break;
default:
diff --git a/libavcodec/vdpau_vp9.c b/libavcodec/vdpau_vp9.c
index fa55101536..424e2e60fb 100644
--- a/libavcodec/vdpau_vp9.c
+++ b/libavcodec/vdpau_vp9.c
@@ -203,16 +203,16 @@ static int vdpau_vp9_init(AVCodecContext *avctx)
uint32_t level = avctx->level;
switch (avctx->profile) {
- case FF_PROFILE_VP9_0:
+ case AV_PROFILE_VP9_0:
profile = VDP_DECODER_PROFILE_VP9_PROFILE_0;
break;
- case FF_PROFILE_VP9_1:
+ case AV_PROFILE_VP9_1:
profile = VDP_DECODER_PROFILE_VP9_PROFILE_1;
break;
- case FF_PROFILE_VP9_2:
+ case AV_PROFILE_VP9_2:
profile = VDP_DECODER_PROFILE_VP9_PROFILE_2;
break;
- case FF_PROFILE_VP9_3:
+ case AV_PROFILE_VP9_3:
profile = VDP_DECODER_PROFILE_VP9_PROFILE_3;
break;
default:
diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
index cfd0b5023e..b9164fe5c6 100644
--- a/libavcodec/version_major.h
+++ b/libavcodec/version_major.h
@@ -51,6 +51,7 @@
#define FF_API_DROPCHANGED (LIBAVCODEC_VERSION_MAJOR < 61)
#define FF_API_AVFFT (LIBAVCODEC_VERSION_MAJOR < 62)
+#define FF_API_FF_PROFILE_LEVEL (LIBAVCODEC_VERSION_MAJOR < 62)
// reminder to remove CrystalHD decoders on next major bump
#define FF_CODEC_CRYSTAL_HD (LIBAVCODEC_VERSION_MAJOR < 61)
diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index 8e493c4f7a..d0a00347b5 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -206,7 +206,7 @@ static void loadVTEncSymbols(void){
GET_SYM(kVTCompressionPropertyKey_MinAllowedFrameQP, "MinAllowedFrameQP");
}
-#define H264_PROFILE_CONSTRAINED_HIGH (FF_PROFILE_H264_HIGH | FF_PROFILE_H264_CONSTRAINED)
+#define H264_PROFILE_CONSTRAINED_HIGH (AV_PROFILE_H264_HIGH | AV_PROFILE_H264_CONSTRAINED)
typedef enum VTH264Entropy{
VT_ENTROPY_NOT_SET,
@@ -455,22 +455,22 @@ static CMVideoCodecType get_cm_codec_type(AVCodecContext *avctx,
return kCMVideoCodecType_HEVC;
case AV_CODEC_ID_PRORES:
switch (profile) {
- case FF_PROFILE_PRORES_PROXY:
+ case AV_PROFILE_PRORES_PROXY:
return MKBETAG('a','p','c','o'); // kCMVideoCodecType_AppleProRes422Proxy
- case FF_PROFILE_PRORES_LT:
+ case AV_PROFILE_PRORES_LT:
return MKBETAG('a','p','c','s'); // kCMVideoCodecType_AppleProRes422LT
- case FF_PROFILE_PRORES_STANDARD:
+ case AV_PROFILE_PRORES_STANDARD:
return MKBETAG('a','p','c','n'); // kCMVideoCodecType_AppleProRes422
- case FF_PROFILE_PRORES_HQ:
+ case AV_PROFILE_PRORES_HQ:
return MKBETAG('a','p','c','h'); // kCMVideoCodecType_AppleProRes422HQ
- case FF_PROFILE_PRORES_4444:
+ case AV_PROFILE_PRORES_4444:
return MKBETAG('a','p','4','h'); // kCMVideoCodecType_AppleProRes4444
- case FF_PROFILE_PRORES_XQ:
+ case AV_PROFILE_PRORES_XQ:
return MKBETAG('a','p','4','x'); // kCMVideoCodecType_AppleProRes4444XQ
default:
av_log(avctx, AV_LOG_ERROR, "Unknown profile ID: %d, using auto\n", profile);
- case FF_PROFILE_UNKNOWN:
+ case AV_PROFILE_UNKNOWN:
if (desc &&
((desc->flags & AV_PIX_FMT_FLAG_ALPHA) ||
desc->log2_chroma_w == 0))
@@ -736,18 +736,18 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx,
VTEncContext *vtctx = avctx->priv_data;
int profile = vtctx->profile;
- if (profile == FF_PROFILE_UNKNOWN && vtctx->level) {
+ if (profile == AV_PROFILE_UNKNOWN && vtctx->level) {
//Need to pick a profile if level is not auto-selected.
- profile = vtctx->has_b_frames ? FF_PROFILE_H264_MAIN : FF_PROFILE_H264_BASELINE;
+ profile = vtctx->has_b_frames ? AV_PROFILE_H264_MAIN : AV_PROFILE_H264_BASELINE;
}
*profile_level_val = NULL;
switch (profile) {
- case FF_PROFILE_UNKNOWN:
+ case AV_PROFILE_UNKNOWN:
return true;
- case FF_PROFILE_H264_BASELINE:
+ case AV_PROFILE_H264_BASELINE:
switch (vtctx->level) {
case 0: *profile_level_val =
compat_keys.kVTProfileLevel_H264_Baseline_AutoLevel; break;
@@ -769,7 +769,7 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx,
}
break;
- case FF_PROFILE_H264_CONSTRAINED_BASELINE:
+ case AV_PROFILE_H264_CONSTRAINED_BASELINE:
*profile_level_val = compat_keys.kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel;
if (vtctx->level != 0) {
@@ -781,7 +781,7 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx,
}
break;
- case FF_PROFILE_H264_MAIN:
+ case AV_PROFILE_H264_MAIN:
switch (vtctx->level) {
case 0: *profile_level_val =
compat_keys.kVTProfileLevel_H264_Main_AutoLevel; break;
@@ -812,7 +812,7 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx,
}
break;
- case FF_PROFILE_H264_HIGH:
+ case AV_PROFILE_H264_HIGH:
switch (vtctx->level) {
case 0: *profile_level_val =
compat_keys.kVTProfileLevel_H264_High_AutoLevel; break;
@@ -835,7 +835,7 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx,
compat_keys.kVTProfileLevel_H264_High_5_2; break;
}
break;
- case FF_PROFILE_H264_EXTENDED:
+ case AV_PROFILE_H264_EXTENDED:
switch (vtctx->level) {
case 0: *profile_level_val =
compat_keys.kVTProfileLevel_H264_Extended_AutoLevel; break;
@@ -868,13 +868,13 @@ static bool get_vt_hevc_profile_level(AVCodecContext *avctx,
*profile_level_val = NULL;
switch (profile) {
- case FF_PROFILE_UNKNOWN:
+ case AV_PROFILE_UNKNOWN:
return true;
- case FF_PROFILE_HEVC_MAIN:
+ case AV_PROFILE_HEVC_MAIN:
*profile_level_val =
compat_keys.kVTProfileLevel_HEVC_Main_AutoLevel;
break;
- case FF_PROFILE_HEVC_MAIN_10:
+ case AV_PROFILE_HEVC_MAIN_10:
*profile_level_val =
compat_keys.kVTProfileLevel_HEVC_Main10_AutoLevel;
break;
@@ -1521,12 +1521,12 @@ static int vtenc_configure_encoder(AVCodecContext *avctx)
vtctx->get_param_set_func = CMVideoFormatDescriptionGetH264ParameterSetAtIndex;
vtctx->has_b_frames = avctx->max_b_frames > 0;
- if(vtctx->has_b_frames && (0xFF & vtctx->profile) == FF_PROFILE_H264_BASELINE){
+ if(vtctx->has_b_frames && (0xFF & vtctx->profile) == AV_PROFILE_H264_BASELINE){
av_log(avctx, AV_LOG_WARNING, "Cannot use B-frames with baseline profile. Output will not contain B-frames.\n");
vtctx->has_b_frames = 0;
}
- if (vtctx->entropy == VT_CABAC && (0xFF & vtctx->profile) == FF_PROFILE_H264_BASELINE) {
+ if (vtctx->entropy == VT_CABAC && (0xFF & vtctx->profile) == AV_PROFILE_H264_BASELINE) {
av_log(avctx, AV_LOG_WARNING, "CABAC entropy requires 'main' or 'high' profile, but baseline was requested. Encode will not use CABAC entropy.\n");
vtctx->entropy = VT_ENTROPY_NOT_SET;
}
@@ -1632,7 +1632,7 @@ static av_cold int vtenc_init(AVCodecContext *avctx)
pthread_cond_init(&vtctx->cv_sample_sent, NULL);
// It can happen when user set avctx->profile directly.
- if (vtctx->profile == FF_PROFILE_UNKNOWN)
+ if (vtctx->profile == AV_PROFILE_UNKNOWN)
vtctx->profile = avctx->profile;
vtctx->session = NULL;
status = vtenc_configure_encoder(avctx);
@@ -2778,13 +2778,13 @@ static const enum AVPixelFormat prores_pix_fmts[] = {
#define OFFSET(x) offsetof(VTEncContext, x)
static const AVOption h264_options[] = {
- { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, INT_MAX, VE, "profile" },
- { "baseline", "Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_BASELINE }, INT_MIN, INT_MAX, VE, "profile" },
- { "constrained_baseline", "Constrained Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_CONSTRAINED_BASELINE }, INT_MIN, INT_MAX, VE, "profile" },
- { "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_MAIN }, INT_MIN, INT_MAX, VE, "profile" },
- { "high", "High Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_HIGH }, INT_MIN, INT_MAX, VE, "profile" },
+ { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, INT_MAX, VE, "profile" },
+ { "baseline", "Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_BASELINE }, INT_MIN, INT_MAX, VE, "profile" },
+ { "constrained_baseline", "Constrained Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_CONSTRAINED_BASELINE }, INT_MIN, INT_MAX, VE, "profile" },
+ { "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_MAIN }, INT_MIN, INT_MAX, VE, "profile" },
+ { "high", "High Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_HIGH }, INT_MIN, INT_MAX, VE, "profile" },
{ "constrained_high", "Constrained High Profile", 0, AV_OPT_TYPE_CONST, { .i64 = H264_PROFILE_CONSTRAINED_HIGH }, INT_MIN, INT_MAX, VE, "profile" },
- { "extended", "Extend Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_EXTENDED }, INT_MIN, INT_MAX, VE, "profile" },
+ { "extended", "Extend Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_EXTENDED }, INT_MIN, INT_MAX, VE, "profile" },
{ "level", "Level", OFFSET(level), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 52, VE, "level" },
{ "1.3", "Level 1.3, only available with Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = 13 }, INT_MIN, INT_MAX, VE, "level" },
@@ -2835,9 +2835,9 @@ const FFCodec ff_h264_videotoolbox_encoder = {
};
static const AVOption hevc_options[] = {
- { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, INT_MAX, VE, "profile" },
- { "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_HEVC_MAIN }, INT_MIN, INT_MAX, VE, "profile" },
- { "main10", "Main10 Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_HEVC_MAIN_10 }, INT_MIN, INT_MAX, VE, "profile" },
+ { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, INT_MAX, VE, "profile" },
+ { "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_HEVC_MAIN }, INT_MIN, INT_MAX, VE, "profile" },
+ { "main10", "Main10 Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_HEVC_MAIN_10 }, INT_MIN, INT_MAX, VE, "profile" },
{ "alpha_quality", "Compression quality for the alpha channel", OFFSET(alpha_quality), AV_OPT_TYPE_DOUBLE, { .dbl = 0.0 }, 0.0, 1.0, VE },
@@ -2872,14 +2872,14 @@ const FFCodec ff_hevc_videotoolbox_encoder = {
};
static const AVOption prores_options[] = {
- { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, FF_PROFILE_PRORES_XQ, VE, "profile" },
- { "auto", "Automatically determine based on input format", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, VE, "profile" },
- { "proxy", "ProRes 422 Proxy", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_PROXY }, INT_MIN, INT_MAX, VE, "profile" },
- { "lt", "ProRes 422 LT", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_LT }, INT_MIN, INT_MAX, VE, "profile" },
- { "standard", "ProRes 422", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_STANDARD }, INT_MIN, INT_MAX, VE, "profile" },
- { "hq", "ProRes 422 HQ", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_HQ }, INT_MIN, INT_MAX, VE, "profile" },
- { "4444", "ProRes 4444", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_4444 }, INT_MIN, INT_MAX, VE, "profile" },
- { "xq", "ProRes 4444 XQ", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_XQ }, INT_MIN, INT_MAX, VE, "profile" },
+ { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, AV_PROFILE_PRORES_XQ, VE, "profile" },
+ { "auto", "Automatically determine based on input format", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, VE, "profile" },
+ { "proxy", "ProRes 422 Proxy", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_PROXY }, INT_MIN, INT_MAX, VE, "profile" },
+ { "lt", "ProRes 422 LT", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_LT }, INT_MIN, INT_MAX, VE, "profile" },
+ { "standard", "ProRes 422", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_STANDARD }, INT_MIN, INT_MAX, VE, "profile" },
+ { "hq", "ProRes 422 HQ", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_HQ }, INT_MIN, INT_MAX, VE, "profile" },
+ { "4444", "ProRes 4444", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_4444 }, INT_MIN, INT_MAX, VE, "profile" },
+ { "xq", "ProRes 4444 XQ", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_XQ }, INT_MIN, INT_MAX, VE, "profile" },
COMMON_OPTIONS
{ NULL },
diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c
index 1b2ff0045d..9a57369df7 100644
--- a/libavcodec/vulkan_decode.c
+++ b/libavcodec/vulkan_decode.c
@@ -696,8 +696,8 @@ static VkResult vulkan_setup_profile(AVCodecContext *avctx,
/* Vulkan transmits all the constrant_set flags, rather than wanting them
* merged in the profile IDC */
- h264_profile->stdProfileIdc = cur_profile & ~(FF_PROFILE_H264_CONSTRAINED |
- FF_PROFILE_H264_INTRA);
+ h264_profile->stdProfileIdc = cur_profile & ~(AV_PROFILE_H264_CONSTRAINED |
+ AV_PROFILE_H264_INTRA);
h264_profile->pictureLayout = avctx->field_order == AV_FIELD_UNKNOWN ||
avctx->field_order == AV_FIELD_PROGRESSIVE ?
@@ -789,8 +789,8 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_
}
cur_profile = avctx->profile;
- base_profile = avctx->codec_id == AV_CODEC_ID_H264 ? FF_PROFILE_H264_CONSTRAINED_BASELINE :
- avctx->codec_id == AV_CODEC_ID_H265 ? FF_PROFILE_HEVC_MAIN :
+ base_profile = avctx->codec_id == AV_CODEC_ID_H264 ? AV_PROFILE_H264_CONSTRAINED_BASELINE :
+ avctx->codec_id == AV_CODEC_ID_H265 ? AV_PROFILE_HEVC_MAIN :
avctx->codec_id == AV_CODEC_ID_AV1 ? STD_VIDEO_AV1_MESA_PROFILE_MAIN :
0;
diff --git a/libavformat/av1.c b/libavformat/av1.c
index b6eaf50627..4455ec0504 100644
--- a/libavformat/av1.c
+++ b/libavformat/av1.c
@@ -23,7 +23,7 @@
#include "libavutil/mem.h"
#include "libavcodec/av1.h"
#include "libavcodec/av1_parse.h"
-#include "libavcodec/avcodec.h"
+#include "libavcodec/defs.h"
#include "libavcodec/put_bits.h"
#include "av1.h"
#include "avio.h"
@@ -141,12 +141,12 @@ static int parse_color_config(AV1SequenceParameters *seq_params, GetBitContext *
{
int twelve_bit = 0;
int high_bitdepth = get_bits1(gb);
- if (seq_params->profile == FF_PROFILE_AV1_PROFESSIONAL && high_bitdepth)
+ if (seq_params->profile == AV_PROFILE_AV1_PROFESSIONAL && high_bitdepth)
twelve_bit = get_bits1(gb);
seq_params->bitdepth = 8 + (high_bitdepth * 2) + (twelve_bit * 2);
- if (seq_params->profile == FF_PROFILE_AV1_HIGH)
+ if (seq_params->profile == AV_PROFILE_AV1_HIGH)
seq_params->monochrome = 0;
else
seq_params->monochrome = get_bits1(gb);
@@ -176,10 +176,10 @@ static int parse_color_config(AV1SequenceParameters *seq_params, GetBitContext *
} else {
seq_params->color_range = get_bits1(gb);
- if (seq_params->profile == FF_PROFILE_AV1_MAIN) {
+ if (seq_params->profile == AV_PROFILE_AV1_MAIN) {
seq_params->chroma_subsampling_x = 1;
seq_params->chroma_subsampling_y = 1;
- } else if (seq_params->profile == FF_PROFILE_AV1_HIGH) {
+ } else if (seq_params->profile == AV_PROFILE_AV1_HIGH) {
seq_params->chroma_subsampling_x = 0;
seq_params->chroma_subsampling_y = 0;
} else {
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 004bd25359..12e20580ee 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -39,7 +39,7 @@
#include "libavutil/time.h"
#include "libavutil/time_internal.h"
-#include "libavcodec/avcodec.h"
+#include "libavcodec/defs.h"
#include "avformat.h"
#include "avio_internal.h"
@@ -369,12 +369,12 @@ static void write_codec_attr(AVStream *st, VariantStream *vs)
}
} else if (st->codecpar->codec_id == AV_CODEC_ID_HEVC) {
uint8_t *data = st->codecpar->extradata;
- int profile = FF_PROFILE_UNKNOWN;
- int level = FF_LEVEL_UNKNOWN;
+ int profile = AV_PROFILE_UNKNOWN;
+ int level = AV_LEVEL_UNKNOWN;
- if (st->codecpar->profile != FF_PROFILE_UNKNOWN)
+ if (st->codecpar->profile != AV_PROFILE_UNKNOWN)
profile = st->codecpar->profile;
- if (st->codecpar->level != FF_LEVEL_UNKNOWN)
+ if (st->codecpar->level != AV_LEVEL_UNKNOWN)
level = st->codecpar->level;
/* check the boundary of data which from current position is small than extradata_size */
@@ -407,8 +407,8 @@ static void write_codec_attr(AVStream *st, VariantStream *vs)
data++;
}
if (st->codecpar->codec_tag == MKTAG('h','v','c','1') &&
- profile != FF_PROFILE_UNKNOWN &&
- level != FF_LEVEL_UNKNOWN) {
+ profile != AV_PROFILE_UNKNOWN &&
+ level != AV_LEVEL_UNKNOWN) {
snprintf(attr, sizeof(attr), "%s.%d.4.L%d.B01", av_fourcc2str(st->codecpar->codec_tag), profile, level);
} else
goto fail;
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index fda77b0b89..b5333c4692 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -51,8 +51,8 @@
#include "libavutil/time_internal.h"
#include "libavutil/spherical.h"
-#include "libavcodec/avcodec.h"
#include "libavcodec/bytestream.h"
+#include "libavcodec/defs.h"
#include "libavcodec/flac.h"
#include "libavcodec/mpeg4audio.h"
#include "libavcodec/packet_internal.h"
@@ -2896,21 +2896,21 @@ static int matroska_parse_tracks(AVFormatContext *s)
// [0x30..0x37] are component tags utilized for
// non-mobile captioning service ("profile A").
if (component_tag >= 0x30 && component_tag <= 0x37) {
- st->codecpar->profile = FF_PROFILE_ARIB_PROFILE_A;
+ st->codecpar->profile = AV_PROFILE_ARIB_PROFILE_A;
}
break;
case 0x0012:
// component tag 0x87 signifies a mobile/partial reception
// (1seg) captioning service ("profile C").
if (component_tag == 0x87) {
- st->codecpar->profile = FF_PROFILE_ARIB_PROFILE_C;
+ st->codecpar->profile = AV_PROFILE_ARIB_PROFILE_C;
}
break;
default:
break;
}
- if (st->codecpar->profile == FF_PROFILE_UNKNOWN)
+ if (st->codecpar->profile == AV_PROFILE_UNKNOWN)
av_log(matroska->ctx, AV_LOG_WARNING,
"Unknown ARIB caption profile utilized: %02x / %04x\n",
component_tag, data_component_id);
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index bf2ca7106b..ba54f5f98e 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -59,9 +59,9 @@
#include "libavutil/stereo3d.h"
#include "libavcodec/av1.h"
-#include "libavcodec/avcodec.h"
#include "libavcodec/bytestream.h"
#include "libavcodec/codec_desc.h"
+#include "libavcodec/defs.h"
#include "libavcodec/xiph.h"
#include "libavcodec/mpeg4audio.h"
@@ -1154,11 +1154,11 @@ static int mkv_assemble_native_codecprivate(AVFormatContext *s, AVIOContext *dyn
case AV_CODEC_ID_ARIB_CAPTION: {
unsigned stream_identifier, data_component_id;
switch (par->profile) {
- case FF_PROFILE_ARIB_PROFILE_A:
+ case AV_PROFILE_ARIB_PROFILE_A:
stream_identifier = 0x30;
data_component_id = 0x0008;
break;
- case FF_PROFILE_ARIB_PROFILE_C:
+ case AV_PROFILE_ARIB_PROFILE_C:
stream_identifier = 0x87;
data_component_id = 0x0012;
break;
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 7ef6cef46a..dbfa647a14 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1760,8 +1760,8 @@ static const struct {
static int mov_get_dnxhd_codec_tag(AVFormatContext *s, MOVTrack *track)
{
int tag = MKTAG('A','V','d','n');
- if (track->par->profile != FF_PROFILE_UNKNOWN &&
- track->par->profile != FF_PROFILE_DNXHD)
+ if (track->par->profile != AV_PROFILE_UNKNOWN &&
+ track->par->profile != AV_PROFILE_DNXHD)
tag = MKTAG('A','V','d','h');
return tag;
}
@@ -4769,10 +4769,10 @@ static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov, AVFormat
if (track->par->codec_id == AV_CODEC_ID_AAC) {
switch (track->par->profile)
{
- case FF_PROFILE_AAC_HE_V2:
+ case AV_PROFILE_AAC_HE_V2:
param_write_string(pb, "FourCC", "AACP");
break;
- case FF_PROFILE_AAC_HE:
+ case AV_PROFILE_AAC_HE:
param_write_string(pb, "FourCC", "AACH");
break;
default:
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 0b3edda817..8fd1524a8a 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -34,6 +34,7 @@
#include "libavutil/dovi_meta.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/bytestream.h"
+#include "libavcodec/defs.h"
#include "libavcodec/get_bits.h"
#include "libavcodec/opus.h"
#include "avformat.h"
@@ -2147,7 +2148,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
// Component tag limits are documented in TR-B14, fascicle 2,
// Vol. 3, Section 2, 4.2.8.1
int actual_component_tag = sti->stream_identifier - 1;
- int picked_profile = FF_PROFILE_UNKNOWN;
+ int picked_profile = AV_PROFILE_UNKNOWN;
int data_component_id = get16(pp, desc_end);
if (data_component_id < 0)
return AVERROR_INVALIDDATA;
@@ -2158,21 +2159,21 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
// non-mobile captioning service ("profile A").
if (actual_component_tag >= 0x30 &&
actual_component_tag <= 0x37) {
- picked_profile = FF_PROFILE_ARIB_PROFILE_A;
+ picked_profile = AV_PROFILE_ARIB_PROFILE_A;
}
break;
case 0x0012:
// component tag 0x87 signifies a mobile/partial reception
// (1seg) captioning service ("profile C").
if (actual_component_tag == 0x87) {
- picked_profile = FF_PROFILE_ARIB_PROFILE_C;
+ picked_profile = AV_PROFILE_ARIB_PROFILE_C;
}
break;
default:
break;
}
- if (picked_profile == FF_PROFILE_UNKNOWN)
+ if (picked_profile == AV_PROFILE_UNKNOWN)
break;
st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 700fc549df..46ed16985f 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -28,8 +28,8 @@
#include "libavutil/opt.h"
#include "libavcodec/ac3_parser_internal.h"
-#include "libavcodec/avcodec.h"
#include "libavcodec/bytestream.h"
+#include "libavcodec/defs.h"
#include "libavcodec/h264.h"
#include "libavcodec/startcode.h"
@@ -300,11 +300,11 @@ static int put_arib_caption_descriptor(AVFormatContext *s, uint8_t **q_ptr,
uint8_t *q = *q_ptr;
switch (codecpar->profile) {
- case FF_PROFILE_ARIB_PROFILE_A:
+ case AV_PROFILE_ARIB_PROFILE_A:
stream_identifier = 0x30;
data_component_id = 0x0008;
break;
- case FF_PROFILE_ARIB_PROFILE_C:
+ case AV_PROFILE_ARIB_PROFILE_C:
stream_identifier = 0x87;
data_component_id = 0x0012;
break;
@@ -431,7 +431,7 @@ static int get_dvb_stream_type(AVFormatContext *s, AVStream *st)
stream_type = STREAM_TYPE_PRIVATE_DATA;
break;
case AV_CODEC_ID_SMPTE_KLV:
- if (st->codecpar->profile == FF_PROFILE_KLVA_SYNC) {
+ if (st->codecpar->profile == AV_PROFILE_KLVA_SYNC) {
stream_type = STREAM_TYPE_METADATA;
} else {
stream_type = STREAM_TYPE_PRIVATE_DATA;
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 110b69b7c1..7dbe294d23 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -52,6 +52,7 @@
#include "libavutil/mastering_display_metadata.h"
#include "libavutil/mathematics.h"
#include "libavcodec/bytestream.h"
+#include "libavcodec/defs.h"
#include "libavcodec/internal.h"
#include "libavutil/channel_layout.h"
#include "libavutil/dict_internal.h"
@@ -1403,8 +1404,8 @@ static int mxf_read_generic_descriptor(void *arg, AVIOContext *pb, int tag, int
}
if (IS_KLV_KEY(uid, mxf_jp2k_rsiz)) {
uint32_t rsiz = avio_rb16(pb);
- if (rsiz == FF_PROFILE_JPEG2000_DCINEMA_2K ||
- rsiz == FF_PROFILE_JPEG2000_DCINEMA_4K)
+ if (rsiz == AV_PROFILE_JPEG2000_DCINEMA_2K ||
+ rsiz == AV_PROFILE_JPEG2000_DCINEMA_4K)
descriptor->pix_fmt = AV_PIX_FMT_XYZ12;
}
if (IS_KLV_KEY(uid, mxf_mastering_display_prefix)) {
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index d8252ed68f..cb299412e2 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -47,7 +47,7 @@
#include "libavutil/mastering_display_metadata.h"
#include "libavutil/pixdesc.h"
#include "libavutil/time_internal.h"
-#include "libavcodec/avcodec.h"
+#include "libavcodec/defs.h"
#include "libavcodec/golomb.h"
#include "libavcodec/h264.h"
#include "libavcodec/packet_internal.h"
@@ -2111,12 +2111,12 @@ static const struct {
int profile;
UID codec_ul;
} mxf_prores_codec_uls[] = {
- { FF_PROFILE_PRORES_PROXY, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x01,0x00 } },
- { FF_PROFILE_PRORES_LT, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x02,0x00 } },
- { FF_PROFILE_PRORES_STANDARD, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x03,0x00 } },
- { FF_PROFILE_PRORES_HQ, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x04,0x00 } },
- { FF_PROFILE_PRORES_4444, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x05,0x00 } },
- { FF_PROFILE_PRORES_XQ, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x06,0x00 } },
+ { AV_PROFILE_PRORES_PROXY, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x01,0x00 } },
+ { AV_PROFILE_PRORES_LT, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x02,0x00 } },
+ { AV_PROFILE_PRORES_STANDARD, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x03,0x00 } },
+ { AV_PROFILE_PRORES_HQ, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x04,0x00 } },
+ { AV_PROFILE_PRORES_4444, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x05,0x00 } },
+ { AV_PROFILE_PRORES_XQ, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x06,0x00 } },
};
static int mxf_parse_prores_frame(AVFormatContext *s, AVStream *st, AVPacket *pkt)
diff --git a/libavformat/vpcc.c b/libavformat/vpcc.c
index ea66959abf..0d9e0cfe10 100644
--- a/libavformat/vpcc.c
+++ b/libavformat/vpcc.c
@@ -21,7 +21,7 @@
#include "libavutil/pixdesc.h"
#include "libavutil/pixfmt.h"
-#include "libavcodec/avcodec.h"
+#include "libavcodec/defs.h"
#include "libavcodec/get_bits.h"
#include "vpcc.h"
@@ -155,7 +155,7 @@ int ff_isom_get_vpcc_features(AVFormatContext *s, AVCodecParameters *par,
AVRational *frame_rate, VPCC *vpcc)
{
int profile = par->profile;
- int level = par->level == FF_LEVEL_UNKNOWN ?
+ int level = par->level == AV_LEVEL_UNKNOWN ?
get_vp9_level(par, frame_rate) : par->level;
int bit_depth = get_bit_depth(s, par->format);
int vpx_chroma_subsampling =
@@ -166,7 +166,7 @@ int ff_isom_get_vpcc_features(AVFormatContext *s, AVCodecParameters *par,
if (bit_depth < 0 || vpx_chroma_subsampling < 0)
return AVERROR_INVALIDDATA;
- if (len && (profile == FF_PROFILE_UNKNOWN || !bit_depth)) {
+ if (len && (profile == AV_PROFILE_UNKNOWN || !bit_depth)) {
GetBitContext gb;
int ret = init_get_bits8(&gb, data, len);
@@ -176,16 +176,16 @@ int ff_isom_get_vpcc_features(AVFormatContext *s, AVCodecParameters *par,
parse_bitstream(&gb, &profile, &bit_depth);
}
- if (profile == FF_PROFILE_UNKNOWN && bit_depth) {
+ if (profile == AV_PROFILE_UNKNOWN && bit_depth) {
if (vpx_chroma_subsampling == VPX_SUBSAMPLING_420_VERTICAL ||
vpx_chroma_subsampling == VPX_SUBSAMPLING_420_COLLOCATED_WITH_LUMA) {
- profile = (bit_depth == 8) ? FF_PROFILE_VP9_0 : FF_PROFILE_VP9_2;
+ profile = (bit_depth == 8) ? AV_PROFILE_VP9_0 : AV_PROFILE_VP9_2;
} else {
- profile = (bit_depth == 8) ? FF_PROFILE_VP9_1 : FF_PROFILE_VP9_3;
+ profile = (bit_depth == 8) ? AV_PROFILE_VP9_1 : AV_PROFILE_VP9_3;
}
}
- if (profile == FF_PROFILE_UNKNOWN || !bit_depth)
+ if (profile == AV_PROFILE_UNKNOWN || !bit_depth)
av_log(s, AV_LOG_WARNING, "VP9 profile and/or bit depth not set or could not be derived\n");
vpcc->profile = profile;
--
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] 20+ messages in thread
* [FFmpeg-devel] [PATCH 3/7] avformat/mux: Only write HEADER marker if format has .write_header
2023-09-02 11:31 [FFmpeg-devel] [PATCH] avformat/avformat: Avoid including codec.h, frame.h Andreas Rheinhardt
2023-09-02 16:21 ` [FFmpeg-devel] [PATCH 2/7] avcodec/defs: Add AV_PROFILE_* defines, deprecate FF_PROFILE_* defines Andreas Rheinhardt
@ 2023-09-02 16:21 ` Andreas Rheinhardt
2023-09-02 16:21 ` [FFmpeg-devel] [PATCH 4/7] avformat/aviobuf: Add ffio_init_(read|write)_context() Andreas Rheinhardt
` (9 subsequent siblings)
11 siblings, 0 replies; 20+ messages in thread
From: Andreas Rheinhardt @ 2023-09-02 16:21 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavformat/mux.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavformat/mux.c b/libavformat/mux.c
index fff8094341..0cf9ebfc19 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -464,9 +464,9 @@ int avformat_write_header(AVFormatContext *s, AVDictionary **options)
if ((ret = avformat_init_output(s, options)) < 0)
return ret;
- if (!(s->oformat->flags & AVFMT_NOFILE) && s->pb)
- avio_write_marker(s->pb, AV_NOPTS_VALUE, AVIO_DATA_MARKER_HEADER);
if (ffofmt(s->oformat)->write_header) {
+ if (!(s->oformat->flags & AVFMT_NOFILE) && s->pb)
+ avio_write_marker(s->pb, AV_NOPTS_VALUE, AVIO_DATA_MARKER_HEADER);
ret = ffofmt(s->oformat)->write_header(s);
if (ret >= 0 && s->pb && s->pb->error < 0)
ret = s->pb->error;
--
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] 20+ messages in thread
* [FFmpeg-devel] [PATCH 4/7] avformat/aviobuf: Add ffio_init_(read|write)_context()
2023-09-02 11:31 [FFmpeg-devel] [PATCH] avformat/avformat: Avoid including codec.h, frame.h Andreas Rheinhardt
2023-09-02 16:21 ` [FFmpeg-devel] [PATCH 2/7] avcodec/defs: Add AV_PROFILE_* defines, deprecate FF_PROFILE_* defines Andreas Rheinhardt
2023-09-02 16:21 ` [FFmpeg-devel] [PATCH 3/7] avformat/mux: Only write HEADER marker if format has .write_header Andreas Rheinhardt
@ 2023-09-02 16:21 ` Andreas Rheinhardt
2023-09-02 16:21 ` [FFmpeg-devel] [PATCH 5/7] avutil: Move error.h from avutil.h to common.h Andreas Rheinhardt
` (8 subsequent siblings)
11 siblings, 0 replies; 20+ messages in thread
From: Andreas Rheinhardt @ 2023-09-02 16:21 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Most users of ffio_init_context() simply want to wrap
a buffer into an AVIOContext; they do not provide
function pointers at all.
Therefore this commit adds shortcuts for these two common
operations. This also allows to accept const data when reading
(i.e. the const is now cast away at a central place in
ffio_init_read_context() instead of at several callers).
This also allows to constify the data in ff_text_init_buf().
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavformat/aacdec.c | 2 +-
libavformat/asfenc.c | 6 ++----
libavformat/av1.c | 2 +-
libavformat/av1dec.c | 3 +--
libavformat/avio_internal.h | 9 +++++++++
libavformat/aviobuf.c | 10 ++++++++++
libavformat/hls.c | 2 +-
libavformat/id3v2.c | 5 ++---
libavformat/matroskadec.c | 12 +++++-------
libavformat/mmst.c | 4 ++--
libavformat/mov.c | 2 +-
libavformat/mpegts.c | 18 +++++++-----------
libavformat/mpjpegdec.c | 2 +-
libavformat/oggenc.c | 2 +-
libavformat/rdt.c | 5 ++---
libavformat/rtpdec_asf.c | 2 +-
libavformat/rtpdec_qt.c | 2 +-
libavformat/rtsp.c | 2 +-
libavformat/sapdec.c | 3 +--
libavformat/subtitles.c | 4 ++--
libavformat/subtitles.h | 2 +-
libavformat/vividas.c | 10 ++++++----
22 files changed, 59 insertions(+), 50 deletions(-)
diff --git a/libavformat/aacdec.c b/libavformat/aacdec.c
index a476640904..41c9a36239 100644
--- a/libavformat/aacdec.c
+++ b/libavformat/aacdec.c
@@ -146,7 +146,7 @@ static int handle_id3(AVFormatContext *s, AVPacket *pkt)
return ret;
}
- ffio_init_context(&pb, pkt->data, pkt->size, 0, NULL, NULL, NULL, NULL);
+ ffio_init_read_context(&pb, pkt->data, pkt->size);
ff_id3v2_read_dict(&pb.pub, &metadata, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta);
if ((ret = ff_id3v2_parse_priv_dict(&metadata, id3v2_extra_meta)) < 0)
goto error;
diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c
index 244c7e7a27..2f2d9b1bab 100644
--- a/libavformat/asfenc.c
+++ b/libavformat/asfenc.c
@@ -773,8 +773,7 @@ static int asf_write_header(AVFormatContext *s)
asf->packet_nb_payloads = 0;
asf->packet_timestamp_start = -1;
asf->packet_timestamp_end = -1;
- ffio_init_context(&asf->pb, asf->packet_buf, s->packet_size, 1,
- NULL, NULL, NULL, NULL);
+ ffio_init_write_context(&asf->pb, asf->packet_buf, s->packet_size);
if (s->avoid_negative_ts < 0)
s->avoid_negative_ts = 1;
@@ -866,8 +865,7 @@ static void flush_packet(AVFormatContext *s)
asf->packet_nb_payloads = 0;
asf->packet_timestamp_start = -1;
asf->packet_timestamp_end = -1;
- ffio_init_context(&asf->pb, asf->packet_buf, s->packet_size, 1,
- NULL, NULL, NULL, NULL);
+ ffio_init_write_context(&asf->pb, asf->packet_buf, s->packet_size);
}
static void put_payload_header(AVFormatContext *s, ASFStream *stream,
diff --git a/libavformat/av1.c b/libavformat/av1.c
index 4455ec0504..cb86e66d09 100644
--- a/libavformat/av1.c
+++ b/libavformat/av1.c
@@ -107,7 +107,7 @@ int ff_av1_filter_obus_buf(const uint8_t *in, uint8_t **out,
if (!buf)
return AVERROR(ENOMEM);
- ffio_init_context(&pb, buf, len, 1, NULL, NULL, NULL, NULL);
+ ffio_init_write_context(&pb, buf, len);
ret = av1_filter_obus(&pb.pub, in, *size, NULL);
av_assert1(ret == len);
diff --git a/libavformat/av1dec.c b/libavformat/av1dec.c
index 2883b320a1..8a06445958 100644
--- a/libavformat/av1dec.c
+++ b/libavformat/av1dec.c
@@ -167,8 +167,7 @@ static int annexb_probe(const AVProbeData *p)
int seq = 0;
int ret, type, cnt = 0;
- ffio_init_context(&ctx, p->buf, p->buf_size, 0,
- NULL, NULL, NULL, NULL);
+ ffio_init_read_context(&ctx, p->buf, p->buf_size);
ret = leb(pb, &temporal_unit_size, 1);
if (ret < 0)
diff --git a/libavformat/avio_internal.h b/libavformat/avio_internal.h
index 1f5e3d474b..57796ade03 100644
--- a/libavformat/avio_internal.h
+++ b/libavformat/avio_internal.h
@@ -93,6 +93,15 @@ void ffio_init_context(FFIOContext *s,
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
int64_t (*seek)(void *opaque, int64_t offset, int whence));
+/**
+ * Wrap a buffer in an AVIOContext for reading.
+ */
+void ffio_init_read_context(FFIOContext *s, const uint8_t *buffer, int buffer_size);
+
+/**
+ * Wrap a buffer in an AVIOContext for writing.
+ */
+void ffio_init_write_context(FFIOContext *s, uint8_t *buffer, int buffer_size);
/**
* Read size bytes from AVIOContext, returning a pointer.
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 4ad734a3c3..029a9e966b 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -127,6 +127,16 @@ void ffio_init_context(FFIOContext *ctx,
ctx->short_seek_get = NULL;
}
+void ffio_init_read_context(FFIOContext *s, const uint8_t *buffer, int buffer_size)
+{
+ ffio_init_context(s, (unsigned char*)buffer, buffer_size, 0, NULL, NULL, NULL, NULL);
+}
+
+void ffio_init_write_context(FFIOContext *s, uint8_t *buffer, int buffer_size)
+{
+ ffio_init_context(s, buffer, buffer_size, 1, NULL, NULL, NULL, NULL);
+}
+
AVIOContext *avio_alloc_context(
unsigned char *buffer,
int buffer_size,
diff --git a/libavformat/hls.c b/libavformat/hls.c
index c625e30291..276e4ee333 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -1265,7 +1265,7 @@ static void intercept_id3(struct playlist *pls, uint8_t *buf,
if (pls->id3_buf) {
/* Now parse all the ID3 tags */
FFIOContext id3ioctx;
- ffio_init_context(&id3ioctx, pls->id3_buf, id3_buf_pos, 0, NULL, NULL, NULL, NULL);
+ ffio_init_read_context(&id3ioctx, pls->id3_buf, id3_buf_pos);
handle_id3(&id3ioctx.pub, pls);
}
diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index 69193933e0..d83716dcf4 100644
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -1001,8 +1001,7 @@ static void id3v2_parse(AVIOContext *pb, AVDictionary **metadata,
t++;
}
- ffio_init_context(&pb_local, buffer, b - buffer, 0, NULL, NULL, NULL,
- NULL);
+ ffio_init_read_context(&pb_local, buffer, b - buffer);
tlen = b - buffer;
pbx = &pb_local.pub; // read from sync buffer
}
@@ -1038,7 +1037,7 @@ static void id3v2_parse(AVIOContext *pb, AVDictionary **metadata,
av_log(s, AV_LOG_ERROR, "Failed to uncompress tag: %d\n", err);
goto seek;
}
- ffio_init_context(&pb_local, uncompressed_buffer, dlen, 0, NULL, NULL, NULL, NULL);
+ ffio_init_read_context(&pb_local, uncompressed_buffer, dlen);
tlen = dlen;
pbx = &pb_local.pub; // read from sync buffer
}
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index b5333c4692..b8506925af 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2676,9 +2676,8 @@ static int matroska_parse_tracks(AVFormatContext *s)
track->codec_priv.size >= 14 &&
track->codec_priv.data) {
int ret;
- ffio_init_context(&b, track->codec_priv.data,
- track->codec_priv.size,
- 0, NULL, NULL, NULL, NULL);
+ ffio_init_read_context(&b, track->codec_priv.data,
+ track->codec_priv.size);
ret = ff_get_wav_header(s, &b.pub, st->codecpar,
track->codec_priv.size, 0);
if (ret < 0)
@@ -2723,9 +2722,8 @@ static int matroska_parse_tracks(AVFormatContext *s)
"mov FourCC not found %s.\n", av_fourcc2str(fourcc));
if (track->codec_priv.size >= 86) {
bit_depth = AV_RB16(track->codec_priv.data + 82);
- ffio_init_context(&b, track->codec_priv.data,
- track->codec_priv.size,
- 0, NULL, NULL, NULL, NULL);
+ ffio_init_read_context(&b, track->codec_priv.data,
+ track->codec_priv.size);
if (ff_get_qtpalette(codec_id, &b.pub, track->palette)) {
bit_depth &= 0x1F;
track->has_palette = 1;
@@ -3915,7 +3913,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, AVBufferRef *buf
av_assert1(buf);
- ffio_init_context(&pb, data, size, 0, NULL, NULL, NULL, NULL);
+ ffio_init_read_context(&pb, data, size);
if ((n = ebml_read_num(matroska, &pb.pub, 8, &num, 1)) < 0)
return n;
diff --git a/libavformat/mmst.c b/libavformat/mmst.c
index 20b04b12aa..d7f71304e5 100644
--- a/libavformat/mmst.c
+++ b/libavformat/mmst.c
@@ -157,8 +157,8 @@ static int mms_put_utf16(MMSContext *mms, const uint8_t *src)
FFIOContext bic;
int size = mms->write_out_ptr - mms->out_buffer;
int len;
- ffio_init_context(&bic, mms->write_out_ptr,
- sizeof(mms->out_buffer) - size, 1, NULL, NULL, NULL, NULL);
+ ffio_init_write_context(&bic, mms->write_out_ptr,
+ sizeof(mms->out_buffer) - size);
len = avio_put_str16le(&bic.pub, src);
if (len < 0)
diff --git a/libavformat/mov.c b/libavformat/mov.c
index be9975f297..aa1d9e4ccc 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5727,7 +5727,7 @@ static int mov_read_cmov(MOVContext *c, AVIOContext *pb, MOVAtom atom)
ret = AVERROR_INVALIDDATA;
if (uncompress (moov_data, (uLongf *) &moov_len, (const Bytef *)cmov_data, cmov_len) != Z_OK)
goto free_and_return;
- ffio_init_context(&ctx, moov_data, moov_len, 0, NULL, NULL, NULL, NULL);
+ ffio_init_read_context(&ctx, moov_data, moov_len);
ctx.pub.seekable = AVIO_SEEKABLE_NORMAL;
atom.type = MKTAG('m','o','o','v');
atom.size = moov_len;
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 8fd1524a8a..d825bf0b5d 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1471,8 +1471,7 @@ static int init_MP4DescrParseContext(MP4DescrParseContext *d, AVFormatContext *s
if (size > (1 << 30))
return AVERROR_INVALIDDATA;
- ffio_init_context(&d->pb, (unsigned char *)buf, size,
- 0, NULL, NULL, NULL, NULL);
+ ffio_init_read_context(&d->pb, buf, size);
d->s = s;
d->level = 0;
@@ -1743,9 +1742,8 @@ static void m4sl_cb(MpegTSFilter *filter, const uint8_t *section,
pes->sl = mp4_descr[i].sl;
- ffio_init_context(&pb, mp4_descr[i].dec_config_descr,
- mp4_descr[i].dec_config_descr_len, 0,
- NULL, NULL, NULL, NULL);
+ ffio_init_read_context(&pb, mp4_descr[i].dec_config_descr,
+ mp4_descr[i].dec_config_descr_len);
ff_mp4_read_dec_config_descr(s, st, &pb.pub);
if (st->codecpar->codec_id == AV_CODEC_ID_AAC &&
st->codecpar->extradata_size > 0)
@@ -1853,9 +1851,8 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
if (mp4_descr[i].dec_config_descr_len &&
mp4_descr[i].es_id == desc_es_id) {
FFIOContext pb;
- ffio_init_context(&pb, mp4_descr[i].dec_config_descr,
- mp4_descr[i].dec_config_descr_len, 0,
- NULL, NULL, NULL, NULL);
+ ffio_init_read_context(&pb, mp4_descr[i].dec_config_descr,
+ mp4_descr[i].dec_config_descr_len);
ff_mp4_read_dec_config_descr(fc, st, &pb.pub);
if (st->codecpar->codec_id == AV_CODEC_ID_AAC &&
st->codecpar->extradata_size > 0) {
@@ -1875,9 +1872,8 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
sti->request_probe > 0) &&
mp4_descr->dec_config_descr_len && mp4_descr->es_id == pid) {
FFIOContext pb;
- ffio_init_context(&pb, mp4_descr->dec_config_descr,
- mp4_descr->dec_config_descr_len, 0,
- NULL, NULL, NULL, NULL);
+ ffio_init_read_context(&pb, mp4_descr->dec_config_descr,
+ mp4_descr->dec_config_descr_len);
ff_mp4_read_dec_config_descr(fc, st, &pb.pub);
if (st->codecpar->codec_id == AV_CODEC_ID_AAC &&
st->codecpar->extradata_size > 0) {
diff --git a/libavformat/mpjpegdec.c b/libavformat/mpjpegdec.c
index 559a375d8d..f1d2d34689 100644
--- a/libavformat/mpjpegdec.c
+++ b/libavformat/mpjpegdec.c
@@ -120,7 +120,7 @@ static int mpjpeg_read_probe(const AVProbeData *p)
if (p->buf_size < 2 || p->buf[0] != '-' || p->buf[1] != '-')
return 0;
- ffio_init_context(&pb, p->buf, p->buf_size, 0, NULL, NULL, NULL, NULL);
+ ffio_init_read_context(&pb, p->buf, p->buf_size);
ret = (parse_multipart_header(&pb.pub, &size, "--", NULL) >= 0) ? AVPROBE_SCORE_MAX : 0;
diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c
index 2e582d0754..c669aea25a 100644
--- a/libavformat/oggenc.c
+++ b/libavformat/oggenc.c
@@ -292,7 +292,7 @@ static uint8_t *ogg_write_vorbiscomment(int64_t offset, int bitexact,
if (!p)
return NULL;
- ffio_init_context(&pb, p + offset, size - offset, 1, NULL, NULL, NULL, NULL);
+ ffio_init_write_context(&pb, p + offset, size - offset);
ff_vorbiscomment_write(&pb.pub, *m, vendor, chapters, nb_chapters);
if (framing_bit)
avio_w8(&pb.pub, 1);
diff --git a/libavformat/rdt.c b/libavformat/rdt.c
index 2fa3c2d266..b9b02a371f 100644
--- a/libavformat/rdt.c
+++ b/libavformat/rdt.c
@@ -152,8 +152,7 @@ rdt_load_mdpr (PayloadContext *rdt, AVStream *st, int rule_nr)
*/
if (!rdt->mlti_data)
return -1;
- ffio_init_context(&pb0, rdt->mlti_data, rdt->mlti_data_size, 0,
- NULL, NULL, NULL, NULL);
+ ffio_init_read_context(&pb0, rdt->mlti_data, rdt->mlti_data_size);
tag = avio_rl32(pb);
if (tag == MKTAG('M', 'L', 'T', 'I')) {
int num, chunk_nr;
@@ -302,7 +301,7 @@ rdt_parse_packet (AVFormatContext *ctx, PayloadContext *rdt, AVStream *st,
FFIOContext pb;
int pos, rmflags;
- ffio_init_context(&pb, (uint8_t *)buf, len, 0, NULL, NULL, NULL, NULL);
+ ffio_init_read_context(&pb, buf, len);
rmflags = (flags & RTP_FLAG_KEY) ? 2 : 0;
res = ff_rm_parse_packet(rdt->rmctx, &pb.pub, st, rdt->rmst[st->index],
len, pkt, &seq, rmflags, *timestamp);
diff --git a/libavformat/rtpdec_asf.c b/libavformat/rtpdec_asf.c
index 72ead6975a..20ca8295f9 100644
--- a/libavformat/rtpdec_asf.c
+++ b/libavformat/rtpdec_asf.c
@@ -210,7 +210,7 @@ static int asfrtp_parse_packet(AVFormatContext *s, PayloadContext *asf,
av_freep(&asf->buf);
- ffio_init_context(pb0, (uint8_t *)buf, len, 0, NULL, NULL, NULL, NULL);
+ ffio_init_read_context(pb0, buf, len);
while (avio_tell(pb) + 4 < len) {
int start_off = avio_tell(pb);
diff --git a/libavformat/rtpdec_qt.c b/libavformat/rtpdec_qt.c
index 495a3ec14e..b71055f8b8 100644
--- a/libavformat/rtpdec_qt.c
+++ b/libavformat/rtpdec_qt.c
@@ -85,7 +85,7 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt,
ret = init_get_bits(&gb, buf, len << 3);
if (ret < 0)
return ret;
- ffio_init_context(&pb0, (uint8_t*)buf, len, 0, NULL, NULL, NULL, NULL);
+ ffio_init_read_context(&pb0, buf, len);
if (len < 4)
return AVERROR_INVALIDDATA;
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index cfafb4be80..c4f78f97b0 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -2610,7 +2610,7 @@ static int rtp_read_header(AVFormatContext *s)
goto fail_nobuf;
avcodec_parameters_free(&par);
- ffio_init_context(&pb, sdp.str, sdp.len, 0, NULL, NULL, NULL, NULL);
+ ffio_init_read_context(&pb, sdp.str, sdp.len);
s->pb = &pb.pub;
/* if sdp_read_header() fails then following ff_network_close() cancels out */
diff --git a/libavformat/sapdec.c b/libavformat/sapdec.c
index fd0e662433..59141448f4 100644
--- a/libavformat/sapdec.c
+++ b/libavformat/sapdec.c
@@ -148,8 +148,7 @@ static int sap_read_header(AVFormatContext *s)
}
av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", sap->sdp);
- ffio_init_context(&sap->sdp_pb, sap->sdp, strlen(sap->sdp), 0, NULL, NULL,
- NULL, NULL);
+ ffio_init_read_context(&sap->sdp_pb, sap->sdp, strlen(sap->sdp));
infmt = av_find_input_format("sdp");
if (!infmt)
diff --git a/libavformat/subtitles.c b/libavformat/subtitles.c
index 6c221e4b29..3413763c7b 100644
--- a/libavformat/subtitles.c
+++ b/libavformat/subtitles.c
@@ -49,9 +49,9 @@ void ff_text_init_avio(void *s, FFTextReader *r, AVIOContext *pb)
"UTF16 is automatically converted to UTF8, do not specify a character encoding\n");
}
-void ff_text_init_buf(FFTextReader *r, void *buf, size_t size)
+void ff_text_init_buf(FFTextReader *r, const void *buf, size_t size)
{
- ffio_init_context(&r->buf_pb, buf, size, 0, NULL, NULL, NULL, NULL);
+ ffio_init_read_context(&r->buf_pb, buf, size);
ff_text_init_avio(NULL, r, &r->buf_pb.pub);
}
diff --git a/libavformat/subtitles.h b/libavformat/subtitles.h
index f6688b71d7..f4993fe20d 100644
--- a/libavformat/subtitles.h
+++ b/libavformat/subtitles.h
@@ -68,7 +68,7 @@ void ff_text_init_avio(void *s, FFTextReader *r, AVIOContext *pb);
* @param buf buffer to read from (referenced as long as FFTextReader is in use)
* @param size size of buf
*/
-void ff_text_init_buf(FFTextReader *r, void *buf, size_t size);
+void ff_text_init_buf(FFTextReader *r, const void *buf, size_t size);
/**
* Return the byte position of the next byte returned by ff_text_r8(). For
diff --git a/libavformat/vividas.c b/libavformat/vividas.c
index ed4e573df8..2f47d65c7c 100644
--- a/libavformat/vividas.c
+++ b/libavformat/vividas.c
@@ -277,7 +277,8 @@ static uint8_t *read_sb_block(AVIOContext *src, unsigned *size,
return buf;
}
-static int track_header(VividasDemuxContext *viv, AVFormatContext *s, uint8_t *buf, int size)
+static int track_header(VividasDemuxContext *viv, AVFormatContext *s,
+ const uint8_t *buf, int size)
{
int i, j, ret;
int64_t off;
@@ -286,7 +287,7 @@ static int track_header(VividasDemuxContext *viv, AVFormatContext *s, uint8_t *
FFIOContext pb0;
AVIOContext *const pb = &pb0.pub;
- ffio_init_context(&pb0, buf, size, 0, NULL, NULL, NULL, NULL);
+ ffio_init_read_context(&pb0, buf, size);
ffio_read_varlen(pb); // track_header_len
avio_r8(pb); // '1'
@@ -432,7 +433,8 @@ static int track_header(VividasDemuxContext *viv, AVFormatContext *s, uint8_t *
return 0;
}
-static int track_index(VividasDemuxContext *viv, AVFormatContext *s, uint8_t *buf, unsigned size)
+static int track_index(VividasDemuxContext *viv, AVFormatContext *s,
+ const uint8_t *buf, unsigned size)
{
int64_t off;
int64_t poff;
@@ -443,7 +445,7 @@ static int track_index(VividasDemuxContext *viv, AVFormatContext *s, uint8_t *bu
int64_t filesize = avio_size(s->pb);
uint64_t n_sb_blocks_tmp;
- ffio_init_context(&pb0, buf, size, 0, NULL, NULL, NULL, NULL);
+ ffio_init_read_context(&pb0, buf, size);
ffio_read_varlen(pb); // track_index_len
avio_r8(pb); // 'c'
--
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] 20+ messages in thread
* [FFmpeg-devel] [PATCH 5/7] avutil: Move error.h from avutil.h to common.h
2023-09-02 11:31 [FFmpeg-devel] [PATCH] avformat/avformat: Avoid including codec.h, frame.h Andreas Rheinhardt
` (2 preceding siblings ...)
2023-09-02 16:21 ` [FFmpeg-devel] [PATCH 4/7] avformat/aviobuf: Add ffio_init_(read|write)_context() Andreas Rheinhardt
@ 2023-09-02 16:21 ` Andreas Rheinhardt
2023-09-03 7:47 ` Paul B Mahol
2023-09-02 16:21 ` [FFmpeg-devel] [PATCH 6/7] avutil/mem: Don't include avutil.h Andreas Rheinhardt
` (7 subsequent siblings)
11 siblings, 1 reply; 20+ messages in thread
From: Andreas Rheinhardt @ 2023-09-02 16:21 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Up until now, avutil.h includes common.h which includes mem.h which
includes avutil.h, so that all these headers are in fact equivalent.
Yet mem.h does not need to include avutil.h at all and when it no longer
does, including common.h will no longer include error.h (included by
avutil.h) as well; change this by moving error.h to avutil.h, as error.h
is clearly a commonly used header.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavutil/avutil.h | 1 -
libavutil/common.h | 1 +
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavutil/avutil.h b/libavutil/avutil.h
index 64b68bdbd3..30bec192f1 100644
--- a/libavutil/avutil.h
+++ b/libavutil/avutil.h
@@ -294,7 +294,6 @@ char av_get_picture_type_char(enum AVPictureType pict_type);
*/
#include "common.h"
-#include "error.h"
#include "rational.h"
#include "version.h"
#include "macros.h"
diff --git a/libavutil/common.h b/libavutil/common.h
index fd1404be6c..de2140a678 100644
--- a/libavutil/common.h
+++ b/libavutil/common.h
@@ -40,6 +40,7 @@
#include <string.h>
#include "attributes.h"
+#include "error.h"
#include "macros.h"
//rounded division & shift
--
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] 20+ messages in thread
* [FFmpeg-devel] [PATCH 6/7] avutil/mem: Don't include avutil.h
2023-09-02 11:31 [FFmpeg-devel] [PATCH] avformat/avformat: Avoid including codec.h, frame.h Andreas Rheinhardt
` (3 preceding siblings ...)
2023-09-02 16:21 ` [FFmpeg-devel] [PATCH 5/7] avutil: Move error.h from avutil.h to common.h Andreas Rheinhardt
@ 2023-09-02 16:21 ` Andreas Rheinhardt
2023-09-03 7:43 ` Paul B Mahol
2023-09-04 14:05 ` Michael Niedermayer
2023-09-02 16:21 ` [FFmpeg-devel] [PATCH 7/7] avutil/avstring: Remove obsolete version.h inclusion Andreas Rheinhardt
` (6 subsequent siblings)
11 siblings, 2 replies; 20+ messages in thread
From: Andreas Rheinhardt @ 2023-09-02 16:21 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
It is not necessary at all. So remove it.
This also breaks an inclusion cycle mem.h->avutil.h->common.h->mem.h.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/avfft.c | 7 ++++---
libavcodec/avpacket.c | 1 +
libavcodec/dirac_dwt.c | 1 +
libavcodec/ffjni.c | 1 +
libavcodec/iirfilter.c | 4 ++++
libavcodec/jpegls.c | 1 +
libavcodec/kbdwin.c | 2 ++
libavcodec/mpc.c | 2 +-
libavcodec/tests/h264_levels.c | 6 +++++-
libavformat/protocols.c | 2 ++
libavutil/dict.c | 4 +++-
libavutil/encryption_info.c | 2 ++
libavutil/fifo.c | 1 +
libavutil/file.c | 1 +
libavutil/hash.c | 2 ++
libavutil/hmac.c | 1 +
libavutil/md5.c | 2 ++
libavutil/mem.h | 4 +---
libavutil/murmur3.c | 1 +
libavutil/tests/lzo.c | 2 ++
libavutil/tests/murmur3.c | 3 +++
libavutil/tests/pixdesc.c | 1 +
libavutil/threadmessage.c | 3 +++
libavutil/timestamp.h | 2 +-
libavutil/tx_priv.h | 1 +
tools/ffeval.c | 4 ++++
tools/zmqsend.c | 3 +++
27 files changed, 54 insertions(+), 10 deletions(-)
diff --git a/libavcodec/avfft.c b/libavcodec/avfft.c
index d07c495022..fb635abfff 100644
--- a/libavcodec/avfft.c
+++ b/libavcodec/avfft.c
@@ -16,13 +16,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <stddef.h>
+#include <string.h>
+
#include "libavutil/attributes.h"
+#include "libavutil/macros.h"
#include "libavutil/mem.h"
#include "libavutil/tx.h"
#include "avfft.h"
-#include "fft.h"
-#include "rdft.h"
-#include "dct.h"
typedef struct AVTXWrapper {
AVTXContext *ctx;
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 5fef65e97a..9ec1feb068 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -22,6 +22,7 @@
#include <string.h>
#include "libavutil/avassert.h"
+#include "libavutil/avutil.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mathematics.h"
#include "libavutil/mem.h"
diff --git a/libavcodec/dirac_dwt.c b/libavcodec/dirac_dwt.c
index 4039899cf0..d473f64daa 100644
--- a/libavcodec/dirac_dwt.c
+++ b/libavcodec/dirac_dwt.c
@@ -21,6 +21,7 @@
#include "libavutil/attributes.h"
#include "libavutil/common.h"
+#include "libavutil/log.h"
#include "dirac_dwt.h"
#define TEMPLATE_8bit
diff --git a/libavcodec/ffjni.c b/libavcodec/ffjni.c
index 154be9ae99..e3cf24d3e2 100644
--- a/libavcodec/ffjni.c
+++ b/libavcodec/ffjni.c
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include "libavutil/bprint.h"
+#include "libavutil/error.h"
#include "libavutil/log.h"
#include "libavutil/mem.h"
diff --git a/libavcodec/iirfilter.c b/libavcodec/iirfilter.c
index 903d64e8d4..727a370444 100644
--- a/libavcodec/iirfilter.c
+++ b/libavcodec/iirfilter.c
@@ -26,8 +26,12 @@
#include <math.h>
+#include "config.h"
+
#include "libavutil/attributes.h"
#include "libavutil/common.h"
+#include "libavutil/log.h"
+#include "libavutil/mem.h"
#include "iirfilter.h"
diff --git a/libavcodec/jpegls.c b/libavcodec/jpegls.c
index cc598f3c17..7b4bc30e46 100644
--- a/libavcodec/jpegls.c
+++ b/libavcodec/jpegls.c
@@ -28,6 +28,7 @@
#include <stddef.h>
#include "libavutil/internal.h"
#include "libavutil/intmath.h"
+#include "libavutil/log.h"
#include "jpegls.h"
void ff_jpegls_init_state(JLSState *state)
diff --git a/libavcodec/kbdwin.c b/libavcodec/kbdwin.c
index eacdb46774..ff7a7d614e 100644
--- a/libavcodec/kbdwin.c
+++ b/libavcodec/kbdwin.c
@@ -17,6 +17,8 @@
*/
#include "libavutil/avassert.h"
+#include "libavutil/error.h"
+#include "libavutil/libm.h"
#include "libavutil/mathematics.h"
#include "libavutil/attributes.h"
#include "libavutil/mem.h"
diff --git a/libavcodec/mpc.c b/libavcodec/mpc.c
index 6aa3e80927..46cb967cf1 100644
--- a/libavcodec/mpc.c
+++ b/libavcodec/mpc.c
@@ -27,7 +27,7 @@
*/
#include <string.h>
-#include "libavutil/intmath.h"
+#include "libavutil/common.h"
#include "mpegaudiodsp.h"
#include "mpc.h"
diff --git a/libavcodec/tests/h264_levels.c b/libavcodec/tests/h264_levels.c
index 98febcc41b..af3bfe01a6 100644
--- a/libavcodec/tests/h264_levels.c
+++ b/libavcodec/tests/h264_levels.c
@@ -16,7 +16,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "libavutil/common.h"
+#include <inttypes.h>
+#include <stddef.h>
+
+#include "libavutil/log.h"
+#include "libavutil/macros.h"
#include "libavcodec/h264_levels.h"
static const struct {
diff --git a/libavformat/protocols.c b/libavformat/protocols.c
index 9491dc7d00..360018b17c 100644
--- a/libavformat/protocols.c
+++ b/libavformat/protocols.c
@@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <string.h>
+
#include "libavutil/avstring.h"
#include "libavutil/log.h"
#include "libavutil/mem.h"
diff --git a/libavutil/dict.c b/libavutil/dict.c
index f673977a98..7f23d5336a 100644
--- a/libavutil/dict.c
+++ b/libavutil/dict.c
@@ -18,13 +18,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+#include <stdio.h>
#include <string.h>
#include "avassert.h"
#include "avstring.h"
#include "dict.h"
#include "dict_internal.h"
-#include "internal.h"
+#include "error.h"
#include "mem.h"
#include "time_internal.h"
#include "bprint.h"
diff --git a/libavutil/encryption_info.c b/libavutil/encryption_info.c
index 09486c4c85..e4ff015b37 100644
--- a/libavutil/encryption_info.c
+++ b/libavutil/encryption_info.c
@@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <string.h>
+
#include "encryption_info.h"
#include "mem.h"
#include "intreadwrite.h"
diff --git a/libavutil/fifo.c b/libavutil/fifo.c
index 51a5af6f39..9b32f708fc 100644
--- a/libavutil/fifo.c
+++ b/libavutil/fifo.c
@@ -293,6 +293,7 @@ void av_fifo_freep2(AVFifo **f)
#if FF_API_FIFO_OLD_API
+#include "internal.h"
FF_DISABLE_DEPRECATION_WARNINGS
#define OLD_FIFO_SIZE_MAX (size_t)FFMIN3(INT_MAX, UINT32_MAX, SIZE_MAX)
diff --git a/libavutil/file.c b/libavutil/file.c
index 6a2f3aa91c..cc17885bcc 100644
--- a/libavutil/file.c
+++ b/libavutil/file.c
@@ -17,6 +17,7 @@
*/
#include "config.h"
+#include "error.h"
#include "file.h"
#include "file_open.h"
#include "internal.h"
diff --git a/libavutil/hash.c b/libavutil/hash.c
index 9a49748189..12333982fb 100644
--- a/libavutil/hash.c
+++ b/libavutil/hash.c
@@ -20,6 +20,8 @@
#include <stddef.h>
#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
#include "hash.h"
#include "adler32.h"
diff --git a/libavutil/hmac.c b/libavutil/hmac.c
index 7d241fc73e..302d7b04cf 100644
--- a/libavutil/hmac.c
+++ b/libavutil/hmac.c
@@ -23,6 +23,7 @@
#include <string.h>
#include "attributes.h"
+#include "error.h"
#include "hmac.h"
#include "md5.h"
#include "sha.h"
diff --git a/libavutil/md5.c b/libavutil/md5.c
index 0170d8dd3f..c01820da2d 100644
--- a/libavutil/md5.c
+++ b/libavutil/md5.c
@@ -31,9 +31,11 @@
*/
#include <stdint.h>
+#include <string.h>
#include "bswap.h"
#include "intreadwrite.h"
+#include "macros.h"
#include "mem.h"
#include "md5.h"
diff --git a/libavutil/mem.h b/libavutil/mem.h
index 62b4ca6e50..ab7648ac57 100644
--- a/libavutil/mem.h
+++ b/libavutil/mem.h
@@ -27,12 +27,10 @@
#ifndef AVUTIL_MEM_H
#define AVUTIL_MEM_H
-#include <limits.h>
+#include <stddef.h>
#include <stdint.h>
#include "attributes.h"
-#include "avutil.h"
-#include "version.h"
/**
* @addtogroup lavu_mem
diff --git a/libavutil/murmur3.c b/libavutil/murmur3.c
index f2e2a9ea6c..c88a236a0c 100644
--- a/libavutil/murmur3.c
+++ b/libavutil/murmur3.c
@@ -20,6 +20,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <string.h>
#include "mem.h"
#include "intreadwrite.h"
#include "murmur3.h"
diff --git a/libavutil/tests/lzo.c b/libavutil/tests/lzo.c
index a5655dbfc5..d7a78a1696 100644
--- a/libavutil/tests/lzo.c
+++ b/libavutil/tests/lzo.c
@@ -19,6 +19,8 @@
*/
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include <lzo/lzo1x.h>
#include "libavutil/log.h"
diff --git a/libavutil/tests/murmur3.c b/libavutil/tests/murmur3.c
index b8d6b1feee..7a793dac47 100644
--- a/libavutil/tests/murmur3.c
+++ b/libavutil/tests/murmur3.c
@@ -18,6 +18,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+#include <stdio.h>
+
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "libavutil/murmur3.h"
diff --git a/libavutil/tests/pixdesc.c b/libavutil/tests/pixdesc.c
index 34e2bea932..b13aba598b 100644
--- a/libavutil/tests/pixdesc.c
+++ b/libavutil/tests/pixdesc.c
@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/log.h"
#include "libavutil/pixdesc.c"
int main(void){
diff --git a/libavutil/threadmessage.c b/libavutil/threadmessage.c
index f0e23f28fc..20b3882033 100644
--- a/libavutil/threadmessage.c
+++ b/libavutil/threadmessage.c
@@ -19,6 +19,9 @@
*/
#include <limits.h>
+#include <stddef.h>
+
+#include "error.h"
#include "fifo.h"
#include "mem.h"
#include "threadmessage.h"
diff --git a/libavutil/timestamp.h b/libavutil/timestamp.h
index e082f01b40..9ae64da8a1 100644
--- a/libavutil/timestamp.h
+++ b/libavutil/timestamp.h
@@ -24,7 +24,7 @@
#ifndef AVUTIL_TIMESTAMP_H
#define AVUTIL_TIMESTAMP_H
-#include "common.h"
+#include "avutil.h"
#if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS) && !defined(PRId64)
#error missing -D__STDC_FORMAT_MACROS / #define __STDC_FORMAT_MACROS
diff --git a/libavutil/tx_priv.h b/libavutil/tx_priv.h
index d5ff8e1421..d3fcdbf563 100644
--- a/libavutil/tx_priv.h
+++ b/libavutil/tx_priv.h
@@ -22,6 +22,7 @@
#include "tx.h"
#include "thread.h"
#include "mem_internal.h"
+#include "common.h"
#include "attributes.h"
#ifdef TX_FLOAT
diff --git a/tools/ffeval.c b/tools/ffeval.c
index 944f374727..0a925b390a 100644
--- a/tools/ffeval.c
+++ b/tools/ffeval.c
@@ -19,11 +19,15 @@
*/
#include "config.h"
+#include <stdio.h>
+#include <string.h>
#if HAVE_UNISTD_H
#include <unistd.h> /* getopt */
#endif
+#include "libavutil/error.h"
#include "libavutil/eval.h"
+#include "libavutil/log.h"
#include "libavutil/mem.h"
#if !HAVE_GETOPT
diff --git a/tools/zmqsend.c b/tools/zmqsend.c
index f26fa9c1c2..dc5d426cc8 100644
--- a/tools/zmqsend.c
+++ b/tools/zmqsend.c
@@ -20,8 +20,11 @@
#include "config.h"
+#include <stdio.h>
+#include <string.h>
#include <zmq.h>
+#include "libavutil/log.h"
#include "libavutil/mem.h"
#include "libavutil/bprint.h"
--
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] 20+ messages in thread
* [FFmpeg-devel] [PATCH 7/7] avutil/avstring: Remove obsolete version.h inclusion
2023-09-02 11:31 [FFmpeg-devel] [PATCH] avformat/avformat: Avoid including codec.h, frame.h Andreas Rheinhardt
` (4 preceding siblings ...)
2023-09-02 16:21 ` [FFmpeg-devel] [PATCH 6/7] avutil/mem: Don't include avutil.h Andreas Rheinhardt
@ 2023-09-02 16:21 ` Andreas Rheinhardt
2023-09-02 23:12 ` [FFmpeg-devel] [PATCH 8/8] all: Replace __FUNCTION__ by __func__ Andreas Rheinhardt
` (5 subsequent siblings)
11 siblings, 0 replies; 20+ messages in thread
From: Andreas Rheinhardt @ 2023-09-02 16:21 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Forgotten in 30e1e7e0f324d7bf66b3b8583a3e49fd3cd101b2.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavutil/avstring.c | 1 -
libavutil/avstring.h | 1 -
libavutil/spherical.c | 1 +
3 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/libavutil/avstring.c b/libavutil/avstring.c
index e460b5be7f..8751ce5576 100644
--- a/libavutil/avstring.c
+++ b/libavutil/avstring.c
@@ -32,7 +32,6 @@
#include "bprint.h"
#include "error.h"
#include "macros.h"
-#include "version.h"
int av_strstart(const char *str, const char *pfx, const char **ptr)
{
diff --git a/libavutil/avstring.h b/libavutil/avstring.h
index e260263763..fd2a7ab391 100644
--- a/libavutil/avstring.h
+++ b/libavutil/avstring.h
@@ -24,7 +24,6 @@
#include <stddef.h>
#include <stdint.h>
#include "attributes.h"
-#include "version.h"
/**
* @addtogroup lavu_string
diff --git a/libavutil/spherical.c b/libavutil/spherical.c
index ed66344a2f..800d3459a5 100644
--- a/libavutil/spherical.c
+++ b/libavutil/spherical.c
@@ -19,6 +19,7 @@
*/
#include "avstring.h"
+#include "macros.h"
#include "mem.h"
#include "spherical.h"
--
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] 20+ messages in thread
* [FFmpeg-devel] [PATCH 8/8] all: Replace __FUNCTION__ by __func__
2023-09-02 11:31 [FFmpeg-devel] [PATCH] avformat/avformat: Avoid including codec.h, frame.h Andreas Rheinhardt
` (5 preceding siblings ...)
2023-09-02 16:21 ` [FFmpeg-devel] [PATCH 7/7] avutil/avstring: Remove obsolete version.h inclusion Andreas Rheinhardt
@ 2023-09-02 23:12 ` Andreas Rheinhardt
2023-09-02 23:40 ` James Almer
2023-09-02 23:28 ` [FFmpeg-devel] [PATCH 9/9] avcodec/vp8data: Use <> for inclusion of stdint.h Andreas Rheinhardt
` (4 subsequent siblings)
11 siblings, 1 reply; 20+ messages in thread
From: Andreas Rheinhardt @ 2023-09-02 23:12 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Only the former is valid ISO C.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavdevice/opengl_enc.c | 2 +-
libavformat/apngdec.c | 2 +-
libavformat/demux.c | 4 ++--
libavformat/mux.c | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/libavdevice/opengl_enc.c b/libavdevice/opengl_enc.c
index 80feda7072..b2ac6eb16a 100644
--- a/libavdevice/opengl_enc.c
+++ b/libavdevice/opengl_enc.c
@@ -152,7 +152,7 @@ typedef struct FFOpenGLFunctions {
{\
GLenum err_code; \
if ((err_code = glGetError()) != GL_NO_ERROR) { \
- av_log(ctx, AV_LOG_ERROR, "OpenGL error occurred in '%s', line %d: %d\n", __FUNCTION__, __LINE__, err_code); \
+ av_log(ctx, AV_LOG_ERROR, "OpenGL error occurred in '%s', line %d: %d\n", __func__, __LINE__, err_code); \
goto fail; \
} \
}\
diff --git a/libavformat/apngdec.c b/libavformat/apngdec.c
index 47cdbfcbfb..8f5f37a2b1 100644
--- a/libavformat/apngdec.c
+++ b/libavformat/apngdec.c
@@ -274,7 +274,7 @@ static int decode_fctl_chunk(AVFormatContext *s, APNGDemuxContext *ctx, AVPacket
"delay_den: %"PRIu16", "
"dispose_op: %d, "
"blend_op: %d\n",
- __FUNCTION__,
+ __func__,
sequence_number,
width,
height,
diff --git a/libavformat/demux.c b/libavformat/demux.c
index b218f64574..b8a7a28c52 100644
--- a/libavformat/demux.c
+++ b/libavformat/demux.c
@@ -2533,7 +2533,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
if (codec && !avctx->codec)
if (avcodec_open2(avctx, codec, options ? &options[i] : &thread_opt) < 0)
av_log(ic, AV_LOG_WARNING,
- "Failed to open codec in %s\n",__FUNCTION__);
+ "Failed to open codec in %s\n", __func__);
}
if (!options)
av_dict_free(&thread_opt);
@@ -2790,7 +2790,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
av_dict_set(&opts, "codec_whitelist", ic->codec_whitelist, 0);
if (avcodec_open2(avctx, codec, (options && stream_index < orig_nb_streams) ? &options[stream_index] : &opts) < 0)
av_log(ic, AV_LOG_WARNING,
- "Failed to open codec in %s\n",__FUNCTION__);
+ "Failed to open codec in %s\n", __func__);
av_dict_free(&opts);
}
}
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 0cf9ebfc19..6c6c677171 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -1120,7 +1120,7 @@ static int write_packet_common(AVFormatContext *s, AVStream *st, AVPacket *pkt,
int ret;
if (s->debug & FF_FDEBUG_TS)
- av_log(s, AV_LOG_DEBUG, "%s size:%d dts:%s pts:%s\n", __FUNCTION__,
+ av_log(s, AV_LOG_DEBUG, "%s size:%d dts:%s pts:%s\n", __func__,
pkt->size, av_ts2str(pkt->dts), av_ts2str(pkt->pts));
guess_pkt_duration(s, st, pkt);
--
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] 20+ messages in thread
* [FFmpeg-devel] [PATCH 9/9] avcodec/vp8data: Use <> for inclusion of stdint.h
2023-09-02 11:31 [FFmpeg-devel] [PATCH] avformat/avformat: Avoid including codec.h, frame.h Andreas Rheinhardt
` (6 preceding siblings ...)
2023-09-02 23:12 ` [FFmpeg-devel] [PATCH 8/8] all: Replace __FUNCTION__ by __func__ Andreas Rheinhardt
@ 2023-09-02 23:28 ` Andreas Rheinhardt
2023-09-03 7:47 ` Paul B Mahol
2023-09-03 14:22 ` [FFmpeg-devel] [PATCH 10/11] avfilter/af_volume: Also deprecate position enum value Andreas Rheinhardt
` (3 subsequent siblings)
11 siblings, 1 reply; 20+ messages in thread
From: Andreas Rheinhardt @ 2023-09-02 23:28 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vp8data.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/vp8data.c b/libavcodec/vp8data.c
index a41fc872f5..857406928a 100644
--- a/libavcodec/vp8data.c
+++ b/libavcodec/vp8data.c
@@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "stdint.h"
+#include <stdint.h>
// cat 1 and 2 are defined in vp8data.h
static const uint8_t vp8_dct_cat3_prob[] = {
--
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] 20+ messages in thread
* Re: [FFmpeg-devel] [PATCH 8/8] all: Replace __FUNCTION__ by __func__
2023-09-02 23:12 ` [FFmpeg-devel] [PATCH 8/8] all: Replace __FUNCTION__ by __func__ Andreas Rheinhardt
@ 2023-09-02 23:40 ` James Almer
2023-09-03 9:05 ` Andreas Rheinhardt
0 siblings, 1 reply; 20+ messages in thread
From: James Almer @ 2023-09-02 23:40 UTC (permalink / raw)
To: ffmpeg-devel
On 9/2/2023 8:12 PM, Andreas Rheinhardt wrote:
> Only the former is valid ISO C.
Don't you mean "the latter"?
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> libavdevice/opengl_enc.c | 2 +-
> libavformat/apngdec.c | 2 +-
> libavformat/demux.c | 4 ++--
> libavformat/mux.c | 2 +-
> 4 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/libavdevice/opengl_enc.c b/libavdevice/opengl_enc.c
> index 80feda7072..b2ac6eb16a 100644
> --- a/libavdevice/opengl_enc.c
> +++ b/libavdevice/opengl_enc.c
> @@ -152,7 +152,7 @@ typedef struct FFOpenGLFunctions {
> {\
> GLenum err_code; \
> if ((err_code = glGetError()) != GL_NO_ERROR) { \
> - av_log(ctx, AV_LOG_ERROR, "OpenGL error occurred in '%s', line %d: %d\n", __FUNCTION__, __LINE__, err_code); \
> + av_log(ctx, AV_LOG_ERROR, "OpenGL error occurred in '%s', line %d: %d\n", __func__, __LINE__, err_code); \
> goto fail; \
> } \
> }\
> diff --git a/libavformat/apngdec.c b/libavformat/apngdec.c
> index 47cdbfcbfb..8f5f37a2b1 100644
> --- a/libavformat/apngdec.c
> +++ b/libavformat/apngdec.c
> @@ -274,7 +274,7 @@ static int decode_fctl_chunk(AVFormatContext *s, APNGDemuxContext *ctx, AVPacket
> "delay_den: %"PRIu16", "
> "dispose_op: %d, "
> "blend_op: %d\n",
> - __FUNCTION__,
> + __func__,
> sequence_number,
> width,
> height,
> diff --git a/libavformat/demux.c b/libavformat/demux.c
> index b218f64574..b8a7a28c52 100644
> --- a/libavformat/demux.c
> +++ b/libavformat/demux.c
> @@ -2533,7 +2533,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
> if (codec && !avctx->codec)
> if (avcodec_open2(avctx, codec, options ? &options[i] : &thread_opt) < 0)
> av_log(ic, AV_LOG_WARNING,
> - "Failed to open codec in %s\n",__FUNCTION__);
> + "Failed to open codec in %s\n", __func__);
> }
> if (!options)
> av_dict_free(&thread_opt);
> @@ -2790,7 +2790,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
> av_dict_set(&opts, "codec_whitelist", ic->codec_whitelist, 0);
> if (avcodec_open2(avctx, codec, (options && stream_index < orig_nb_streams) ? &options[stream_index] : &opts) < 0)
> av_log(ic, AV_LOG_WARNING,
> - "Failed to open codec in %s\n",__FUNCTION__);
> + "Failed to open codec in %s\n", __func__);
> av_dict_free(&opts);
> }
> }
> diff --git a/libavformat/mux.c b/libavformat/mux.c
> index 0cf9ebfc19..6c6c677171 100644
> --- a/libavformat/mux.c
> +++ b/libavformat/mux.c
> @@ -1120,7 +1120,7 @@ static int write_packet_common(AVFormatContext *s, AVStream *st, AVPacket *pkt,
> int ret;
>
> if (s->debug & FF_FDEBUG_TS)
> - av_log(s, AV_LOG_DEBUG, "%s size:%d dts:%s pts:%s\n", __FUNCTION__,
> + av_log(s, AV_LOG_DEBUG, "%s size:%d dts:%s pts:%s\n", __func__,
> pkt->size, av_ts2str(pkt->dts), av_ts2str(pkt->pts));
>
> guess_pkt_duration(s, st, pkt);
_______________________________________________
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] 20+ messages in thread
* Re: [FFmpeg-devel] [PATCH 6/7] avutil/mem: Don't include avutil.h
2023-09-02 16:21 ` [FFmpeg-devel] [PATCH 6/7] avutil/mem: Don't include avutil.h Andreas Rheinhardt
@ 2023-09-03 7:43 ` Paul B Mahol
2023-09-04 14:05 ` Michael Niedermayer
1 sibling, 0 replies; 20+ messages in thread
From: Paul B Mahol @ 2023-09-03 7:43 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Andreas Rheinhardt
probably ok
_______________________________________________
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] 20+ messages in thread
* Re: [FFmpeg-devel] [PATCH 9/9] avcodec/vp8data: Use <> for inclusion of stdint.h
2023-09-02 23:28 ` [FFmpeg-devel] [PATCH 9/9] avcodec/vp8data: Use <> for inclusion of stdint.h Andreas Rheinhardt
@ 2023-09-03 7:47 ` Paul B Mahol
0 siblings, 0 replies; 20+ messages in thread
From: Paul B Mahol @ 2023-09-03 7:47 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Andreas Rheinhardt
OK
_______________________________________________
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] 20+ messages in thread
* Re: [FFmpeg-devel] [PATCH 5/7] avutil: Move error.h from avutil.h to common.h
2023-09-02 16:21 ` [FFmpeg-devel] [PATCH 5/7] avutil: Move error.h from avutil.h to common.h Andreas Rheinhardt
@ 2023-09-03 7:47 ` Paul B Mahol
0 siblings, 0 replies; 20+ messages in thread
From: Paul B Mahol @ 2023-09-03 7:47 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Andreas Rheinhardt
Probably OK
_______________________________________________
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] 20+ messages in thread
* Re: [FFmpeg-devel] [PATCH 8/8] all: Replace __FUNCTION__ by __func__
2023-09-02 23:40 ` James Almer
@ 2023-09-03 9:05 ` Andreas Rheinhardt
0 siblings, 0 replies; 20+ messages in thread
From: Andreas Rheinhardt @ 2023-09-03 9:05 UTC (permalink / raw)
To: ffmpeg-devel
James Almer:
> On 9/2/2023 8:12 PM, Andreas Rheinhardt wrote:
>> Only the former is valid ISO C.
>
> Don't you mean "the latter"?
>
Yes. Thanks for noticing.
>>
>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
>> ---
>> libavdevice/opengl_enc.c | 2 +-
>> libavformat/apngdec.c | 2 +-
>> libavformat/demux.c | 4 ++--
>> libavformat/mux.c | 2 +-
>> 4 files changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/libavdevice/opengl_enc.c b/libavdevice/opengl_enc.c
>> index 80feda7072..b2ac6eb16a 100644
>> --- a/libavdevice/opengl_enc.c
>> +++ b/libavdevice/opengl_enc.c
>> @@ -152,7 +152,7 @@ typedef struct FFOpenGLFunctions {
>> {\
>> GLenum err_code; \
>> if ((err_code = glGetError()) != GL_NO_ERROR) { \
>> - av_log(ctx, AV_LOG_ERROR, "OpenGL error occurred in '%s',
>> line %d: %d\n", __FUNCTION__, __LINE__, err_code); \
>> + av_log(ctx, AV_LOG_ERROR, "OpenGL error occurred in '%s',
>> line %d: %d\n", __func__, __LINE__, err_code); \
>> goto fail; \
>> } \
>> }\
>> diff --git a/libavformat/apngdec.c b/libavformat/apngdec.c
>> index 47cdbfcbfb..8f5f37a2b1 100644
>> --- a/libavformat/apngdec.c
>> +++ b/libavformat/apngdec.c
>> @@ -274,7 +274,7 @@ static int decode_fctl_chunk(AVFormatContext *s,
>> APNGDemuxContext *ctx, AVPacket
>> "delay_den: %"PRIu16", "
>> "dispose_op: %d, "
>> "blend_op: %d\n",
>> - __FUNCTION__,
>> + __func__,
>> sequence_number,
>> width,
>> height,
>> diff --git a/libavformat/demux.c b/libavformat/demux.c
>> index b218f64574..b8a7a28c52 100644
>> --- a/libavformat/demux.c
>> +++ b/libavformat/demux.c
>> @@ -2533,7 +2533,7 @@ int avformat_find_stream_info(AVFormatContext
>> *ic, AVDictionary **options)
>> if (codec && !avctx->codec)
>> if (avcodec_open2(avctx, codec, options ?
>> &options[i] : &thread_opt) < 0)
>> av_log(ic, AV_LOG_WARNING,
>> - "Failed to open codec in %s\n",__FUNCTION__);
>> + "Failed to open codec in %s\n", __func__);
>> }
>> if (!options)
>> av_dict_free(&thread_opt);
>> @@ -2790,7 +2790,7 @@ int avformat_find_stream_info(AVFormatContext
>> *ic, AVDictionary **options)
>> av_dict_set(&opts, "codec_whitelist",
>> ic->codec_whitelist, 0);
>> if (avcodec_open2(avctx, codec, (options &&
>> stream_index < orig_nb_streams) ? &options[stream_index] : &opts) < 0)
>> av_log(ic, AV_LOG_WARNING,
>> - "Failed to open codec in
>> %s\n",__FUNCTION__);
>> + "Failed to open codec in %s\n",
>> __func__);
>> av_dict_free(&opts);
>> }
>> }
>> diff --git a/libavformat/mux.c b/libavformat/mux.c
>> index 0cf9ebfc19..6c6c677171 100644
>> --- a/libavformat/mux.c
>> +++ b/libavformat/mux.c
>> @@ -1120,7 +1120,7 @@ static int write_packet_common(AVFormatContext
>> *s, AVStream *st, AVPacket *pkt,
>> int ret;
>> if (s->debug & FF_FDEBUG_TS)
>> - av_log(s, AV_LOG_DEBUG, "%s size:%d dts:%s pts:%s\n",
>> __FUNCTION__,
>> + av_log(s, AV_LOG_DEBUG, "%s size:%d dts:%s pts:%s\n", __func__,
>> pkt->size, av_ts2str(pkt->dts), av_ts2str(pkt->pts));
>> guess_pkt_duration(s, st, pkt);
> _______________________________________________
> 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] 20+ messages in thread
* [FFmpeg-devel] [PATCH 10/11] avfilter/af_volume: Also deprecate position enum value
2023-09-02 11:31 [FFmpeg-devel] [PATCH] avformat/avformat: Avoid including codec.h, frame.h Andreas Rheinhardt
` (7 preceding siblings ...)
2023-09-02 23:28 ` [FFmpeg-devel] [PATCH 9/9] avcodec/vp8data: Use <> for inclusion of stdint.h Andreas Rheinhardt
@ 2023-09-03 14:22 ` Andreas Rheinhardt
2023-09-03 14:22 ` [FFmpeg-devel] [PATCH 11/11] avfilter/f_select: Also deprecate "pos" variable name Andreas Rheinhardt
` (2 subsequent siblings)
11 siblings, 0 replies; 20+ messages in thread
From: Andreas Rheinhardt @ 2023-09-03 14:22 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Forgotten in 27f8c9b27bce42a4a6a4c64e03fab769579c8683.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavfilter/af_volume.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavfilter/af_volume.h b/libavfilter/af_volume.h
index c97902969e..c3756ee969 100644
--- a/libavfilter/af_volume.h
+++ b/libavfilter/af_volume.h
@@ -47,7 +47,9 @@ enum VolumeVarName {
VAR_NB_CHANNELS,
VAR_NB_CONSUMED_SAMPLES,
VAR_NB_SAMPLES,
+#if FF_API_FRAME_PKT
VAR_POS,
+#endif
VAR_PTS,
VAR_SAMPLE_RATE,
VAR_STARTPTS,
--
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] 20+ messages in thread
* [FFmpeg-devel] [PATCH 11/11] avfilter/f_select: Also deprecate "pos" variable name
2023-09-02 11:31 [FFmpeg-devel] [PATCH] avformat/avformat: Avoid including codec.h, frame.h Andreas Rheinhardt
` (8 preceding siblings ...)
2023-09-03 14:22 ` [FFmpeg-devel] [PATCH 10/11] avfilter/af_volume: Also deprecate position enum value Andreas Rheinhardt
@ 2023-09-03 14:22 ` Andreas Rheinhardt
2023-09-04 14:17 ` [FFmpeg-devel] [PATCH v2 6/11] avutil/mem: Don't include avutil.h Andreas Rheinhardt
2023-09-06 9:36 ` [FFmpeg-devel] [PATCH] avformat/avformat: Avoid including codec.h, frame.h Andreas Rheinhardt
11 siblings, 0 replies; 20+ messages in thread
From: Andreas Rheinhardt @ 2023-09-03 14:22 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Forgotten in 27f8c9b27bce42a4a6a4c64e03fab769579c8683.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavfilter/f_select.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c
index 49fcdc31ff..64599f085a 100644
--- a/libavfilter/f_select.c
+++ b/libavfilter/f_select.c
@@ -82,7 +82,9 @@ static const char *const var_names[] = {
"prev_selected_n", ///< number of the last selected frame
"key", ///< tell if the frame is a key frame
+#if FF_API_FRAME_PKT
"pos", ///< original position in the file of the frame
+#endif
"scene",
--
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] 20+ messages in thread
* Re: [FFmpeg-devel] [PATCH 6/7] avutil/mem: Don't include avutil.h
2023-09-02 16:21 ` [FFmpeg-devel] [PATCH 6/7] avutil/mem: Don't include avutil.h Andreas Rheinhardt
2023-09-03 7:43 ` Paul B Mahol
@ 2023-09-04 14:05 ` Michael Niedermayer
2023-09-04 14:20 ` Andreas Rheinhardt
1 sibling, 1 reply; 20+ messages in thread
From: Michael Niedermayer @ 2023-09-04 14:05 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 4428 bytes --]
On Sat, Sep 02, 2023 at 06:21:40PM +0200, Andreas Rheinhardt wrote:
> It is not necessary at all. So remove it.
> This also breaks an inclusion cycle mem.h->avutil.h->common.h->mem.h.
the mingw64 build seems not to like this
In file included from src/libavutil/getenv_utf8.h:29:0,
from src/libavformat/ipfsgateway.c:24:
src/libavutil/wchar_filename.h: In function ‘utf8towchar’:
src/libavutil/wchar_filename.h:34:17: error: ‘EINVAL’ undeclared (first use in this function); did you mean ‘WINVER’?
errno = EINVAL;
^~~~~~
WINVER
src/libavutil/wchar_filename.h:34:17: note: each undeclared identifier is reported only once for each function it appears in
src/libavutil/wchar_filename.h:39:17: error: ‘ENOMEM’ undeclared (first use in this function)
errno = ENOMEM;
^~~~~~
src/libavutil/wchar_filename.h: In function ‘wchartocp’:
src/libavutil/wchar_filename.h:55:17: error: ‘EINVAL’ undeclared (first use in this function); did you mean ‘WINVER’?
errno = EINVAL;
^~~~~~
WINVER
src/libavutil/wchar_filename.h:60:17: error: ‘ENOMEM’ undeclared (first use in this function)
errno = ENOMEM;
^~~~~~
In file included from src/libavutil/getenv_utf8.h:29:0,
from src/libavformat/ipfsgateway.c:24:
src/libavutil/wchar_filename.h: In function ‘get_full_path_name’:
src/libavutil/wchar_filename.h:137:17: error: ‘EINVAL’ undeclared (first use in this function); did you mean ‘WINVER’?
errno = EINVAL;
^~~~~~
WINVER
src/libavutil/wchar_filename.h:143:17: error: ‘ENOMEM’ undeclared (first use in this function)
errno = ENOMEM;
^~~~~~
src/libavutil/wchar_filename.h: In function ‘add_extended_prefix’:
src/libavutil/wchar_filename.h:211:21: error: ‘ENOMEM’ undeclared (first use in this function)
errno = ENOMEM;
^~~~~~
src/ffbuild/common.mak:81: recipe for target 'libavformat/ipfsgateway.o' failed
make: *** [libavformat/ipfsgateway.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from src/libavutil/getenv_utf8.h:29:0,
from src/libavformat/http.c:33:
src/libavutil/wchar_filename.h: In function ‘utf8towchar’:
src/libavutil/wchar_filename.h:34:17: error: ‘EINVAL’ undeclared (first use in this function); did you mean ‘WINVER’?
errno = EINVAL;
^~~~~~
WINVER
src/libavutil/wchar_filename.h:34:17: note: each undeclared identifier is reported only once for each function it appears in
src/libavutil/wchar_filename.h:39:17: error: ‘ENOMEM’ undeclared (first use in this function)
errno = ENOMEM;
^~~~~~
src/libavutil/wchar_filename.h: In function ‘wchartocp’:
src/libavutil/wchar_filename.h:55:17: error: ‘EINVAL’ undeclared (first use in this function); did you mean ‘WINVER’?
errno = EINVAL;
^~~~~~
WINVER
src/libavutil/wchar_filename.h:60:17: error: ‘ENOMEM’ undeclared (first use in this function)
errno = ENOMEM;
^~~~~~
In file included from src/libavutil/getenv_utf8.h:29:0,
from src/libavformat/http.c:33:
src/libavutil/wchar_filename.h: In function ‘get_full_path_name’:
src/libavutil/wchar_filename.h:137:17: error: ‘EINVAL’ undeclared (first use in this function); did you mean ‘WINVER’?
errno = EINVAL;
^~~~~~
WINVER
src/libavutil/wchar_filename.h:143:17: error: ‘ENOMEM’ undeclared (first use in this function)
errno = ENOMEM;
^~~~~~
src/libavutil/wchar_filename.h: In function ‘add_extended_prefix’:
src/libavutil/wchar_filename.h:211:21: error: ‘ENOMEM’ undeclared (first use in this function)
errno = ENOMEM;
^~~~~~
src/ffbuild/common.mak:81: recipe for target 'libavformat/http.o' failed
make: *** [libavformat/http.o] Error 1
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
[-- 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] 20+ messages in thread
* [FFmpeg-devel] [PATCH v2 6/11] avutil/mem: Don't include avutil.h
2023-09-02 11:31 [FFmpeg-devel] [PATCH] avformat/avformat: Avoid including codec.h, frame.h Andreas Rheinhardt
` (9 preceding siblings ...)
2023-09-03 14:22 ` [FFmpeg-devel] [PATCH 11/11] avfilter/f_select: Also deprecate "pos" variable name Andreas Rheinhardt
@ 2023-09-04 14:17 ` Andreas Rheinhardt
2023-09-06 9:36 ` [FFmpeg-devel] [PATCH] avformat/avformat: Avoid including codec.h, frame.h Andreas Rheinhardt
11 siblings, 0 replies; 20+ messages in thread
From: Andreas Rheinhardt @ 2023-09-04 14:17 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
It is not necessary at all. So remove it.
This also breaks an inclusion cycle mem.h->avutil.h->common.h->mem.h.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/avfft.c | 7 ++++---
libavcodec/avpacket.c | 1 +
libavcodec/dirac_dwt.c | 1 +
libavcodec/ffjni.c | 1 +
libavcodec/iirfilter.c | 4 ++++
libavcodec/jpegls.c | 1 +
libavcodec/kbdwin.c | 2 ++
libavcodec/mpc.c | 2 +-
libavcodec/ppc/mpegaudiodsp_altivec.c | 2 ++
libavcodec/tests/h264_levels.c | 6 +++++-
libavformat/protocols.c | 2 ++
libavutil/dict.c | 4 +++-
libavutil/encryption_info.c | 2 ++
libavutil/fifo.c | 1 +
libavutil/file.c | 1 +
libavutil/hash.c | 2 ++
libavutil/hmac.c | 1 +
libavutil/md5.c | 2 ++
libavutil/mem.h | 4 +---
libavutil/murmur3.c | 1 +
libavutil/tests/lzo.c | 2 ++
libavutil/tests/murmur3.c | 3 +++
libavutil/tests/pixdesc.c | 1 +
libavutil/threadmessage.c | 3 +++
libavutil/timestamp.h | 2 +-
libavutil/tx_priv.h | 1 +
libavutil/wchar_filename.h | 2 ++
tools/ffeval.c | 4 ++++
tools/zmqsend.c | 3 +++
29 files changed, 58 insertions(+), 10 deletions(-)
diff --git a/libavcodec/avfft.c b/libavcodec/avfft.c
index d07c495022..fb635abfff 100644
--- a/libavcodec/avfft.c
+++ b/libavcodec/avfft.c
@@ -16,13 +16,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <stddef.h>
+#include <string.h>
+
#include "libavutil/attributes.h"
+#include "libavutil/macros.h"
#include "libavutil/mem.h"
#include "libavutil/tx.h"
#include "avfft.h"
-#include "fft.h"
-#include "rdft.h"
-#include "dct.h"
typedef struct AVTXWrapper {
AVTXContext *ctx;
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 5fef65e97a..9ec1feb068 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -22,6 +22,7 @@
#include <string.h>
#include "libavutil/avassert.h"
+#include "libavutil/avutil.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mathematics.h"
#include "libavutil/mem.h"
diff --git a/libavcodec/dirac_dwt.c b/libavcodec/dirac_dwt.c
index 4039899cf0..d473f64daa 100644
--- a/libavcodec/dirac_dwt.c
+++ b/libavcodec/dirac_dwt.c
@@ -21,6 +21,7 @@
#include "libavutil/attributes.h"
#include "libavutil/common.h"
+#include "libavutil/log.h"
#include "dirac_dwt.h"
#define TEMPLATE_8bit
diff --git a/libavcodec/ffjni.c b/libavcodec/ffjni.c
index 154be9ae99..e3cf24d3e2 100644
--- a/libavcodec/ffjni.c
+++ b/libavcodec/ffjni.c
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include "libavutil/bprint.h"
+#include "libavutil/error.h"
#include "libavutil/log.h"
#include "libavutil/mem.h"
diff --git a/libavcodec/iirfilter.c b/libavcodec/iirfilter.c
index 903d64e8d4..727a370444 100644
--- a/libavcodec/iirfilter.c
+++ b/libavcodec/iirfilter.c
@@ -26,8 +26,12 @@
#include <math.h>
+#include "config.h"
+
#include "libavutil/attributes.h"
#include "libavutil/common.h"
+#include "libavutil/log.h"
+#include "libavutil/mem.h"
#include "iirfilter.h"
diff --git a/libavcodec/jpegls.c b/libavcodec/jpegls.c
index cc598f3c17..7b4bc30e46 100644
--- a/libavcodec/jpegls.c
+++ b/libavcodec/jpegls.c
@@ -28,6 +28,7 @@
#include <stddef.h>
#include "libavutil/internal.h"
#include "libavutil/intmath.h"
+#include "libavutil/log.h"
#include "jpegls.h"
void ff_jpegls_init_state(JLSState *state)
diff --git a/libavcodec/kbdwin.c b/libavcodec/kbdwin.c
index eacdb46774..ff7a7d614e 100644
--- a/libavcodec/kbdwin.c
+++ b/libavcodec/kbdwin.c
@@ -17,6 +17,8 @@
*/
#include "libavutil/avassert.h"
+#include "libavutil/error.h"
+#include "libavutil/libm.h"
#include "libavutil/mathematics.h"
#include "libavutil/attributes.h"
#include "libavutil/mem.h"
diff --git a/libavcodec/mpc.c b/libavcodec/mpc.c
index 6aa3e80927..46cb967cf1 100644
--- a/libavcodec/mpc.c
+++ b/libavcodec/mpc.c
@@ -27,7 +27,7 @@
*/
#include <string.h>
-#include "libavutil/intmath.h"
+#include "libavutil/common.h"
#include "mpegaudiodsp.h"
#include "mpc.h"
diff --git a/libavcodec/ppc/mpegaudiodsp_altivec.c b/libavcodec/ppc/mpegaudiodsp_altivec.c
index 6794ed0928..b065203c4e 100644
--- a/libavcodec/ppc/mpegaudiodsp_altivec.c
+++ b/libavcodec/ppc/mpegaudiodsp_altivec.c
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <string.h>
+
#include "config.h"
#include "libavutil/attributes.h"
#include "libavutil/cpu.h"
diff --git a/libavcodec/tests/h264_levels.c b/libavcodec/tests/h264_levels.c
index 98febcc41b..af3bfe01a6 100644
--- a/libavcodec/tests/h264_levels.c
+++ b/libavcodec/tests/h264_levels.c
@@ -16,7 +16,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "libavutil/common.h"
+#include <inttypes.h>
+#include <stddef.h>
+
+#include "libavutil/log.h"
+#include "libavutil/macros.h"
#include "libavcodec/h264_levels.h"
static const struct {
diff --git a/libavformat/protocols.c b/libavformat/protocols.c
index 9491dc7d00..360018b17c 100644
--- a/libavformat/protocols.c
+++ b/libavformat/protocols.c
@@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <string.h>
+
#include "libavutil/avstring.h"
#include "libavutil/log.h"
#include "libavutil/mem.h"
diff --git a/libavutil/dict.c b/libavutil/dict.c
index f673977a98..7f23d5336a 100644
--- a/libavutil/dict.c
+++ b/libavutil/dict.c
@@ -18,13 +18,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+#include <stdio.h>
#include <string.h>
#include "avassert.h"
#include "avstring.h"
#include "dict.h"
#include "dict_internal.h"
-#include "internal.h"
+#include "error.h"
#include "mem.h"
#include "time_internal.h"
#include "bprint.h"
diff --git a/libavutil/encryption_info.c b/libavutil/encryption_info.c
index 09486c4c85..e4ff015b37 100644
--- a/libavutil/encryption_info.c
+++ b/libavutil/encryption_info.c
@@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <string.h>
+
#include "encryption_info.h"
#include "mem.h"
#include "intreadwrite.h"
diff --git a/libavutil/fifo.c b/libavutil/fifo.c
index 51a5af6f39..9b32f708fc 100644
--- a/libavutil/fifo.c
+++ b/libavutil/fifo.c
@@ -293,6 +293,7 @@ void av_fifo_freep2(AVFifo **f)
#if FF_API_FIFO_OLD_API
+#include "internal.h"
FF_DISABLE_DEPRECATION_WARNINGS
#define OLD_FIFO_SIZE_MAX (size_t)FFMIN3(INT_MAX, UINT32_MAX, SIZE_MAX)
diff --git a/libavutil/file.c b/libavutil/file.c
index 6a2f3aa91c..cc17885bcc 100644
--- a/libavutil/file.c
+++ b/libavutil/file.c
@@ -17,6 +17,7 @@
*/
#include "config.h"
+#include "error.h"
#include "file.h"
#include "file_open.h"
#include "internal.h"
diff --git a/libavutil/hash.c b/libavutil/hash.c
index 9a49748189..12333982fb 100644
--- a/libavutil/hash.c
+++ b/libavutil/hash.c
@@ -20,6 +20,8 @@
#include <stddef.h>
#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
#include "hash.h"
#include "adler32.h"
diff --git a/libavutil/hmac.c b/libavutil/hmac.c
index 7d241fc73e..302d7b04cf 100644
--- a/libavutil/hmac.c
+++ b/libavutil/hmac.c
@@ -23,6 +23,7 @@
#include <string.h>
#include "attributes.h"
+#include "error.h"
#include "hmac.h"
#include "md5.h"
#include "sha.h"
diff --git a/libavutil/md5.c b/libavutil/md5.c
index 0170d8dd3f..c01820da2d 100644
--- a/libavutil/md5.c
+++ b/libavutil/md5.c
@@ -31,9 +31,11 @@
*/
#include <stdint.h>
+#include <string.h>
#include "bswap.h"
#include "intreadwrite.h"
+#include "macros.h"
#include "mem.h"
#include "md5.h"
diff --git a/libavutil/mem.h b/libavutil/mem.h
index 62b4ca6e50..ab7648ac57 100644
--- a/libavutil/mem.h
+++ b/libavutil/mem.h
@@ -27,12 +27,10 @@
#ifndef AVUTIL_MEM_H
#define AVUTIL_MEM_H
-#include <limits.h>
+#include <stddef.h>
#include <stdint.h>
#include "attributes.h"
-#include "avutil.h"
-#include "version.h"
/**
* @addtogroup lavu_mem
diff --git a/libavutil/murmur3.c b/libavutil/murmur3.c
index f2e2a9ea6c..c88a236a0c 100644
--- a/libavutil/murmur3.c
+++ b/libavutil/murmur3.c
@@ -20,6 +20,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <string.h>
#include "mem.h"
#include "intreadwrite.h"
#include "murmur3.h"
diff --git a/libavutil/tests/lzo.c b/libavutil/tests/lzo.c
index a5655dbfc5..d7a78a1696 100644
--- a/libavutil/tests/lzo.c
+++ b/libavutil/tests/lzo.c
@@ -19,6 +19,8 @@
*/
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include <lzo/lzo1x.h>
#include "libavutil/log.h"
diff --git a/libavutil/tests/murmur3.c b/libavutil/tests/murmur3.c
index b8d6b1feee..7a793dac47 100644
--- a/libavutil/tests/murmur3.c
+++ b/libavutil/tests/murmur3.c
@@ -18,6 +18,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+#include <stdio.h>
+
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "libavutil/murmur3.h"
diff --git a/libavutil/tests/pixdesc.c b/libavutil/tests/pixdesc.c
index 34e2bea932..b13aba598b 100644
--- a/libavutil/tests/pixdesc.c
+++ b/libavutil/tests/pixdesc.c
@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/log.h"
#include "libavutil/pixdesc.c"
int main(void){
diff --git a/libavutil/threadmessage.c b/libavutil/threadmessage.c
index f0e23f28fc..20b3882033 100644
--- a/libavutil/threadmessage.c
+++ b/libavutil/threadmessage.c
@@ -19,6 +19,9 @@
*/
#include <limits.h>
+#include <stddef.h>
+
+#include "error.h"
#include "fifo.h"
#include "mem.h"
#include "threadmessage.h"
diff --git a/libavutil/timestamp.h b/libavutil/timestamp.h
index e082f01b40..9ae64da8a1 100644
--- a/libavutil/timestamp.h
+++ b/libavutil/timestamp.h
@@ -24,7 +24,7 @@
#ifndef AVUTIL_TIMESTAMP_H
#define AVUTIL_TIMESTAMP_H
-#include "common.h"
+#include "avutil.h"
#if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS) && !defined(PRId64)
#error missing -D__STDC_FORMAT_MACROS / #define __STDC_FORMAT_MACROS
diff --git a/libavutil/tx_priv.h b/libavutil/tx_priv.h
index d5ff8e1421..d3fcdbf563 100644
--- a/libavutil/tx_priv.h
+++ b/libavutil/tx_priv.h
@@ -22,6 +22,7 @@
#include "tx.h"
#include "thread.h"
#include "mem_internal.h"
+#include "common.h"
#include "attributes.h"
#ifdef TX_FLOAT
diff --git a/libavutil/wchar_filename.h b/libavutil/wchar_filename.h
index 4f87e6f88b..868a30b532 100644
--- a/libavutil/wchar_filename.h
+++ b/libavutil/wchar_filename.h
@@ -21,6 +21,8 @@
#ifdef _WIN32
+#include <errno.h>
+#include <stddef.h>
#include <windows.h>
#include "mem.h"
diff --git a/tools/ffeval.c b/tools/ffeval.c
index 944f374727..0a925b390a 100644
--- a/tools/ffeval.c
+++ b/tools/ffeval.c
@@ -19,11 +19,15 @@
*/
#include "config.h"
+#include <stdio.h>
+#include <string.h>
#if HAVE_UNISTD_H
#include <unistd.h> /* getopt */
#endif
+#include "libavutil/error.h"
#include "libavutil/eval.h"
+#include "libavutil/log.h"
#include "libavutil/mem.h"
#if !HAVE_GETOPT
diff --git a/tools/zmqsend.c b/tools/zmqsend.c
index f26fa9c1c2..dc5d426cc8 100644
--- a/tools/zmqsend.c
+++ b/tools/zmqsend.c
@@ -20,8 +20,11 @@
#include "config.h"
+#include <stdio.h>
+#include <string.h>
#include <zmq.h>
+#include "libavutil/log.h"
#include "libavutil/mem.h"
#include "libavutil/bprint.h"
--
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] 20+ messages in thread
* Re: [FFmpeg-devel] [PATCH 6/7] avutil/mem: Don't include avutil.h
2023-09-04 14:05 ` Michael Niedermayer
@ 2023-09-04 14:20 ` Andreas Rheinhardt
0 siblings, 0 replies; 20+ messages in thread
From: Andreas Rheinhardt @ 2023-09-04 14:20 UTC (permalink / raw)
To: ffmpeg-devel
Michael Niedermayer:
> On Sat, Sep 02, 2023 at 06:21:40PM +0200, Andreas Rheinhardt wrote:
>> It is not necessary at all. So remove it.
>> This also breaks an inclusion cycle mem.h->avutil.h->common.h->mem.h.
>
> the mingw64 build seems not to like this
>
> In file included from src/libavutil/getenv_utf8.h:29:0,
> from src/libavformat/ipfsgateway.c:24:
> src/libavutil/wchar_filename.h: In function ‘utf8towchar’:
> src/libavutil/wchar_filename.h:34:17: error: ‘EINVAL’ undeclared (first use in this function); did you mean ‘WINVER’?
> errno = EINVAL;
> ^~~~~~
> WINVER
> src/libavutil/wchar_filename.h:34:17: note: each undeclared identifier is reported only once for each function it appears in
> src/libavutil/wchar_filename.h:39:17: error: ‘ENOMEM’ undeclared (first use in this function)
> errno = ENOMEM;
> ^~~~~~
> src/libavutil/wchar_filename.h: In function ‘wchartocp’:
> src/libavutil/wchar_filename.h:55:17: error: ‘EINVAL’ undeclared (first use in this function); did you mean ‘WINVER’?
> errno = EINVAL;
> ^~~~~~
> WINVER
> src/libavutil/wchar_filename.h:60:17: error: ‘ENOMEM’ undeclared (first use in this function)
> errno = ENOMEM;
> ^~~~~~
> In file included from src/libavutil/getenv_utf8.h:29:0,
> from src/libavformat/ipfsgateway.c:24:
> src/libavutil/wchar_filename.h: In function ‘get_full_path_name’:
> src/libavutil/wchar_filename.h:137:17: error: ‘EINVAL’ undeclared (first use in this function); did you mean ‘WINVER’?
> errno = EINVAL;
> ^~~~~~
> WINVER
> src/libavutil/wchar_filename.h:143:17: error: ‘ENOMEM’ undeclared (first use in this function)
> errno = ENOMEM;
> ^~~~~~
> src/libavutil/wchar_filename.h: In function ‘add_extended_prefix’:
> src/libavutil/wchar_filename.h:211:21: error: ‘ENOMEM’ undeclared (first use in this function)
> errno = ENOMEM;
> ^~~~~~
> src/ffbuild/common.mak:81: recipe for target 'libavformat/ipfsgateway.o' failed
> make: *** [libavformat/ipfsgateway.o] Error 1
> make: *** Waiting for unfinished jobs....
> In file included from src/libavutil/getenv_utf8.h:29:0,
> from src/libavformat/http.c:33:
> src/libavutil/wchar_filename.h: In function ‘utf8towchar’:
> src/libavutil/wchar_filename.h:34:17: error: ‘EINVAL’ undeclared (first use in this function); did you mean ‘WINVER’?
> errno = EINVAL;
> ^~~~~~
> WINVER
> src/libavutil/wchar_filename.h:34:17: note: each undeclared identifier is reported only once for each function it appears in
> src/libavutil/wchar_filename.h:39:17: error: ‘ENOMEM’ undeclared (first use in this function)
> errno = ENOMEM;
> ^~~~~~
> src/libavutil/wchar_filename.h: In function ‘wchartocp’:
> src/libavutil/wchar_filename.h:55:17: error: ‘EINVAL’ undeclared (first use in this function); did you mean ‘WINVER’?
> errno = EINVAL;
> ^~~~~~
> WINVER
> src/libavutil/wchar_filename.h:60:17: error: ‘ENOMEM’ undeclared (first use in this function)
> errno = ENOMEM;
> ^~~~~~
> In file included from src/libavutil/getenv_utf8.h:29:0,
> from src/libavformat/http.c:33:
> src/libavutil/wchar_filename.h: In function ‘get_full_path_name’:
> src/libavutil/wchar_filename.h:137:17: error: ‘EINVAL’ undeclared (first use in this function); did you mean ‘WINVER’?
> errno = EINVAL;
> ^~~~~~
> WINVER
> src/libavutil/wchar_filename.h:143:17: error: ‘ENOMEM’ undeclared (first use in this function)
> errno = ENOMEM;
> ^~~~~~
> src/libavutil/wchar_filename.h: In function ‘add_extended_prefix’:
> src/libavutil/wchar_filename.h:211:21: error: ‘ENOMEM’ undeclared (first use in this function)
> errno = ENOMEM;
> ^~~~~~
> src/ffbuild/common.mak:81: recipe for target 'libavformat/http.o' failed
> make: *** [libavformat/http.o] Error 1
>
>
>
Thanks for testing. I tested mingw64, but not with http or ipfsgateway
enabled. But I could have found it via checkheaders (which passes now),
but didn't.
- 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] 20+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avformat/avformat: Avoid including codec.h, frame.h
2023-09-02 11:31 [FFmpeg-devel] [PATCH] avformat/avformat: Avoid including codec.h, frame.h Andreas Rheinhardt
` (10 preceding siblings ...)
2023-09-04 14:17 ` [FFmpeg-devel] [PATCH v2 6/11] avutil/mem: Don't include avutil.h Andreas Rheinhardt
@ 2023-09-06 9:36 ` Andreas Rheinhardt
11 siblings, 0 replies; 20+ messages in thread
From: Andreas Rheinhardt @ 2023-09-06 9:36 UTC (permalink / raw)
To: ffmpeg-devel
Andreas Rheinhardt:
> AVCodec is only ever used as an incomplete type (i.e. via a pointer
> to an AVCodec) in avformat.h and it is not really part of the core
> of avformat.h or libavformat; almost none of our internal users
> make use of it (and none make use of hwcontext.h, which is implicitly
> included). So switch to use struct AVCodec, but continue to include
> codec.h for external users for compatibility.
>
> Also, do the same for AVFrame and frame.h, which is implicitly included
> by codec.h (via lavu/hwcontext.h).
>
> Also, remove an unnecessary inclusion of <time.h>.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> libavdevice/alsa_enc.c | 1 +
> libavdevice/opengl_enc.c | 1 +
> libavdevice/pulse_audio_enc.c | 1 +
> libavdevice/xv.c | 1 +
> libavformat/asfdec_o.c | 2 ++
> libavformat/avformat.c | 2 ++
> libavformat/avformat.h | 29 ++++++++++++++++-------------
> libavformat/dashdec.c | 1 +
> libavformat/dashenc.c | 1 +
> libavformat/dhav.c | 2 ++
> libavformat/ftp.c | 1 +
> libavformat/hlsenc.c | 1 +
> libavformat/hlsplaylist.c | 1 +
> libavformat/http.c | 1 +
> libavformat/img2enc.c | 2 ++
> libavformat/internal.h | 4 ++--
> libavformat/mlvdec.c | 2 ++
> libavformat/mux.c | 2 ++
> libavformat/mux.h | 2 +-
> libavformat/mxfdec.c | 1 +
> libavformat/uncodedframecrcenc.c | 1 +
> libavformat/wavenc.c | 1 +
> libavformat/webmdashenc.c | 1 +
> libavformat/wtvdec.c | 1 +
> libavformat/yuv4mpegenc.c | 1 +
> 25 files changed, 47 insertions(+), 16 deletions(-)
>
> diff --git a/libavdevice/alsa_enc.c b/libavdevice/alsa_enc.c
> index 62a20c7ba4..4c7805065e 100644
> --- a/libavdevice/alsa_enc.c
> +++ b/libavdevice/alsa_enc.c
> @@ -39,6 +39,7 @@
>
> #include <alsa/asoundlib.h>
>
> +#include "libavutil/frame.h"
> #include "libavutil/internal.h"
> #include "libavutil/time.h"
>
> diff --git a/libavdevice/opengl_enc.c b/libavdevice/opengl_enc.c
> index 1b0cf5aa8f..80feda7072 100644
> --- a/libavdevice/opengl_enc.c
> +++ b/libavdevice/opengl_enc.c
> @@ -49,6 +49,7 @@
> #endif
>
> #include "libavutil/common.h"
> +#include "libavutil/frame.h"
> #include "libavutil/pixdesc.h"
> #include "libavutil/log.h"
> #include "libavutil/opt.h"
> diff --git a/libavdevice/pulse_audio_enc.c b/libavdevice/pulse_audio_enc.c
> index 3d8323233f..9e594c6424 100644
> --- a/libavdevice/pulse_audio_enc.c
> +++ b/libavdevice/pulse_audio_enc.c
> @@ -26,6 +26,7 @@
> #include "libavformat/mux.h"
> #include "libavformat/version.h"
> #include "libavutil/channel_layout.h"
> +#include "libavutil/frame.h"
> #include "libavutil/internal.h"
> #include "libavutil/opt.h"
> #include "libavutil/time.h"
> diff --git a/libavdevice/xv.c b/libavdevice/xv.c
> index 441f854121..b3d79d57a8 100644
> --- a/libavdevice/xv.c
> +++ b/libavdevice/xv.c
> @@ -32,6 +32,7 @@
> #include <X11/extensions/Xvlib.h>
> #include <sys/shm.h>
>
> +#include "libavutil/frame.h"
> #include "libavutil/opt.h"
> #include "libavutil/pixdesc.h"
> #include "libavutil/imgutils.h"
> diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c
> index 2b407c016f..10942ecfa0 100644
> --- a/libavformat/asfdec_o.c
> +++ b/libavformat/asfdec_o.c
> @@ -19,6 +19,8 @@
> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> */
>
> +#include <time.h>
> +
> #include "libavutil/attributes.h"
> #include "libavutil/common.h"
> #include "libavutil/dict.h"
> diff --git a/libavformat/avformat.c b/libavformat/avformat.c
> index 356b4de931..7ff0cf3429 100644
> --- a/libavformat/avformat.c
> +++ b/libavformat/avformat.c
> @@ -23,12 +23,14 @@
> #include "libavutil/avassert.h"
> #include "libavutil/avstring.h"
> #include "libavutil/channel_layout.h"
> +#include "libavutil/frame.h"
> #include "libavutil/intreadwrite.h"
> #include "libavutil/mem.h"
> #include "libavutil/opt.h"
> #include "libavutil/pixfmt.h"
> #include "libavutil/samplefmt.h"
> #include "libavcodec/avcodec.h"
> +#include "libavcodec/codec.h"
> #include "libavcodec/bsf.h"
> #include "libavcodec/codec_desc.h"
> #include "libavcodec/packet_internal.h"
> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> index 1916aa2dc5..10ee3c87c6 100644
> --- a/libavformat/avformat.h
> +++ b/libavformat/avformat.h
> @@ -307,10 +307,8 @@
> * @}
> */
>
> -#include <time.h>
> #include <stdio.h> /* FILE */
>
> -#include "libavcodec/codec.h"
> #include "libavcodec/codec_par.h"
> #include "libavcodec/defs.h"
> #include "libavcodec/packet.h"
> @@ -325,10 +323,13 @@
> * to avoid unnecessary rebuilds. When included externally, keep including
> * the full version information. */
> #include "libavformat/version.h"
> +
> +#include "libavutil/frame.h"
> +#include "libavcodec/codec.h"
> #endif
>
> struct AVFormatContext;
> -
> +struct AVFrame;
> struct AVDeviceInfoList;
>
> /**
> @@ -1569,7 +1570,7 @@ typedef struct AVFormatContext {
> * the same codec_id.
> * Demuxing: Set by user
> */
> - const AVCodec *video_codec;
> + const struct AVCodec *video_codec;
>
> /**
> * Forced audio codec.
> @@ -1577,7 +1578,7 @@ typedef struct AVFormatContext {
> * the same codec_id.
> * Demuxing: Set by user
> */
> - const AVCodec *audio_codec;
> + const struct AVCodec *audio_codec;
>
> /**
> * Forced subtitle codec.
> @@ -1585,7 +1586,7 @@ typedef struct AVFormatContext {
> * the same codec_id.
> * Demuxing: Set by user
> */
> - const AVCodec *subtitle_codec;
> + const struct AVCodec *subtitle_codec;
>
> /**
> * Forced data codec.
> @@ -1593,7 +1594,7 @@ typedef struct AVFormatContext {
> * the same codec_id.
> * Demuxing: Set by user
> */
> - const AVCodec *data_codec;
> + const struct AVCodec *data_codec;
>
> /**
> * Number of bytes to be written as padding in a metadata header.
> @@ -1842,7 +1843,7 @@ const AVClass *av_stream_get_class(void);
> *
> * @return newly created stream or NULL on error.
> */
> -AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c);
> +AVStream *avformat_new_stream(AVFormatContext *s, const struct AVCodec *c);
>
> /**
> * Wrap an existing array as stream side data.
> @@ -2076,7 +2077,7 @@ int av_find_best_stream(AVFormatContext *ic,
> enum AVMediaType type,
> int wanted_stream_nb,
> int related_stream,
> - const AVCodec **decoder_ret,
> + const struct AVCodec **decoder_ret,
> int flags);
>
> /**
> @@ -2352,7 +2353,7 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt);
> * See av_interleaved_write_uncoded_frame() for details.
> */
> int av_write_uncoded_frame(AVFormatContext *s, int stream_index,
> - AVFrame *frame);
> + struct AVFrame *frame);
>
> /**
> * Write an uncoded frame to an output media file.
> @@ -2371,7 +2372,7 @@ int av_write_uncoded_frame(AVFormatContext *s, int stream_index,
> * @return >=0 for success, a negative code on error
> */
> int av_interleaved_write_uncoded_frame(AVFormatContext *s, int stream_index,
> - AVFrame *frame);
> + struct AVFrame *frame);
>
> /**
> * Test whether a muxer supports uncoded frame.
> @@ -2759,7 +2760,8 @@ const struct AVCodecTag *avformat_get_mov_audio_tags(void);
> * @param frame the frame with the aspect ratio to be determined
> * @return the guessed (valid) sample_aspect_ratio, 0/1 if no idea
> */
> -AVRational av_guess_sample_aspect_ratio(AVFormatContext *format, AVStream *stream, AVFrame *frame);
> +AVRational av_guess_sample_aspect_ratio(AVFormatContext *format, AVStream *stream,
> + struct AVFrame *frame);
>
> /**
> * Guess the frame rate, based on both the container and codec information.
> @@ -2769,7 +2771,8 @@ AVRational av_guess_sample_aspect_ratio(AVFormatContext *format, AVStream *strea
> * @param frame the frame for which the frame rate should be determined, may be NULL
> * @return the guessed (valid) frame rate, 0/1 if no idea
> */
> -AVRational av_guess_frame_rate(AVFormatContext *ctx, AVStream *stream, AVFrame *frame);
> +AVRational av_guess_frame_rate(AVFormatContext *ctx, AVStream *stream,
> + struct AVFrame *frame);
>
> /**
> * Check if the stream st contained in s is matched by the stream specifier
> diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
> index 29d4680c68..f4af625814 100644
> --- a/libavformat/dashdec.c
> +++ b/libavformat/dashdec.c
> @@ -20,6 +20,7 @@
> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> */
> #include <libxml/parser.h>
> +#include <time.h>
> #include "libavutil/bprint.h"
> #include "libavutil/opt.h"
> #include "libavutil/time.h"
> diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
> index 17fe5f430c..69ceae2cbf 100644
> --- a/libavformat/dashenc.c
> +++ b/libavformat/dashenc.c
> @@ -22,6 +22,7 @@
>
> #include "config.h"
> #include "config_components.h"
> +#include <time.h>
> #if HAVE_UNISTD_H
> #include <unistd.h>
> #endif
> diff --git a/libavformat/dhav.c b/libavformat/dhav.c
> index 4e720f2a26..2ec4857f29 100644
> --- a/libavformat/dhav.c
> +++ b/libavformat/dhav.c
> @@ -20,6 +20,8 @@
> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> */
>
> +#include <time.h>
> +
> #include "libavutil/parseutils.h"
> #include "avio_internal.h"
> #include "avformat.h"
> diff --git a/libavformat/ftp.c b/libavformat/ftp.c
> index 883668b37b..f9b069a59e 100644
> --- a/libavformat/ftp.c
> +++ b/libavformat/ftp.c
> @@ -19,6 +19,7 @@
> */
>
> #include <string.h>
> +#include <time.h>
>
> #include "libavutil/avstring.h"
> #include "libavutil/internal.h"
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index 27d97f5f72..004bd25359 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -23,6 +23,7 @@
> #include "config.h"
> #include "config_components.h"
> #include <stdint.h>
> +#include <time.h>
> #if HAVE_UNISTD_H
> #include <unistd.h>
> #endif
> diff --git a/libavformat/hlsplaylist.c b/libavformat/hlsplaylist.c
> index 0e1dcc087f..2bf05f3c7c 100644
> --- a/libavformat/hlsplaylist.c
> +++ b/libavformat/hlsplaylist.c
> @@ -22,6 +22,7 @@
>
> #include "config.h"
> #include <stdint.h>
> +#include <time.h>
>
> #include "libavutil/time_internal.h"
>
> diff --git a/libavformat/http.c b/libavformat/http.c
> index fd931c2d8e..c0fe7c36d9 100644
> --- a/libavformat/http.c
> +++ b/libavformat/http.c
> @@ -22,6 +22,7 @@
> #include "config.h"
> #include "config_components.h"
>
> +#include <time.h>
> #if CONFIG_ZLIB
> #include <zlib.h>
> #endif /* CONFIG_ZLIB */
> diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c
> index 9b8ec06cea..526a11e5ee 100644
> --- a/libavformat/img2enc.c
> +++ b/libavformat/img2enc.c
> @@ -20,6 +20,8 @@
> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> */
>
> +#include <time.h>
> +
> #include "config_components.h"
>
> #include "libavutil/intreadwrite.h"
> diff --git a/libavformat/internal.h b/libavformat/internal.h
> index 53e70ccb53..051e8e2893 100644
> --- a/libavformat/internal.h
> +++ b/libavformat/internal.h
> @@ -566,8 +566,8 @@ void ff_parse_key_value(const char *str, ff_parse_key_val_cb callback_get_buf,
>
> enum AVCodecID ff_guess_image2_codec(const char *filename);
>
> -const AVCodec *ff_find_decoder(AVFormatContext *s, const AVStream *st,
> - enum AVCodecID codec_id);
> +const struct AVCodec *ff_find_decoder(AVFormatContext *s, const AVStream *st,
> + enum AVCodecID codec_id);
>
> /**
> * Set the time base and wrapping info for a given stream. This will be used
> diff --git a/libavformat/mlvdec.c b/libavformat/mlvdec.c
> index db3b77bb9b..b706898cb3 100644
> --- a/libavformat/mlvdec.c
> +++ b/libavformat/mlvdec.c
> @@ -24,6 +24,8 @@
> * Magic Lantern Video (MLV) demuxer
> */
>
> +#include <time.h>
> +
> #include "libavutil/imgutils.h"
> #include "libavutil/intreadwrite.h"
> #include "libavutil/rational.h"
> diff --git a/libavformat/mux.c b/libavformat/mux.c
> index 415bd3948f..fff8094341 100644
> --- a/libavformat/mux.c
> +++ b/libavformat/mux.c
> @@ -24,12 +24,14 @@
> #include "mux.h"
> #include "version.h"
> #include "libavcodec/bsf.h"
> +#include "libavcodec/codec_desc.h"
> #include "libavcodec/internal.h"
> #include "libavcodec/packet_internal.h"
> #include "libavutil/opt.h"
> #include "libavutil/dict.h"
> #include "libavutil/timestamp.h"
> #include "libavutil/avassert.h"
> +#include "libavutil/frame.h"
> #include "libavutil/internal.h"
> #include "libavutil/mathematics.h"
>
> diff --git a/libavformat/mux.h b/libavformat/mux.h
> index c2de45400c..9de5c2852a 100644
> --- a/libavformat/mux.h
> +++ b/libavformat/mux.h
> @@ -96,7 +96,7 @@ typedef struct FFOutputFormat {
> * by setting the pointer to NULL.
> */
> int (*write_uncoded_frame)(AVFormatContext *, int stream_index,
> - AVFrame **frame, unsigned flags);
> + struct AVFrame **frame, unsigned flags);
> /**
> * Returns device list with it properties.
> * @see avdevice_list_devices() for more details.
> diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> index 34230ece98..110b69b7c1 100644
> --- a/libavformat/mxfdec.c
> +++ b/libavformat/mxfdec.c
> @@ -45,6 +45,7 @@
> */
>
> #include <inttypes.h>
> +#include <time.h>
>
> #include "libavutil/aes.h"
> #include "libavutil/avstring.h"
> diff --git a/libavformat/uncodedframecrcenc.c b/libavformat/uncodedframecrcenc.c
> index 4c37ef6e5b..529b2f36cb 100644
> --- a/libavformat/uncodedframecrcenc.c
> +++ b/libavformat/uncodedframecrcenc.c
> @@ -21,6 +21,7 @@
> #include "libavutil/adler32.h"
> #include "libavutil/avassert.h"
> #include "libavutil/bprint.h"
> +#include "libavutil/frame.h"
> #include "libavutil/imgutils.h"
> #include "libavutil/pixdesc.h"
> #include "libavformat/mux.h"
> diff --git a/libavformat/wavenc.c b/libavformat/wavenc.c
> index c12c090934..82acb9ef0f 100644
> --- a/libavformat/wavenc.c
> +++ b/libavformat/wavenc.c
> @@ -32,6 +32,7 @@
>
> #include <stdint.h>
> #include <string.h>
> +#include <time.h>
>
> #include "libavutil/avstring.h"
> #include "libavutil/dict.h"
> diff --git a/libavformat/webmdashenc.c b/libavformat/webmdashenc.c
> index 0d6c4a2072..31ea3c6e8c 100644
> --- a/libavformat/webmdashenc.c
> +++ b/libavformat/webmdashenc.c
> @@ -29,6 +29,7 @@
> #include <float.h>
> #include <stdint.h>
> #include <string.h>
> +#include <time.h>
>
> #include "avformat.h"
> #include "matroska.h"
> diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c
> index 98128b7201..b29ea7a923 100644
> --- a/libavformat/wtvdec.c
> +++ b/libavformat/wtvdec.c
> @@ -26,6 +26,7 @@
> */
>
> #include <inttypes.h>
> +#include <time.h>
>
> #include "libavutil/channel_layout.h"
> #include "libavutil/intreadwrite.h"
> diff --git a/libavformat/yuv4mpegenc.c b/libavformat/yuv4mpegenc.c
> index 968ba2fa13..1d641eb9e4 100644
> --- a/libavformat/yuv4mpegenc.c
> +++ b/libavformat/yuv4mpegenc.c
> @@ -19,6 +19,7 @@
> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> */
>
> +#include "libavutil/frame.h"
> #include "libavutil/pixdesc.h"
> #include "avformat.h"
> #include "internal.h"
Will apply this patchset tomorrow unless there are objections.
- 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] 20+ messages in thread
end of thread, other threads:[~2023-09-06 9:35 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-02 11:31 [FFmpeg-devel] [PATCH] avformat/avformat: Avoid including codec.h, frame.h Andreas Rheinhardt
2023-09-02 16:21 ` [FFmpeg-devel] [PATCH 2/7] avcodec/defs: Add AV_PROFILE_* defines, deprecate FF_PROFILE_* defines Andreas Rheinhardt
2023-09-02 16:21 ` [FFmpeg-devel] [PATCH 3/7] avformat/mux: Only write HEADER marker if format has .write_header Andreas Rheinhardt
2023-09-02 16:21 ` [FFmpeg-devel] [PATCH 4/7] avformat/aviobuf: Add ffio_init_(read|write)_context() Andreas Rheinhardt
2023-09-02 16:21 ` [FFmpeg-devel] [PATCH 5/7] avutil: Move error.h from avutil.h to common.h Andreas Rheinhardt
2023-09-03 7:47 ` Paul B Mahol
2023-09-02 16:21 ` [FFmpeg-devel] [PATCH 6/7] avutil/mem: Don't include avutil.h Andreas Rheinhardt
2023-09-03 7:43 ` Paul B Mahol
2023-09-04 14:05 ` Michael Niedermayer
2023-09-04 14:20 ` Andreas Rheinhardt
2023-09-02 16:21 ` [FFmpeg-devel] [PATCH 7/7] avutil/avstring: Remove obsolete version.h inclusion Andreas Rheinhardt
2023-09-02 23:12 ` [FFmpeg-devel] [PATCH 8/8] all: Replace __FUNCTION__ by __func__ Andreas Rheinhardt
2023-09-02 23:40 ` James Almer
2023-09-03 9:05 ` Andreas Rheinhardt
2023-09-02 23:28 ` [FFmpeg-devel] [PATCH 9/9] avcodec/vp8data: Use <> for inclusion of stdint.h Andreas Rheinhardt
2023-09-03 7:47 ` Paul B Mahol
2023-09-03 14:22 ` [FFmpeg-devel] [PATCH 10/11] avfilter/af_volume: Also deprecate position enum value Andreas Rheinhardt
2023-09-03 14:22 ` [FFmpeg-devel] [PATCH 11/11] avfilter/f_select: Also deprecate "pos" variable name Andreas Rheinhardt
2023-09-04 14:17 ` [FFmpeg-devel] [PATCH v2 6/11] avutil/mem: Don't include avutil.h Andreas Rheinhardt
2023-09-06 9:36 ` [FFmpeg-devel] [PATCH] avformat/avformat: Avoid including codec.h, frame.h Andreas Rheinhardt
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