]> git.sesse.net Git - ffmpeg/commitdiff
Rename functions and fields:
authorS.N. Hemanth Meenakshisundaram <smeenaks@ucsd.edu>
Sat, 7 Aug 2010 01:15:27 +0000 (01:15 +0000)
committerStefano Sabatini <stefano.sabatini-lala@poste.it>
Sat, 7 Aug 2010 01:15:27 +0000 (01:15 +0000)
avfilter_(un)ref_pic       -> avfilter_(un)ref_buffer
avfilter_copy_picref_props -> avfilter_copy_buffer_ref_props
AVFilterBufferRef.pic      -> AVFilterBufferRef.buffer

They have been renamed to allow sharing with audio.

Patch by S.N. Hemanth Meenakshisundaram $smeenaks$ucsd$edu$.

Originally committed as revision 24731 to svn://svn.ffmpeg.org/ffmpeg/trunk

ffmpeg.c
ffplay.c
libavfilter/avfilter.c
libavfilter/avfilter.h
libavfilter/defaults.c
libavfilter/vf_crop.c
libavfilter/vf_pad.c
libavfilter/vf_pixdesctest.c
libavfilter/vf_scale.c
libavfilter/vf_unsharp.c
libavfilter/vsrc_buffer.c

index 67dcb9ae0a71da33a156f2c2c9d3816265a70496..104d57e5b82ae595db9a826e0b4d0c1a09a97b4d 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1777,7 +1777,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
             frame_available = (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO) &&
                               ist->out_video_filter && avfilter_poll_frame(ist->out_video_filter->inputs[0]);
             if(ist->picref)
-                avfilter_unref_pic(ist->picref);
+                avfilter_unref_buffer(ist->picref);
         }
 #endif
         av_free(buffer_to_free);
index 9b523de84a4ff63ca7cecf175cf4310b715d65fa..287e43613d9a5ac7ef81506775d8689b228a7c25 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -1304,7 +1304,7 @@ static void alloc_picture(void *opaque)
 
 #if CONFIG_AVFILTER
     if (vp->picref)
-        avfilter_unref_pic(vp->picref);
+        avfilter_unref_buffer(vp->picref);
     vp->picref = NULL;
 
     vp->width   = is->out_video_filter->inputs[0]->w;
@@ -1389,7 +1389,7 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, int64_t
         AVPicture pict;
 #if CONFIG_AVFILTER
         if(vp->picref)
-            avfilter_unref_pic(vp->picref);
+            avfilter_unref_buffer(vp->picref);
         vp->picref = src_frame->opaque;
 #endif
 
@@ -1604,7 +1604,7 @@ static int input_get_buffer(AVCodecContext *codec, AVFrame *pic)
 static void input_release_buffer(AVCodecContext *codec, AVFrame *pic)
 {
     memset(pic->data, 0, sizeof(pic->data));
-    avfilter_unref_pic(pic->opaque);
+    avfilter_unref_buffer(pic->opaque);
 }
 
 static int input_reget_buffer(AVCodecContext *codec, AVFrame *pic)
@@ -1667,7 +1667,7 @@ static int input_request_frame(AVFilterLink *link)
         return -1;
 
     if(priv->use_dr1) {
-        picref = avfilter_ref_pic(priv->frame->opaque, ~0);
+        picref = avfilter_ref_buffer(priv->frame->opaque, ~0);
     } else {
         picref = avfilter_get_video_buffer(link, AV_PERM_WRITE, link->w, link->h);
         av_picture_copy((AVPicture *)&picref->data, (AVPicture *)priv->frame,
@@ -2672,7 +2672,7 @@ static void stream_close(VideoState *is)
         vp = &is->pictq[i];
 #if CONFIG_AVFILTER
         if (vp->picref) {
-            avfilter_unref_pic(vp->picref);
+            avfilter_unref_buffer(vp->picref);
             vp->picref = NULL;
         }
 #endif
index bef0dd69ed6c5be96fbd9b4c930552926169d330..02c6106fa8a93dfee5b05edfb7426d6a30c25e0e 100644 (file)
@@ -45,19 +45,19 @@ const char *avfilter_license(void)
 #define link_dpad(link)     link->dst-> input_pads[link->dstpad]
 #define link_spad(link)     link->src->output_pads[link->srcpad]
 
-AVFilterBufferRef *avfilter_ref_pic(AVFilterBufferRef *ref, int pmask)
+AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask)
 {
     AVFilterBufferRef *ret = av_malloc(sizeof(AVFilterBufferRef));
     *ret = *ref;
     ret->perms &= pmask;
-    ret->pic->refcount ++;
+    ret->buf->refcount ++;
     return ret;
 }
 
-void avfilter_unref_pic(AVFilterBufferRef *ref)
+void avfilter_unref_buffer(AVFilterBufferRef *ref)
 {
-    if(!(--ref->pic->refcount))
-        ref->pic->free(ref->pic);
+    if(!(--ref->buf->refcount))
+        ref->buf->free(ref->buf);
     av_free(ref);
 }
 
@@ -264,7 +264,7 @@ void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
 
         link->cur_pic = avfilter_default_get_video_buffer(link, dst->min_perms, link->w, link->h);
         link->srcpic = picref;
-        avfilter_copy_picref_props(link->cur_pic, link->srcpic);
+        avfilter_copy_buffer_ref_props(link->cur_pic, link->srcpic);
     }
     else
         link->cur_pic = picref;
@@ -284,7 +284,7 @@ void avfilter_end_frame(AVFilterLink *link)
     /* unreference the source picture if we're feeding the destination filter
      * a copied version dues to permission issues */
     if(link->srcpic) {
-        avfilter_unref_pic(link->srcpic);
+        avfilter_unref_buffer(link->srcpic);
         link->srcpic = NULL;
     }
 
index 4c4cf11b75900f16272d9128c719a5f92b9d6106..a9e765b4de105f0d88baf4ceca265b8186569ab4 100644 (file)
@@ -25,7 +25,7 @@
 #include "libavutil/avutil.h"
 
 #define LIBAVFILTER_VERSION_MAJOR  1
-#define LIBAVFILTER_VERSION_MINOR 29
+#define LIBAVFILTER_VERSION_MINOR 30
 #define LIBAVFILTER_VERSION_MICRO  0
 
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
@@ -90,7 +90,7 @@ typedef struct AVFilterBuffer
 
 /**
  * A reference to an AVFilterBuffer. Since filters can manipulate the origin of
- * a picture to, for example, crop image without any memcpy, the picture origin
+ * a buffer to, for example, crop image without any memcpy, the buffer origin
  * and dimensions are per-reference properties. Linesize is also useful for
  * image flipping, frame to field filters, etc, and so is also per-reference.
  *
@@ -98,7 +98,7 @@ typedef struct AVFilterBuffer
  */
 typedef struct AVFilterBufferRef
 {
-    AVFilterBuffer *pic;        ///< the picture that this is a reference to
+    AVFilterBuffer *buf;        ///< the buffer that this is a reference to
     uint8_t *data[4];           ///< picture data for each plane
     int linesize[4];            ///< number of bytes per line
     int w;                      ///< image width
@@ -120,7 +120,7 @@ typedef struct AVFilterBufferRef
  * Copy properties of src to dst, without copying the actual video
  * data.
  */
-static inline void avfilter_copy_picref_props(AVFilterBufferRef *dst, AVFilterBufferRef *src)
+static inline void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst, AVFilterBufferRef *src)
 {
     dst->pts             = src->pts;
     dst->pos             = src->pos;
@@ -132,21 +132,21 @@ static inline void avfilter_copy_picref_props(AVFilterBufferRef *dst, AVFilterBu
 }
 
 /**
- * Add a new reference to a picture.
- * @param ref   an existing reference to the picture
+ * Add a new reference to a buffer.
+ * @param ref   an existing reference to the buffer
  * @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
+ * @return      a new reference to the buffer with the same properties as the
  *              old, excluding any permissions denied by pmask
  */
-AVFilterBufferRef *avfilter_ref_pic(AVFilterBufferRef *ref, int pmask);
+AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask);
 
 /**
- * Remove a reference to a picture. If this is the last reference to the
- * picture, the picture itself is also automatically freed.
- * @param ref reference to the picture
+ * Remove a reference to a buffer. If this is the last reference to the
+ * buffer, the buffer itself is also automatically freed.
+ * @param ref reference to the buffer
  */
-void avfilter_unref_pic(AVFilterBufferRef *ref);
+void avfilter_unref_buffer(AVFilterBufferRef *ref);
 
 /**
  * A list of supported formats for one end of a filter link. This is used
@@ -442,7 +442,7 @@ typedef struct AVFilter
 
     /**
      * Filter uninitialization function. Should deallocate any memory held
-     * by the filter, release any picture references, etc. This does not need
+     * by the filter, release any buffer references, etc. This does not need
      * to deallocate the AVFilterContext->priv memory itself.
      */
     void (*uninit)(AVFilterContext *ctx);
@@ -524,9 +524,9 @@ struct AVFilterLink
     AVFilterFormats *out_formats;
 
     /**
-     * The picture reference currently being sent across the link by the source
+     * The buffer reference currently being sent across the link by the source
      * filter. This is used internally by the filter system to allow
-     * automatic copying of pictures which do not have sufficient permissions
+     * automatic copying of buffers which do not have sufficient permissions
      * for the destination. This should not be accessed directly by the
      * filters.
      */
@@ -556,13 +556,13 @@ int avfilter_config_links(AVFilterContext *filter);
 
 /**
  * Request a picture buffer with a specific set of permissions.
- * @param link  the output link to the filter from which the picture will
+ * @param link  the output link to the filter from which the buffer will
  *              be requested
  * @param perms the required access permissions
  * @param w     the minimum width of the buffer to allocate
  * @param h     the minimum height of the buffer to allocate
- * @return      A reference to the picture. This must be unreferenced with
- *              avfilter_unref_pic when you are finished with it.
+ * @return      A reference to the buffer. This must be unreferenced with
+ *              avfilter_unref_buffer when you are finished with it.
  */
 AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms,
                                           int w, int h);
index db53d252c74c42646bcb8a519ca383a83e5fe7ac..78696e4665c83e900db441ee8fc085176aa29ca7 100644 (file)
@@ -39,7 +39,7 @@ AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, int per
     int i, tempsize;
     char *buf;
 
-    ref->pic   = pic;
+    ref->buf   = pic;
     ref->w     = w;
     ref->h     = h;
 
@@ -74,8 +74,8 @@ void avfilter_default_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
 
     if(out) {
         out->outpic      = avfilter_get_video_buffer(out, AV_PERM_WRITE, out->w, out->h);
-        avfilter_copy_picref_props(out->outpic, picref);
-        avfilter_start_frame(out, avfilter_ref_pic(out->outpic, ~0));
+        avfilter_copy_buffer_ref_props(out->outpic, picref);
+        avfilter_start_frame(out, avfilter_ref_buffer(out->outpic, ~0));
     }
 }
 
@@ -97,12 +97,12 @@ void avfilter_default_end_frame(AVFilterLink *link)
     if(link->dst->output_count)
         out = link->dst->outputs[0];
 
-    avfilter_unref_pic(link->cur_pic);
+    avfilter_unref_buffer(link->cur_pic);
     link->cur_pic = NULL;
 
     if(out) {
         if(out->outpic) {
-            avfilter_unref_pic(out->outpic);
+            avfilter_unref_buffer(out->outpic);
             out->outpic = NULL;
         }
         avfilter_end_frame(out);
index c8c8538cc445abc515beb598d2adb309fcc087fb..704458f02cc29751336921cb43f9518fdcfb1ede 100644 (file)
@@ -132,7 +132,7 @@ static int config_output(AVFilterLink *link)
 static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
 {
     CropContext *crop = link->dst->priv;
-    AVFilterBufferRef *ref2 = avfilter_ref_pic(picref, ~0);
+    AVFilterBufferRef *ref2 = avfilter_ref_buffer(picref, ~0);
     int i;
 
     ref2->w        = crop->w;
index e6b9e48ca162f84bdf4f995336edd87316207e1a..1dd26a9bc391b6e1a82d9433d63b967161a26aee 100644 (file)
@@ -244,7 +244,7 @@ static AVFilterBufferRef *get_video_buffer(AVFilterLink *inlink, int perms, int
 static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
 {
     PadContext *pad = inlink->dst->priv;
-    AVFilterBufferRef *outpicref = avfilter_ref_pic(inpicref, ~0);
+    AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0);
     int plane;
 
     inlink->dst->outputs[0]->outpic = outpicref;
@@ -263,7 +263,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
 static void end_frame(AVFilterLink *link)
 {
     avfilter_end_frame(link->dst->outputs[0]);
-    avfilter_unref_pic(link->cur_pic);
+    avfilter_unref_buffer(link->cur_pic);
 }
 
 static void draw_send_bar_slice(AVFilterLink *link, int y, int h, int slice_dir, int before_slice)
@@ -432,13 +432,13 @@ static int color_request_frame(AVFilterLink *link)
     picref->pts          = av_rescale_q(color->pts++, color->time_base, AV_TIME_BASE_Q);
     picref->pos          = 0;
 
-    avfilter_start_frame(link, avfilter_ref_pic(picref, ~0));
+    avfilter_start_frame(link, avfilter_ref_buffer(picref, ~0));
     draw_rectangle(picref,
                    color->line, color->line_step, color->hsub, color->vsub,
                    0, 0, color->w, color->h);
     avfilter_draw_slice(link, 0, color->h, 1);
     avfilter_end_frame(link);
-    avfilter_unref_pic(picref);
+    avfilter_unref_buffer(picref);
 
     return 0;
 }
index c9397b52800c1968f69a896b583dc6b7f6ece99d..d06741950d67365d127bb7db8dc43f7624da2aa3 100644 (file)
@@ -58,7 +58,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
     outlink->outpic = avfilter_get_video_buffer(outlink, AV_PERM_WRITE,
                                                 outlink->w, outlink->h);
     outpicref = outlink->outpic;
-    avfilter_copy_picref_props(outpicref, picref);
+    avfilter_copy_buffer_ref_props(outpicref, picref);
 
     for (i = 0; i < 4; i++) {
         int h = outlink->h;
@@ -74,7 +74,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
     if (priv->pix_desc->flags & PIX_FMT_PAL)
         memcpy(outpicref->data[1], outpicref->data[1], 256*4);
 
-    avfilter_start_frame(outlink, avfilter_ref_pic(outpicref, ~0));
+    avfilter_start_frame(outlink, avfilter_ref_buffer(outpicref, ~0));
 }
 
 static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
index 4608de5a336bd2ea0c6b2efa33fd6e6c6f017865..3dd02fe2c2df834afae2f5fbf23e1777b0b926af 100644 (file)
@@ -152,7 +152,7 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
     scale->vsub = av_pix_fmt_descriptors[link->format].log2_chroma_h;
 
     outpicref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
-    avfilter_copy_picref_props(outpicref, picref);
+    avfilter_copy_buffer_ref_props(outpicref, picref);
 
     outlink->outpic = outpicref;
 
@@ -162,7 +162,7 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
               INT_MAX);
 
     scale->slice_y = 0;
-    avfilter_start_frame(outlink, avfilter_ref_pic(outpicref, ~0));
+    avfilter_start_frame(outlink, avfilter_ref_buffer(outpicref, ~0));
 }
 
 static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
index 81d950e68d46d6e6039a07bbe90920ff3961147b..ba7e83b732ff28b0923473fd52b09495b1ca50a2 100644 (file)
@@ -202,10 +202,10 @@ static void end_frame(AVFilterLink *link)
     unsharpen(out->data[1], in->data[1], out->linesize[1], in->linesize[1], CHROMA_WIDTH(link), CHROMA_HEIGHT(link), &unsharp->chroma);
     unsharpen(out->data[2], in->data[2], out->linesize[2], in->linesize[2], CHROMA_WIDTH(link), CHROMA_HEIGHT(link), &unsharp->chroma);
 
-    avfilter_unref_pic(in);
+    avfilter_unref_buffer(in);
     avfilter_draw_slice(link->dst->outputs[0], 0, link->h, 1);
     avfilter_end_frame(link->dst->outputs[0]);
-    avfilter_unref_pic(out);
+    avfilter_unref_buffer(out);
 }
 
 static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
index aa7cb4572838efc5b8c2832feac7f23cbe018a08..2bec9111e89d24f9c5f2d2c58e96b1f411e36cec 100644 (file)
@@ -126,10 +126,10 @@ static int request_frame(AVFilterLink *link)
     picref->pixel_aspect    = c->pixel_aspect;
     picref->interlaced      = c->frame.interlaced_frame;
     picref->top_field_first = c->frame.top_field_first;
-    avfilter_start_frame(link, avfilter_ref_pic(picref, ~0));
+    avfilter_start_frame(link, avfilter_ref_buffer(picref, ~0));
     avfilter_draw_slice(link, 0, link->h, 1);
     avfilter_end_frame(link);
-    avfilter_unref_pic(picref);
+    avfilter_unref_buffer(picref);
 
     c->has_frame = 0;