aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_swapuv.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2012-12-08 11:14:51 +0100
committerStefano Sabatini <stefasab@gmail.com>2012-12-08 12:10:34 +0100
commit3eae531de2879808e6af7d9920162845e4c54dd3 (patch)
tree7489b41f8d95c38ea642f4508b54ace970e0a7cf /libavfilter/vf_swapuv.c
parente6701d51e1c7c0b33c567b50d7c3d7adf35a5823 (diff)
downloadffmpeg-3eae531de2879808e6af7d9920162845e4c54dd3.tar.gz
lavfi/swapuv: switch to filter_frame API
Diffstat (limited to 'libavfilter/vf_swapuv.c')
-rw-r--r--libavfilter/vf_swapuv.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/libavfilter/vf_swapuv.c b/libavfilter/vf_swapuv.c
index 6345c0d39d..2541c3f120 100644
--- a/libavfilter/vf_swapuv.c
+++ b/libavfilter/vf_swapuv.c
@@ -25,6 +25,7 @@
#include "avfilter.h"
#include "formats.h"
+#include "internal.h"
#include "video.h"
static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms,
@@ -46,17 +47,20 @@ static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms,
return picref;
}
-static int start_frame(AVFilterLink *link, AVFilterBufferRef *inpicref)
+static int filter_frame(AVFilterLink *link, AVFilterBufferRef *inpicref)
{
- AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0);
+ uint8_t *tmp_data;
+ int tmp_linesize;
- outpicref->data[1] = inpicref->data[2];
- outpicref->data[2] = inpicref->data[1];
+ tmp_data = inpicref->data[1];
+ inpicref->data[1] = inpicref->data[2];
+ inpicref->data[2] = tmp_data;
- outpicref->linesize[1] = inpicref->linesize[2];
- outpicref->linesize[2] = inpicref->linesize[1];
+ tmp_linesize = inpicref->linesize[1];
+ inpicref->linesize[1] = inpicref->linesize[2];
+ inpicref->linesize[2] = tmp_linesize;
- return ff_start_frame(link->dst->outputs[0], outpicref);
+ return ff_filter_frame(link->dst->outputs[0], inpicref);
}
static int query_formats(AVFilterContext *ctx)
@@ -79,7 +83,7 @@ static const AVFilterPad swapuv_inputs[] = {
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.get_video_buffer = get_video_buffer,
- .start_frame = start_frame,
+ .filter_frame = filter_frame,
},
{ NULL }
};