[FFmpeg-soc] [soc]: r344 - in libavfilter: avfilter.c avfilter.h vf_crop.c vf_rgb2bgr.c vf_slicify.c vsrc_dummy.c vsrc_ppm.c

koorogi subversion at mplayerhq.hu
Sun Jul 8 18:14:50 CEST 2007


Author: koorogi
Date: Sun Jul  8 18:14:49 2007
New Revision: 344

Log:
Make avfilter_ref_pic also handle removal of permissions for the caller.


Modified:
   libavfilter/avfilter.c
   libavfilter/avfilter.h
   libavfilter/vf_crop.c
   libavfilter/vf_rgb2bgr.c
   libavfilter/vf_slicify.c
   libavfilter/vsrc_dummy.c
   libavfilter/vsrc_ppm.c

Modified: libavfilter/avfilter.c
==============================================================================
--- libavfilter/avfilter.c	(original)
+++ libavfilter/avfilter.c	Sun Jul  8 18:14:49 2007
@@ -73,10 +73,11 @@ void avfilter_default_end_frame(AVFilter
     link->cur_pic = NULL;
 }
 
-AVFilterPicRef *avfilter_ref_pic(AVFilterPicRef *ref)
+AVFilterPicRef *avfilter_ref_pic(AVFilterPicRef *ref, int pmask)
 {
     AVFilterPicRef *ret = av_malloc(sizeof(AVFilterPicRef));
     memcpy(ret, ref, sizeof(AVFilterPicRef));
+    ret->perms &= pmask;
     ret->pic->refcount ++;
     return ret;
 }

Modified: libavfilter/avfilter.h
==============================================================================
--- libavfilter/avfilter.h	(original)
+++ libavfilter/avfilter.h	Sun Jul  8 18:14:49 2007
@@ -72,9 +72,10 @@ typedef struct AVFilterPicRef
 /**
  * Add a new reference to a picture.
  * @param ref An existing reference to the picture
+ * @param pmask A bitmask containing the allowable permissions in the new reference
  * @return A new reference to the picture with the same properties as the old
  */
-AVFilterPicRef *avfilter_ref_pic(AVFilterPicRef *ref);
+AVFilterPicRef *avfilter_ref_pic(AVFilterPicRef *ref, int pmask);
 
 /**
  * Remove a reference to a picture.  If this is the last reference to the

Modified: libavfilter/vf_crop.c
==============================================================================
--- libavfilter/vf_crop.c	(original)
+++ libavfilter/vf_crop.c	Sun Jul  8 18:14:49 2007
@@ -79,7 +79,7 @@ static int config_output(AVFilterLink *l
 static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
 {
     CropContext *crop = link->dst->priv;
-    AVFilterPicRef *ref2 = avfilter_ref_pic(picref);
+    AVFilterPicRef *ref2 = avfilter_ref_pic(picref, ~0);
 
     ref2->w = crop->cw;
     ref2->h = crop->ch;

Modified: libavfilter/vf_rgb2bgr.c
==============================================================================
--- libavfilter/vf_rgb2bgr.c	(original)
+++ libavfilter/vf_rgb2bgr.c	Sun Jul  8 18:14:49 2007
@@ -51,7 +51,7 @@ static void start_frame(AVFilterLink *li
 
     rgb->out = avfilter_get_video_buffer(link->dst->outputs[0], AV_PERM_WRITE);
     avfilter_default_start_frame(link, picref);
-    avfilter_start_frame(link->dst->outputs[0], avfilter_ref_pic(rgb->out));
+    avfilter_start_frame(link->dst->outputs[0], avfilter_ref_pic(rgb->out, ~0));
 }
 
 static void end_frame(AVFilterLink *link)

Modified: libavfilter/vf_slicify.c
==============================================================================
--- libavfilter/vf_slicify.c	(original)
+++ libavfilter/vf_slicify.c	Sun Jul  8 18:14:49 2007
@@ -61,7 +61,7 @@ static int config_props(AVFilterLink *li
 static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
 {
     avfilter_default_start_frame(link, picref);
-    avfilter_start_frame(link->dst->outputs[0], avfilter_ref_pic(picref));
+    avfilter_start_frame(link->dst->outputs[0], avfilter_ref_pic(picref, ~0));
 }
 
 static void end_frame(AVFilterLink *link)

Modified: libavfilter/vsrc_dummy.c
==============================================================================
--- libavfilter/vsrc_dummy.c	(original)
+++ libavfilter/vsrc_dummy.c	Sun Jul  8 18:14:49 2007
@@ -48,7 +48,7 @@ static void request_frame(AVFilterLink *
     uint8_t *row, *cur;
 
     pic = avfilter_get_video_buffer(link, AV_PERM_WRITE);
-    avfilter_start_frame(link, avfilter_ref_pic(pic));
+    avfilter_start_frame(link, avfilter_ref_pic(pic), ~0);
 
     row = pic->data[0];
     for(y = 0; y < pic->h; y ++) {

Modified: libavfilter/vsrc_ppm.c
==============================================================================
--- libavfilter/vsrc_ppm.c	(original)
+++ libavfilter/vsrc_ppm.c	Sun Jul  8 18:14:49 2007
@@ -88,8 +88,7 @@ static void request_frame(AVFilterLink *
         ppm->in = NULL;
     }
 
-    out = avfilter_ref_pic(ppm->pic);
-    out->perms &= ~AV_PERM_WRITE;
+    out = avfilter_ref_pic(ppm->pic, ~AV_PERM_WRITE);
     avfilter_start_frame(link, out);
     avfilter_draw_slice(link, out->data, 0, out->h);
     avfilter_end_frame(link);



More information about the FFmpeg-soc mailing list