-
-fail:
- uninit(ctx);
- return -1;
-}
-
-int graph_load_from_desc3(GraphContext *graph, AVFilterGraphDesc *desc, AVFilterContext *in, int inpad, AVFilterContext *out, int outpad)
-{
- AVFilterGraphDescExport *curpad;
- char tmp[20];
- AVFilterContext *filt;
-
- if (graph_load_from_desc2(graph, desc) < 0)
- goto fail;
-
- /* export all input pads */
- for(curpad = desc->inputs; curpad; curpad = curpad->next) {
- snprintf(tmp, 20, "%d", curpad->filter);
- if(!(filt = avfilter_graph_get_filter(graph, tmp))) {
- av_log(&log_ctx, AV_LOG_ERROR, "filter owning exported pad does not exist\n");
- goto fail;
- }
- if(avfilter_link(in, inpad, filt, curpad->pad)) {
- av_log(&log_ctx, AV_LOG_ERROR, "cannot create link between source and destination filters\n");
- goto fail;
- }
- }
-
- /* export all output pads */
- for(curpad = desc->outputs; curpad; curpad = curpad->next) {
- snprintf(tmp, 20, "%d", curpad->filter);
- if(!(filt = avfilter_graph_get_filter(graph, tmp))) {
- av_log(&log_ctx, AV_LOG_ERROR, "filter owning exported pad does not exist\n");
- goto fail;
- }
-
- if(avfilter_link(filt, curpad->pad, out, outpad)) {
- av_log(&log_ctx, AV_LOG_ERROR, "cannot create link between source and destination filters\n");
- goto fail;
- }
- }
-
- return 0;
-
-fail:
- uninit(graph);
- return -1;