MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / avformat_alloc_context

Function avformat_alloc_context

libavformat/options.c:163–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163AVFormatContext *avformat_alloc_context(void)
164{
165 FormatContextInternal *fci;
166 FFFormatContext *si;
167 AVFormatContext *s;
168
169 fci = av_mallocz(sizeof(*fci));
170 if (!fci)
171 return NULL;
172
173 si = &fci->fc;
174 s = &si->pub;
175 s->av_class = &av_format_context_class;
176 s->io_open = io_open_default;
177 s->io_close2= io_close2_default;
178
179 av_opt_set_defaults(s);
180
181 si->pkt = av_packet_alloc();
182 si->parse_pkt = av_packet_alloc();
183 if (!si->pkt || !si->parse_pkt) {
184 avformat_free_context(s);
185 return NULL;
186 }
187
188 return s;
189}
190
191const AVClass *avformat_get_class(void)
192{

Callers 15

LLVMFuzzerTestOneInputFunction · 0.85
mov_finalize_stsd_codecFunction · 0.85
dvdvideo_subdemux_openFunction · 0.85
avformat_open_inputFunction · 0.85
read_gab2_subFunction · 0.85
ff_wms_parse_sdp_a_lineFunction · 0.85
vobsub_read_headerFunction · 0.85
init_subtitle_contextFunction · 0.85
hls_read_headerFunction · 0.85

Calls 4

av_opt_set_defaultsFunction · 0.85
av_packet_allocFunction · 0.85
avformat_free_contextFunction · 0.85
av_malloczFunction · 0.50

Tested by 2

mainFunction · 0.68
init_fpsFunction · 0.68