Commit 5a5c525a authored by vitor's avatar vitor

Implement poll_frame() method. Fix ffmpeg.c bug with

vf_fps filter.

Commited in SoC by Vitor Sessak on 2008-02-06 19:55:36


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@12718 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 58cad0d6
...@@ -69,6 +69,15 @@ static int link_in_request_frame(AVFilterLink *link) ...@@ -69,6 +69,15 @@ static int link_in_request_frame(AVFilterLink *link)
return avfilter_request_frame(link2); return avfilter_request_frame(link2);
} }
static int link_in_poll_frame(AVFilterLink *link)
{
AVFilterLink *link2 = get_extern_input_link(link);
if(!link2)
return -1;
return avfilter_poll_frame(link2);
}
static int link_in_config_props(AVFilterLink *link) static int link_in_config_props(AVFilterLink *link)
{ {
AVFilterLink *link2 = get_extern_input_link(link); AVFilterLink *link2 = get_extern_input_link(link);
...@@ -236,6 +245,16 @@ static int graph_out_request_frame(AVFilterLink *link) ...@@ -236,6 +245,16 @@ static int graph_out_request_frame(AVFilterLink *link)
return -1; return -1;
} }
static int graph_out_poll_frame(AVFilterLink *link)
{
AVFilterLink *link2 = get_intern_output_link(link);
if(!link2)
return -1;
return avfilter_poll_frame(link2);
}
static int graph_out_config_props(AVFilterLink *link) static int graph_out_config_props(AVFilterLink *link)
{ {
GraphContext *graph = link->src->priv; GraphContext *graph = link->src->priv;
...@@ -276,6 +295,7 @@ static int add_graph_input(AVFilterContext *gctx, AVFilterContext *filt, unsigne ...@@ -276,6 +295,7 @@ static int add_graph_input(AVFilterContext *gctx, AVFilterContext *filt, unsigne
.name = NULL, /* FIXME? */ .name = NULL, /* FIXME? */
.type = AV_PAD_VIDEO, .type = AV_PAD_VIDEO,
.request_frame = link_in_request_frame, .request_frame = link_in_request_frame,
.poll_frame = link_in_poll_frame,
.config_props = link_in_config_props, .config_props = link_in_config_props,
}; };
...@@ -296,6 +316,7 @@ static int add_graph_output(AVFilterContext *gctx, AVFilterContext *filt, unsign ...@@ -296,6 +316,7 @@ static int add_graph_output(AVFilterContext *gctx, AVFilterContext *filt, unsign
.name = name, .name = name,
.type = AV_PAD_VIDEO, .type = AV_PAD_VIDEO,
.request_frame = graph_out_request_frame, .request_frame = graph_out_request_frame,
.poll_frame = graph_out_poll_frame,
.config_props = graph_out_config_props, .config_props = graph_out_config_props,
}; };
AVFilterPad dummy_inpad = AVFilterPad dummy_inpad =
...@@ -488,12 +509,14 @@ static int graph_load_from_desc(AVFilterContext *ctx, AVFilterGraphDesc *desc) ...@@ -488,12 +509,14 @@ static int graph_load_from_desc(AVFilterContext *ctx, AVFilterGraphDesc *desc)
for(curfilt = desc->filters; curfilt; curfilt = curfilt->next) { for(curfilt = desc->filters; curfilt; curfilt = curfilt->next) {
if(!(filterdef = avfilter_get_by_name(curfilt->filter)) || if(!(filterdef = avfilter_get_by_name(curfilt->filter)) ||
!(filt = avfilter_open(filterdef, curfilt->name))) { !(filt = avfilter_open(filterdef, curfilt->name))) {
av_log(ctx, AV_LOG_ERROR, "error creating filter\n"); av_log(ctx, AV_LOG_ERROR,
"error creating filter '%s'\n", curfilt->name);
goto fail; goto fail;
} }
avfilter_graph_add_filter(ctx, filt); avfilter_graph_add_filter(ctx, filt);
if(avfilter_init_filter(filt, curfilt->args, NULL)) { if(avfilter_init_filter(filt, curfilt->args, NULL)) {
av_log(ctx, AV_LOG_ERROR, "error initializing filter\n"); av_log(ctx, AV_LOG_ERROR,
"error initializing filter '%s'\n", curfilt->name);
goto fail; goto fail;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment