diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2016-05-20 12:32:25 +0200 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2016-06-06 17:45:38 -0400 |
commit | 89a2f0a6470483ca1da184cf4c8bde3ba23a918b (patch) | |
tree | bd595b3b85e6664c8c6903205e24dd2657e3fa90 /sys | |
parent | 616ccbb0db7e9793e84dfadd99ce6d330ce62b29 (diff) |
v4l2transform: fix scaling in case of fixed pixel aspect ratio
To change pixel aspect ratio from DAR to PAR, the necessary scaling factor
is DAR/PAR, not DAR*PAR.
For good measure, add debug output similar to the fixed-width and
fixed-height cases.
https://bugzilla.gnome.org/show_bug.cgi?id=766711
Diffstat (limited to 'sys')
-rw-r--r-- | sys/v4l2/gstv4l2transform.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/v4l2/gstv4l2transform.c b/sys/v4l2/gstv4l2transform.c index 342d99824..781912903 100644 --- a/sys/v4l2/gstv4l2transform.c +++ b/sys/v4l2/gstv4l2transform.c @@ -687,9 +687,11 @@ gst_v4l2_transform_fixate_caps (GstBaseTransform * trans, to_par_n = gst_value_get_fraction_numerator (to_par); to_par_d = gst_value_get_fraction_denominator (to_par); + GST_DEBUG_OBJECT (trans, "PAR is fixed %d/%d", to_par_n, to_par_d); + /* Calculate scale factor for the PAR change */ - if (!gst_util_fraction_multiply (from_dar_n, from_dar_d, to_par_n, - to_par_d, &num, &den)) { + if (!gst_util_fraction_multiply (from_dar_n, from_dar_d, to_par_d, + to_par_n, &num, &den)) { GST_ELEMENT_ERROR (trans, CORE, NEGOTIATION, (NULL), ("Error calculating the output scaled size - integer overflow")); goto done; |