FFmpeg
parsers.c
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
4  * FFmpeg is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * FFmpeg is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with FFmpeg; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #include <stdint.h>
20 
21 #include "avcodec.h"
22 #include "parser_internal.h"
23 
24 #if FF_API_PARSER_PRIVATE
25 #include "libavutil/internal.h"
26 #include <assert.h>
27 #include <stddef.h>
28 
30 #define CHECK_OFFSET(field, public_prefix) static_assert(offsetof(FFCodecParser, field) == offsetof(FFCodecParser, p.public_prefix ## field), "Wrong offsets")
32 CHECK_OFFSET(priv_data_size,);
33 CHECK_OFFSET(init, parser_);
34 CHECK_OFFSET(parse, parser_);
35 CHECK_OFFSET(close, parser_);
38 #endif
39 
40 extern const FFCodecParser ff_aac_parser;
42 extern const FFCodecParser ff_ac3_parser;
43 extern const FFCodecParser ff_adx_parser;
44 extern const FFCodecParser ff_ahx_parser;
45 extern const FFCodecParser ff_amr_parser;
46 extern const FFCodecParser ff_apv_parser;
47 extern const FFCodecParser ff_av1_parser;
48 extern const FFCodecParser ff_avs2_parser;
49 extern const FFCodecParser ff_avs3_parser;
50 extern const FFCodecParser ff_bmp_parser;
52 extern const FFCodecParser ff_cook_parser;
53 extern const FFCodecParser ff_cri_parser;
54 extern const FFCodecParser ff_dca_parser;
55 extern const FFCodecParser ff_dirac_parser;
56 extern const FFCodecParser ff_dnxhd_parser;
57 extern const FFCodecParser ff_dnxuc_parser;
58 extern const FFCodecParser ff_dolby_e_parser;
59 extern const FFCodecParser ff_dpx_parser;
60 extern const FFCodecParser ff_dvaudio_parser;
61 extern const FFCodecParser ff_dvbsub_parser;
62 extern const FFCodecParser ff_dvdsub_parser;
63 extern const FFCodecParser ff_dvd_nav_parser;
64 extern const FFCodecParser ff_evc_parser;
65 extern const FFCodecParser ff_flac_parser;
66 extern const FFCodecParser ff_ftr_parser;
67 extern const FFCodecParser ff_ffv1_parser;
68 extern const FFCodecParser ff_g723_1_parser;
69 extern const FFCodecParser ff_g729_parser;
70 extern const FFCodecParser ff_gif_parser;
71 extern const FFCodecParser ff_gsm_parser;
72 extern const FFCodecParser ff_h261_parser;
73 extern const FFCodecParser ff_h263_parser;
74 extern const FFCodecParser ff_h264_parser;
75 extern const FFCodecParser ff_hevc_parser;
76 extern const FFCodecParser ff_hdr_parser;
77 extern const FFCodecParser ff_ipu_parser;
79 extern const FFCodecParser ff_jpegxl_parser;
80 extern const FFCodecParser ff_misc4_parser;
81 extern const FFCodecParser ff_mjpeg_parser;
82 extern const FFCodecParser ff_mlp_parser;
86 extern const FFCodecParser ff_opus_parser;
87 extern const FFCodecParser ff_prores_parser;
88 extern const FFCodecParser ff_png_parser;
89 extern const FFCodecParser ff_pnm_parser;
91 extern const FFCodecParser ff_qoi_parser;
92 extern const FFCodecParser ff_rv34_parser;
93 extern const FFCodecParser ff_sbc_parser;
94 extern const FFCodecParser ff_sipr_parser;
95 extern const FFCodecParser ff_tak_parser;
96 extern const FFCodecParser ff_vc1_parser;
97 extern const FFCodecParser ff_vorbis_parser;
98 extern const FFCodecParser ff_vp3_parser;
99 extern const FFCodecParser ff_vp8_parser;
100 extern const FFCodecParser ff_vp9_parser;
101 extern const FFCodecParser ff_vvc_parser;
102 extern const FFCodecParser ff_webp_parser;
103 extern const FFCodecParser ff_xbm_parser;
104 extern const FFCodecParser ff_xma_parser;
105 extern const FFCodecParser ff_xwd_parser;
106 
107 #include "libavcodec/parser_list.c"
108 
109 const AVCodecParser *av_parser_iterate(void **opaque)
110 {
111  uintptr_t i = (uintptr_t)*opaque;
112  const FFCodecParser *p = parser_list[i];
113 
114  if (p) {
115  *opaque = (void*)(i + 1);
116  return &p->p;
117  }
118 
119  return NULL;
120 }
FF_ENABLE_DEPRECATION_WARNINGS
#define FF_ENABLE_DEPRECATION_WARNINGS
Definition: internal.h:73
ff_aac_parser
const FF_ENABLE_DEPRECATION_WARNINGS FFCodecParser ff_aac_parser
Definition: aac_parser.c:55
ff_xbm_parser
const FFCodecParser ff_xbm_parser
Definition: xbm_parser.c:104
ff_tak_parser
const FFCodecParser ff_tak_parser
Definition: tak_parser.c:127
ff_evc_parser
const FFCodecParser ff_evc_parser
Definition: evc_parser.c:375
av_parser_iterate
const AVCodecParser * av_parser_iterate(void **opaque)
Iterate over all registered codec parsers.
Definition: parsers.c:109
ff_vorbis_parser
const FFCodecParser ff_vorbis_parser
ff_bmp_parser
const FFCodecParser ff_bmp_parser
Definition: bmp_parser.c:109
parser_internal.h
ff_opus_parser
const FFCodecParser ff_opus_parser
Definition: parser.c:217
ff_av1_parser
const FFCodecParser ff_av1_parser
Definition: av1_parser.c:213
ff_prores_parser
const FFCodecParser ff_prores_parser
Definition: prores_parser.c:126
ff_qoi_parser
const FFCodecParser ff_qoi_parser
Definition: qoi_parser.c:73
codec_ids
static enum AVCodecID codec_ids[]
Definition: aac_adtstoasc.c:146
ff_dirac_parser
const FFCodecParser ff_dirac_parser
Definition: dirac_parser.c:278
close
static av_cold void close(AVCodecParserContext *s)
Definition: apv_parser.c:136
ff_adx_parser
const FFCodecParser ff_adx_parser
Definition: adx_parser.c:101
ff_ftr_parser
const FFCodecParser ff_ftr_parser
Definition: ftr_parser.c:100
ff_vvc_parser
const FFCodecParser ff_vvc_parser
Definition: vvc_parser.c:509
ff_flac_parser
const FFCodecParser ff_flac_parser
Definition: flac_parser.c:906
ff_prores_raw_parser
const FFCodecParser ff_prores_raw_parser
Definition: prores_raw_parser.c:100
ff_g729_parser
const FFCodecParser ff_g729_parser
Definition: g729_parser.c:88
ff_gif_parser
const FFCodecParser ff_gif_parser
Definition: gif_parser.c:204
ff_vp8_parser
const FFCodecParser ff_vp8_parser
Definition: vp8_parser.c:77
ff_png_parser
const FFCodecParser ff_png_parser
Definition: png_parser.c:114
ff_ahx_parser
const FFCodecParser ff_ahx_parser
Definition: ahx_parser.c:74
ff_apv_parser
const FFCodecParser ff_apv_parser
Definition: apv_parser.c:144
ff_cavsvideo_parser
const FFCodecParser ff_cavsvideo_parser
Definition: cavs_parser.c:100
ff_mpeg4video_parser
const FFCodecParser ff_mpeg4video_parser
Definition: mpeg4video_parser.c:159
ff_mpegvideo_parser
const FFCodecParser ff_mpegvideo_parser
Definition: mpegvideo_parser.c:303
ff_dolby_e_parser
const FFCodecParser ff_dolby_e_parser
Definition: dolby_e_parser.c:69
ff_amr_parser
const FFCodecParser ff_amr_parser
Definition: amr_parser.c:126
ff_dca_parser
const FFCodecParser ff_dca_parser
Definition: dca_parser.c:347
ff_mjpeg_parser
const FFCodecParser ff_mjpeg_parser
Definition: mjpeg_parser.c:132
ff_vc1_parser
const FFCodecParser ff_vc1_parser
Definition: vc1_parser.c:275
NULL
#define NULL
Definition: coverity.c:32
ff_vp3_parser
const FFCodecParser ff_vp3_parser
Definition: vp3_parser.c:39
ff_cri_parser
const FFCodecParser ff_cri_parser
Definition: cri_parser.c:101
ff_dvaudio_parser
const FFCodecParser ff_dvaudio_parser
Definition: dvaudio_parser.c:44
ff_dnxuc_parser
const FFCodecParser ff_dnxuc_parser
Definition: dnxuc_parser.c:85
ff_ac3_parser
const FFCodecParser ff_ac3_parser
parse
static int parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
Definition: apv_parser.c:46
ff_rv34_parser
const FFCodecParser ff_rv34_parser
Definition: rv34_parser.c:79
ff_mlp_parser
const FFCodecParser ff_mlp_parser
Definition: mlp_parser.c:208
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
ff_pnm_parser
const FFCodecParser ff_pnm_parser
Definition: pnm_parser.c:137
ff_ffv1_parser
const FFCodecParser ff_ffv1_parser
Definition: ffv1_parser.c:84
ff_h264_parser
const FFCodecParser ff_h264_parser
Definition: h264_parser.c:686
ff_aac_latm_parser
const FFCodecParser ff_aac_latm_parser
Definition: latm_parser.c:108
ff_mpegaudio_parser
const FFCodecParser ff_mpegaudio_parser
Definition: mpegaudio_parser.c:140
split
static char * split(char *message, char delim)
Definition: af_channelmap.c:89
CHECK_OFFSET
#define CHECK_OFFSET(field, public_prefix)
Definition: parsers.c:30
ff_dvd_nav_parser
const FFCodecParser ff_dvd_nav_parser
Definition: dvd_nav_parser.c:111
ff_dnxhd_parser
const FFCodecParser ff_dnxhd_parser
Definition: dnxhd_parser.c:142
FFCodecParser
Definition: parser_internal.h:29
ff_sipr_parser
const FFCodecParser ff_sipr_parser
Definition: sipr_parser.c:70
ff_xwd_parser
const FFCodecParser ff_xwd_parser
Definition: xwd_parser.c:99
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
ff_webp_parser
const FFCodecParser ff_webp_parser
Definition: webp_parser.c:108
internal.h
ff_jpegxl_parser
const FFCodecParser ff_jpegxl_parser
Definition: jpegxl_parser.c:1549
ff_cook_parser
const FFCodecParser ff_cook_parser
Definition: cook_parser.c:57
ff_gsm_parser
const FFCodecParser ff_gsm_parser
Definition: gsm_parser.c:87
ff_h261_parser
const FFCodecParser ff_h261_parser
Definition: h261_parser.c:90
avcodec.h
ff_dvbsub_parser
const FFCodecParser ff_dvbsub_parser
Definition: dvbsub_parser.c:167
ff_vp9_parser
const FFCodecParser ff_vp9_parser
Definition: vp9_parser.c:67
ff_dvdsub_parser
const FFCodecParser ff_dvdsub_parser
Definition: dvdsub_parser.c:88
ff_avs3_parser
const FFCodecParser ff_avs3_parser
Definition: avs3_parser.c:176
ff_h263_parser
const FFCodecParser ff_h263_parser
Definition: h263_parser.c:91
ff_sbc_parser
const FFCodecParser ff_sbc_parser
Definition: sbc_parser.c:120
ff_misc4_parser
const FFCodecParser ff_misc4_parser
Definition: misc4_parser.c:77
ff_dpx_parser
const FFCodecParser ff_dpx_parser
Definition: dpx_parser.c:112
Windows::Graphics::DirectX::Direct3D11::p
IDirect3DDxgiInterfaceAccess _COM_Outptr_ void ** p
Definition: vsrc_gfxcapture_winrt.hpp:53
FF_DISABLE_DEPRECATION_WARNINGS
#define FF_DISABLE_DEPRECATION_WARNINGS
Definition: internal.h:72
ff_hdr_parser
const FFCodecParser ff_hdr_parser
Definition: hdr_parser.c:75
ff_hevc_parser
const FFCodecParser ff_hevc_parser
Definition: parser.c:356
ff_ipu_parser
const FFCodecParser ff_ipu_parser
Definition: ipu_parser.c:73
AVCodecParser
Definition: avcodec.h:2734
ff_xma_parser
const FFCodecParser ff_xma_parser
Definition: xma_parser.c:59
ff_avs2_parser
const FFCodecParser ff_avs2_parser
Definition: avs2_parser.c:193
ff_g723_1_parser
const FFCodecParser ff_g723_1_parser
Definition: g723_1_parser.c:56
ff_jpeg2000_parser
const FFCodecParser ff_jpeg2000_parser
Definition: jpeg2000_parser.c:215