1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/codec_internal: Add FFCodec, hide internal part of AVCodec

Up until now, codec.h contains both public and private parts
of AVCodec. This exposes the internals of AVCodec to users
and leads them into the temptation of actually using them
and forces us to forward-declare structures and types that
users can't use at all.

This commit changes this by adding a new structure FFCodec to
codec_internal.h that extends AVCodec, i.e. contains the public
AVCodec as first member; the private fields of AVCodec are moved
to this structure, leaving codec.h clean.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2022-03-16 21:09:54 +01:00
parent a688f3c13c
commit 20f9727018
513 changed files with 5330 additions and 5260 deletions

6
configure vendored
View File

@ -3985,8 +3985,8 @@ OUTDEV_LIST=$(find_things_extern muxer AVOutputFormat libavdevice/alldevices.c o
INDEV_LIST=$(find_things_extern demuxer AVInputFormat libavdevice/alldevices.c indev)
MUXER_LIST=$(find_things_extern muxer AVOutputFormat libavformat/allformats.c)
DEMUXER_LIST=$(find_things_extern demuxer AVInputFormat libavformat/allformats.c)
ENCODER_LIST=$(find_things_extern encoder AVCodec libavcodec/allcodecs.c)
DECODER_LIST=$(find_things_extern decoder AVCodec libavcodec/allcodecs.c)
ENCODER_LIST=$(find_things_extern encoder FFCodec libavcodec/allcodecs.c)
DECODER_LIST=$(find_things_extern decoder FFCodec libavcodec/allcodecs.c)
CODEC_LIST="
$ENCODER_LIST
$DECODER_LIST
@ -7867,7 +7867,7 @@ print_enabled_components(){
}
print_enabled_components libavfilter/filter_list.c AVFilter filter_list $FILTER_LIST
print_enabled_components libavcodec/codec_list.c AVCodec codec_list $CODEC_LIST
print_enabled_components libavcodec/codec_list.c FFCodec codec_list $CODEC_LIST
print_enabled_components libavcodec/parser_list.c AVCodecParser parser_list $PARSER_LIST
print_enabled_components libavcodec/bsf_list.c AVBitStreamFilter bitstream_filters $BSF_LIST
print_enabled_components libavformat/demuxer_list.c AVInputFormat demuxer_list $DEMUXER_LIST

View File

@ -145,13 +145,13 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
return avpkt->size;
}
const AVCodec ff_zero12v_decoder = {
.name = "012v",
.long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_012V,
const FFCodec ff_zero12v_decoder = {
.p.name = "012v",
.p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_012V,
.init = zero12v_decode_init,
.decode = zero12v_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -1027,15 +1027,15 @@ static av_cold int decode_init(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_fourxm_decoder = {
.name = "4xm",
.long_name = NULL_IF_CONFIG_SMALL("4X Movie"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_4XM,
const FFCodec ff_fourxm_decoder = {
.p.name = "4xm",
.p.long_name = NULL_IF_CONFIG_SMALL("4X Movie"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_4XM,
.priv_data_size = sizeof(FourXContext),
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};

View File

@ -174,14 +174,14 @@ static av_cold int decode_init(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_eightbps_decoder = {
.name = "8bps",
.long_name = NULL_IF_CONFIG_SMALL("QuickTime 8BPS video"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_8BPS,
const FFCodec ff_eightbps_decoder = {
.p.name = "8bps",
.p.long_name = NULL_IF_CONFIG_SMALL("QuickTime 8BPS video"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_8BPS,
.priv_data_size = sizeof(EightBpsContext),
.init = decode_init,
.decode = decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -188,33 +188,33 @@ static av_cold int eightsvx_decode_close(AVCodecContext *avctx)
}
#if CONFIG_EIGHTSVX_FIB_DECODER
const AVCodec ff_eightsvx_fib_decoder = {
.name = "8svx_fib",
.long_name = NULL_IF_CONFIG_SMALL("8SVX fibonacci"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_8SVX_FIB,
const FFCodec ff_eightsvx_fib_decoder = {
.p.name = "8svx_fib",
.p.long_name = NULL_IF_CONFIG_SMALL("8SVX fibonacci"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_8SVX_FIB,
.priv_data_size = sizeof (EightSvxContext),
.init = eightsvx_decode_init,
.decode = eightsvx_decode_frame,
.close = eightsvx_decode_close,
.capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
.p.capabilities = AV_CODEC_CAP_DR1,
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
AV_SAMPLE_FMT_NONE },
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif
#if CONFIG_EIGHTSVX_EXP_DECODER
const AVCodec ff_eightsvx_exp_decoder = {
.name = "8svx_exp",
.long_name = NULL_IF_CONFIG_SMALL("8SVX exponential"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_8SVX_EXP,
const FFCodec ff_eightsvx_exp_decoder = {
.p.name = "8svx_exp",
.p.long_name = NULL_IF_CONFIG_SMALL("8SVX exponential"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_8SVX_EXP,
.priv_data_size = sizeof (EightSvxContext),
.init = eightsvx_decode_init,
.decode = eightsvx_decode_frame,
.close = eightsvx_decode_close,
.capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
.p.capabilities = AV_CODEC_CAP_DR1,
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
AV_SAMPLE_FMT_NONE },
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -393,32 +393,32 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
#if CONFIG_A64MULTI_ENCODER
const AVCodec ff_a64multi_encoder = {
.name = "a64multi",
.long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_A64_MULTI,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
const FFCodec ff_a64multi_encoder = {
.p.name = "a64multi",
.p.long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_A64_MULTI,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
.priv_data_size = sizeof(A64Context),
.init = a64multi_encode_init,
.encode2 = a64multi_encode_frame,
.close = a64multi_close_encoder,
.pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE},
.p.pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE},
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif
#if CONFIG_A64MULTI5_ENCODER
const AVCodec ff_a64multi5_encoder = {
.name = "a64multi5",
.long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64, extended with 5th color (colram)"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_A64_MULTI5,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
const FFCodec ff_a64multi5_encoder = {
.p.name = "a64multi5",
.p.long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64, extended with 5th color (colram)"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_A64_MULTI5,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
.priv_data_size = sizeof(A64Context),
.init = a64multi_encode_init,
.encode2 = a64multi_encode_frame,
.close = a64multi_close_encoder,
.pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE},
.p.pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE},
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif

View File

@ -552,27 +552,27 @@ static av_cold int latm_decode_init(AVCodecContext *avctx)
return ret;
}
const AVCodec ff_aac_decoder = {
.name = "aac",
.long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_AAC,
const FFCodec ff_aac_decoder = {
.p.name = "aac",
.p.long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_AAC,
.priv_data_size = sizeof(AACContext),
.init = aac_decode_init,
.close = aac_decode_close,
.decode = aac_decode_frame,
.sample_fmts = (const enum AVSampleFormat[]) {
.p.sample_fmts = (const enum AVSampleFormat[]) {
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE
},
.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
#if FF_API_OLD_CHANNEL_LAYOUT
.channel_layouts = aac_channel_layout,
.p.channel_layouts = aac_channel_layout,
#endif
.ch_layouts = aac_ch_layout,
.p.ch_layouts = aac_ch_layout,
.flush = flush,
.priv_class = &aac_decoder_class,
.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
.p.priv_class = &aac_decoder_class,
.p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
};
/*
@ -580,24 +580,24 @@ const AVCodec ff_aac_decoder = {
in MPEG transport streams which only contain one program.
To do a more complex LATM demuxing a separate LATM demuxer should be used.
*/
const AVCodec ff_aac_latm_decoder = {
.name = "aac_latm",
.long_name = NULL_IF_CONFIG_SMALL("AAC LATM (Advanced Audio Coding LATM syntax)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_AAC_LATM,
const FFCodec ff_aac_latm_decoder = {
.p.name = "aac_latm",
.p.long_name = NULL_IF_CONFIG_SMALL("AAC LATM (Advanced Audio Coding LATM syntax)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_AAC_LATM,
.priv_data_size = sizeof(struct LATMContext),
.init = latm_decode_init,
.close = aac_decode_close,
.decode = latm_decode_frame,
.sample_fmts = (const enum AVSampleFormat[]) {
.p.sample_fmts = (const enum AVSampleFormat[]) {
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE
},
.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
#if FF_API_OLD_CHANNEL_LAYOUT
.channel_layouts = aac_channel_layout,
.p.channel_layouts = aac_channel_layout,
#endif
.ch_layouts = aac_ch_layout,
.p.ch_layouts = aac_ch_layout,
.flush = flush,
.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
.p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
};

View File

@ -450,24 +450,24 @@ static void apply_independent_coupling_fixed(AACContext *ac,
#include "aacdec_template.c"
const AVCodec ff_aac_fixed_decoder = {
.name = "aac_fixed",
.long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_AAC,
const FFCodec ff_aac_fixed_decoder = {
.p.name = "aac_fixed",
.p.long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_AAC,
.priv_data_size = sizeof(AACContext),
.init = aac_decode_init,
.close = aac_decode_close,
.decode = aac_decode_frame,
.sample_fmts = (const enum AVSampleFormat[]) {
.p.sample_fmts = (const enum AVSampleFormat[]) {
AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE
},
.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
#if FF_API_OLD_CHANNEL_LAYOUT
.channel_layouts = aac_channel_layout,
.p.channel_layouts = aac_channel_layout,
#endif
.ch_layouts = aac_ch_layout,
.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
.p.ch_layouts = aac_ch_layout,
.p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
.flush = flush,
};

View File

@ -1137,20 +1137,20 @@ static const AVCodecDefault aac_encode_defaults[] = {
{ NULL }
};
const AVCodec ff_aac_encoder = {
.name = "aac",
.long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_AAC,
const FFCodec ff_aac_encoder = {
.p.name = "aac",
.p.long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_AAC,
.priv_data_size = sizeof(AACEncContext),
.init = aac_encode_init,
.encode2 = aac_encode_frame,
.close = aac_encode_end,
.defaults = aac_encode_defaults,
.supported_samplerates = ff_mpeg4audio_sample_rates,
.p.supported_samplerates = ff_mpeg4audio_sample_rates,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP,
.p.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY,
.p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
.priv_class = &aacenc_class,
.p.priv_class = &aacenc_class,
};

View File

@ -150,15 +150,15 @@ static av_cold int aasc_decode_end(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_aasc_decoder = {
.name = "aasc",
.long_name = NULL_IF_CONFIG_SMALL("Autodesk RLE"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_AASC,
const FFCodec ff_aasc_decoder = {
.p.name = "aasc",
.p.long_name = NULL_IF_CONFIG_SMALL("Autodesk RLE"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_AASC,
.priv_data_size = sizeof(AascContext),
.init = aasc_decode_init,
.close = aasc_decode_end,
.decode = aasc_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -169,19 +169,19 @@ static const AVClass ac3_decoder_class = {
.version = LIBAVUTIL_VERSION_INT,
};
const AVCodec ff_ac3_fixed_decoder = {
.name = "ac3_fixed",
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_AC3,
const FFCodec ff_ac3_fixed_decoder = {
.p.name = "ac3_fixed",
.p.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_AC3,
.p.priv_class = &ac3_decoder_class,
.priv_data_size = sizeof (AC3DecodeContext),
.init = ac3_decode_init,
.close = ac3_decode_end,
.decode = ac3_decode_frame,
.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
.p.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
AV_CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_NONE },
.priv_class = &ac3_decoder_class,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};

View File

@ -59,38 +59,38 @@ static const AVClass ac3_eac3_decoder_class = {
.version = LIBAVUTIL_VERSION_INT,
};
const AVCodec ff_ac3_decoder = {
.name = "ac3",
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_AC3,
const FFCodec ff_ac3_decoder = {
.p.name = "ac3",
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_AC3,
.priv_data_size = sizeof (AC3DecodeContext),
.init = ac3_decode_init,
.close = ac3_decode_end,
.decode = ac3_decode_frame,
.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
.p.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
AV_CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
.p.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
.priv_class = &ac3_eac3_decoder_class,
.p.priv_class = &ac3_eac3_decoder_class,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};
#if CONFIG_EAC3_DECODER
const AVCodec ff_eac3_decoder = {
.name = "eac3",
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_EAC3,
const FFCodec ff_eac3_decoder = {
.p.name = "eac3",
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_EAC3,
.priv_data_size = sizeof (AC3DecodeContext),
.init = ac3_decode_init,
.close = ac3_decode_end,
.decode = ac3_decode_frame,
.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
.p.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
AV_CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52B (AC-3, E-AC-3)"),
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
.p.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52B (AC-3, E-AC-3)"),
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
.priv_class = &ac3_eac3_decoder_class,
.p.priv_class = &ac3_eac3_decoder_class,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};
#endif

View File

@ -120,25 +120,25 @@ static av_cold int ac3_fixed_encode_init(AVCodecContext *avctx)
FF_DISABLE_DEPRECATION_WARNINGS
const AVCodec ff_ac3_fixed_encoder = {
.name = "ac3_fixed",
.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_AC3,
.capabilities = AV_CODEC_CAP_DR1,
const FFCodec ff_ac3_fixed_encoder = {
.p.name = "ac3_fixed",
.p.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_AC3,
.p.capabilities = AV_CODEC_CAP_DR1,
.priv_data_size = sizeof(AC3EncodeContext),
.init = ac3_fixed_encode_init,
.encode2 = ff_ac3_fixed_encode_frame,
.close = ff_ac3_encode_close,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32P,
.p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32P,
AV_SAMPLE_FMT_NONE },
.priv_class = &ff_ac3enc_class,
.p.priv_class = &ff_ac3enc_class,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
.supported_samplerates = ff_ac3_sample_rate_tab,
.p.supported_samplerates = ff_ac3_sample_rate_tab,
#if FF_API_OLD_CHANNEL_LAYOUT
.channel_layouts = ff_ac3_channel_layouts,
.p.channel_layouts = ff_ac3_channel_layouts,
#endif
.ch_layouts = ff_ac3_ch_layouts,
.p.ch_layouts = ff_ac3_ch_layouts,
.defaults = ff_ac3_enc_defaults,
};
FF_ENABLE_DEPRECATION_WARNINGS

View File

@ -124,24 +124,24 @@ av_cold int ff_ac3_float_encode_init(AVCodecContext *avctx)
}
FF_DISABLE_DEPRECATION_WARNINGS
const AVCodec ff_ac3_encoder = {
.name = "ac3",
.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_AC3,
.capabilities = AV_CODEC_CAP_DR1,
const FFCodec ff_ac3_encoder = {
.p.name = "ac3",
.p.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_AC3,
.p.capabilities = AV_CODEC_CAP_DR1,
.priv_data_size = sizeof(AC3EncodeContext),
.init = ff_ac3_float_encode_init,
.encode2 = ff_ac3_float_encode_frame,
.close = ff_ac3_encode_close,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP,
.p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
.priv_class = &ff_ac3enc_class,
.supported_samplerates = ff_ac3_sample_rate_tab,
.p.priv_class = &ff_ac3enc_class,
.p.supported_samplerates = ff_ac3_sample_rate_tab,
#if FF_API_OLD_CHANNEL_LAYOUT
.channel_layouts = ff_ac3_channel_layouts,
.p.channel_layouts = ff_ac3_channel_layouts,
#endif
.ch_layouts = ff_ac3_ch_layouts,
.p.ch_layouts = ff_ac3_ch_layouts,
.defaults = ff_ac3_enc_defaults,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};

View File

@ -2286,17 +2286,17 @@ static const enum AVSampleFormat sample_fmts_both[] = { AV_SAMPLE_FMT_S16,
#define ADPCM_DECODER_0(id_, sample_fmts_, name_, long_name_)
#define ADPCM_DECODER_1(id_, sample_fmts_, name_, long_name_) \
const AVCodec ff_ ## name_ ## _decoder = { \
.name = #name_, \
.long_name = NULL_IF_CONFIG_SMALL(long_name_), \
.type = AVMEDIA_TYPE_AUDIO, \
.id = id_, \
const FFCodec ff_ ## name_ ## _decoder = { \
.p.name = #name_, \
.p.long_name = NULL_IF_CONFIG_SMALL(long_name_), \
.p.type = AVMEDIA_TYPE_AUDIO, \
.p.id = id_, \
.p.capabilities = AV_CODEC_CAP_DR1, \
.p.sample_fmts = sample_fmts_, \
.priv_data_size = sizeof(ADPCMDecodeContext), \
.init = adpcm_decode_init, \
.decode = adpcm_decode_frame, \
.flush = adpcm_flush, \
.capabilities = AV_CODEC_CAP_DR1, \
.sample_fmts = sample_fmts_, \
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, \
};
#define ADPCM_DECODER_2(enabled, codec_id, name, sample_fmts, long_name) \

View File

@ -996,20 +996,20 @@ static const AVClass adpcm_encoder_class = {
#define ADPCM_ENCODER_0(id_, name_, sample_fmts_, capabilities_, long_name_)
#define ADPCM_ENCODER_1(id_, name_, sample_fmts_, capabilities_, long_name_) \
const AVCodec ff_ ## name_ ## _encoder = { \
.name = #name_, \
.long_name = NULL_IF_CONFIG_SMALL(long_name_), \
.type = AVMEDIA_TYPE_AUDIO, \
.id = id_, \
const FFCodec ff_ ## name_ ## _encoder = { \
.p.name = #name_, \
.p.long_name = NULL_IF_CONFIG_SMALL(long_name_), \
.p.type = AVMEDIA_TYPE_AUDIO, \
.p.id = id_, \
.p.sample_fmts = sample_fmts_, \
.p.ch_layouts = ch_layouts, \
.p.capabilities = capabilities_ | AV_CODEC_CAP_DR1, \
.p.priv_class = &adpcm_encoder_class, \
.priv_data_size = sizeof(ADPCMEncodeContext), \
.init = adpcm_encode_init, \
.encode2 = adpcm_encode_frame, \
.close = adpcm_encode_close, \
.sample_fmts = sample_fmts_, \
.ch_layouts = ch_layouts, \
.capabilities = capabilities_ | AV_CODEC_CAP_DR1, \
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, \
.priv_class = &adpcm_encoder_class, \
};
#define ADPCM_ENCODER_2(enabled, codec_id, name, sample_fmts, capabilities, long_name) \
ADPCM_ENCODER_ ## enabled(codec_id, name, sample_fmts, capabilities, long_name)

View File

@ -191,18 +191,18 @@ static void adx_decode_flush(AVCodecContext *avctx)
c->eof = 0;
}
const AVCodec ff_adpcm_adx_decoder = {
.name = "adpcm_adx",
.long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX ADPCM"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_ADPCM_ADX,
const FFCodec ff_adpcm_adx_decoder = {
.p.name = "adpcm_adx",
.p.long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX ADPCM"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_ADPCM_ADX,
.priv_data_size = sizeof(ADXContext),
.init = adx_decode_init,
.decode = adx_decode_frame,
.flush = adx_decode_flush,
.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
.p.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_NONE },
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -189,16 +189,16 @@ static int adx_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
return 0;
}
const AVCodec ff_adpcm_adx_encoder = {
.name = "adpcm_adx",
.long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX ADPCM"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_ADPCM_ADX,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
const FFCodec ff_adpcm_adx_encoder = {
.p.name = "adpcm_adx",
.p.long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX ADPCM"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_ADPCM_ADX,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
.priv_data_size = sizeof(ADXContext),
.init = adx_encode_init,
.encode2 = adx_encode_frame,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16,
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -1286,17 +1286,17 @@ static av_cold int decode_close(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_agm_decoder = {
.name = "agm",
.long_name = NULL_IF_CONFIG_SMALL("Amuse Graphics Movie"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_AGM,
const FFCodec ff_agm_decoder = {
.p.name = "agm",
.p.long_name = NULL_IF_CONFIG_SMALL("Amuse Graphics Movie"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_AGM,
.p.capabilities = AV_CODEC_CAP_DR1,
.priv_data_size = sizeof(AGMContext),
.init = decode_init,
.close = decode_close,
.decode = decode_frame,
.flush = decode_flush,
.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
FF_CODEC_CAP_INIT_CLEANUP |
FF_CODEC_CAP_EXPORTS_CROPPING,

View File

@ -495,15 +495,15 @@ static av_cold int aic_decode_close(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_aic_decoder = {
.name = "aic",
.long_name = NULL_IF_CONFIG_SMALL("Apple Intermediate Codec"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_AIC,
const FFCodec ff_aic_decoder = {
.p.name = "aic",
.p.long_name = NULL_IF_CONFIG_SMALL("Apple Intermediate Codec"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_AIC,
.priv_data_size = sizeof(AICContext),
.init = aic_decode_init,
.close = aic_decode_close,
.decode = aic_decode_frame,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -611,16 +611,16 @@ static const AVClass alac_class = {
.version = LIBAVUTIL_VERSION_INT,
};
const AVCodec ff_alac_decoder = {
.name = "alac",
.long_name = NULL_IF_CONFIG_SMALL("ALAC (Apple Lossless Audio Codec)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_ALAC,
const FFCodec ff_alac_decoder = {
.p.name = "alac",
.p.long_name = NULL_IF_CONFIG_SMALL("ALAC (Apple Lossless Audio Codec)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_ALAC,
.priv_data_size = sizeof(ALACContext),
.init = alac_decode_init,
.close = alac_decode_close,
.decode = alac_decode_frame,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_CHANNEL_CONF,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_CHANNEL_CONF,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
.priv_class = &alac_class
.p.priv_class = &alac_class
};

View File

@ -649,22 +649,22 @@ static const AVClass alacenc_class = {
};
FF_DISABLE_DEPRECATION_WARNINGS
const AVCodec ff_alac_encoder = {
.name = "alac",
.long_name = NULL_IF_CONFIG_SMALL("ALAC (Apple Lossless Audio Codec)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_ALAC,
const FFCodec ff_alac_encoder = {
.p.name = "alac",
.p.long_name = NULL_IF_CONFIG_SMALL("ALAC (Apple Lossless Audio Codec)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_ALAC,
.priv_data_size = sizeof(AlacEncodeContext),
.priv_class = &alacenc_class,
.p.priv_class = &alacenc_class,
.init = alac_encode_init,
.encode2 = alac_encode_frame,
.close = alac_encode_close,
.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME,
.p.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME,
#if FF_API_OLD_CHANNEL_LAYOUT
.channel_layouts = alac_channel_layouts,
.p.channel_layouts = alac_channel_layouts,
#endif
.ch_layouts = ff_alac_ch_layouts,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32P,
.p.ch_layouts = ff_alac_ch_layouts,
.p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32P,
AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_NONE },
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,

View File

@ -23,6 +23,7 @@
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "internal.h"
#define ALIAS_HEADER_SIZE 10
@ -121,11 +122,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
return avpkt->size;
}
const AVCodec ff_alias_pix_decoder = {
.name = "alias_pix",
.long_name = NULL_IF_CONFIG_SMALL("Alias/Wavefront PIX image"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_ALIAS_PIX,
const FFCodec ff_alias_pix_decoder = {
.p.name = "alias_pix",
.p.long_name = NULL_IF_CONFIG_SMALL("Alias/Wavefront PIX image"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_ALIAS_PIX,
.p.capabilities = AV_CODEC_CAP_DR1,
.decode = decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
};

View File

@ -23,6 +23,7 @@
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "encode.h"
#define ALIAS_HEADER_SIZE 10
@ -100,13 +101,13 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
return 0;
}
const AVCodec ff_alias_pix_encoder = {
.name = "alias_pix",
.long_name = NULL_IF_CONFIG_SMALL("Alias/Wavefront PIX image"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_ALIAS_PIX,
const FFCodec ff_alias_pix_encoder = {
.p.name = "alias_pix",
.p.long_name = NULL_IF_CONFIG_SMALL("Alias/Wavefront PIX image"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_ALIAS_PIX,
.encode2 = encode_frame,
.pix_fmts = (const enum AVPixelFormat[]) {
.p.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_BGR24, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE
},
};

File diff suppressed because it is too large Load Diff

View File

@ -2176,16 +2176,16 @@ static av_cold void flush(AVCodecContext *avctx)
}
const AVCodec ff_als_decoder = {
.name = "als",
.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 Audio Lossless Coding (ALS)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_MP4ALS,
const FFCodec ff_als_decoder = {
.p.name = "als",
.p.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 Audio Lossless Coding (ALS)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_MP4ALS,
.priv_data_size = sizeof(ALSDecContext),
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
.flush = flush,
.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
.p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};

View File

@ -378,21 +378,21 @@ static const AVClass h264_amf_class = {
.version = LIBAVUTIL_VERSION_INT,
};
const AVCodec ff_h264_amf_encoder = {
.name = "h264_amf",
.long_name = NULL_IF_CONFIG_SMALL("AMD AMF H.264 Encoder"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_H264,
const FFCodec ff_h264_amf_encoder = {
.p.name = "h264_amf",
.p.long_name = NULL_IF_CONFIG_SMALL("AMD AMF H.264 Encoder"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_H264,
.init = amf_encode_init_h264,
.receive_packet = ff_amf_receive_packet,
.close = ff_amf_encode_close,
.priv_data_size = sizeof(AmfContext),
.priv_class = &h264_amf_class,
.p.priv_class = &h264_amf_class,
.defaults = defaults,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE |
.p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE |
AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.pix_fmts = ff_amf_pix_fmts,
.wrapper_name = "amf",
.p.pix_fmts = ff_amf_pix_fmts,
.p.wrapper_name = "amf",
.hw_configs = ff_amfenc_hw_configs,
};

View File

@ -310,21 +310,21 @@ static const AVClass hevc_amf_class = {
.version = LIBAVUTIL_VERSION_INT,
};
const AVCodec ff_hevc_amf_encoder = {
.name = "hevc_amf",
.long_name = NULL_IF_CONFIG_SMALL("AMD AMF HEVC encoder"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_HEVC,
const FFCodec ff_hevc_amf_encoder = {
.p.name = "hevc_amf",
.p.long_name = NULL_IF_CONFIG_SMALL("AMD AMF HEVC encoder"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_HEVC,
.init = amf_encode_init_hevc,
.receive_packet = ff_amf_receive_packet,
.close = ff_amf_encode_close,
.priv_data_size = sizeof(AmfContext),
.priv_class = &hevc_amf_class,
.p.priv_class = &hevc_amf_class,
.defaults = defaults,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE |
.p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE |
AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.pix_fmts = ff_amf_pix_fmts,
.wrapper_name = "amf",
.p.pix_fmts = ff_amf_pix_fmts,
.p.wrapper_name = "amf",
.hw_configs = ff_amfenc_hw_configs,
};

View File

@ -1097,16 +1097,16 @@ static int amrnb_decode_frame(AVCodecContext *avctx, void *data,
}
const AVCodec ff_amrnb_decoder = {
.name = "amrnb",
.long_name = NULL_IF_CONFIG_SMALL("AMR-NB (Adaptive Multi-Rate NarrowBand)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_AMR_NB,
const FFCodec ff_amrnb_decoder = {
.p.name = "amrnb",
.p.long_name = NULL_IF_CONFIG_SMALL("AMR-NB (Adaptive Multi-Rate NarrowBand)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_AMR_NB,
.priv_data_size = sizeof(AMRChannelsContext),
.init = amrnb_decode_init,
.decode = amrnb_decode_frame,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
.p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -1293,16 +1293,16 @@ static int amrwb_decode_frame(AVCodecContext *avctx, void *data,
return avpkt->size;
}
const AVCodec ff_amrwb_decoder = {
.name = "amrwb",
.long_name = NULL_IF_CONFIG_SMALL("AMR-WB (Adaptive Multi-Rate WideBand)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_AMR_WB,
const FFCodec ff_amrwb_decoder = {
.p.name = "amrwb",
.p.long_name = NULL_IF_CONFIG_SMALL("AMR-WB (Adaptive Multi-Rate WideBand)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_AMR_WB,
.priv_data_size = sizeof(AMRWBChannelsContext),
.init = amrwb_decode_init,
.decode = amrwb_decode_frame,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
.p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT,
AV_SAMPLE_FMT_NONE },
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -190,15 +190,15 @@ static av_cold int decode_end(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_anm_decoder = {
.name = "anm",
.long_name = NULL_IF_CONFIG_SMALL("Deluxe Paint Animation"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_ANM,
const FFCodec ff_anm_decoder = {
.p.name = "anm",
.p.long_name = NULL_IF_CONFIG_SMALL("Deluxe Paint Animation"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_ANM,
.priv_data_size = sizeof(AnmContext),
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -481,16 +481,16 @@ static const AVCodecDefault ansi_defaults[] = {
{ NULL },
};
const AVCodec ff_ansi_decoder = {
.name = "ansi",
.long_name = NULL_IF_CONFIG_SMALL("ASCII/ANSI art"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_ANSI,
const FFCodec ff_ansi_decoder = {
.p.name = "ansi",
.p.long_name = NULL_IF_CONFIG_SMALL("ASCII/ANSI art"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_ANSI,
.priv_data_size = sizeof(AnsiContext),
.init = decode_init,
.close = decode_close,
.decode = decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
.defaults = ansi_defaults,
};

View File

@ -1659,22 +1659,22 @@ static const AVClass ape_decoder_class = {
.version = LIBAVUTIL_VERSION_INT,
};
const AVCodec ff_ape_decoder = {
.name = "ape",
.long_name = NULL_IF_CONFIG_SMALL("Monkey's Audio"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_APE,
const FFCodec ff_ape_decoder = {
.p.name = "ape",
.p.long_name = NULL_IF_CONFIG_SMALL("Monkey's Audio"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_APE,
.priv_data_size = sizeof(APEContext),
.init = ape_decode_init,
.close = ape_decode_close,
.decode = ape_decode_frame,
.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DELAY |
.p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DELAY |
AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
.flush = ape_flush,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_S32P,
AV_SAMPLE_FMT_NONE },
.priv_class = &ape_decoder_class,
.p.priv_class = &ape_decoder_class,
};

View File

@ -175,41 +175,41 @@ static int aptx_decode_frame(AVCodecContext *avctx, void *data,
}
#if CONFIG_APTX_DECODER
const AVCodec ff_aptx_decoder = {
.name = "aptx",
.long_name = NULL_IF_CONFIG_SMALL("aptX (Audio Processing Technology for Bluetooth)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_APTX,
const FFCodec ff_aptx_decoder = {
.p.name = "aptx",
.p.long_name = NULL_IF_CONFIG_SMALL("aptX (Audio Processing Technology for Bluetooth)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_APTX,
.priv_data_size = sizeof(AptXContext),
.init = ff_aptx_init,
.decode = aptx_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
#if FF_API_OLD_CHANNEL_LAYOUT
.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0},
.p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0},
#endif
.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } },
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P,
.p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } },
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P,
AV_SAMPLE_FMT_NONE },
};
#endif
#if CONFIG_APTX_HD_DECODER
const AVCodec ff_aptx_hd_decoder = {
.name = "aptx_hd",
.long_name = NULL_IF_CONFIG_SMALL("aptX HD (Audio Processing Technology for Bluetooth)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_APTX_HD,
const FFCodec ff_aptx_hd_decoder = {
.p.name = "aptx_hd",
.p.long_name = NULL_IF_CONFIG_SMALL("aptX HD (Audio Processing Technology for Bluetooth)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_APTX_HD,
.priv_data_size = sizeof(AptXContext),
.init = ff_aptx_init,
.decode = aptx_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
#if FF_API_OLD_CHANNEL_LAYOUT
.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0},
.p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0},
#endif
.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } },
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P,
.p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } },
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P,
AV_SAMPLE_FMT_NONE },
};
#endif

View File

@ -245,45 +245,45 @@ static av_cold int aptx_close(AVCodecContext *avctx)
}
#if CONFIG_APTX_ENCODER
const AVCodec ff_aptx_encoder = {
.name = "aptx",
.long_name = NULL_IF_CONFIG_SMALL("aptX (Audio Processing Technology for Bluetooth)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_APTX,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME,
const FFCodec ff_aptx_encoder = {
.p.name = "aptx",
.p.long_name = NULL_IF_CONFIG_SMALL("aptX (Audio Processing Technology for Bluetooth)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_APTX,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME,
.priv_data_size = sizeof(AptXContext),
.init = ff_aptx_init,
.encode2 = aptx_encode_frame,
.close = aptx_close,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
#if FF_API_OLD_CHANNEL_LAYOUT
.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0},
.p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0},
#endif
.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } },
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P,
.p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } },
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P,
AV_SAMPLE_FMT_NONE },
.supported_samplerates = (const int[]) {8000, 16000, 24000, 32000, 44100, 48000, 0},
.p.supported_samplerates = (const int[]) {8000, 16000, 24000, 32000, 44100, 48000, 0},
};
#endif
#if CONFIG_APTX_HD_ENCODER
const AVCodec ff_aptx_hd_encoder = {
.name = "aptx_hd",
.long_name = NULL_IF_CONFIG_SMALL("aptX HD (Audio Processing Technology for Bluetooth)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_APTX_HD,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME,
const FFCodec ff_aptx_hd_encoder = {
.p.name = "aptx_hd",
.p.long_name = NULL_IF_CONFIG_SMALL("aptX HD (Audio Processing Technology for Bluetooth)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_APTX_HD,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME,
.priv_data_size = sizeof(AptXContext),
.init = ff_aptx_init,
.encode2 = aptx_encode_frame,
.close = aptx_close,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
#if FF_API_OLD_CHANNEL_LAYOUT
.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0},
.p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0},
#endif
.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } },
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P,
.p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } },
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P,
AV_SAMPLE_FMT_NONE },
.supported_samplerates = (const int[]) {8000, 16000, 24000, 32000, 44100, 48000, 0},
.p.supported_samplerates = (const int[]) {8000, 16000, 24000, 32000, 44100, 48000, 0},
};
#endif

View File

@ -212,16 +212,16 @@ static av_cold int decode_close(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_arbc_decoder = {
.name = "arbc",
.long_name = NULL_IF_CONFIG_SMALL("Gryphon's Anim Compressor"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_ARBC,
const FFCodec ff_arbc_decoder = {
.p.name = "arbc",
.p.long_name = NULL_IF_CONFIG_SMALL("Gryphon's Anim Compressor"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_ARBC,
.priv_data_size = sizeof(ARBCContext),
.init = decode_init,
.decode = decode_frame,
.flush = decode_flush,
.close = decode_close,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};

View File

@ -733,16 +733,16 @@ static av_cold int decode_close(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_argo_decoder = {
.name = "argo",
.long_name = NULL_IF_CONFIG_SMALL("Argonaut Games Video"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_ARGO,
const FFCodec ff_argo_decoder = {
.p.name = "argo",
.p.long_name = NULL_IF_CONFIG_SMALL("Argonaut Games Video"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_ARGO,
.priv_data_size = sizeof(ArgoContext),
.init = decode_init,
.decode = decode_frame,
.flush = decode_flush,
.close = decode_close,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};

View File

@ -64,11 +64,11 @@ static int ass_decode_frame(AVCodecContext *avctx, void *data, int *got_sub_ptr,
}
#if CONFIG_SSA_DECODER
const AVCodec ff_ssa_decoder = {
.name = "ssa",
.long_name = NULL_IF_CONFIG_SMALL("ASS (Advanced SubStation Alpha) subtitle"),
.type = AVMEDIA_TYPE_SUBTITLE,
.id = AV_CODEC_ID_ASS,
const FFCodec ff_ssa_decoder = {
.p.name = "ssa",
.p.long_name = NULL_IF_CONFIG_SMALL("ASS (Advanced SubStation Alpha) subtitle"),
.p.type = AVMEDIA_TYPE_SUBTITLE,
.p.id = AV_CODEC_ID_ASS,
.init = ass_decode_init,
.decode = ass_decode_frame,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
@ -76,11 +76,11 @@ const AVCodec ff_ssa_decoder = {
#endif
#if CONFIG_ASS_DECODER
const AVCodec ff_ass_decoder = {
.name = "ass",
.long_name = NULL_IF_CONFIG_SMALL("ASS (Advanced SubStation Alpha) subtitle"),
.type = AVMEDIA_TYPE_SUBTITLE,
.id = AV_CODEC_ID_ASS,
const FFCodec ff_ass_decoder = {
.p.name = "ass",
.p.long_name = NULL_IF_CONFIG_SMALL("ASS (Advanced SubStation Alpha) subtitle"),
.p.type = AVMEDIA_TYPE_SUBTITLE,
.p.id = AV_CODEC_ID_ASS,
.init = ass_decode_init,
.decode = ass_decode_frame,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,

View File

@ -69,11 +69,11 @@ static int ass_encode_frame(AVCodecContext *avctx,
}
#if CONFIG_SSA_ENCODER
const AVCodec ff_ssa_encoder = {
.name = "ssa",
.long_name = NULL_IF_CONFIG_SMALL("ASS (Advanced SubStation Alpha) subtitle"),
.type = AVMEDIA_TYPE_SUBTITLE,
.id = AV_CODEC_ID_ASS,
const FFCodec ff_ssa_encoder = {
.p.name = "ssa",
.p.long_name = NULL_IF_CONFIG_SMALL("ASS (Advanced SubStation Alpha) subtitle"),
.p.type = AVMEDIA_TYPE_SUBTITLE,
.p.id = AV_CODEC_ID_ASS,
.init = ass_encode_init,
.encode_sub = ass_encode_frame,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
@ -81,11 +81,11 @@ const AVCodec ff_ssa_encoder = {
#endif
#if CONFIG_ASS_ENCODER
const AVCodec ff_ass_encoder = {
.name = "ass",
.long_name = NULL_IF_CONFIG_SMALL("ASS (Advanced SubStation Alpha) subtitle"),
.type = AVMEDIA_TYPE_SUBTITLE,
.id = AV_CODEC_ID_ASS,
const FFCodec ff_ass_encoder = {
.p.name = "ass",
.p.long_name = NULL_IF_CONFIG_SMALL("ASS (Advanced SubStation Alpha) subtitle"),
.p.type = AVMEDIA_TYPE_SUBTITLE,
.p.id = AV_CODEC_ID_ASS,
.init = ass_encode_init,
.encode_sub = ass_encode_frame,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,

View File

@ -329,30 +329,30 @@ static av_cold int decode_end(AVCodecContext *avctx)
}
#if CONFIG_ASV1_DECODER
const AVCodec ff_asv1_decoder = {
.name = "asv1",
.long_name = NULL_IF_CONFIG_SMALL("ASUS V1"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_ASV1,
const FFCodec ff_asv1_decoder = {
.p.name = "asv1",
.p.long_name = NULL_IF_CONFIG_SMALL("ASUS V1"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_ASV1,
.priv_data_size = sizeof(ASV1Context),
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif
#if CONFIG_ASV2_DECODER
const AVCodec ff_asv2_decoder = {
.name = "asv2",
.long_name = NULL_IF_CONFIG_SMALL("ASUS V2"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_ASV2,
const FFCodec ff_asv2_decoder = {
.p.name = "asv2",
.p.long_name = NULL_IF_CONFIG_SMALL("ASUS V2"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_ASV2,
.priv_data_size = sizeof(ASV1Context),
.init = decode_init,
.decode = decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif

View File

@ -343,30 +343,30 @@ static av_cold int encode_init(AVCodecContext *avctx)
}
#if CONFIG_ASV1_ENCODER
const AVCodec ff_asv1_encoder = {
.name = "asv1",
.long_name = NULL_IF_CONFIG_SMALL("ASUS V1"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_ASV1,
const FFCodec ff_asv1_encoder = {
.p.name = "asv1",
.p.long_name = NULL_IF_CONFIG_SMALL("ASUS V1"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_ASV1,
.priv_data_size = sizeof(ASV1Context),
.init = encode_init,
.encode2 = encode_frame,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
.p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE },
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif
#if CONFIG_ASV2_ENCODER
const AVCodec ff_asv2_encoder = {
.name = "asv2",
.long_name = NULL_IF_CONFIG_SMALL("ASUS V2"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_ASV2,
const FFCodec ff_asv2_encoder = {
.p.name = "asv2",
.p.long_name = NULL_IF_CONFIG_SMALL("ASUS V2"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_ASV2,
.priv_data_size = sizeof(ASV1Context),
.init = encode_init,
.encode2 = encode_frame,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
.p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE },
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -385,17 +385,17 @@ static av_cold int atrac1_decode_init(AVCodecContext *avctx)
}
const AVCodec ff_atrac1_decoder = {
.name = "atrac1",
.long_name = NULL_IF_CONFIG_SMALL("ATRAC1 (Adaptive TRansform Acoustic Coding)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_ATRAC1,
const FFCodec ff_atrac1_decoder = {
.p.name = "atrac1",
.p.long_name = NULL_IF_CONFIG_SMALL("ATRAC1 (Adaptive TRansform Acoustic Coding)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_ATRAC1,
.priv_data_size = sizeof(AT1Ctx),
.init = atrac1_decode_init,
.close = atrac1_decode_end,
.decode = atrac1_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
.p.capabilities = AV_CODEC_CAP_DR1,
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};

View File

@ -1017,32 +1017,32 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_atrac3_decoder = {
.name = "atrac3",
.long_name = NULL_IF_CONFIG_SMALL("ATRAC3 (Adaptive TRansform Acoustic Coding 3)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_ATRAC3,
const FFCodec ff_atrac3_decoder = {
.p.name = "atrac3",
.p.long_name = NULL_IF_CONFIG_SMALL("ATRAC3 (Adaptive TRansform Acoustic Coding 3)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_ATRAC3,
.priv_data_size = sizeof(ATRAC3Context),
.init = atrac3_decode_init,
.close = atrac3_decode_close,
.decode = atrac3_decode_frame,
.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
.p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1,
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};
const AVCodec ff_atrac3al_decoder = {
.name = "atrac3al",
.long_name = NULL_IF_CONFIG_SMALL("ATRAC3 AL (Adaptive TRansform Acoustic Coding 3 Advanced Lossless)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_ATRAC3AL,
const FFCodec ff_atrac3al_decoder = {
.p.name = "atrac3al",
.p.long_name = NULL_IF_CONFIG_SMALL("ATRAC3 AL (Adaptive TRansform Acoustic Coding 3 Advanced Lossless)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_ATRAC3AL,
.priv_data_size = sizeof(ATRAC3Context),
.init = atrac3_decode_init,
.close = atrac3_decode_close,
.decode = atrac3al_decode_frame,
.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
.p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1,
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};

View File

@ -391,12 +391,12 @@ static int atrac3p_decode_frame(AVCodecContext *avctx, void *data,
return avctx->codec_id == AV_CODEC_ID_ATRAC3P ? FFMIN(avctx->block_align, avpkt->size) : avpkt->size;
}
const AVCodec ff_atrac3p_decoder = {
.name = "atrac3plus",
.long_name = NULL_IF_CONFIG_SMALL("ATRAC3+ (Adaptive TRansform Acoustic Coding 3+)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_ATRAC3P,
.capabilities = AV_CODEC_CAP_DR1,
const FFCodec ff_atrac3p_decoder = {
.p.name = "atrac3plus",
.p.long_name = NULL_IF_CONFIG_SMALL("ATRAC3+ (Adaptive TRansform Acoustic Coding 3+)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_ATRAC3P,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
.priv_data_size = sizeof(ATRAC3PContext),
.init = atrac3p_decode_init,
@ -404,12 +404,12 @@ const AVCodec ff_atrac3p_decoder = {
.decode = atrac3p_decode_frame,
};
const AVCodec ff_atrac3pal_decoder = {
.name = "atrac3plusal",
.long_name = NULL_IF_CONFIG_SMALL("ATRAC3+ AL (Adaptive TRansform Acoustic Coding 3+ Advanced Lossless)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_ATRAC3PAL,
.capabilities = AV_CODEC_CAP_DR1,
const FFCodec ff_atrac3pal_decoder = {
.p.name = "atrac3plusal",
.p.long_name = NULL_IF_CONFIG_SMALL("ATRAC3+ AL (Adaptive TRansform Acoustic Coding 3+ Advanced Lossless)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_ATRAC3PAL,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
.priv_data_size = sizeof(ATRAC3PContext),
.init = atrac3p_decode_init,

View File

@ -988,16 +988,16 @@ static av_cold int atrac9_decode_init(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_atrac9_decoder = {
.name = "atrac9",
.long_name = NULL_IF_CONFIG_SMALL("ATRAC9 (Adaptive TRansform Acoustic Coding 9)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_ATRAC9,
const FFCodec ff_atrac9_decoder = {
.p.name = "atrac9",
.p.long_name = NULL_IF_CONFIG_SMALL("ATRAC9 (Adaptive TRansform Acoustic Coding 9)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_ATRAC9,
.priv_data_size = sizeof(ATRAC9Context),
.init = atrac9_decode_init,
.close = atrac9_decode_close,
.decode = atrac9_decode_frame,
.flush = atrac9_decode_flush,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
.p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
};

View File

@ -585,21 +585,21 @@ static av_cold int ffat_close_decoder(AVCodecContext *avctx)
#define FFAT_DEC(NAME, ID, bsf_name) \
FFAT_DEC_CLASS(NAME) \
const AVCodec ff_##NAME##_at_decoder = { \
.name = #NAME "_at", \
.long_name = NULL_IF_CONFIG_SMALL(#NAME " (AudioToolbox)"), \
.type = AVMEDIA_TYPE_AUDIO, \
.id = ID, \
const FFCodec ff_##NAME##_at_decoder = { \
.p.name = #NAME "_at", \
.p.long_name = NULL_IF_CONFIG_SMALL(#NAME " (AudioToolbox)"), \
.p.type = AVMEDIA_TYPE_AUDIO, \
.p.id = ID, \
.priv_data_size = sizeof(ATDecodeContext), \
.init = ffat_init_decoder, \
.close = ffat_close_decoder, \
.decode = ffat_decode, \
.flush = ffat_decode_flush, \
.priv_class = &ffat_##NAME##_dec_class, \
.p.priv_class = &ffat_##NAME##_dec_class, \
.bsfs = bsf_name, \
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_CHANNEL_CONF, \
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_CHANNEL_CONF, \
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, \
.wrapper_name = "at", \
.p.wrapper_name = "at", \
};
FFAT_DEC(aac, AV_CODEC_ID_AAC, "aac_adtstoasc")

View File

@ -613,28 +613,28 @@ static const AVOption options[] = {
#define FFAT_ENC(NAME, ID, PROFILES, CAPS, CHANNEL_LAYOUTS, CH_LAYOUTS) \
FFAT_ENC_CLASS(NAME) \
const AVCodec ff_##NAME##_at_encoder = { \
.name = #NAME "_at", \
.long_name = NULL_IF_CONFIG_SMALL(#NAME " (AudioToolbox)"), \
.type = AVMEDIA_TYPE_AUDIO, \
.id = ID, \
const FFCodec ff_##NAME##_at_encoder = { \
.p.name = #NAME "_at", \
.p.long_name = NULL_IF_CONFIG_SMALL(#NAME " (AudioToolbox)"), \
.p.type = AVMEDIA_TYPE_AUDIO, \
.p.id = ID, \
.priv_data_size = sizeof(ATDecodeContext), \
.init = ffat_init_encoder, \
.close = ffat_close_encoder, \
.encode2 = ffat_encode, \
.flush = ffat_encode_flush, \
.priv_class = &ffat_##NAME##_enc_class, \
.capabilities = AV_CODEC_CAP_DELAY | \
.p.priv_class = &ffat_##NAME##_enc_class, \
.p.capabilities = AV_CODEC_CAP_DELAY | \
AV_CODEC_CAP_ENCODER_FLUSH CAPS, \
.channel_layouts= CHANNEL_LAYOUTS, \
.ch_layouts = CH_LAYOUTS, \
.sample_fmts = (const enum AVSampleFormat[]) { \
.p.channel_layouts = CHANNEL_LAYOUTS, \
.p.ch_layouts = CH_LAYOUTS, \
.p.sample_fmts = (const enum AVSampleFormat[]) { \
AV_SAMPLE_FMT_S16, \
AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_NONE \
}, \
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, \
.profiles = PROFILES, \
.wrapper_name = "at", \
.p.profiles = PROFILES, \
.p.wrapper_name = "at", \
};
static const AVChannelLayout aac_at_ch_layouts[] = {

View File

@ -98,13 +98,13 @@ static int aura_decode_frame(AVCodecContext *avctx,
return pkt->size;
}
const AVCodec ff_aura2_decoder = {
.name = "aura2",
.long_name = NULL_IF_CONFIG_SMALL("Auravision Aura 2"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_AURA2,
const FFCodec ff_aura2_decoder = {
.p.name = "aura2",
.p.long_name = NULL_IF_CONFIG_SMALL("Auravision Aura 2"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_AURA2,
.init = aura_decode_init,
.decode = aura_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -1238,22 +1238,22 @@ static const AVClass av1_class = {
.version = LIBAVUTIL_VERSION_INT,
};
const AVCodec ff_av1_decoder = {
.name = "av1",
.long_name = NULL_IF_CONFIG_SMALL("Alliance for Open Media AV1"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_AV1,
const FFCodec ff_av1_decoder = {
.p.name = "av1",
.p.long_name = NULL_IF_CONFIG_SMALL("Alliance for Open Media AV1"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_AV1,
.priv_data_size = sizeof(AV1DecContext),
.init = av1_decode_init,
.close = av1_decode_free,
.decode = av1_decode_frame,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
FF_CODEC_CAP_INIT_CLEANUP |
FF_CODEC_CAP_SETS_PKT_DTS,
.flush = av1_decode_flush,
.profiles = NULL_IF_CONFIG_SMALL(ff_av1_profiles),
.priv_class = &av1_class,
.p.profiles = NULL_IF_CONFIG_SMALL(ff_av1_profiles),
.p.priv_class = &av1_class,
.bsfs = "av1_frame_split",
.hw_configs = (const AVCodecHWConfigInternal *const []) {
#if CONFIG_AV1_DXVA2_HWACCEL

View File

@ -94,13 +94,13 @@ int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2,
static AVMutex codec_mutex = AV_MUTEX_INITIALIZER;
static void lock_avcodec(const AVCodec *codec)
static void lock_avcodec(const FFCodec *codec)
{
if (!(codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE) && codec->init)
ff_mutex_lock(&codec_mutex);
}
static void unlock_avcodec(const AVCodec *codec)
static void unlock_avcodec(const FFCodec *codec)
{
if (!(codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE) && codec->init)
ff_mutex_unlock(&codec_mutex);
@ -140,6 +140,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
{
int ret = 0;
AVCodecInternal *avci;
const FFCodec *codec2;
if (avcodec_is_open(avctx))
return 0;
@ -155,6 +156,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
}
if (!codec)
codec = avctx->codec;
codec2 = ffcodec(codec);
if ((avctx->codec_type == AVMEDIA_TYPE_UNKNOWN || avctx->codec_type == codec->type) &&
avctx->codec_id == AV_CODEC_ID_NONE) {
@ -194,9 +196,9 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
avci->skip_samples_multiplier = 1;
if (codec->priv_data_size > 0) {
if (codec2->priv_data_size > 0) {
if (!avctx->priv_data) {
avctx->priv_data = av_mallocz(codec->priv_data_size);
avctx->priv_data = av_mallocz(codec2->priv_data_size);
if (!avctx->priv_data) {
ret = AVERROR(ENOMEM);
goto free_and_end;
@ -327,25 +329,25 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (HAVE_THREADS
&& !(avci->frame_thread_encoder && (avctx->active_thread_type&FF_THREAD_FRAME))) {
/* Frame-threaded decoders call AVCodec.init for their child contexts. */
lock_avcodec(codec);
/* Frame-threaded decoders call FFCodec.init for their child contexts. */
lock_avcodec(codec2);
ret = ff_thread_init(avctx);
unlock_avcodec(codec);
unlock_avcodec(codec2);
if (ret < 0) {
goto free_and_end;
}
}
if (!HAVE_THREADS && !(codec->caps_internal & FF_CODEC_CAP_AUTO_THREADS))
if (!HAVE_THREADS && !(codec2->caps_internal & FF_CODEC_CAP_AUTO_THREADS))
avctx->thread_count = 1;
if (!(avctx->active_thread_type & FF_THREAD_FRAME) ||
avci->frame_thread_encoder) {
if (avctx->codec->init) {
lock_avcodec(codec);
ret = avctx->codec->init(avctx);
unlock_avcodec(codec);
if (codec2->init) {
lock_avcodec(codec2);
ret = codec2->init(avctx);
unlock_avcodec(codec2);
if (ret < 0) {
avci->needs_close = avctx->codec->caps_internal & FF_CODEC_CAP_INIT_CLEANUP;
avci->needs_close = codec2->caps_internal & FF_CODEC_CAP_INIT_CLEANUP;
goto free_and_end;
}
}
@ -439,8 +441,8 @@ void avcodec_flush_buffers(AVCodecContext *avctx)
if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME)
ff_thread_flush(avctx);
else if (avctx->codec->flush)
avctx->codec->flush(avctx);
else if (ffcodec(avctx->codec)->flush)
ffcodec(avctx->codec)->flush(avctx);
avctx->pts_correction_last_pts =
avctx->pts_correction_last_dts = INT64_MIN;
@ -484,8 +486,8 @@ av_cold int avcodec_close(AVCodecContext *avctx)
}
if (HAVE_THREADS && avci->thread_ctx)
ff_thread_free(avctx);
if (avci->needs_close && avctx->codec->close)
avctx->codec->close(avctx);
if (avci->needs_close && ffcodec(avctx->codec)->close)
ffcodec(avctx->codec)->close(avctx);
avci->byte_buffer_size = 0;
av_freep(&avci->byte_buffer);
av_frame_free(&avci->buffer_frame);

View File

@ -90,14 +90,14 @@ static int decode_frame(AVCodecContext *avctx, void *data,
return buf_size;
}
const AVCodec ff_avrn_decoder = {
.name = "avrn",
.long_name = NULL_IF_CONFIG_SMALL("Avid AVI Codec"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_AVRN,
const FFCodec ff_avrn_decoder = {
.p.name = "avrn",
.p.long_name = NULL_IF_CONFIG_SMALL("Avid AVI Codec"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_AVRN,
.priv_data_size = sizeof(AVRnContext),
.init = init,
.decode = decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};

View File

@ -177,15 +177,15 @@ static av_cold int avs_decode_end(AVCodecContext *avctx)
}
const AVCodec ff_avs_decoder = {
.name = "avs",
.long_name = NULL_IF_CONFIG_SMALL("AVS (Audio Video Standard) video"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_AVS,
const FFCodec ff_avs_decoder = {
.p.name = "avs",
.p.long_name = NULL_IF_CONFIG_SMALL("AVS (Audio Video Standard) video"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_AVS,
.priv_data_size = sizeof(AvsContext),
.init = avs_decode_init,
.decode = avs_decode_frame,
.close = avs_decode_end,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -120,13 +120,13 @@ static int avui_decode_frame(AVCodecContext *avctx, void *data,
return avpkt->size;
}
const AVCodec ff_avui_decoder = {
.name = "avui",
.long_name = NULL_IF_CONFIG_SMALL("Avid Meridien Uncompressed"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_AVUI,
const FFCodec ff_avui_decoder = {
.p.name = "avui",
.p.long_name = NULL_IF_CONFIG_SMALL("Avid Meridien Uncompressed"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_AVUI,
.p.capabilities = AV_CODEC_CAP_DR1,
.init = avui_decode_init,
.decode = avui_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -91,14 +91,14 @@ static int avui_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
return 0;
}
const AVCodec ff_avui_encoder = {
.name = "avui",
.long_name = NULL_IF_CONFIG_SMALL("Avid Meridien Uncompressed"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_AVUI,
const FFCodec ff_avui_encoder = {
.p.name = "avui",
.p.long_name = NULL_IF_CONFIG_SMALL("Avid Meridien Uncompressed"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_AVUI,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL,
.p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_UYVY422, AV_PIX_FMT_NONE },
.init = avui_encode_init,
.encode2 = avui_encode_frame,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_UYVY422, AV_PIX_FMT_NONE },
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -159,15 +159,15 @@ static av_cold int bethsoftvid_decode_end(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_bethsoftvid_decoder = {
.name = "bethsoftvid",
.long_name = NULL_IF_CONFIG_SMALL("Bethesda VID video"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_BETHSOFTVID,
const FFCodec ff_bethsoftvid_decoder = {
.p.name = "bethsoftvid",
.p.long_name = NULL_IF_CONFIG_SMALL("Bethesda VID video"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_BETHSOFTVID,
.priv_data_size = sizeof(BethsoftvidContext),
.init = bethsoftvid_decode_init,
.close = bethsoftvid_decode_end,
.decode = bethsoftvid_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -176,15 +176,15 @@ static av_cold int bfi_decode_close(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_bfi_decoder = {
.name = "bfi",
.long_name = NULL_IF_CONFIG_SMALL("Brute Force & Ignorance"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_BFI,
const FFCodec ff_bfi_decoder = {
.p.name = "bfi",
.p.long_name = NULL_IF_CONFIG_SMALL("Brute Force & Ignorance"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_BFI,
.priv_data_size = sizeof(BFIContext),
.init = bfi_decode_init,
.close = bfi_decode_close,
.decode = bfi_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -1419,16 +1419,16 @@ static void flush(AVCodecContext *avctx)
c->frame_num = 0;
}
const AVCodec ff_bink_decoder = {
.name = "binkvideo",
.long_name = NULL_IF_CONFIG_SMALL("Bink video"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_BINKVIDEO,
const FFCodec ff_bink_decoder = {
.p.name = "binkvideo",
.p.long_name = NULL_IF_CONFIG_SMALL("Bink video"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_BINKVIDEO,
.priv_data_size = sizeof(BinkContext),
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
.flush = flush,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};

View File

@ -346,30 +346,30 @@ static void decode_flush(AVCodecContext *avctx)
s->first = 1;
}
const AVCodec ff_binkaudio_rdft_decoder = {
.name = "binkaudio_rdft",
.long_name = NULL_IF_CONFIG_SMALL("Bink Audio (RDFT)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_BINKAUDIO_RDFT,
const FFCodec ff_binkaudio_rdft_decoder = {
.p.name = "binkaudio_rdft",
.p.long_name = NULL_IF_CONFIG_SMALL("Bink Audio (RDFT)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_BINKAUDIO_RDFT,
.priv_data_size = sizeof(BinkAudioContext),
.init = decode_init,
.flush = decode_flush,
.close = decode_end,
.receive_frame = binkaudio_receive_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};
const AVCodec ff_binkaudio_dct_decoder = {
.name = "binkaudio_dct",
.long_name = NULL_IF_CONFIG_SMALL("Bink Audio (DCT)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_BINKAUDIO_DCT,
const FFCodec ff_binkaudio_dct_decoder = {
.p.name = "binkaudio_dct",
.p.long_name = NULL_IF_CONFIG_SMALL("Bink Audio (DCT)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_BINKAUDIO_DCT,
.priv_data_size = sizeof(BinkAudioContext),
.init = decode_init,
.flush = decode_flush,
.close = decode_end,
.receive_frame = binkaudio_receive_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};

View File

@ -218,41 +218,41 @@ static int decode_frame(AVCodecContext *avctx,
}
#if CONFIG_BINTEXT_DECODER
const AVCodec ff_bintext_decoder = {
.name = "bintext",
.long_name = NULL_IF_CONFIG_SMALL("Binary text"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_BINTEXT,
const FFCodec ff_bintext_decoder = {
.p.name = "bintext",
.p.long_name = NULL_IF_CONFIG_SMALL("Binary text"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_BINTEXT,
.priv_data_size = sizeof(XbinContext),
.init = decode_init,
.decode = decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif
#if CONFIG_XBIN_DECODER
const AVCodec ff_xbin_decoder = {
.name = "xbin",
.long_name = NULL_IF_CONFIG_SMALL("eXtended BINary text"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_XBIN,
const FFCodec ff_xbin_decoder = {
.p.name = "xbin",
.p.long_name = NULL_IF_CONFIG_SMALL("eXtended BINary text"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_XBIN,
.priv_data_size = sizeof(XbinContext),
.init = decode_init,
.decode = decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif
#if CONFIG_IDF_DECODER
const AVCodec ff_idf_decoder = {
.name = "idf",
.long_name = NULL_IF_CONFIG_SMALL("iCEDraw text"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_IDF,
const FFCodec ff_idf_decoder = {
.p.name = "idf",
.p.long_name = NULL_IF_CONFIG_SMALL("iCEDraw text"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_IDF,
.priv_data_size = sizeof(XbinContext),
.init = decode_init,
.decode = decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif

View File

@ -142,15 +142,15 @@ static int bitpacked_decode(AVCodecContext *avctx, void *data, int *got_frame,
}
const AVCodec ff_bitpacked_decoder = {
.name = "bitpacked",
.long_name = NULL_IF_CONFIG_SMALL("Bitpacked"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_BITPACKED,
const FFCodec ff_bitpacked_decoder = {
.p.name = "bitpacked",
.p.long_name = NULL_IF_CONFIG_SMALL("Bitpacked"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_BITPACKED,
.p.capabilities = AV_CODEC_CAP_FRAME_THREADS,
.priv_data_size = sizeof(struct BitpackedContext),
.init = bitpacked_init_decoder,
.decode = bitpacked_decode,
.capabilities = AV_CODEC_CAP_FRAME_THREADS,
.codec_tags = (const uint32_t []){
MKTAG('U', 'Y', 'V', 'Y'),
FF_CODEC_TAGS_END,

View File

@ -104,16 +104,16 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
return 0;
}
const AVCodec ff_bitpacked_encoder = {
.name = "bitpacked",
.long_name = NULL_IF_CONFIG_SMALL("Bitpacked"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_BITPACKED,
const FFCodec ff_bitpacked_encoder = {
.p.name = "bitpacked",
.p.long_name = NULL_IF_CONFIG_SMALL("Bitpacked"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_BITPACKED,
.priv_data_size = sizeof(struct BitpackedContext),
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.init = encode_init,
.encode2 = encode_frame,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV422P10,
.p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV422P10,
AV_PIX_FMT_NONE },
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -24,6 +24,7 @@
#include "avcodec.h"
#include "bytestream.h"
#include "bmp.h"
#include "codec_internal.h"
#include "internal.h"
#include "msrledec.h"
@ -365,11 +366,11 @@ static int bmp_decode_frame(AVCodecContext *avctx,
return buf_size;
}
const AVCodec ff_bmp_decoder = {
.name = "bmp",
.long_name = NULL_IF_CONFIG_SMALL("BMP (Windows and OS/2 bitmap)"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_BMP,
const FFCodec ff_bmp_decoder = {
.p.name = "bmp",
.p.long_name = NULL_IF_CONFIG_SMALL("BMP (Windows and OS/2 bitmap)"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_BMP,
.p.capabilities = AV_CODEC_CAP_DR1,
.decode = bmp_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
};

View File

@ -155,15 +155,15 @@ static int bmp_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
return 0;
}
const AVCodec ff_bmp_encoder = {
.name = "bmp",
.long_name = NULL_IF_CONFIG_SMALL("BMP (Windows and OS/2 bitmap)"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_BMP,
.capabilities = AV_CODEC_CAP_DR1,
const FFCodec ff_bmp_encoder = {
.p.name = "bmp",
.p.long_name = NULL_IF_CONFIG_SMALL("BMP (Windows and OS/2 bitmap)"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_BMP,
.p.capabilities = AV_CODEC_CAP_DR1,
.init = bmp_encode_init,
.encode2 = bmp_encode_frame,
.pix_fmts = (const enum AVPixelFormat[]){
.p.pix_fmts = (const enum AVPixelFormat[]){
AV_PIX_FMT_BGRA, AV_PIX_FMT_BGR24,
AV_PIX_FMT_RGB565, AV_PIX_FMT_RGB555, AV_PIX_FMT_RGB444,
AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE, AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8,

View File

@ -79,13 +79,13 @@ static int bmv_aud_decode_frame(AVCodecContext *avctx, void *data,
return buf_size;
}
const AVCodec ff_bmv_audio_decoder = {
.name = "bmv_audio",
.long_name = NULL_IF_CONFIG_SMALL("Discworld II BMV audio"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_BMV_AUDIO,
const FFCodec ff_bmv_audio_decoder = {
.p.name = "bmv_audio",
.p.long_name = NULL_IF_CONFIG_SMALL("Discworld II BMV audio"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_BMV_AUDIO,
.init = bmv_aud_decode_init,
.decode = bmv_aud_decode_frame,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -286,14 +286,14 @@ static av_cold int decode_init(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_bmv_video_decoder = {
.name = "bmv_video",
.long_name = NULL_IF_CONFIG_SMALL("Discworld II BMV video"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_BMV_VIDEO,
const FFCodec ff_bmv_video_decoder = {
.p.name = "bmv_video",
.p.long_name = NULL_IF_CONFIG_SMALL("Discworld II BMV video"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_BMV_VIDEO,
.priv_data_size = sizeof(BMVDecContext),
.init = decode_init,
.decode = decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -25,6 +25,7 @@
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "internal.h"
#define HEADER1_CHUNK 0x03
@ -285,11 +286,11 @@ static int pix_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
return avpkt->size;
}
const AVCodec ff_brender_pix_decoder = {
.name = "brender_pix",
.long_name = NULL_IF_CONFIG_SMALL("BRender PIX image"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_BRENDER_PIX,
const FFCodec ff_brender_pix_decoder = {
.p.name = "brender_pix",
.p.long_name = NULL_IF_CONFIG_SMALL("BRender PIX image"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_BRENDER_PIX,
.p.capabilities = AV_CODEC_CAP_DR1,
.decode = pix_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
};

View File

@ -258,15 +258,15 @@ static int decode_frame(AVCodecContext *avctx, void *data,
return buf_size;
}
const AVCodec ff_c93_decoder = {
.name = "c93",
.long_name = NULL_IF_CONFIG_SMALL("Interplay C93"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_C93,
const FFCodec ff_c93_decoder = {
.p.name = "c93",
.p.long_name = NULL_IF_CONFIG_SMALL("Interplay C93"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_C93,
.priv_data_size = sizeof(C93DecoderContext),
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};

View File

@ -1309,16 +1309,16 @@ static int cavs_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
}
}
const AVCodec ff_cavs_decoder = {
.name = "cavs",
.long_name = NULL_IF_CONFIG_SMALL("Chinese AVS (Audio Video Standard) (AVS1-P2, JiZhun profile)"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_CAVS,
const FFCodec ff_cavs_decoder = {
.p.name = "cavs",
.p.long_name = NULL_IF_CONFIG_SMALL("Chinese AVS (Audio Video Standard) (AVS1-P2, JiZhun profile)"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_CAVS,
.priv_data_size = sizeof(AVSContext),
.init = ff_cavs_init,
.close = ff_cavs_end,
.decode = cavs_decode_frame,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
.flush = cavs_flush,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};

View File

@ -944,17 +944,17 @@ static const AVClass ccaption_dec_class = {
.version = LIBAVUTIL_VERSION_INT,
};
const AVCodec ff_ccaption_decoder = {
.name = "cc_dec",
.long_name = NULL_IF_CONFIG_SMALL("Closed Caption (EIA-608 / CEA-708)"),
.type = AVMEDIA_TYPE_SUBTITLE,
.id = AV_CODEC_ID_EIA_608,
const FFCodec ff_ccaption_decoder = {
.p.name = "cc_dec",
.p.long_name = NULL_IF_CONFIG_SMALL("Closed Caption (EIA-608 / CEA-708)"),
.p.type = AVMEDIA_TYPE_SUBTITLE,
.p.id = AV_CODEC_ID_EIA_608,
.p.priv_class = &ccaption_dec_class,
.p.capabilities = AV_CODEC_CAP_DELAY,
.priv_data_size = sizeof(CCaptionSubContext),
.init = init_decoder,
.close = close_decoder,
.flush = flush_decoder,
.decode = decode,
.priv_class = &ccaption_dec_class,
.capabilities = AV_CODEC_CAP_DELAY,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -388,16 +388,16 @@ static av_cold int cdg_decode_end(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_cdgraphics_decoder = {
.name = "cdgraphics",
.long_name = NULL_IF_CONFIG_SMALL("CD Graphics video"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_CDGRAPHICS,
const FFCodec ff_cdgraphics_decoder = {
.p.name = "cdgraphics",
.p.long_name = NULL_IF_CONFIG_SMALL("CD Graphics video"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_CDGRAPHICS,
.priv_data_size = sizeof(CDGraphicsContext),
.init = cdg_decode_init,
.close = cdg_decode_end,
.decode = cdg_decode_frame,
.flush = cdg_decode_flush,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -443,16 +443,16 @@ static av_cold int cdtoons_decode_end(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_cdtoons_decoder = {
.name = "cdtoons",
.long_name = NULL_IF_CONFIG_SMALL("CDToons video"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_CDTOONS,
const FFCodec ff_cdtoons_decoder = {
.p.name = "cdtoons",
.p.long_name = NULL_IF_CONFIG_SMALL("CDToons video"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_CDTOONS,
.priv_data_size = sizeof(CDToonsContext),
.init = cdtoons_decode_init,
.close = cdtoons_decode_end,
.decode = cdtoons_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.flush = cdtoons_flush,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -337,15 +337,15 @@ static av_cold int cdxl_decode_end(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_cdxl_decoder = {
.name = "cdxl",
.long_name = NULL_IF_CONFIG_SMALL("Commodore CDXL video"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_CDXL,
const FFCodec ff_cdxl_decoder = {
.p.name = "cdxl",
.p.long_name = NULL_IF_CONFIG_SMALL("Commodore CDXL video"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_CDXL,
.priv_data_size = sizeof(CDXLVideoContext),
.init = cdxl_decode_init,
.close = cdxl_decode_end,
.decode = cdxl_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -1456,16 +1456,16 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
}
#endif
const AVCodec ff_cfhd_decoder = {
.name = "cfhd",
.long_name = NULL_IF_CONFIG_SMALL("GoPro CineForm HD"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_CFHD,
const FFCodec ff_cfhd_decoder = {
.p.name = "cfhd",
.p.long_name = NULL_IF_CONFIG_SMALL("GoPro CineForm HD"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_CFHD,
.priv_data_size = sizeof(CFHDContext),
.init = cfhd_init,
.close = cfhd_close,
.decode = cfhd_decode,
.update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context),
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};

View File

@ -845,18 +845,18 @@ static const AVClass cfhd_class = {
.version = LIBAVUTIL_VERSION_INT,
};
const AVCodec ff_cfhd_encoder = {
.name = "cfhd",
.long_name = NULL_IF_CONFIG_SMALL("GoPro CineForm HD"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_CFHD,
const FFCodec ff_cfhd_encoder = {
.p.name = "cfhd",
.p.long_name = NULL_IF_CONFIG_SMALL("GoPro CineForm HD"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_CFHD,
.priv_data_size = sizeof(CFHDEncContext),
.priv_class = &cfhd_class,
.p.priv_class = &cfhd_class,
.init = cfhd_encode_init,
.close = cfhd_encode_close,
.encode2 = cfhd_encode_frame,
.capabilities = AV_CODEC_CAP_FRAME_THREADS,
.pix_fmts = (const enum AVPixelFormat[]) {
.p.capabilities = AV_CODEC_CAP_FRAME_THREADS,
.p.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_YUV422P10,
AV_PIX_FMT_GBRP12,
AV_PIX_FMT_GBRAP12,

View File

@ -507,15 +507,15 @@ static av_cold int cinepak_decode_end(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_cinepak_decoder = {
.name = "cinepak",
.long_name = NULL_IF_CONFIG_SMALL("Cinepak"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_CINEPAK,
const FFCodec ff_cinepak_decoder = {
.p.name = "cinepak",
.p.long_name = NULL_IF_CONFIG_SMALL("Cinepak"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_CINEPAK,
.priv_data_size = sizeof(CinepakContext),
.init = cinepak_decode_init,
.close = cinepak_decode_end,
.decode = cinepak_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -1194,16 +1194,16 @@ static av_cold int cinepak_encode_end(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_cinepak_encoder = {
.name = "cinepak",
.long_name = NULL_IF_CONFIG_SMALL("Cinepak"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_CINEPAK,
const FFCodec ff_cinepak_encoder = {
.p.name = "cinepak",
.p.long_name = NULL_IF_CONFIG_SMALL("Cinepak"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_CINEPAK,
.priv_data_size = sizeof(CinepakEncContext),
.init = cinepak_encode_init,
.encode2 = cinepak_encode_frame,
.close = cinepak_encode_end,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE },
.priv_class = &cinepak_class,
.p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE },
.p.priv_class = &cinepak_class,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};

View File

@ -767,15 +767,15 @@ static av_cold int clv_decode_end(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_clearvideo_decoder = {
.name = "clearvideo",
.long_name = NULL_IF_CONFIG_SMALL("Iterated Systems ClearVideo"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_CLEARVIDEO,
const FFCodec ff_clearvideo_decoder = {
.p.name = "clearvideo",
.p.long_name = NULL_IF_CONFIG_SMALL("Iterated Systems ClearVideo"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_CLEARVIDEO,
.priv_data_size = sizeof(CLVContext),
.init = clv_decode_init,
.close = clv_decode_end,
.decode = clv_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};

View File

@ -83,14 +83,14 @@ static av_cold int decode_init(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_cljr_decoder = {
.name = "cljr",
.long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_CLJR,
const FFCodec ff_cljr_decoder = {
.p.name = "cljr",
.p.long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_CLJR,
.init = decode_init,
.decode = decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -27,6 +27,7 @@
#include "libavutil/opt.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "encode.h"
#include "put_bits.h"
@ -107,15 +108,15 @@ static const AVClass cljr_class = {
.version = LIBAVUTIL_VERSION_INT,
};
const AVCodec ff_cljr_encoder = {
.name = "cljr",
.long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_CLJR,
.capabilities = AV_CODEC_CAP_DR1,
const FFCodec ff_cljr_encoder = {
.p.name = "cljr",
.p.long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_CLJR,
.p.capabilities = AV_CODEC_CAP_DR1,
.priv_data_size = sizeof(CLJRContext),
.encode2 = encode_frame,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV411P,
.p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV411P,
AV_PIX_FMT_NONE },
.priv_class = &cljr_class,
.p.priv_class = &cljr_class,
};

View File

@ -492,15 +492,15 @@ static av_cold int cllc_decode_init(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_cllc_decoder = {
.name = "cllc",
.long_name = NULL_IF_CONFIG_SMALL("Canopus Lossless Codec"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_CLLC,
const FFCodec ff_cllc_decoder = {
.p.name = "cllc",
.p.long_name = NULL_IF_CONFIG_SMALL("Canopus Lossless Codec"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_CLLC,
.priv_data_size = sizeof(CLLCContext),
.init = cllc_decode_init,
.decode = cllc_decode_frame,
.close = cllc_decode_close,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -163,19 +163,19 @@ static int cng_decode_frame(AVCodecContext *avctx, void *data,
return buf_size;
}
const AVCodec ff_comfortnoise_decoder = {
.name = "comfortnoise",
.long_name = NULL_IF_CONFIG_SMALL("RFC 3389 comfort noise generator"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_COMFORT_NOISE,
const FFCodec ff_comfortnoise_decoder = {
.p.name = "comfortnoise",
.p.long_name = NULL_IF_CONFIG_SMALL("RFC 3389 comfort noise generator"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_COMFORT_NOISE,
.priv_data_size = sizeof(CNGContext),
.init = cng_decode_init,
.decode = cng_decode_frame,
.flush = cng_decode_flush,
.close = cng_decode_close,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
.p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
FF_CODEC_CAP_INIT_CLEANUP,
};

View File

@ -96,18 +96,18 @@ static int cng_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
return 0;
}
const AVCodec ff_comfortnoise_encoder = {
.name = "comfortnoise",
.long_name = NULL_IF_CONFIG_SMALL("RFC 3389 comfort noise generator"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_COMFORT_NOISE,
.capabilities = AV_CODEC_CAP_DR1,
const FFCodec ff_comfortnoise_encoder = {
.p.name = "comfortnoise",
.p.long_name = NULL_IF_CONFIG_SMALL("RFC 3389 comfort noise generator"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_COMFORT_NOISE,
.p.capabilities = AV_CODEC_CAP_DR1,
.priv_data_size = sizeof(CNGContext),
.init = cng_encode_init,
.encode2 = cng_encode_frame,
.close = cng_encode_close,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
.p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } },
.p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } },
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};

View File

@ -190,12 +190,6 @@ typedef struct AVProfile {
const char *name; ///< short name for the profile
} AVProfile;
typedef struct AVCodecDefault AVCodecDefault;
struct AVCodecContext;
struct AVSubtitle;
struct AVPacket;
/**
* AVCodec.
*/
@ -250,121 +244,6 @@ typedef struct AVCodec {
* Array of supported channel layouts, terminated with a zeroed layout.
*/
const AVChannelLayout *ch_layouts;
/*****************************************************************
* No fields below this line are part of the public API. They
* may not be used outside of libavcodec and can be changed and
* removed at will.
* New public fields should be added right above.
*****************************************************************
*/
/**
* Internal codec capabilities.
* See FF_CODEC_CAP_* in internal.h
*/
int caps_internal;
int priv_data_size;
/**
* @name Frame-level threading support functions
* @{
*/
/**
* Copy necessary context variables from a previous thread context to the current one.
* If not defined, the next thread will start automatically; otherwise, the codec
* must call ff_thread_finish_setup().
*
* dst and src will (rarely) point to the same context, in which case memcpy should be skipped.
*/
int (*update_thread_context)(struct AVCodecContext *dst, const struct AVCodecContext *src);
/**
* Copy variables back to the user-facing context
*/
int (*update_thread_context_for_user)(struct AVCodecContext *dst, const struct AVCodecContext *src);
/** @} */
/**
* Private codec-specific defaults.
*/
const AVCodecDefault *defaults;
/**
* Initialize codec static data, called from av_codec_iterate().
*
* This is not intended for time consuming operations as it is
* run for every codec regardless of that codec being used.
*/
void (*init_static_data)(struct AVCodec *codec);
int (*init)(struct AVCodecContext *);
int (*encode_sub)(struct AVCodecContext *, uint8_t *buf, int buf_size,
const struct AVSubtitle *sub);
/**
* Encode data to an AVPacket.
*
* @param avctx codec context
* @param avpkt output AVPacket
* @param[in] frame AVFrame containing the raw data to be encoded
* @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a
* non-empty packet was returned in avpkt.
* @return 0 on success, negative error code on failure
*/
int (*encode2)(struct AVCodecContext *avctx, struct AVPacket *avpkt,
const struct AVFrame *frame, int *got_packet_ptr);
/**
* Decode picture or subtitle data.
*
* @param avctx codec context
* @param outdata codec type dependent output struct
* @param[out] got_frame_ptr decoder sets to 0 or 1 to indicate that a
* non-empty frame or subtitle was returned in
* outdata.
* @param[in] avpkt AVPacket containing the data to be decoded
* @return amount of bytes read from the packet on success, negative error
* code on failure
*/
int (*decode)(struct AVCodecContext *avctx, void *outdata,
int *got_frame_ptr, struct AVPacket *avpkt);
int (*close)(struct AVCodecContext *);
/**
* Encode API with decoupled frame/packet dataflow. This function is called
* to get one output packet. It should call ff_encode_get_frame() to obtain
* input data.
*/
int (*receive_packet)(struct AVCodecContext *avctx, struct AVPacket *avpkt);
/**
* Decode API with decoupled packet/frame dataflow. This function is called
* to get one output frame. It should call ff_decode_get_packet() to obtain
* input data.
*/
int (*receive_frame)(struct AVCodecContext *avctx, struct AVFrame *frame);
/**
* Flush buffers.
* Will be called when seeking
*/
void (*flush)(struct AVCodecContext *);
/**
* Decoding only, a comma-separated list of bitstream filters to apply to
* packets before decoding.
*/
const char *bsfs;
/**
* Array of pointers to hardware configurations supported by the codec,
* or NULL if no hardware supported. The array is terminated by a NULL
* pointer.
*
* The user can only access this field via avcodec_get_hw_config().
*/
const struct AVCodecHWConfigInternal *const *hw_configs;
/**
* List of supported codec_tags, terminated by FF_CODEC_TAGS_END.
*/
const uint32_t *codec_tags;
} AVCodec;
/**

View File

@ -19,6 +19,11 @@
#ifndef AVCODEC_CODEC_INTERNAL_H
#define AVCODEC_CODEC_INTERNAL_H
#include <stdint.h>
#include "libavutil/attributes.h"
#include "codec.h"
/**
* The codec does not modify any global variables in the init function,
* allowing to call the init function without locking any global mutexes.
@ -70,13 +75,136 @@
#define FF_CODEC_CAP_SETS_FRAME_PROPS (1 << 8)
/**
* AVCodec.codec_tags termination value
* FFCodec.codec_tags termination value
*/
#define FF_CODEC_TAGS_END -1
struct AVCodecDefault {
typedef struct AVCodecDefault {
const char *key;
const char *value;
};
} AVCodecDefault;
struct AVCodecContext;
struct AVSubtitle;
struct AVPacket;
typedef struct FFCodec {
/**
* The public AVCodec. See codec.h for it.
*/
AVCodec p;
/**
* Internal codec capabilities FF_CODEC_CAP_*.
*/
int caps_internal;
int priv_data_size;
/**
* @name Frame-level threading support functions
* @{
*/
/**
* Copy necessary context variables from a previous thread context to the current one.
* If not defined, the next thread will start automatically; otherwise, the codec
* must call ff_thread_finish_setup().
*
* dst and src will (rarely) point to the same context, in which case memcpy should be skipped.
*/
int (*update_thread_context)(struct AVCodecContext *dst, const struct AVCodecContext *src);
/**
* Copy variables back to the user-facing context
*/
int (*update_thread_context_for_user)(struct AVCodecContext *dst, const struct AVCodecContext *src);
/** @} */
/**
* Private codec-specific defaults.
*/
const AVCodecDefault *defaults;
/**
* Initialize codec static data, called from av_codec_iterate().
*
* This is not intended for time consuming operations as it is
* run for every codec regardless of that codec being used.
*/
void (*init_static_data)(struct FFCodec *codec);
int (*init)(struct AVCodecContext *);
int (*encode_sub)(struct AVCodecContext *, uint8_t *buf, int buf_size,
const struct AVSubtitle *sub);
/**
* Encode data to an AVPacket.
*
* @param avctx codec context
* @param avpkt output AVPacket
* @param[in] frame AVFrame containing the raw data to be encoded
* @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a
* non-empty packet was returned in avpkt.
* @return 0 on success, negative error code on failure
*/
int (*encode2)(struct AVCodecContext *avctx, struct AVPacket *avpkt,
const struct AVFrame *frame, int *got_packet_ptr);
/**
* Decode picture or subtitle data.
*
* @param avctx codec context
* @param outdata codec type dependent output struct
* @param[out] got_frame_ptr decoder sets to 0 or 1 to indicate that a
* non-empty frame or subtitle was returned in
* outdata.
* @param[in] avpkt AVPacket containing the data to be decoded
* @return amount of bytes read from the packet on success, negative error
* code on failure
*/
int (*decode)(struct AVCodecContext *avctx, void *outdata,
int *got_frame_ptr, struct AVPacket *avpkt);
int (*close)(struct AVCodecContext *);
/**
* Encode API with decoupled frame/packet dataflow. This function is called
* to get one output packet. It should call ff_encode_get_frame() to obtain
* input data.
*/
int (*receive_packet)(struct AVCodecContext *avctx, struct AVPacket *avpkt);
/**
* Decode API with decoupled packet/frame dataflow. This function is called
* to get one output frame. It should call ff_decode_get_packet() to obtain
* input data.
*/
int (*receive_frame)(struct AVCodecContext *avctx, struct AVFrame *frame);
/**
* Flush buffers.
* Will be called when seeking
*/
void (*flush)(struct AVCodecContext *);
/**
* Decoding only, a comma-separated list of bitstream filters to apply to
* packets before decoding.
*/
const char *bsfs;
/**
* Array of pointers to hardware configurations supported by the codec,
* or NULL if no hardware supported. The array is terminated by a NULL
* pointer.
*
* The user can only access this field via avcodec_get_hw_config().
*/
const struct AVCodecHWConfigInternal *const *hw_configs;
/**
* List of supported codec_tags, terminated by FF_CODEC_TAGS_END.
*/
const uint32_t *codec_tags;
} FFCodec;
static av_always_inline const FFCodec *ffcodec(const AVCodec *codec)
{
return (const FFCodec*)codec;
}
#endif /* AVCODEC_CODEC_INTERNAL_H */

View File

@ -1297,17 +1297,17 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_cook_decoder = {
.name = "cook",
.long_name = NULL_IF_CONFIG_SMALL("Cook / Cooker / Gecko (RealAudio G2)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_COOK,
const FFCodec ff_cook_decoder = {
.p.name = "cook",
.p.long_name = NULL_IF_CONFIG_SMALL("Cook / Cooker / Gecko (RealAudio G2)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_COOK,
.priv_data_size = sizeof(COOKContext),
.init = cook_decode_init,
.close = cook_decode_close,
.decode = cook_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
.p.capabilities = AV_CODEC_CAP_DR1,
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};

View File

@ -222,15 +222,15 @@ static av_cold int cpia_decode_end(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_cpia_decoder = {
.name = "cpia",
.long_name = NULL_IF_CONFIG_SMALL("CPiA video format"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_CPIA,
const FFCodec ff_cpia_decoder = {
.p.name = "cpia",
.p.long_name = NULL_IF_CONFIG_SMALL("CPiA video format"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_CPIA,
.priv_data_size = sizeof(CpiaContext),
.init = cpia_decode_init,
.close = cpia_decode_end,
.decode = cpia_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -424,15 +424,15 @@ static av_cold int cri_decode_close(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_cri_decoder = {
.name = "cri",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_CRI,
const FFCodec ff_cri_decoder = {
.p.name = "cri",
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_CRI,
.priv_data_size = sizeof(CRIContext),
.init = cri_decode_init,
.decode = cri_decode_frame,
.close = cri_decode_close,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
.long_name = NULL_IF_CONFIG_SMALL("Cintel RAW"),
.p.long_name = NULL_IF_CONFIG_SMALL("Cintel RAW"),
};

View File

@ -774,22 +774,22 @@ static int crystalhd_receive_frame(AVCodecContext *avctx, AVFrame *frame)
.option = options, \
.version = LIBAVUTIL_VERSION_INT, \
}; \
const AVCodec ff_##x##_crystalhd_decoder = { \
.name = #x "_crystalhd", \
.long_name = NULL_IF_CONFIG_SMALL("CrystalHD " #X " decoder"), \
.type = AVMEDIA_TYPE_VIDEO, \
.id = AV_CODEC_ID_##X, \
const FFCodec ff_##x##_crystalhd_decoder = { \
.p.name = #x "_crystalhd", \
.p.long_name = NULL_IF_CONFIG_SMALL("CrystalHD " #X " decoder"), \
.p.type = AVMEDIA_TYPE_VIDEO, \
.p.id = AV_CODEC_ID_##X, \
.priv_data_size = sizeof(CHDContext), \
.priv_class = &x##_crystalhd_class, \
.p.priv_class = &x##_crystalhd_class, \
.init = init, \
.close = uninit, \
.receive_frame = crystalhd_receive_frame, \
.flush = flush, \
.bsfs = bsf_name, \
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE, \
.p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE, \
.caps_internal = FF_CODEC_CAP_SETS_FRAME_PROPS, \
.pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUYV422, AV_PIX_FMT_NONE}, \
.wrapper_name = "crystalhd", \
.p.pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUYV422, AV_PIX_FMT_NONE}, \
.p.wrapper_name = "crystalhd", \
};
#if CONFIG_H264_CRYSTALHD_DECODER

View File

@ -167,15 +167,15 @@ static av_cold int decode_end(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_cscd_decoder = {
.name = "camstudio",
.long_name = NULL_IF_CONFIG_SMALL("CamStudio"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_CSCD,
const FFCodec ff_cscd_decoder = {
.p.name = "camstudio",
.p.long_name = NULL_IF_CONFIG_SMALL("CamStudio"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_CSCD,
.priv_data_size = sizeof(CamStudioContext),
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};

View File

@ -943,7 +943,7 @@ static av_cold int cuvid_decode_init(AVCodecContext *avctx)
return AVERROR_BUG;
}
if (avctx->codec->bsfs) {
if (ffcodec(avctx->codec)->bsfs) {
const AVCodecParameters *par = avctx->internal->bsf->par_out;
extradata = par->extradata;
extradata_size = par->extradata_size;
@ -1103,27 +1103,27 @@ static const AVCodecHWConfigInternal *const cuvid_hw_configs[] = {
.option = options, \
.version = LIBAVUTIL_VERSION_INT, \
}; \
const AVCodec ff_##x##_cuvid_decoder = { \
.name = #x "_cuvid", \
.long_name = NULL_IF_CONFIG_SMALL("Nvidia CUVID " #X " decoder"), \
.type = AVMEDIA_TYPE_VIDEO, \
.id = AV_CODEC_ID_##X, \
const FFCodec ff_##x##_cuvid_decoder = { \
.p.name = #x "_cuvid", \
.p.long_name = NULL_IF_CONFIG_SMALL("Nvidia CUVID " #X " decoder"), \
.p.type = AVMEDIA_TYPE_VIDEO, \
.p.id = AV_CODEC_ID_##X, \
.priv_data_size = sizeof(CuvidContext), \
.priv_class = &x##_cuvid_class, \
.p.priv_class = &x##_cuvid_class, \
.init = cuvid_decode_init, \
.close = cuvid_decode_end, \
.receive_frame = cuvid_output_frame, \
.flush = cuvid_flush, \
.bsfs = bsf_name, \
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE, \
.p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE, \
.caps_internal = FF_CODEC_CAP_SETS_FRAME_PROPS, \
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_CUDA, \
.p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_CUDA, \
AV_PIX_FMT_NV12, \
AV_PIX_FMT_P010, \
AV_PIX_FMT_P016, \
AV_PIX_FMT_NONE }, \
.hw_configs = cuvid_hw_configs, \
.wrapper_name = "cuvid", \
.p.wrapper_name = "cuvid", \
};
#if CONFIG_AV1_CUVID_DECODER && defined(CUVID_HAS_AV1_SUPPORT)

View File

@ -179,29 +179,29 @@ static int cyuv_decode_frame(AVCodecContext *avctx,
}
#if CONFIG_AURA_DECODER
const AVCodec ff_aura_decoder = {
.name = "aura",
.long_name = NULL_IF_CONFIG_SMALL("Auravision AURA"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_AURA,
const FFCodec ff_aura_decoder = {
.p.name = "aura",
.p.long_name = NULL_IF_CONFIG_SMALL("Auravision AURA"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_AURA,
.priv_data_size = sizeof(CyuvDecodeContext),
.init = cyuv_decode_init,
.decode = cyuv_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif
#if CONFIG_CYUV_DECODER
const AVCodec ff_cyuv_decoder = {
.name = "cyuv",
.long_name = NULL_IF_CONFIG_SMALL("Creative YUV (CYUV)"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_CYUV,
const FFCodec ff_cyuv_decoder = {
.p.name = "cyuv",
.p.long_name = NULL_IF_CONFIG_SMALL("Creative YUV (CYUV)"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_CYUV,
.priv_data_size = sizeof(CyuvDecodeContext),
.init = cyuv_decode_init,
.decode = cyuv_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif

View File

@ -411,20 +411,20 @@ static const AVClass dcadec_class = {
.category = AV_CLASS_CATEGORY_DECODER,
};
const AVCodec ff_dca_decoder = {
.name = "dca",
.long_name = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_DTS,
const FFCodec ff_dca_decoder = {
.p.name = "dca",
.p.long_name = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_DTS,
.priv_data_size = sizeof(DCAContext),
.init = dcadec_init,
.decode = dcadec_decode_frame,
.close = dcadec_close,
.flush = dcadec_flush,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P,
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE },
.priv_class = &dcadec_class,
.profiles = NULL_IF_CONFIG_SMALL(ff_dca_profiles),
.p.priv_class = &dcadec_class,
.p.profiles = NULL_IF_CONFIG_SMALL(ff_dca_profiles),
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};

View File

@ -1240,29 +1240,29 @@ static const AVCodecDefault defaults[] = {
{ NULL },
};
const AVCodec ff_dca_encoder = {
.name = "dca",
.long_name = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_DTS,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL,
const FFCodec ff_dca_encoder = {
.p.name = "dca",
.p.long_name = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_DTS,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL,
.priv_data_size = sizeof(DCAEncContext),
.init = encode_init,
.close = encode_close,
.encode2 = encode_frame,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32,
.p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32,
AV_SAMPLE_FMT_NONE },
.supported_samplerates = sample_rates,
.p.supported_samplerates = sample_rates,
#if FF_API_OLD_CHANNEL_LAYOUT
.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO,
.p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO,
AV_CH_LAYOUT_STEREO,
AV_CH_LAYOUT_2_2,
AV_CH_LAYOUT_5POINT0,
AV_CH_LAYOUT_5POINT1,
0 },
#endif
.ch_layouts = (const AVChannelLayout[]){
.p.ch_layouts = (const AVChannelLayout[]){
AV_CHANNEL_LAYOUT_MONO,
AV_CHANNEL_LAYOUT_STEREO,
AV_CHANNEL_LAYOUT_2_2,
@ -1271,5 +1271,5 @@ const AVCodec ff_dca_encoder = {
{ 0 },
},
.defaults = defaults,
.priv_class = &dcaenc_class,
.p.priv_class = &dcaenc_class,
};

View File

@ -749,13 +749,13 @@ static int dds_decode(AVCodecContext *avctx, void *data,
return avpkt->size;
}
const AVCodec ff_dds_decoder = {
.name = "dds",
.long_name = NULL_IF_CONFIG_SMALL("DirectDraw Surface image decoder"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_DDS,
const FFCodec ff_dds_decoder = {
.p.name = "dds",
.p.long_name = NULL_IF_CONFIG_SMALL("DirectDraw Surface image decoder"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_DDS,
.decode = dds_decode,
.priv_data_size = sizeof(DDSContext),
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE
};

View File

@ -188,14 +188,15 @@ static int extract_packet_props(AVCodecInternal *avci, const AVPacket *pkt)
static int decode_bsfs_init(AVCodecContext *avctx)
{
AVCodecInternal *avci = avctx->internal;
const FFCodec *const codec = ffcodec(avctx->codec);
int ret;
if (avci->bsf)
return 0;
ret = av_bsf_list_parse_str(avctx->codec->bsfs, &avci->bsf);
ret = av_bsf_list_parse_str(codec->bsfs, &avci->bsf);
if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "Error parsing decoder bitstream filters '%s': %s\n", avctx->codec->bsfs, av_err2str(ret));
av_log(avctx, AV_LOG_ERROR, "Error parsing decoder bitstream filters '%s': %s\n", codec->bsfs, av_err2str(ret));
if (ret != AVERROR(ENOMEM))
ret = AVERROR_BUG;
goto fail;
@ -233,7 +234,7 @@ int ff_decode_get_packet(AVCodecContext *avctx, AVPacket *pkt)
if (ret < 0)
return ret;
if (!(avctx->codec->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) {
if (!(ffcodec(avctx->codec)->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) {
ret = extract_packet_props(avctx->internal, pkt);
if (ret < 0)
goto finish;
@ -295,6 +296,7 @@ static inline int decode_simple_internal(AVCodecContext *avctx, AVFrame *frame,
{
AVCodecInternal *avci = avctx->internal;
AVPacket *const pkt = avci->in_pkt;
const FFCodec *const codec = ffcodec(avctx->codec);
int got_frame, actual_got_frame;
int ret;
@ -320,9 +322,9 @@ static inline int decode_simple_internal(AVCodecContext *avctx, AVFrame *frame,
if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME) {
ret = ff_thread_decode_frame(avctx, frame, &got_frame, pkt);
} else {
ret = avctx->codec->decode(avctx, frame, &got_frame, pkt);
ret = codec->decode(avctx, frame, &got_frame, pkt);
if (!(avctx->codec->caps_internal & FF_CODEC_CAP_SETS_PKT_DTS))
if (!(codec->caps_internal & FF_CODEC_CAP_SETS_PKT_DTS))
frame->pkt_dts = pkt->dts;
if (avctx->codec->type == AVMEDIA_TYPE_VIDEO) {
if(!avctx->has_b_frames)
@ -507,7 +509,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
pkt->size -= consumed;
pkt->pts = AV_NOPTS_VALUE;
pkt->dts = AV_NOPTS_VALUE;
if (!(avctx->codec->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) {
if (!(codec->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) {
avci->last_pkt_props->size -= consumed; // See extract_packet_props() comment.
avci->last_pkt_props->pts = AV_NOPTS_VALUE;
avci->last_pkt_props->dts = AV_NOPTS_VALUE;
@ -539,12 +541,13 @@ static int decode_simple_receive_frame(AVCodecContext *avctx, AVFrame *frame)
static int decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame)
{
AVCodecInternal *avci = avctx->internal;
const FFCodec *const codec = ffcodec(avctx->codec);
int ret;
av_assert0(!frame->buf[0]);
if (avctx->codec->receive_frame) {
ret = avctx->codec->receive_frame(avctx, frame);
if (codec->receive_frame) {
ret = codec->receive_frame(avctx, frame);
if (ret != AVERROR(EAGAIN))
av_packet_unref(avci->last_pkt_props);
} else
@ -553,7 +556,7 @@ static int decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame)
if (ret == AVERROR_EOF)
avci->draining_done = 1;
if (!(avctx->codec->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS) &&
if (!(codec->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS) &&
IS_EMPTY(avci->last_pkt_props)) {
// May fail if the FIFO is empty.
av_fifo_read(avci->pkt_props, avci->last_pkt_props, 1);
@ -859,7 +862,7 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
if (avctx->pkt_timebase.num && avpkt->pts != AV_NOPTS_VALUE)
sub->pts = av_rescale_q(avpkt->pts,
avctx->pkt_timebase, AV_TIME_BASE_Q);
ret = avctx->codec->decode(avctx, sub, got_sub_ptr, pkt);
ret = ffcodec(avctx->codec)->decode(avctx, sub, got_sub_ptr, pkt);
if (pkt == avci->buffer_pkt) // did we recode?
av_packet_unref(avci->buffer_pkt);
if (ret < 0) {
@ -909,11 +912,11 @@ enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *avctx,
// If a device was supplied when the codec was opened, assume that the
// user wants to use it.
if (avctx->hw_device_ctx && avctx->codec->hw_configs) {
if (avctx->hw_device_ctx && ffcodec(avctx->codec)->hw_configs) {
AVHWDeviceContext *device_ctx =
(AVHWDeviceContext*)avctx->hw_device_ctx->data;
for (i = 0;; i++) {
config = &avctx->codec->hw_configs[i]->public;
config = &ffcodec(avctx->codec)->hw_configs[i]->public;
if (!config)
break;
if (!(config->methods &
@ -1025,7 +1028,7 @@ int avcodec_get_hw_frames_parameters(AVCodecContext *avctx,
int i, ret;
for (i = 0;; i++) {
hw_config = avctx->codec->hw_configs[i];
hw_config = ffcodec(avctx->codec)->hw_configs[i];
if (!hw_config)
return AVERROR(ENOENT);
if (hw_config->public.pix_fmt == hw_pix_fmt)
@ -1169,9 +1172,9 @@ int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
break;
}
if (avctx->codec->hw_configs) {
if (ffcodec(avctx->codec)->hw_configs) {
for (i = 0;; i++) {
hw_config = avctx->codec->hw_configs[i];
hw_config = ffcodec(avctx->codec)->hw_configs[i];
if (!hw_config)
break;
if (hw_config->public.pix_fmt == user_choice)
@ -1538,7 +1541,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame)
{ AV_PKT_DATA_DYNAMIC_HDR10_PLUS, AV_FRAME_DATA_DYNAMIC_HDR_PLUS },
};
if (!(avctx->codec->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) {
if (!(ffcodec(avctx->codec)->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) {
frame->pts = pkt->pts;
frame->pkt_pos = pkt->pos;
frame->pkt_duration = pkt->duration;
@ -1739,7 +1742,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
end:
if (avctx->codec_type == AVMEDIA_TYPE_VIDEO && !override_dimensions &&
!(avctx->codec->caps_internal & FF_CODEC_CAP_EXPORTS_CROPPING)) {
!(ffcodec(avctx->codec)->caps_internal & FF_CODEC_CAP_EXPORTS_CROPPING)) {
frame->width = avctx->width;
frame->height = avctx->height;
}

View File

@ -90,7 +90,7 @@ int ff_copy_palette(void *dst, const AVPacket *src, void *logctx);
/**
* Perform decoder initialization and validation.
* Called when opening the decoder, before the AVCodec.init() call.
* Called when opening the decoder, before the FFCodec.init() call.
*/
int ff_decode_preinit(AVCodecContext *avctx);

View File

@ -423,15 +423,15 @@ static av_cold int dfa_decode_end(AVCodecContext *avctx)
return 0;
}
const AVCodec ff_dfa_decoder = {
.name = "dfa",
.long_name = NULL_IF_CONFIG_SMALL("Chronomaster DFA"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_DFA,
const FFCodec ff_dfa_decoder = {
.p.name = "dfa",
.p.long_name = NULL_IF_CONFIG_SMALL("Chronomaster DFA"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_DFA,
.priv_data_size = sizeof(DfaContext),
.init = dfa_decode_init,
.close = dfa_decode_end,
.decode = dfa_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -125,14 +125,14 @@ static int dfpwm_dec_frame(struct AVCodecContext *ctx, void *data,
return packet->size;
}
const AVCodec ff_dfpwm_decoder = {
.name = "dfpwm",
.long_name = NULL_IF_CONFIG_SMALL("DFPWM1a audio"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_DFPWM,
const FFCodec ff_dfpwm_decoder = {
.p.name = "dfpwm",
.p.long_name = NULL_IF_CONFIG_SMALL("DFPWM1a audio"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_DFPWM,
.priv_data_size = sizeof(DFPWMState),
.init = dfpwm_dec_init,
.decode = dfpwm_dec_frame,
.capabilities = AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -107,15 +107,15 @@ static int dfpwm_enc_frame(struct AVCodecContext *ctx, struct AVPacket *packet,
return 0;
}
const AVCodec ff_dfpwm_encoder = {
.name = "dfpwm",
.long_name = NULL_IF_CONFIG_SMALL("DFPWM1a audio"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_DFPWM,
const FFCodec ff_dfpwm_encoder = {
.p.name = "dfpwm",
.p.long_name = NULL_IF_CONFIG_SMALL("DFPWM1a audio"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_DFPWM,
.priv_data_size = sizeof(DFPWMState),
.init = dfpwm_enc_init,
.encode2 = dfpwm_enc_frame,
.sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_NONE},
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_VARIABLE_FRAME_SIZE,
.p.sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_NONE},
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_VARIABLE_FRAME_SIZE,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};

View File

@ -2356,16 +2356,16 @@ static int dirac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
return buf_idx;
}
const AVCodec ff_dirac_decoder = {
.name = "dirac",
.long_name = NULL_IF_CONFIG_SMALL("BBC Dirac VC-2"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_DIRAC,
const FFCodec ff_dirac_decoder = {
.p.name = "dirac",
.p.long_name = NULL_IF_CONFIG_SMALL("BBC Dirac VC-2"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_DIRAC,
.priv_data_size = sizeof(DiracContext),
.init = dirac_decode_init,
.close = dirac_decode_end,
.decode = dirac_decode_frame,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_DR1,
.p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
.flush = dirac_decode_flush,
};

Some files were not shown because too many files have changed in this diff Show More