mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-25 23:46:45 +00:00
gst/videoscale/gstvideoscale.c: PAR can be non-fixed when not provided as argument (#162626).
Original commit message from CVS: * gst/videoscale/gstvideoscale.c: (gst_videoscale_link): PAR can be non-fixed when not provided as argument (#162626).
This commit is contained in:
parent
be8b0be739
commit
a1e2e9442d
2 changed files with 19 additions and 8 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2005-01-29 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
|
||||||
|
* gst/videoscale/gstvideoscale.c: (gst_videoscale_link):
|
||||||
|
PAR can be non-fixed when not provided as argument (#162626).
|
||||||
|
|
||||||
2005-01-29 David Moore <dcm@acm.org>
|
2005-01-29 David Moore <dcm@acm.org>
|
||||||
|
|
||||||
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
|
|
@ -263,13 +263,19 @@ gst_videoscale_link (GstPad * pad, const GstCaps * caps)
|
||||||
otherstructure = gst_caps_get_structure (othercaps, 0);
|
otherstructure = gst_caps_get_structure (othercaps, 0);
|
||||||
otherpar = gst_structure_get_value (otherstructure, "pixel-aspect-ratio");
|
otherpar = gst_structure_get_value (otherstructure, "pixel-aspect-ratio");
|
||||||
if (par && otherpar) {
|
if (par && otherpar) {
|
||||||
gint num = gst_value_get_fraction_numerator (par),
|
gint num, den, onum, oden;
|
||||||
den = gst_value_get_fraction_denominator (par),
|
gboolean keep_h, w_align, h_align, w_inc;
|
||||||
onum = gst_value_get_fraction_numerator (otherpar),
|
|
||||||
|
/* otherpar can be a list */
|
||||||
|
if (G_VALUE_TYPE (otherpar) == GST_TYPE_LIST)
|
||||||
|
otherpar = gst_value_list_get_value (otherpar, 0);
|
||||||
|
|
||||||
|
num = gst_value_get_fraction_numerator (par);
|
||||||
|
den = gst_value_get_fraction_denominator (par);
|
||||||
|
onum = gst_value_get_fraction_numerator (otherpar);
|
||||||
oden = gst_value_get_fraction_denominator (otherpar);
|
oden = gst_value_get_fraction_denominator (otherpar);
|
||||||
gboolean keep_h,
|
w_align = (width * num * oden % (den * onum) == 0);
|
||||||
w_align = (width * num * oden % (den * onum) == 0),
|
h_align = (height * den * onum % (num * oden) == 0);
|
||||||
h_align = (height * den * onum % (num * oden) == 0),
|
|
||||||
w_inc = (num * oden > den * onum);
|
w_inc = (num * oden > den * onum);
|
||||||
|
|
||||||
/* decide whether to change width or height */
|
/* decide whether to change width or height */
|
||||||
|
|
Loading…
Reference in a new issue