lavfi: move AVFilterLink.graph to FilterLink

This commit is contained in:
Anton Khirnov 2024-08-11 16:35:52 +02:00
parent fb3efef1db
commit d566a37003
5 changed files with 10 additions and 10 deletions

View File

@ -185,7 +185,7 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad,
link->srcpad = &src->output_pads[srcpad];
link->dstpad = &dst->input_pads[dstpad];
link->type = src->output_pads[srcpad].type;
link->graph = src->graph;
li->l.graph = src->graph;
av_assert0(AV_PIX_FMT_NONE == -1 && AV_SAMPLE_FMT_NONE == -1);
link->format = -1;
link->colorspace = AVCOL_SPC_UNSPECIFIED;
@ -231,8 +231,8 @@ static void update_link_current_pts(FilterLinkInternal *li, int64_t pts)
li->l.current_pts = pts;
li->l.current_pts_us = av_rescale_q(pts, link->time_base, AV_TIME_BASE_Q);
/* TODO use duration */
if (link->graph && li->age_index >= 0)
ff_avfilter_graph_update_heap(link->graph, li);
if (li->l.graph && li->age_index >= 0)
ff_avfilter_graph_update_heap(li->l.graph, li);
}
void ff_filter_set_ready(AVFilterContext *filter, unsigned priority)

View File

@ -594,11 +594,6 @@ struct AVFilterLink {
* Lists of supported formats / etc. supported by the output filter.
*/
AVFilterFormatsConfig outcfg;
/**
* Graph the filter belongs to.
*/
struct AVFilterGraph *graph;
};
/**

View File

@ -106,7 +106,7 @@ void ff_filter_graph_remove_filter(AVFilterGraph *graph, AVFilterContext *filter
filter->graph = NULL;
for (j = 0; j<filter->nb_outputs; j++)
if (filter->outputs[j])
filter->outputs[j]->graph = NULL;
ff_filter_link(filter->outputs[j])->graph = NULL;
return;
}

View File

@ -567,7 +567,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
av_log(ctx, AV_LOG_VERBOSE,
"Processing command #%d target:%s command:%s arg:%s\n",
cmd->index, cmd->target, cmd->command, cmd_arg);
ret = avfilter_graph_send_command(inlink->graph,
ret = avfilter_graph_send_command(inl->graph,
cmd->target, cmd->command, cmd_arg,
buf, sizeof(buf),
AVFILTER_CMD_FLAG_ONE);

View File

@ -42,6 +42,11 @@
typedef struct FilterLink {
AVFilterLink pub;
/**
* Graph the filter belongs to.
*/
struct AVFilterGraph *graph;
/**
* Current timestamp of the link, as defined by the most recent
* frame(s), in link time_base units.