[FFmpeg-soc] [soc]: r349 - in libavfilter: avfilter.c vf_crop.c vf_rgb2bgr.c
koorogi
subversion at mplayerhq.hu
Sun Jul 8 18:55:10 CEST 2007
Author: koorogi
Date: Sun Jul 8 18:55:09 2007
New Revision: 349
Log:
Provide a default for request_frame() which does the right thing for simple
filters.
Modified:
libavfilter/avfilter.c
libavfilter/vf_crop.c
libavfilter/vf_rgb2bgr.c
Modified: libavfilter/avfilter.c
==============================================================================
--- libavfilter/avfilter.c (original)
+++ libavfilter/avfilter.c Sun Jul 8 18:55:09 2007
@@ -191,7 +191,12 @@ AVFilterPicRef *avfilter_get_video_buffe
void avfilter_request_frame(AVFilterLink *link)
{
- link->src->filter->outputs[link->srcpad].request_frame(link);
+ const AVFilterPad *pad = &link->src->filter->outputs[link->srcpad];
+
+ if(pad->request_frame)
+ pad->request_frame(link);
+ else if(link->src->inputs[0])
+ avfilter_request_frame(link->src->inputs[0]);
}
/* XXX: should we do the duplicating of the picture ref here, instead of
Modified: libavfilter/vf_crop.c
==============================================================================
--- libavfilter/vf_crop.c (original)
+++ libavfilter/vf_crop.c Sun Jul 8 18:55:09 2007
@@ -129,12 +129,6 @@ static void draw_slice(AVFilterLink *lin
avfilter_draw_slice(ctx->outputs[0], src, top - crop->cy, height);
}
-/* XXX: maybe make the default implementation do this? */
-static void request_frame(AVFilterLink *link)
-{
- avfilter_request_frame(link->src->inputs[0]);
-}
-
AVFilter vf_crop =
{
.name = "crop",
@@ -153,7 +147,6 @@ AVFilter vf_crop =
{ .name = NULL}},
.outputs = (AVFilterPad[]) {{ .name = "default",
.type = AV_PAD_VIDEO,
- .request_frame = request_frame,
.config_props = config_output, },
{ .name = NULL}},
};
Modified: libavfilter/vf_rgb2bgr.c
==============================================================================
--- libavfilter/vf_rgb2bgr.c (original)
+++ libavfilter/vf_rgb2bgr.c Sun Jul 8 18:55:09 2007
@@ -68,11 +68,6 @@ static void draw_slice(AVFilterLink *lin
avfilter_draw_slice(link->dst->outputs[0], out, y, h);
}
-static void request_frame(AVFilterLink *link)
-{
- avfilter_request_frame(link->src->inputs[0]);
-}
-
AVFilter vf_rgb2bgr =
{
.name = "rgb2bgr",
@@ -85,7 +80,6 @@ AVFilter vf_rgb2bgr =
{ .name = NULL}},
.outputs = (AVFilterPad[]) {{ .name = "default",
.type = AV_PAD_VIDEO,
- .request_frame = request_frame,
.query_formats = query_out_formats, },
{ .name = NULL}},
};
More information about the FFmpeg-soc
mailing list