avcodec/parser_internal: Remove prefix from parser_{init,parse,close}

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-10-26 14:42:59 +01:00
parent e0b0ca8111
commit 7c43cc4cb7
69 changed files with 160 additions and 160 deletions

View File

@@ -55,7 +55,7 @@ static av_cold int aac_parse_init(AVCodecParserContext *s1)
const FFCodecParser ff_aac_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_AAC),
.priv_data_size = sizeof(AACAC3ParseContext),
.parser_init = aac_parse_init,
.parser_parse = ff_aac_ac3_parse,
.parser_close = ff_parse_close,
.init = aac_parse_init,
.parse = ff_aac_ac3_parse,
.close = ff_parse_close,
};

View File

@@ -481,9 +481,9 @@ static av_cold int ac3_parse_init(AVCodecParserContext *s1)
const FFCodecParser ff_ac3_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_AC3, AV_CODEC_ID_EAC3),
.priv_data_size = sizeof(AACAC3ParseContext),
.parser_init = ac3_parse_init,
.parser_parse = ff_aac_ac3_parse,
.parser_close = ff_parse_close,
.init = ac3_parse_init,
.parse = ff_aac_ac3_parse,
.close = ff_parse_close,
};
#else

View File

@@ -101,6 +101,6 @@ static int adx_parse(AVCodecParserContext *s1,
const FFCodecParser ff_adx_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_ADPCM_ADX),
.priv_data_size = sizeof(ADXParseContext),
.parser_parse = adx_parse,
.parser_close = ff_parse_close,
.parse = adx_parse,
.close = ff_parse_close,
};

View File

@@ -74,6 +74,6 @@ static int ahx_parse(AVCodecParserContext *s1,
const FFCodecParser ff_ahx_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_AHX),
.priv_data_size = sizeof(AHXParseContext),
.parser_parse = ahx_parse,
.parser_close = ff_parse_close,
.parse = ahx_parse,
.close = ff_parse_close,
};

View File

@@ -126,7 +126,7 @@ static int amr_parse(AVCodecParserContext *s1,
const FFCodecParser ff_amr_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_AMR_NB, AV_CODEC_ID_AMR_WB),
.priv_data_size = sizeof(AMRParseContext),
.parser_init = amr_parse_init,
.parser_parse = amr_parse,
.parser_close = ff_parse_close,
.init = amr_parse_init,
.parse = amr_parse,
.close = ff_parse_close,
};

View File

@@ -144,7 +144,7 @@ static av_cold void close(AVCodecParserContext *s)
const FFCodecParser ff_apv_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_APV),
.priv_data_size = sizeof(APVParseContext),
.parser_init = init,
.parser_parse = parse,
.parser_close = close,
.init = init,
.parse = parse,
.close = close,
};

View File

@@ -213,7 +213,7 @@ static av_cold void av1_parser_close(AVCodecParserContext *ctx)
const FFCodecParser ff_av1_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_AV1),
.priv_data_size = sizeof(AV1ParseContext),
.parser_init = av1_parser_init,
.parser_close = av1_parser_close,
.parser_parse = av1_parser_parse,
.init = av1_parser_init,
.close = av1_parser_close,
.parse = av1_parser_parse,
};

View File

@@ -193,6 +193,6 @@ static int avs2_parse(AVCodecParserContext *s, AVCodecContext *avctx,
const FFCodecParser ff_avs2_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_AVS2),
.priv_data_size = sizeof(ParseContext),
.parser_parse = avs2_parse,
.parser_close = ff_parse_close,
.parse = avs2_parse,
.close = ff_parse_close,
};

View File

@@ -176,6 +176,6 @@ static int avs3_parse(AVCodecParserContext *s, AVCodecContext *avctx,
const FFCodecParser ff_avs3_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_AVS3),
.priv_data_size = sizeof(ParseContext),
.parser_parse = avs3_parse,
.parser_close = ff_parse_close,
.parse = avs3_parse,
.close = ff_parse_close,
};

View File

@@ -109,6 +109,6 @@ flush:
const FFCodecParser ff_bmp_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_BMP),
.priv_data_size = sizeof(BMPParseContext),
.parser_parse = bmp_parse,
.parser_close = ff_parse_close,
.parse = bmp_parse,
.close = ff_parse_close,
};

View File

@@ -100,6 +100,6 @@ static int cavsvideo_parse(AVCodecParserContext *s,
const FFCodecParser ff_cavsvideo_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_CAVS),
.priv_data_size = sizeof(ParseContext),
.parser_parse = cavsvideo_parse,
.parser_close = ff_parse_close,
.parse = cavsvideo_parse,
.close = ff_parse_close,
};

View File

@@ -57,5 +57,5 @@ static int cook_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
const FFCodecParser ff_cook_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_COOK),
.priv_data_size = sizeof(CookParseContext),
.parser_parse = cook_parse,
.parse = cook_parse,
};

View File

@@ -101,6 +101,6 @@ static int cri_parse(AVCodecParserContext *s, AVCodecContext *avctx,
const FFCodecParser ff_cri_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_CRI),
.priv_data_size = sizeof(CRIParser),
.parser_parse = cri_parse,
.parser_close = ff_parse_close,
.parse = cri_parse,
.close = ff_parse_close,
};

View File

@@ -347,7 +347,7 @@ static int dca_parse(AVCodecParserContext *s, AVCodecContext *avctx,
const FFCodecParser ff_dca_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_DTS),
.priv_data_size = sizeof(DCAParseContext),
.parser_init = dca_parse_init,
.parser_parse = dca_parse,
.parser_close = ff_parse_close,
.init = dca_parse_init,
.parse = dca_parse,
.close = ff_parse_close,
};

View File

@@ -278,6 +278,6 @@ static av_cold void dirac_parse_close(AVCodecParserContext *s)
const FFCodecParser ff_dirac_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_DIRAC),
.priv_data_size = sizeof(DiracParseContext),
.parser_parse = dirac_parse,
.parser_close = dirac_parse_close,
.parse = dirac_parse,
.close = dirac_parse_close,
};

View File

@@ -142,6 +142,6 @@ static int dnxhd_parse(AVCodecParserContext *s,
const FFCodecParser ff_dnxhd_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_DNXHD),
.priv_data_size = sizeof(DNXHDParserContext),
.parser_parse = dnxhd_parse,
.parser_close = ff_parse_close,
.parse = dnxhd_parse,
.close = ff_parse_close,
};

View File

@@ -85,6 +85,6 @@ static int dnxuc_parse(AVCodecParserContext *s,
const FFCodecParser ff_dnxuc_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_DNXUC),
.priv_data_size = sizeof(DNxUcParseContext),
.parser_parse = dnxuc_parse,
.parser_close = ff_parse_close,
.parse = dnxuc_parse,
.close = ff_parse_close,
};

View File

@@ -69,5 +69,5 @@ end:
const FFCodecParser ff_dolby_e_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_DOLBY_E),
.priv_data_size = sizeof(DBEParseContext),
.parser_parse = dolby_e_parse,
.parse = dolby_e_parse,
};

View File

@@ -112,6 +112,6 @@ flush:
const FFCodecParser ff_dpx_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_DPX),
.priv_data_size = sizeof(DPXParseContext),
.parser_parse = dpx_parse,
.parser_close = ff_parse_close,
.parse = dpx_parse,
.close = ff_parse_close,
};

View File

@@ -43,5 +43,5 @@ static int dvaudio_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
const FFCodecParser ff_dvaudio_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_DVAUDIO),
.parser_parse = dvaudio_parse,
.parse = dvaudio_parse,
};

View File

@@ -167,5 +167,5 @@ static int dvbsub_parse(AVCodecParserContext *s,
const FFCodecParser ff_dvbsub_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_DVB_SUBTITLE),
.priv_data_size = sizeof(DVBSubParseContext),
.parser_parse = dvbsub_parse,
.parse = dvbsub_parse,
};

View File

@@ -111,6 +111,6 @@ static int dvd_nav_parse(AVCodecParserContext *s,
const FFCodecParser ff_dvd_nav_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_DVD_NAV),
.priv_data_size = sizeof(DVDNavParseContext),
.parser_init = dvd_nav_parse_init,
.parser_parse = dvd_nav_parse,
.init = dvd_nav_parse_init,
.parse = dvd_nav_parse,
};

View File

@@ -88,6 +88,6 @@ static av_cold void dvdsub_parse_close(AVCodecParserContext *s)
const FFCodecParser ff_dvdsub_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_DVD_SUBTITLE),
.priv_data_size = sizeof(DVDSubParseContext),
.parser_parse = dvdsub_parse,
.parser_close = dvdsub_parse_close,
.parse = dvdsub_parse,
.close = dvdsub_parse_close,
};

View File

@@ -375,6 +375,6 @@ static av_cold void evc_parser_close(AVCodecParserContext *s)
const FFCodecParser ff_evc_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_EVC),
.priv_data_size = sizeof(EVCParserContext),
.parser_parse = evc_parse,
.parser_close = evc_parser_close,
.parse = evc_parse,
.close = evc_parser_close,
};

View File

@@ -84,6 +84,6 @@ static av_cold void ffv1_close(AVCodecParserContext *s)
const FFCodecParser ff_ffv1_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_FFV1),
.priv_data_size = sizeof(FFV1ParseContext),
.parser_parse = parse,
.parser_close = ffv1_close,
.parse = parse,
.close = ffv1_close,
};

View File

@@ -906,7 +906,7 @@ static av_cold void flac_parse_close(AVCodecParserContext *c)
const FFCodecParser ff_flac_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_FLAC),
.priv_data_size = sizeof(FLACParseContext),
.parser_init = flac_parse_init,
.parser_parse = flac_parse,
.parser_close = flac_parse_close,
.init = flac_parse_init,
.parse = flac_parse,
.close = flac_parse_close,
};

View File

@@ -100,6 +100,6 @@ static int ftr_parse(AVCodecParserContext *s, AVCodecContext *avctx,
const FFCodecParser ff_ftr_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_FTR),
.priv_data_size = sizeof(FTRParseContext),
.parser_parse = ftr_parse,
.parser_close = ff_parse_close,
.parse = ftr_parse,
.close = ff_parse_close,
};

View File

@@ -56,6 +56,6 @@ static int g723_1_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
const FFCodecParser ff_g723_1_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_G723_1),
.priv_data_size = sizeof(G723_1ParseContext),
.parser_parse = g723_1_parse,
.parser_close = ff_parse_close,
.parse = g723_1_parse,
.close = ff_parse_close,
};

View File

@@ -88,6 +88,6 @@ static int g729_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
const FFCodecParser ff_g729_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_G729, AV_CODEC_ID_ACELP_KELVIN),
.priv_data_size = sizeof(G729ParseContext),
.parser_parse = g729_parse,
.parser_close = ff_parse_close,
.parse = g729_parse,
.close = ff_parse_close,
};

View File

@@ -204,6 +204,6 @@ static int gif_parse(AVCodecParserContext *s, AVCodecContext *avctx,
const FFCodecParser ff_gif_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_GIF),
.priv_data_size = sizeof(GIFParseContext),
.parser_parse = gif_parse,
.parser_close = ff_parse_close,
.parse = gif_parse,
.close = ff_parse_close,
};

View File

@@ -87,6 +87,6 @@ static int gsm_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
const FFCodecParser ff_gsm_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_GSM, AV_CODEC_ID_GSM_MS),
.priv_data_size = sizeof(GSMParseContext),
.parser_parse = gsm_parse,
.parser_close = ff_parse_close,
.parse = gsm_parse,
.close = ff_parse_close,
};

View File

@@ -90,6 +90,6 @@ static int h261_parse(AVCodecParserContext *s,
const FFCodecParser ff_h261_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_H261),
.priv_data_size = sizeof(ParseContext),
.parser_parse = h261_parse,
.parser_close = ff_parse_close,
.parse = h261_parse,
.close = ff_parse_close,
};

View File

@@ -91,6 +91,6 @@ static int h263_parse(AVCodecParserContext *s,
const FFCodecParser ff_h263_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_H263),
.priv_data_size = sizeof(ParseContext),
.parser_parse = h263_parse,
.parser_close = ff_parse_close,
.parse = h263_parse,
.close = ff_parse_close,
};

View File

@@ -686,7 +686,7 @@ static av_cold int init(AVCodecParserContext *s)
const FFCodecParser ff_h264_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_H264),
.priv_data_size = sizeof(H264ParseContext),
.parser_init = init,
.parser_parse = h264_parse,
.parser_close = h264_close,
.init = init,
.parse = h264_parse,
.close = h264_close,
};

View File

@@ -75,6 +75,6 @@ static int hdr_parse(AVCodecParserContext *s, AVCodecContext *avctx,
const FFCodecParser ff_hdr_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_RADIANCE_HDR),
.priv_data_size = sizeof(HDRParseContext),
.parser_parse = hdr_parse,
.parser_close = ff_parse_close,
.parse = hdr_parse,
.close = ff_parse_close,
};

View File

@@ -356,6 +356,6 @@ static void hevc_parser_close(AVCodecParserContext *s)
const FFCodecParser ff_hevc_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_HEVC),
.priv_data_size = sizeof(HEVCParserContext),
.parser_parse = hevc_parse,
.parser_close = hevc_parser_close,
.parse = hevc_parse,
.close = hevc_parser_close,
};

View File

@@ -73,6 +73,6 @@ static int ipu_parse(AVCodecParserContext *s, AVCodecContext *avctx,
const FFCodecParser ff_ipu_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_IPU),
.priv_data_size = sizeof(IPUParseContext),
.parser_parse = ipu_parse,
.parser_close = ff_parse_close,
.parse = ipu_parse,
.close = ff_parse_close,
};

View File

@@ -215,6 +215,6 @@ static int jpeg2000_parse(AVCodecParserContext *s,
const FFCodecParser ff_jpeg2000_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_JPEG2000),
.priv_data_size = sizeof(JPEG2000ParserContext),
.parser_parse = jpeg2000_parse,
.parser_close = ff_parse_close,
.parse = jpeg2000_parse,
.close = ff_parse_close,
};

View File

@@ -1549,6 +1549,6 @@ flush:
const FFCodecParser ff_jpegxl_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_JPEGXL, AV_CODEC_ID_JPEGXL_ANIM),
.priv_data_size = sizeof(JXLParseContext),
.parser_parse = jpegxl_parse,
.parser_close = ff_parse_close,
.parse = jpegxl_parse,
.close = ff_parse_close,
};

View File

@@ -108,6 +108,6 @@ static int latm_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
const FFCodecParser ff_aac_latm_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_AAC_LATM),
.priv_data_size = sizeof(LATMParseContext),
.parser_parse = latm_parse,
.parser_close = ff_parse_close
.parse = latm_parse,
.close = ff_parse_close
};

View File

@@ -77,6 +77,6 @@ static int misc4_parse(AVCodecParserContext *s, AVCodecContext *avctx,
const FFCodecParser ff_misc4_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_MISC4),
.priv_data_size = sizeof(MISC4Context),
.parser_parse = misc4_parse,
.parser_close = ff_parse_close,
.parse = misc4_parse,
.close = ff_parse_close,
};

View File

@@ -132,6 +132,6 @@ static int jpeg_parse(AVCodecParserContext *s,
const FFCodecParser ff_mjpeg_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_MJPEG, AV_CODEC_ID_JPEGLS),
.priv_data_size = sizeof(MJPEGParserContext),
.parser_parse = jpeg_parse,
.parser_close = ff_parse_close,
.parse = jpeg_parse,
.close = ff_parse_close,
};

View File

@@ -208,7 +208,7 @@ lost_sync:
const FFCodecParser ff_mlp_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_MLP, AV_CODEC_ID_TRUEHD),
.priv_data_size = sizeof(MLPParseContext),
.parser_init = mlp_init,
.parser_parse = mlp_parse,
.parser_close = ff_parse_close,
.init = mlp_init,
.parse = mlp_parse,
.close = ff_parse_close,
};

View File

@@ -159,7 +159,7 @@ static int mpeg4video_parse(AVCodecParserContext *s,
const FFCodecParser ff_mpeg4video_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_MPEG4),
.priv_data_size = sizeof(struct Mp4vParseContext),
.parser_init = mpeg4video_parse_init,
.parser_parse = mpeg4video_parse,
.parser_close = ff_parse_close,
.init = mpeg4video_parse_init,
.parse = mpeg4video_parse,
.close = ff_parse_close,
};

View File

@@ -141,6 +141,6 @@ const FFCodecParser ff_mpegaudio_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_MP1, AV_CODEC_ID_MP2,
AV_CODEC_ID_MP3, AV_CODEC_ID_MP3ADU),
.priv_data_size = sizeof(MpegAudioParseContext),
.parser_parse = mpegaudio_parse,
.parser_close = ff_parse_close,
.parse = mpegaudio_parse,
.close = ff_parse_close,
};

View File

@@ -303,7 +303,7 @@ static av_cold int mpegvideo_parse_init(AVCodecParserContext *s)
const FFCodecParser ff_mpegvideo_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_MPEG1VIDEO, AV_CODEC_ID_MPEG2VIDEO),
.priv_data_size = sizeof(struct MpvParseContext),
.parser_init = mpegvideo_parse_init,
.parser_parse = mpegvideo_parse,
.parser_close = ff_parse_close,
.init = mpegvideo_parse_init,
.parse = mpegvideo_parse,
.close = ff_parse_close,
};

View File

@@ -217,6 +217,6 @@ fail:
const FFCodecParser ff_opus_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_OPUS),
.priv_data_size = sizeof(OpusParserContext),
.parser_parse = opus_parse,
.parser_close = ff_parse_close
.parse = opus_parse,
.close = ff_parse_close
};

View File

@@ -65,8 +65,8 @@ found:
goto err_out;
s->fetch_timestamp=1;
s->pict_type = AV_PICTURE_TYPE_I;
if (ffparser->parser_init) {
ret = ffparser->parser_init(s);
if (ffparser->init) {
ret = ffparser->init(s);
if (ret != 0)
goto err_out;
}
@@ -164,8 +164,8 @@ int av_parser_parse2(AVCodecParserContext *s, AVCodecContext *avctx,
ff_fetch_timestamp(s, 0, 0, 0);
}
/* WARNING: the returned index can be negative */
index = ffcodecparser(s->parser)->parser_parse(s, avctx, (const uint8_t **) poutbuf,
poutbuf_size, buf, buf_size);
index = ffcodecparser(s->parser)->parse(s, avctx, (const uint8_t **) poutbuf,
poutbuf_size, buf, buf_size);
av_assert0(index > -0x20000000); // The API does not allow returning AVERROR codes
#define FILL(name) if(s->name > 0 && avctx->name <= 0) avctx->name = s->name
if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
@@ -197,8 +197,8 @@ int av_parser_parse2(AVCodecParserContext *s, AVCodecContext *avctx,
av_cold void av_parser_close(AVCodecParserContext *s)
{
if (s) {
if (ffcodecparser(s->parser)->parser_close)
ffcodecparser(s->parser)->parser_close(s);
if (ffcodecparser(s->parser)->close)
ffcodecparser(s->parser)->close(s);
av_freep(&s->priv_data);
av_free(s);
}

View File

@@ -30,12 +30,12 @@ typedef union FFCodecParser {
struct {
int codec_ids[7]; /* several codec IDs are permitted */
int priv_data_size;
int (*parser_init)(AVCodecParserContext *s);
int (*parser_parse)(AVCodecParserContext *s,
AVCodecContext *avctx,
const uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size);
void (*parser_close)(AVCodecParserContext *s);
int (*init)(AVCodecParserContext *s);
int (*parse)(AVCodecParserContext *s,
AVCodecContext *avctx,
const uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size);
void (*close)(AVCodecParserContext *s);
int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
};
AVCodecParser p;
@@ -43,12 +43,12 @@ typedef union FFCodecParser {
typedef struct FFCodecParser {
AVCodecParser p;
unsigned priv_data_size;
int (*parser_init)(AVCodecParserContext *s);
int (*parser_parse)(AVCodecParserContext *s,
AVCodecContext *avctx,
const uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size);
void (*parser_close)(AVCodecParserContext *s);
int (*init)(AVCodecParserContext *s);
int (*parse)(AVCodecParserContext *s,
AVCodecContext *avctx,
const uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size);
void (*close)(AVCodecParserContext *s);
#endif
} FFCodecParser;

View File

@@ -24,13 +24,13 @@
#if FF_API_PARSER_PRIVATE
#include <assert.h>
#include <stddef.h>
#define CHECK_OFFSET(field) static_assert(offsetof(FFCodecParser, field) == offsetof(FFCodecParser, p.field), "Wrong offsets")
CHECK_OFFSET(codec_ids);
CHECK_OFFSET(priv_data_size);
CHECK_OFFSET(parser_init);
CHECK_OFFSET(parser_parse);
CHECK_OFFSET(parser_close);
CHECK_OFFSET(split);
#define CHECK_OFFSET(field, public_prefix) static_assert(offsetof(FFCodecParser, field) == offsetof(FFCodecParser, p.public_prefix ## field), "Wrong offsets")
CHECK_OFFSET(codec_ids,);
CHECK_OFFSET(priv_data_size,);
CHECK_OFFSET(init, parser_);
CHECK_OFFSET(parse, parser_);
CHECK_OFFSET(close, parser_);
CHECK_OFFSET(split,);
#endif
extern const FFCodecParser ff_aac_parser;

View File

@@ -114,6 +114,6 @@ flush:
const FFCodecParser ff_png_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_PNG),
.priv_data_size = sizeof(PNGParseContext),
.parser_parse = png_parse,
.parser_close = ff_parse_close,
.parse = png_parse,
.close = ff_parse_close,
};

View File

@@ -139,6 +139,6 @@ const FFCodecParser ff_pnm_parser = {
AV_CODEC_ID_PBM, AV_CODEC_ID_PAM, AV_CODEC_ID_PFM,
AV_CODEC_ID_PHM),
.priv_data_size = sizeof(PNMParseContext),
.parser_parse = pnm_parse,
.parser_close = ff_parse_close,
.parse = pnm_parse,
.close = ff_parse_close,
};

View File

@@ -125,5 +125,5 @@ static int parse(AVCodecParserContext *s,
const FFCodecParser ff_prores_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_PRORES),
.parser_parse = parse,
.parse = parse,
};

View File

@@ -99,5 +99,5 @@ static int prores_raw_parse(AVCodecParserContext *s, AVCodecContext *avctx,
const FFCodecParser ff_prores_raw_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_PRORES_RAW),
.parser_parse = prores_raw_parse,
.parse = prores_raw_parse,
};

View File

@@ -73,6 +73,6 @@ static int qoi_parse(AVCodecParserContext *s, AVCodecContext *avctx,
const FFCodecParser ff_qoi_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_QOI),
.priv_data_size = sizeof(QOIParseContext),
.parser_parse = qoi_parse,
.parser_close = ff_parse_close,
.parse = qoi_parse,
.close = ff_parse_close,
};

View File

@@ -79,5 +79,5 @@ static int rv34_parse(AVCodecParserContext *s,
const FFCodecParser ff_rv34_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_RV30, AV_CODEC_ID_RV40),
.priv_data_size = sizeof(RV34ParseContext),
.parser_parse = rv34_parse,
.parse = rv34_parse,
};

View File

@@ -120,6 +120,6 @@ static int sbc_parse(AVCodecParserContext *s, AVCodecContext *avctx,
const FFCodecParser ff_sbc_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_SBC),
.priv_data_size = sizeof(SBCParseContext),
.parser_parse = sbc_parse,
.parser_close = ff_parse_close,
.parse = sbc_parse,
.close = ff_parse_close,
};

View File

@@ -70,6 +70,6 @@ static int sipr_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
const FFCodecParser ff_sipr_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_SIPR),
.priv_data_size = sizeof(SiprParserContext),
.parser_parse = sipr_parse,
.parser_close = ff_parse_close,
.parse = sipr_parse,
.close = ff_parse_close,
};

View File

@@ -127,6 +127,6 @@ fail:
const FFCodecParser ff_tak_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_TAK),
.priv_data_size = sizeof(TAKParseContext),
.parser_parse = tak_parse,
.parser_close = ff_parse_close,
.parse = tak_parse,
.close = ff_parse_close,
};

View File

@@ -275,7 +275,7 @@ static av_cold int vc1_parse_init(AVCodecParserContext *s)
const FFCodecParser ff_vc1_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_VC1),
.priv_data_size = sizeof(VC1ParseContext),
.parser_init = vc1_parse_init,
.parser_parse = vc1_parse,
.parser_close = ff_parse_close,
.init = vc1_parse_init,
.parse = vc1_parse,
.close = ff_parse_close,
};

View File

@@ -339,7 +339,7 @@ static av_cold void vorbis_parser_close(AVCodecParserContext *ctx)
const FFCodecParser ff_vorbis_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_VORBIS),
.priv_data_size = sizeof(VorbisParseContext),
.parser_parse = vorbis_parse,
.parser_close = vorbis_parser_close,
.parse = vorbis_parse,
.close = vorbis_parser_close,
};
#endif /* CONFIG_VORBIS_PARSER */

View File

@@ -39,5 +39,5 @@ static int parse(AVCodecParserContext *s,
const FFCodecParser ff_vp3_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_THEORA, AV_CODEC_ID_VP3,
AV_CODEC_ID_VP6, AV_CODEC_ID_VP6F, AV_CODEC_ID_VP6A),
.parser_parse = parse,
.parse = parse,
};

View File

@@ -76,5 +76,5 @@ static int parse(AVCodecParserContext *s,
const FFCodecParser ff_vp8_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_VP8),
.parser_parse = parse,
.parse = parse,
};

View File

@@ -66,5 +66,5 @@ static int parse(AVCodecParserContext *ctx,
const FFCodecParser ff_vp9_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_VP9),
.parser_parse = parse,
.parse = parse,
};

View File

@@ -509,7 +509,7 @@ static av_cold void vvc_parser_close(AVCodecParserContext *s)
const FFCodecParser ff_vvc_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_VVC),
.priv_data_size = sizeof(VVCParserContext),
.parser_init = vvc_parser_init,
.parser_close = vvc_parser_close,
.parser_parse = vvc_parser_parse,
.init = vvc_parser_init,
.close = vvc_parser_close,
.parse = vvc_parser_parse,
};

View File

@@ -108,6 +108,6 @@ flush:
const FFCodecParser ff_webp_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_WEBP),
.priv_data_size = sizeof(WebPParseContext),
.parser_parse = webp_parse,
.parser_close = ff_parse_close,
.parse = webp_parse,
.close = ff_parse_close,
};

View File

@@ -104,7 +104,7 @@ static int xbm_parse(AVCodecParserContext *s, AVCodecContext *avctx,
const FFCodecParser ff_xbm_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_XBM),
.priv_data_size = sizeof(XBMParseContext),
.parser_init = xbm_init,
.parser_parse = xbm_parse,
.parser_close = ff_parse_close,
.init = xbm_init,
.parse = xbm_parse,
.close = ff_parse_close,
};

View File

@@ -59,5 +59,5 @@ static int xma_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
const FFCodecParser ff_xma_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_XMA2),
.priv_data_size = sizeof(XMAParserContext),
.parser_parse = xma_parse,
.parse = xma_parse,
};

View File

@@ -99,6 +99,6 @@ static int xwd_parse(AVCodecParserContext *s, AVCodecContext *avctx,
const FFCodecParser ff_xwd_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_XWD),
.priv_data_size = sizeof(XWDParseContext),
.parser_parse = xwd_parse,
.parser_close = ff_parse_close,
.parse = xwd_parse,
.close = ff_parse_close,
};