lavfi: rename AVFilterBufferRefVideoProps.pixel_aspect to sample_aspect_ratio
authorStefano Sabatini <stefano.sabatini-lala@poste.it>
Fri, 29 Apr 2011 11:12:39 +0000 (13:12 +0200)
committerStefano Sabatini <stefano.sabatini-lala@poste.it>
Sun, 1 May 2011 11:10:18 +0000 (13:10 +0200)
Improve consistency with libavcodec.

This breaks libavfilter API/ABI.

The non-sequential 2.1.0 -> 2.4.0 bump is due to the mess previously
done with the lavfi minor number.

14 files changed:
cmdutils.c
doc/APIchanges
ffmpeg.c
ffplay.c
libavfilter/avfilter.c
libavfilter/avfilter.h
libavfilter/vf_aspect.c
libavfilter/vf_frei0r.c
libavfilter/vf_scale.c
libavfilter/vf_showinfo.c
libavfilter/vf_transpose.c
libavfilter/vsrc_buffer.c
libavfilter/vsrc_color.c
libavfilter/vsrc_movie.c

index 3ad29af..dd19bbf 100644 (file)
@@ -912,7 +912,7 @@ int get_filtered_video_frame(AVFilterContext *ctx, AVFrame *frame,
     frame->top_field_first  = picref->video->top_field_first;
     frame->key_frame        = picref->video->key_frame;
     frame->pict_type        = picref->video->pict_type;
-    frame->sample_aspect_ratio = picref->video->pixel_aspect;
+    frame->sample_aspect_ratio = picref->video->sample_aspect_ratio;
 
     return 1;
 }
index 42e654f..ab91c24 100644 (file)
@@ -13,6 +13,10 @@ libavutil:   2011-04-18
 
 API changes, most recent first:
 
+2011-05-01 - xxxxxxx - lavfi 2.4.0 - avfilter.h
+  Rename AVFilterBufferRefVideoProps.pixel_aspect to
+  sample_aspect_ratio.
+
 2011-05-01 - xxxxxxx - lavc 53.3.0 - AVFrame
   Add a sample_aspect_ratio field to AVFrame.
 
index 5f87cd0..904847c 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1696,7 +1696,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
                         case AVMEDIA_TYPE_VIDEO:
 #if CONFIG_AVFILTER
                             if (ost->picref->video && !ost->frame_aspect_ratio)
-                                ost->st->codec->sample_aspect_ratio = ost->picref->video->pixel_aspect;
+                                ost->st->codec->sample_aspect_ratio = ost->picref->video->sample_aspect_ratio;
 #endif
                             do_video_out(os, ost, ist, &picture, &frame_size);
                             if (vstats_filename && frame_size)
index fcb9418..945e08f 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -692,10 +692,10 @@ static void video_image_display(VideoState *is)
     vp = &is->pictq[is->pictq_rindex];
     if (vp->bmp) {
 #if CONFIG_AVFILTER
-         if (vp->picref->video->pixel_aspect.num == 0)
+         if (vp->picref->video->sample_aspect_ratio.num == 0)
              aspect_ratio = 0;
          else
-             aspect_ratio = av_q2d(vp->picref->video->pixel_aspect);
+             aspect_ratio = av_q2d(vp->picref->video->sample_aspect_ratio);
 #else
 
         /* XXX: use variable in the frame */
@@ -1688,7 +1688,7 @@ static int input_request_frame(AVFilterLink *link)
 
     picref->pts = pts;
     picref->pos = priv->frame->pkt_pos;
-    picref->video->pixel_aspect = priv->frame->sample_aspect_ratio;
+    picref->video->sample_aspect_ratio = priv->frame->sample_aspect_ratio;
     avfilter_start_frame(link, picref);
     avfilter_draw_slice(link, 0, link->h, 1);
     avfilter_end_frame(link);
index 443562b..49d84e0 100644 (file)
@@ -238,7 +238,7 @@ static void ff_dlog_ref(void *ctx, AVFilterBufferRef *ref, int end)
 
     if (ref->video) {
         av_dlog(ctx, " a:%d/%d s:%dx%d i:%c iskey:%d type:%c",
-                ref->video->pixel_aspect.num, ref->video->pixel_aspect.den,
+                ref->video->sample_aspect_ratio.num, ref->video->sample_aspect_ratio.den,
                 ref->video->w, ref->video->h,
                 !ref->video->interlaced     ? 'P' :         /* Progressive  */
                 ref->video->top_field_first ? 'T' : 'B',    /* Top / Bottom */
index 48a42ac..5003152 100644 (file)
@@ -26,7 +26,7 @@
 #include "libavutil/samplefmt.h"
 
 #define LIBAVFILTER_VERSION_MAJOR  2
-#define LIBAVFILTER_VERSION_MINOR  1
+#define LIBAVFILTER_VERSION_MINOR  4
 #define LIBAVFILTER_VERSION_MICRO  0
 
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
@@ -112,7 +112,7 @@ typedef struct AVFilterBufferRefAudioProps {
 typedef struct AVFilterBufferRefVideoProps {
     int w;                      ///< image width
     int h;                      ///< image height
-    AVRational pixel_aspect;    ///< pixel aspect ratio
+    AVRational sample_aspect_ratio; ///< sample aspect ratio
     int interlaced;             ///< is frame interlaced
     int top_field_first;        ///< field order
     enum AVPictureType pict_type; ///< picture type of the frame
index 95900d1..3b4a57c 100644 (file)
@@ -65,7 +65,7 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
 {
     AspectContext *aspect = link->dst->priv;
 
-    picref->video->pixel_aspect = aspect->aspect;
+    picref->video->sample_aspect_ratio = aspect->aspect;
     avfilter_start_frame(link->dst->outputs[0], picref);
 }
 
index adccccb..0cb5fd3 100644 (file)
@@ -430,7 +430,7 @@ static int source_request_frame(AVFilterLink *outlink)
 {
     Frei0rContext *frei0r = outlink->src->priv;
     AVFilterBufferRef *picref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
-    picref->video->pixel_aspect = (AVRational) {1, 1};
+    picref->video->sample_aspect_ratio = (AVRational) {1, 1};
     picref->pts = frei0r->pts++;
     picref->pos = -1;
 
index 27214a6..da84efc 100644 (file)
@@ -252,9 +252,9 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
 
     outlink->out_buf = outpicref;
 
-    av_reduce(&outpicref->video->pixel_aspect.num, &outpicref->video->pixel_aspect.den,
-              (int64_t)picref->video->pixel_aspect.num * outlink->h * link->w,
-              (int64_t)picref->video->pixel_aspect.den * outlink->w * link->h,
+    av_reduce(&outpicref->video->sample_aspect_ratio.num, &outpicref->video->sample_aspect_ratio.den,
+              (int64_t)picref->video->sample_aspect_ratio.num * outlink->h * link->w,
+              (int64_t)picref->video->sample_aspect_ratio.den * outlink->w * link->h,
               INT_MAX);
 
     scale->slice_y = 0;
index d2483d5..d512199 100644 (file)
@@ -59,7 +59,7 @@ static void end_frame(AVFilterLink *inlink)
            showinfo->frame,
            picref->pts, picref ->pts * av_q2d(inlink->time_base), picref->pos,
            av_pix_fmt_descriptors[picref->format].name,
-           picref->video->pixel_aspect.num, picref->video->pixel_aspect.den,
+           picref->video->sample_aspect_ratio.num, picref->video->sample_aspect_ratio.den,
            picref->video->w, picref->video->h,
            !picref->video->interlaced     ? 'P' :         /* Progressive  */
            picref->video->top_field_first ? 'T' : 'B',    /* Top / Bottom */
index ed91aaa..a5247c9 100644 (file)
@@ -122,11 +122,11 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
                                                  outlink->w, outlink->h);
     outlink->out_buf->pts = picref->pts;
 
-    if (picref->video->pixel_aspect.num == 0) {
-        outlink->out_buf->video->pixel_aspect = picref->video->pixel_aspect;
+    if (picref->video->sample_aspect_ratio.num == 0) {
+        outlink->out_buf->video->sample_aspect_ratio = picref->video->sample_aspect_ratio;
     } else {
-        outlink->out_buf->video->pixel_aspect.num = picref->video->pixel_aspect.den;
-        outlink->out_buf->video->pixel_aspect.den = picref->video->pixel_aspect.num;
+        outlink->out_buf->video->sample_aspect_ratio.num = picref->video->sample_aspect_ratio.den;
+        outlink->out_buf->video->sample_aspect_ratio.den = picref->video->sample_aspect_ratio.num;
     }
 
     avfilter_start_frame(outlink, avfilter_ref_buffer(outlink->out_buf, ~0));
index 48c2f23..906cb5d 100644 (file)
@@ -34,7 +34,7 @@ typedef struct {
     int               h, w;
     enum PixelFormat  pix_fmt;
     AVRational        time_base;     ///< time_base to set in the output link
-    AVRational        pixel_aspect;
+    AVRational        sample_aspect_ratio;
     char              sws_param[256];
 } BufferSourceContext;
 
@@ -130,7 +130,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
     if (!args ||
         (n = sscanf(args, "%d:%d:%127[^:]:%d:%d:%d:%d", &c->w, &c->h, pix_fmt_str,
                     &c->time_base.num, &c->time_base.den,
-                    &c->pixel_aspect.num, &c->pixel_aspect.den)) != 7) {
+                    &c->sample_aspect_ratio.num, &c->sample_aspect_ratio.den)) != 7) {
         av_log(ctx, AV_LOG_ERROR, "Expected 7 arguments, but only %d found in '%s'\n", n, args);
         return AVERROR(EINVAL);
     }
@@ -162,7 +162,7 @@ static int config_props(AVFilterLink *link)
 
     link->w = c->w;
     link->h = c->h;
-    link->sample_aspect_ratio = c->pixel_aspect;
+    link->sample_aspect_ratio = c->sample_aspect_ratio;
     link->time_base = c->time_base;
 
     return 0;
@@ -190,7 +190,7 @@ static int request_frame(AVFilterLink *link)
                   picref->format, link->w, link->h);
 
     picref->pts                    = c->pts;
-    picref->video->pixel_aspect    = c->frame.sample_aspect_ratio;
+    picref->video->sample_aspect_ratio = c->frame.sample_aspect_ratio;
     picref->video->interlaced      = c->frame.interlaced_frame;
     picref->video->top_field_first = c->frame.top_field_first;
     picref->video->key_frame       = c->frame.key_frame;
index 3fab260..dc73e1b 100644 (file)
@@ -132,7 +132,7 @@ static int color_request_frame(AVFilterLink *link)
 {
     ColorContext *color = link->src->priv;
     AVFilterBufferRef *picref = avfilter_get_video_buffer(link, AV_PERM_WRITE, color->w, color->h);
-    picref->video->pixel_aspect = (AVRational) {1, 1};
+    picref->video->sample_aspect_ratio = (AVRational) {1, 1};
     picref->pts                 = av_rescale_q(color->pts++, color->time_base, AV_TIME_BASE_Q);
     picref->pos                 = 0;
 
index dd3feae..e94e77d 100644 (file)
@@ -248,7 +248,7 @@ static int movie_get_frame(AVFilterLink *outlink)
 
                 movie->picref->pos                    = movie->frame->pkt_pos;
                 if (!movie->frame->sample_aspect_ratio.num)
-                    movie->picref->video->pixel_aspect = st->sample_aspect_ratio;
+                    movie->picref->video->sample_aspect_ratio = st->sample_aspect_ratio;
                 movie->picref->video->interlaced      = movie->frame->interlaced_frame;
                 movie->picref->video->top_field_first = movie->frame->top_field_first;
                 movie->picref->video->key_frame       = movie->frame->key_frame;
@@ -258,7 +258,8 @@ static int movie_get_frame(AVFilterLink *outlink)
                         movie->file_name, movie->picref->pts,
                         (double)movie->picref->pts * av_q2d(st->time_base),
                         movie->picref->pos,
-                        movie->picref->video->pixel_aspect.num, movie->picref->video->pixel_aspect.den);
+                        movie->picref->video->sample_aspect_ratio.num,
+                        movie->picref->video->sample_aspect_ratio.den);
                 // We got it. Free the packet since we are returning
                 av_free_packet(&pkt);