[FFmpeg-cvslog] lavfi/swapuv: switch to filter_frame API

Stefano Sabatini git at videolan.org
Sat Dec 8 12:50:00 CET 2012


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Sat Dec  8 11:14:51 2012 +0100| [3eae531de2879808e6af7d9920162845e4c54dd3] | committer: Stefano Sabatini

lavfi/swapuv: switch to filter_frame API

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3eae531de2879808e6af7d9920162845e4c54dd3
---

 libavfilter/vf_swapuv.c |   20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/libavfilter/vf_swapuv.c b/libavfilter/vf_swapuv.c
index 6345c0d..2541c3f 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 }
 };



More information about the ffmpeg-cvslog mailing list