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.
Unified · Split
| @@ -912,7 +912,7 @@ int get_filtered_video_frame(AVFilterContext *ctx, AVFrame *frame, · 911 unmodified lines | |||
| 912 | frame->top_field_first = picref->video->top_field_first; | 912 | frame->top_field_first = picref->video->top_field_first; |
| 913 | frame->key_frame = picref->video->key_frame; | 913 | frame->key_frame = picref->video->key_frame; |
| 914 | frame->pict_type = picref->video->pict_type; | 914 | frame->pict_type = picref->video->pict_type; |
| 915 | frame->sample_aspect_ratio = picref->video->pixel_aspect; | 915 | frame->sample_aspect_ratio = picref->video->sample_aspect_ratio; |
| 916 | 916 | ||
| 917 | return 1; | 917 | return 1; |
| 918 | } | 918 | } |
| @@ -13,6 +13,10 @@ libavutil: 2011-04-18 · 12 unmodified lines | |||
| 13 | 13 | ||
| 14 | API changes, most recent first: | 14 | API changes, most recent first: |
| 15 | 15 | ||
| 16 | 2011-05-01 - xxxxxxx - lavfi 2.4.0 - avfilter.h | ||
| 17 | Rename AVFilterBufferRefVideoProps.pixel_aspect to | ||
| 18 | sample_aspect_ratio. | ||
| 19 | |||
| 16 | 2011-05-01 - xxxxxxx - lavc 53.3.0 - AVFrame | 20 | 2011-05-01 - xxxxxxx - lavc 53.3.0 - AVFrame |
| 17 | Add a sample_aspect_ratio field to AVFrame. | 21 | Add a sample_aspect_ratio field to AVFrame. |
| 18 | 22 | ||
| @@ -1696,7 +1696,7 @@ static int output_packet(AVInputStream *ist, int ist_index, · 1695 unmodified lines | |||
| 1696 | case AVMEDIA_TYPE_VIDEO: | 1696 | case AVMEDIA_TYPE_VIDEO: |
| 1697 | #if CONFIG_AVFILTER | 1697 | #if CONFIG_AVFILTER |
| 1698 | if (ost->picref->video && !ost->frame_aspect_ratio) | 1698 | if (ost->picref->video && !ost->frame_aspect_ratio) |
| 1699 | ost->st->codec->sample_aspect_ratio = ost->picref->video->pixel_aspect; | 1699 | ost->st->codec->sample_aspect_ratio = ost->picref->video->sample_aspect_ratio; |
| 1700 | #endif | 1700 | #endif |
| 1701 | do_video_out(os, ost, ist, &picture, &frame_size); | 1701 | do_video_out(os, ost, ist, &picture, &frame_size); |
| 1702 | if (vstats_filename && frame_size) | 1702 | if (vstats_filename && frame_size) |
| @@ -692,10 +692,10 @@ static void video_image_display(VideoState *is) · 691 unmodified lines | |||
| 692 | vp = &is->pictq[is->pictq_rindex]; | 692 | vp = &is->pictq[is->pictq_rindex]; |
| 693 | if (vp->bmp) { | 693 | if (vp->bmp) { |
| 694 | #if CONFIG_AVFILTER | 694 | #if CONFIG_AVFILTER |
| 695 | if (vp->picref->video->pixel_aspect.num == 0) | 695 | if (vp->picref->video->sample_aspect_ratio.num == 0) |
| 696 | aspect_ratio = 0; | 696 | aspect_ratio = 0; |
| 697 | else | 697 | else |
| 698 | aspect_ratio = av_q2d(vp->picref->video->pixel_aspect); | 698 | aspect_ratio = av_q2d(vp->picref->video->sample_aspect_ratio); |
| 699 | #else | 699 | #else |
| 700 | 700 | ||
| 701 | /* XXX: use variable in the frame */ | 701 | /* XXX: use variable in the frame */ |
| @@ -1688,7 +1688,7 @@ static int input_request_frame(AVFilterLink *link) · 986 unmodified lines | |||
| 1688 | 1688 | ||
| 1689 | picref->pts = pts; | 1689 | picref->pts = pts; |
| 1690 | picref->pos = priv->frame->pkt_pos; | 1690 | picref->pos = priv->frame->pkt_pos; |
| 1691 | picref->video->pixel_aspect = priv->frame->sample_aspect_ratio; | 1691 | picref->video->sample_aspect_ratio = priv->frame->sample_aspect_ratio; |
| 1692 | avfilter_start_frame(link, picref); | 1692 | avfilter_start_frame(link, picref); |
| 1693 | avfilter_draw_slice(link, 0, link->h, 1); | 1693 | avfilter_draw_slice(link, 0, link->h, 1); |
| 1694 | avfilter_end_frame(link); | 1694 | avfilter_end_frame(link); |
| @@ -238,7 +238,7 @@ static void ff_dlog_ref(void *ctx, AVFilterBufferRef *ref, int end) · 237 unmodified lines | |||
| 238 | 238 | ||
| 239 | if (ref->video) { | 239 | if (ref->video) { |
| 240 | av_dlog(ctx, " a:%d/%d s:%dx%d i:%c iskey:%d type:%c", | 240 | av_dlog(ctx, " a:%d/%d s:%dx%d i:%c iskey:%d type:%c", |
| 241 | ref->video->pixel_aspect.num, ref->video->pixel_aspect.den, | 241 | ref->video->sample_aspect_ratio.num, ref->video->sample_aspect_ratio.den, |
| 242 | ref->video->w, ref->video->h, | 242 | ref->video->w, ref->video->h, |
| 243 | !ref->video->interlaced ? 'P' : /* Progressive */ | 243 | !ref->video->interlaced ? 'P' : /* Progressive */ |
| 244 | ref->video->top_field_first ? 'T' : 'B', /* Top / Bottom */ | 244 | ref->video->top_field_first ? 'T' : 'B', /* Top / Bottom */ |
| @@ -26,7 +26,7 @@ · 25 unmodified lines | |||
| 26 | #include "libavutil/samplefmt.h" | 26 | #include "libavutil/samplefmt.h" |
| 27 | 27 | ||
| 28 | #define LIBAVFILTER_VERSION_MAJOR 2 | 28 | #define LIBAVFILTER_VERSION_MAJOR 2 |
| 29 | #define LIBAVFILTER_VERSION_MINOR 1 | 29 | #define LIBAVFILTER_VERSION_MINOR 4 |
| 30 | #define LIBAVFILTER_VERSION_MICRO 0 | 30 | #define LIBAVFILTER_VERSION_MICRO 0 |
| 31 | 31 | ||
| 32 | #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ | 32 | #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ |
| @@ -112,7 +112,7 @@ typedef struct AVFilterBufferRefAudioProps { · 79 unmodified lines | |||
| 112 | typedef struct AVFilterBufferRefVideoProps { | 112 | typedef struct AVFilterBufferRefVideoProps { |
| 113 | int w; ///< image width | 113 | int w; ///< image width |
| 114 | int h; ///< image height | 114 | int h; ///< image height |
| 115 | AVRational pixel_aspect; ///< pixel aspect ratio | 115 | AVRational sample_aspect_ratio; ///< sample aspect ratio |
| 116 | int interlaced; ///< is frame interlaced | 116 | int interlaced; ///< is frame interlaced |
| 117 | int top_field_first; ///< field order | 117 | int top_field_first; ///< field order |
| 118 | enum AVPictureType pict_type; ///< picture type of the frame | 118 | enum AVPictureType pict_type; ///< picture type of the frame |
| @@ -65,7 +65,7 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref) · 64 unmodified lines | |||
| 65 | { | 65 | { |
| 66 | AspectContext *aspect = link->dst->priv; | 66 | AspectContext *aspect = link->dst->priv; |
| 67 | 67 | ||
| 68 | picref->video->pixel_aspect = aspect->aspect; | 68 | picref->video->sample_aspect_ratio = aspect->aspect; |
| 69 | avfilter_start_frame(link->dst->outputs[0], picref); | 69 | avfilter_start_frame(link->dst->outputs[0], picref); |
| 70 | } | 70 | } |
| 71 | 71 | ||
| @@ -430,7 +430,7 @@ static int source_request_frame(AVFilterLink *outlink) · 429 unmodified lines | |||
| 430 | { | 430 | { |
| 431 | Frei0rContext *frei0r = outlink->src->priv; | 431 | Frei0rContext *frei0r = outlink->src->priv; |
| 432 | AVFilterBufferRef *picref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h); | 432 | AVFilterBufferRef *picref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h); |
| 433 | picref->video->pixel_aspect = (AVRational) {1, 1}; | 433 | picref->video->sample_aspect_ratio = (AVRational) {1, 1}; |
| 434 | picref->pts = frei0r->pts++; | 434 | picref->pts = frei0r->pts++; |
| 435 | picref->pos = -1; | 435 | picref->pos = -1; |
| 436 | 436 | ||
| @@ -252,9 +252,9 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref) · 251 unmodified lines | |||
| 252 | 252 | ||
| 253 | outlink->out_buf = outpicref; | 253 | outlink->out_buf = outpicref; |
| 254 | 254 | ||
| 255 | av_reduce(&outpicref->video->pixel_aspect.num, &outpicref->video->pixel_aspect.den, | 255 | av_reduce(&outpicref->video->sample_aspect_ratio.num, &outpicref->video->sample_aspect_ratio.den, |
| 256 | (int64_t)picref->video->pixel_aspect.num * outlink->h * link->w, | 256 | (int64_t)picref->video->sample_aspect_ratio.num * outlink->h * link->w, |
| 257 | (int64_t)picref->video->pixel_aspect.den * outlink->w * link->h, | 257 | (int64_t)picref->video->sample_aspect_ratio.den * outlink->w * link->h, |
| 258 | INT_MAX); | 258 | INT_MAX); |
| 259 | 259 | ||
| 260 | scale->slice_y = 0; | 260 | scale->slice_y = 0; |
| @@ -59,7 +59,7 @@ static void end_frame(AVFilterLink *inlink) · 58 unmodified lines | |||
| 59 | showinfo->frame, | 59 | showinfo->frame, |
| 60 | picref->pts, picref ->pts * av_q2d(inlink->time_base), picref->pos, | 60 | picref->pts, picref ->pts * av_q2d(inlink->time_base), picref->pos, |
| 61 | av_pix_fmt_descriptors[picref->format].name, | 61 | av_pix_fmt_descriptors[picref->format].name, |
| 62 | picref->video->pixel_aspect.num, picref->video->pixel_aspect.den, | 62 | picref->video->sample_aspect_ratio.num, picref->video->sample_aspect_ratio.den, |
| 63 | picref->video->w, picref->video->h, | 63 | picref->video->w, picref->video->h, |
| 64 | !picref->video->interlaced ? 'P' : /* Progressive */ | 64 | !picref->video->interlaced ? 'P' : /* Progressive */ |
| 65 | picref->video->top_field_first ? 'T' : 'B', /* Top / Bottom */ | 65 | picref->video->top_field_first ? 'T' : 'B', /* Top / Bottom */ |
| @@ -122,11 +122,11 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) · 121 unmodified lines | |||
| 122 | outlink->w, outlink->h); | 122 | outlink->w, outlink->h); |
| 123 | outlink->out_buf->pts = picref->pts; | 123 | outlink->out_buf->pts = picref->pts; |
| 124 | 124 | ||
| 125 | if (picref->video->pixel_aspect.num == 0) { | 125 | if (picref->video->sample_aspect_ratio.num == 0) { |
| 126 | outlink->out_buf->video->pixel_aspect = picref->video->pixel_aspect; | 126 | outlink->out_buf->video->sample_aspect_ratio = picref->video->sample_aspect_ratio; |
| 127 | } else { | 127 | } else { |
| 128 | outlink->out_buf->video->pixel_aspect.num = picref->video->pixel_aspect.den; | 128 | outlink->out_buf->video->sample_aspect_ratio.num = picref->video->sample_aspect_ratio.den; |
| 129 | outlink->out_buf->video->pixel_aspect.den = picref->video->pixel_aspect.num; | 129 | outlink->out_buf->video->sample_aspect_ratio.den = picref->video->sample_aspect_ratio.num; |
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | avfilter_start_frame(outlink, avfilter_ref_buffer(outlink->out_buf, ~0)); | 132 | avfilter_start_frame(outlink, avfilter_ref_buffer(outlink->out_buf, ~0)); |
| @@ -34,7 +34,7 @@ typedef struct { · 33 unmodified lines | |||
| 34 | int h, w; | 34 | int h, w; |
| 35 | enum PixelFormat pix_fmt; | 35 | enum PixelFormat pix_fmt; |
| 36 | AVRational time_base; ///< time_base to set in the output link | 36 | AVRational time_base; ///< time_base to set in the output link |
| 37 | AVRational pixel_aspect; | 37 | AVRational sample_aspect_ratio; |
| 38 | char sws_param[256]; | 38 | char sws_param[256]; |
| 39 | } BufferSourceContext; | 39 | } BufferSourceContext; |
| 40 | 40 | ||
| @@ -130,7 +130,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) · 89 unmodified lines | |||
| 130 | if (!args || | 130 | if (!args || |
| 131 | (n = sscanf(args, "%d:%d:%127[^:]:%d:%d:%d:%d", &c->w, &c->h, pix_fmt_str, | 131 | (n = sscanf(args, "%d:%d:%127[^:]:%d:%d:%d:%d", &c->w, &c->h, pix_fmt_str, |
| 132 | &c->time_base.num, &c->time_base.den, | 132 | &c->time_base.num, &c->time_base.den, |
| 133 | &c->pixel_aspect.num, &c->pixel_aspect.den)) != 7) { | 133 | &c->sample_aspect_ratio.num, &c->sample_aspect_ratio.den)) != 7) { |
| 134 | av_log(ctx, AV_LOG_ERROR, "Expected 7 arguments, but only %d found in '%s'\n", n, args); | 134 | av_log(ctx, AV_LOG_ERROR, "Expected 7 arguments, but only %d found in '%s'\n", n, args); |
| 135 | return AVERROR(EINVAL); | 135 | return AVERROR(EINVAL); |
| 136 | } | 136 | } |
| @@ -162,7 +162,7 @@ static int config_props(AVFilterLink *link) · 25 unmodified lines | |||
| 162 | 162 | ||
| 163 | link->w = c->w; | 163 | link->w = c->w; |
| 164 | link->h = c->h; | 164 | link->h = c->h; |
| 165 | link->sample_aspect_ratio = c->pixel_aspect; | 165 | link->sample_aspect_ratio = c->sample_aspect_ratio; |
| 166 | link->time_base = c->time_base; | 166 | link->time_base = c->time_base; |
| 167 | 167 | ||
| 168 | return 0; | 168 | return 0; |
| @@ -190,7 +190,7 @@ static int request_frame(AVFilterLink *link) · 21 unmodified lines | |||
| 190 | picref->format, link->w, link->h); | 190 | picref->format, link->w, link->h); |
| 191 | 191 | ||
| 192 | picref->pts = c->pts; | 192 | picref->pts = c->pts; |
| 193 | picref->video->pixel_aspect = c->frame.sample_aspect_ratio; | 193 | picref->video->sample_aspect_ratio = c->frame.sample_aspect_ratio; |
| 194 | picref->video->interlaced = c->frame.interlaced_frame; | 194 | picref->video->interlaced = c->frame.interlaced_frame; |
| 195 | picref->video->top_field_first = c->frame.top_field_first; | 195 | picref->video->top_field_first = c->frame.top_field_first; |
| 196 | picref->video->key_frame = c->frame.key_frame; | 196 | picref->video->key_frame = c->frame.key_frame; |
| @@ -132,7 +132,7 @@ static int color_request_frame(AVFilterLink *link) · 131 unmodified lines | |||
| 132 | { | 132 | { |
| 133 | ColorContext *color = link->src->priv; | 133 | ColorContext *color = link->src->priv; |
| 134 | AVFilterBufferRef *picref = avfilter_get_video_buffer(link, AV_PERM_WRITE, color->w, color->h); | 134 | AVFilterBufferRef *picref = avfilter_get_video_buffer(link, AV_PERM_WRITE, color->w, color->h); |
| 135 | picref->video->pixel_aspect = (AVRational) {1, 1}; | 135 | picref->video->sample_aspect_ratio = (AVRational) {1, 1}; |
| 136 | picref->pts = av_rescale_q(color->pts++, color->time_base, AV_TIME_BASE_Q); | 136 | picref->pts = av_rescale_q(color->pts++, color->time_base, AV_TIME_BASE_Q); |
| 137 | picref->pos = 0; | 137 | picref->pos = 0; |
| 138 | 138 | ||
| @@ -248,7 +248,7 @@ static int movie_get_frame(AVFilterLink *outlink) · 247 unmodified lines | |||
| 248 | 248 | ||
| 249 | movie->picref->pos = movie->frame->pkt_pos; | 249 | movie->picref->pos = movie->frame->pkt_pos; |
| 250 | if (!movie->frame->sample_aspect_ratio.num) | 250 | if (!movie->frame->sample_aspect_ratio.num) |
| 251 | movie->picref->video->pixel_aspect = st->sample_aspect_ratio; | 251 | movie->picref->video->sample_aspect_ratio = st->sample_aspect_ratio; |
| 252 | movie->picref->video->interlaced = movie->frame->interlaced_frame; | 252 | movie->picref->video->interlaced = movie->frame->interlaced_frame; |
| 253 | movie->picref->video->top_field_first = movie->frame->top_field_first; | 253 | movie->picref->video->top_field_first = movie->frame->top_field_first; |
| 254 | movie->picref->video->key_frame = movie->frame->key_frame; | 254 | movie->picref->video->key_frame = movie->frame->key_frame; |
| @@ -258,7 +258,8 @@ static int movie_get_frame(AVFilterLink *outlink) · 3 unmodified lines | |||
| 258 | movie->file_name, movie->picref->pts, | 258 | movie->file_name, movie->picref->pts, |
| 259 | (double)movie->picref->pts * av_q2d(st->time_base), | 259 | (double)movie->picref->pts * av_q2d(st->time_base), |
| 260 | movie->picref->pos, | 260 | movie->picref->pos, |
| 261 | movie->picref->video->pixel_aspect.num, movie->picref->video->pixel_aspect.den); | 261 | movie->picref->video->sample_aspect_ratio.num, |
| 262 | movie->picref->video->sample_aspect_ratio.den); | ||
| 262 | // We got it. Free the packet since we are returning | 263 | // We got it. Free the packet since we are returning |
| 263 | av_free_packet(&pkt); | 264 | av_free_packet(&pkt); |
| 264 | 265 | ||