summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-09-02 14:57:41 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-09-07 00:39:02 +0200
commit8238bc0b5e3dba271217b1223a901b3f9713dc6e (patch)
tree2809c5b9d9b26042d584c92afeb76b059484c00f /libavformat
parent0c6e5f321bf5c4054e8b98232692465b342b42b4 (diff)
avcodec/defs: Add AV_PROFILE_* defines, deprecate FF_PROFILE_* defines
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>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/av1.c10
-rw-r--r--libavformat/hlsenc.c14
-rw-r--r--libavformat/matroskadec.c8
-rw-r--r--libavformat/matroskaenc.c6
-rw-r--r--libavformat/movenc.c8
-rw-r--r--libavformat/mpegts.c9
-rw-r--r--libavformat/mpegtsenc.c8
-rw-r--r--libavformat/mxfdec.c5
-rw-r--r--libavformat/mxfenc.c14
-rw-r--r--libavformat/vpcc.c14
10 files changed, 49 insertions, 47 deletions
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 0d6f153d18..638e07c13d 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"
@@ -3037,21 +3037,21 @@ static int mkv_parse_subtitle_codec(MatroskaTrack *track, AVStream *st,
// [0x30..0x37] are component tags utilized for
// non-mobile captioning service ("profile A").
if (component_tag >= 0x30 && component_tag <= 0x37) {
- par->profile = FF_PROFILE_ARIB_PROFILE_A;
+ par->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) {
- par->profile = FF_PROFILE_ARIB_PROFILE_C;
+ par->profile = AV_PROFILE_ARIB_PROFILE_C;
}
break;
default:
break;
}
- if (par->profile == FF_PROFILE_UNKNOWN)
+ if (par->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 696ae5a6c9..ab92263cd7 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1757,8 +1757,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;
}
@@ -4766,10 +4766,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 256407dd6d..a5977916bf 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;