mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 17:50:36 +00:00
videomaxrate: Simplify transform_caps
This commit is contained in:
parent
ed74d385bc
commit
3449d16566
1 changed files with 6 additions and 5 deletions
|
@ -137,19 +137,20 @@ gst_video_max_rate_transform_caps (GstBaseTransform * trans,
|
|||
GstPadDirection direction, GstCaps * caps)
|
||||
{
|
||||
GstCaps *ret;
|
||||
GstStructure *structure;
|
||||
GstStructure *s;
|
||||
|
||||
/* this function is always called with a simple caps */
|
||||
g_return_val_if_fail (GST_CAPS_IS_SIMPLE (caps), NULL);
|
||||
|
||||
ret = gst_caps_copy (caps);
|
||||
|
||||
s = gst_structure_copy (gst_caps_get_structure (caps, 0));
|
||||
|
||||
/* set the framerate as a range */
|
||||
structure = gst_structure_copy (gst_caps_get_structure (ret, 0));
|
||||
gst_structure_set (structure, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1,
|
||||
gst_structure_set (s, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1,
|
||||
G_MAXINT, 1, NULL);
|
||||
gst_caps_merge_structure (ret, gst_structure_copy (structure));
|
||||
gst_structure_free (structure);
|
||||
|
||||
gst_caps_merge_structure (ret, s);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue