summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2015-05-21 00:56:01 +1000
committerMatthew Waters <matthew@centricular.com>2015-05-21 01:04:38 +1000
commitd1419afef1521777a227eb5c83d4be4ccc405ef2 (patch)
treef51874e03901e2065bcb21fb05444588d4da4edd /gst
parent69c09c38cf7f086835c2d4c07531eed30b5ebfdf (diff)
downloadgstreamer-plugins-bad-d1419afef1521777a227eb5c83d4be4ccc405ef2.tar.gz
compositor/glvideomixer: fix up par handling
We were using the wrong formula https://bugzilla.gnome.org/show_bug.cgi?id=749634
Diffstat (limited to 'gst')
-rw-r--r--gst/compositor/compositor.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/gst/compositor/compositor.c b/gst/compositor/compositor.c
index 942c48036..dd1ba7071 100644
--- a/gst/compositor/compositor.c
+++ b/gst/compositor/compositor.c
@@ -221,7 +221,7 @@ _mixer_pad_get_output_size (GstCompositor * comp,
GstVideoAggregator *vagg = GST_VIDEO_AGGREGATOR (comp);
GstVideoAggregatorPad *vagg_pad = GST_VIDEO_AGGREGATOR_PAD (comp_pad);
gint pad_width, pad_height;
- gint dar_n, dar_d;
+ guint dar_n, dar_d;
pad_width =
comp_pad->width <=
@@ -230,21 +230,22 @@ _mixer_pad_get_output_size (GstCompositor * comp,
comp_pad->height <=
0 ? GST_VIDEO_INFO_HEIGHT (&vagg_pad->info) : comp_pad->height;
- gst_util_fraction_multiply (GST_VIDEO_INFO_PAR_N (&vagg_pad->info),
+ gst_video_calculate_display_ratio (&dar_n, &dar_d, pad_width, pad_height,
+ GST_VIDEO_INFO_PAR_N (&vagg_pad->info),
GST_VIDEO_INFO_PAR_D (&vagg_pad->info),
- GST_VIDEO_INFO_PAR_D (&vagg->info), GST_VIDEO_INFO_PAR_N (&vagg->info),
- &dar_n, &dar_d);
+ GST_VIDEO_INFO_PAR_N (&vagg->info), GST_VIDEO_INFO_PAR_D (&vagg->info)
+ );
GST_LOG_OBJECT (comp_pad, "scaling %ux%u by %u/%u (%u/%u / %u/%u)", pad_width,
pad_height, dar_n, dar_d, GST_VIDEO_INFO_PAR_N (&vagg_pad->info),
GST_VIDEO_INFO_PAR_D (&vagg_pad->info),
GST_VIDEO_INFO_PAR_N (&vagg->info), GST_VIDEO_INFO_PAR_D (&vagg->info));
if (pad_height % dar_n == 0) {
- pad_height = gst_util_uint64_scale_int (pad_width, dar_n, dar_d);
+ pad_width = gst_util_uint64_scale_int (pad_height, dar_n, dar_d);
} else if (pad_width % dar_d == 0) {
- pad_width = gst_util_uint64_scale_int (pad_height, dar_d, dar_n);
+ pad_height = gst_util_uint64_scale_int (pad_width, dar_d, dar_n);
} else {
- pad_height = gst_util_uint64_scale_int (pad_width, dar_n, dar_d);
+ pad_width = gst_util_uint64_scale_int (pad_height, dar_n, dar_d);
}
if (width)