mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
gst/videoscale/gstvideoscale.c: Transform a given PAR to a range on the struct with the generic height/width instead ...
Original commit message from CVS: * gst/videoscale/gstvideoscale.c: (gst_video_scale_transform_caps): Transform a given PAR to a range on the struct with the generic height/width instead of the struct with the possibly restricted height/width.
This commit is contained in:
parent
8b14d08115
commit
d57ab7cfdb
2 changed files with 12 additions and 15 deletions
|
@ -1,3 +1,10 @@
|
|||
2008-06-04 Sebastian Dröge <slomo@circular-chaos.org>
|
||||
|
||||
* gst/videoscale/gstvideoscale.c: (gst_video_scale_transform_caps):
|
||||
Transform a given PAR to a range on the struct with the generic
|
||||
height/width instead of the struct with the possibly restricted
|
||||
height/width.
|
||||
|
||||
2008-06-04 Sebastian Dröge <slomo@circular-chaos.org>
|
||||
|
||||
* gst/videoscale/gstvideoscale.c: (gst_video_scale_transform_caps):
|
||||
|
|
|
@ -387,26 +387,16 @@ gst_video_scale_transform_caps (GstBaseTransform * trans,
|
|||
"width", GST_TYPE_INT_RANGE, 1, G_MAXINT,
|
||||
"height", GST_TYPE_INT_RANGE, 1, G_MAXINT, NULL);
|
||||
|
||||
gst_caps_merge_structure (ret, structure);
|
||||
structure = gst_caps_get_structure (ret, 0);
|
||||
gst_caps_merge_structure (ret, gst_structure_copy (structure));
|
||||
|
||||
/* if pixel aspect ratio, make a range of it */
|
||||
if ((par = gst_structure_get_value (structure, "pixel-aspect-ratio"))) {
|
||||
GstCaps *copy;
|
||||
|
||||
GstStructure *cstruct;
|
||||
|
||||
/* copy input PAR first, this is the prefered PAR */
|
||||
gst_structure_set_value (structure, "pixel-aspect-ratio", par);
|
||||
|
||||
/* then make a copy with a fraction range as a second choice */
|
||||
copy = gst_caps_copy (ret);
|
||||
cstruct = gst_caps_get_structure (copy, 0);
|
||||
gst_structure_set (cstruct,
|
||||
gst_structure_set (structure,
|
||||
"pixel-aspect-ratio", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL);
|
||||
|
||||
/* and append */
|
||||
gst_caps_append (ret, copy);
|
||||
gst_caps_merge_structure (ret, structure);
|
||||
} else {
|
||||
gst_structure_free (structure);
|
||||
}
|
||||
|
||||
GST_DEBUG_OBJECT (trans, "returning caps: %" GST_PTR_FORMAT, ret);
|
||||
|
|
Loading…
Reference in a new issue