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

Function avfilter_open

libavfilter/avfilter.c:393–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391};
392
393AVFilterContext *avfilter_open(AVFilter *filter, const char *inst_name)
394{
395 AVFilterContext *ret;
396
397 if (!filter)
398 return 0;
399
400 ret = av_mallocz(sizeof(AVFilterContext));
401
402 ret->av_class = &avfilter_class;
403 ret->filter = filter;
404 ret->name = inst_name ? av_strdup(inst_name) : NULL;
405 ret->priv = av_mallocz(filter->priv_size);
406
407 ret->input_count = pad_count(filter->inputs);
408 if (ret->input_count) {
409 ret->input_pads = av_malloc(sizeof(AVFilterPad) * ret->input_count);
410 memcpy(ret->input_pads, filter->inputs, sizeof(AVFilterPad) * ret->input_count);
411 ret->inputs = av_mallocz(sizeof(AVFilterLink*) * ret->input_count);
412 }
413
414 ret->output_count = pad_count(filter->outputs);
415 if (ret->output_count) {
416 ret->output_pads = av_malloc(sizeof(AVFilterPad) * ret->output_count);
417 memcpy(ret->output_pads, filter->outputs, sizeof(AVFilterPad) * ret->output_count);
418 ret->outputs = av_mallocz(sizeof(AVFilterLink*) * ret->output_count);
419 }
420
421 return ret;
422}
423
424void avfilter_destroy(AVFilterContext *filter)
425{

Callers 3

video_threadFunction · 0.85
create_filterFunction · 0.85
query_formatsFunction · 0.85

Calls 4

av_malloczFunction · 0.85
av_strdupFunction · 0.85
pad_countFunction · 0.85
av_mallocFunction · 0.85

Tested by

no test coverage detected