aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2011-04-29 13:12:39 +0200
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2011-05-01 13:10:18 +0200
commit35fe66abbc9a6d151cedbc8d0261dc007aa71fe2 (patch)
tree19560da3923fa463a4b674bebecbbedc6f0e340a /libavfilter
parent77e9dee8aefa3fca75984226f66bf004bb8f9e13 (diff)
downloadffmpeg-35fe66abbc9a6d151cedbc8d0261dc007aa71fe2.tar.gz
lavfi: rename AVFilterBufferRefVideoProps.pixel_aspect to sample_aspect_ratio
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.
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/avfilter.c2
-rw-r--r--libavfilter/avfilter.h4
-rw-r--r--libavfilter/vf_aspect.c2
-rw-r--r--libavfilter/vf_frei0r.c2
-rw-r--r--libavfilter/vf_scale.c6
-rw-r--r--libavfilter/vf_showinfo.c2
-rw-r--r--libavfilter/vf_transpose.c8
-rw-r--r--libavfilter/vsrc_buffer.c8
-rw-r--r--libavfilter/vsrc_color.c2
-rw-r--r--libavfilter/vsrc_movie.c5
10 files changed, 21 insertions, 20 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 443562b2f4..49d84e08b8 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -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 */
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index 48a42ac4b1..5003152069 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -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
diff --git a/libavfilter/vf_aspect.c b/libavfilter/vf_aspect.c
index 95900d15a9..3b4a57cf58 100644
--- a/libavfilter/vf_aspect.c
+++ b/libavfilter/vf_aspect.c
@@ -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);
}
diff --git a/libavfilter/vf_frei0r.c b/libavfilter/vf_frei0r.c
index adccccb95b..0cb5fd30b5 100644
--- a/libavfilter/vf_frei0r.c
+++ b/libavfilter/vf_frei0r.c
@@ -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;
diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
index 27214a6a2f..da84efcbb1 100644
--- a/libavfilter/vf_scale.c
+++ b/libavfilter/vf_scale.c
@@ -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;
diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c
index d2483d5a7f..d512199602 100644
--- a/libavfilter/vf_showinfo.c
+++ b/libavfilter/vf_showinfo.c
@@ -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 */
diff --git a/libavfilter/vf_transpose.c b/libavfilter/vf_transpose.c
index ed91aaade5..a5247c9753 100644
--- a/libavfilter/vf_transpose.c
+++ b/libavfilter/vf_transpose.c
@@ -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));
diff --git a/libavfilter/vsrc_buffer.c b/libavfilter/vsrc_buffer.c
index 48c2f23509..906cb5dca7 100644
--- a/libavfilter/vsrc_buffer.c
+++ b/libavfilter/vsrc_buffer.c
@@ -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;
diff --git a/libavfilter/vsrc_color.c b/libavfilter/vsrc_color.c
index 3fab260a2f..dc73e1bafa 100644
--- a/libavfilter/vsrc_color.c
+++ b/libavfilter/vsrc_color.c
@@ -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;
diff --git a/libavfilter/vsrc_movie.c b/libavfilter/vsrc_movie.c
index dd3feaea98..e94e77d8ee 100644
--- a/libavfilter/vsrc_movie.c
+++ b/libavfilter/vsrc_movie.c
@@ -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);