diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-02-02 19:39:56 +0000 |
---|---|---|
committer | Mans Rullgard <mans@mansr.com> | 2011-02-14 13:07:21 +0000 |
commit | 910b5b82e8429f2e478d8e2aaff5e522c8848b59 (patch) | |
tree | 54c92515eecb0f90a6843596da4b00080b4ee8c0 /libavfilter/vf_aspect.c | |
parent | b7ec5cc4013242a9f30c429d2ce9c20ec01b03eb (diff) |
Add sample_aspect_ratio to AVFilterLink
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavfilter/vf_aspect.c')
-rw-r--r-- | libavfilter/vf_aspect.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libavfilter/vf_aspect.c b/libavfilter/vf_aspect.c index 6f86bf2924..95bfb666ff 100644 --- a/libavfilter/vf_aspect.c +++ b/libavfilter/vf_aspect.c @@ -82,6 +82,9 @@ static int setdar_config_props(AVFilterLink *inlink) av_log(inlink->dst, AV_LOG_INFO, "w:%d h:%d -> dar:%d/%d par:%d/%d\n", inlink->w, inlink->h, dar.num, dar.den, aspect->aspect.num, aspect->aspect.den); + + inlink->sample_aspect_ratio = aspect->aspect; + return 0; } @@ -108,6 +111,16 @@ AVFilter avfilter_vf_setdar = { #endif /* CONFIG_SETDAR_FILTER */ #if CONFIG_SETSAR_FILTER +/* for setdar filter, convert from frame aspect ratio to pixel aspect ratio */ +static int setsar_config_props(AVFilterLink *inlink) +{ + AspectContext *aspect = inlink->dst->priv; + + inlink->sample_aspect_ratio = aspect->aspect; + + return 0; +} + AVFilter avfilter_vf_setsar = { .name = "setsar", .description = NULL_IF_CONFIG_SMALL("Set the pixel sample aspect ratio."), @@ -118,6 +131,7 @@ AVFilter avfilter_vf_setsar = { .inputs = (AVFilterPad[]) {{ .name = "default", .type = AVMEDIA_TYPE_VIDEO, + .config_props = setsar_config_props, .get_video_buffer = avfilter_null_get_video_buffer, .start_frame = start_frame, .end_frame = avfilter_null_end_frame }, |