mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-11 06:11:27 +00:00
camerabin: don't leak sink_caps if they would be any-caps
This commit is contained in:
parent
a5e9a5eebc
commit
c9208657b1
1 changed files with 24 additions and 22 deletions
|
@ -2210,7 +2210,8 @@ gst_camerabin_update_aspect_filter (GstCameraBin * camera, GstCaps * new_caps)
|
||||||
if (sink_pad) {
|
if (sink_pad) {
|
||||||
sink_caps = gst_pad_get_caps (sink_pad);
|
sink_caps = gst_pad_get_caps (sink_pad);
|
||||||
gst_object_unref (sink_pad);
|
gst_object_unref (sink_pad);
|
||||||
if (sink_caps && !gst_caps_is_any (sink_caps)) {
|
if (sink_caps) {
|
||||||
|
if (!gst_caps_is_any (sink_caps)) {
|
||||||
GST_DEBUG_OBJECT (camera, "sink element caps %" GST_PTR_FORMAT,
|
GST_DEBUG_OBJECT (camera, "sink element caps %" GST_PTR_FORMAT,
|
||||||
sink_caps);
|
sink_caps);
|
||||||
/* Get maximum resolution that view finder sink accepts */
|
/* Get maximum resolution that view finder sink accepts */
|
||||||
|
@ -2223,7 +2224,6 @@ gst_camerabin_update_aspect_filter (GstCameraBin * camera, GstCaps * new_caps)
|
||||||
range = gst_structure_get_value (st, "height");
|
range = gst_structure_get_value (st, "height");
|
||||||
sink_h = gst_value_get_int_range_max (range);
|
sink_h = gst_value_get_int_range_max (range);
|
||||||
}
|
}
|
||||||
gst_caps_unref (sink_caps);
|
|
||||||
GST_DEBUG_OBJECT (camera, "sink element accepts max %dx%d", sink_w,
|
GST_DEBUG_OBJECT (camera, "sink element accepts max %dx%d", sink_w,
|
||||||
sink_h);
|
sink_h);
|
||||||
|
|
||||||
|
@ -2235,6 +2235,8 @@ gst_camerabin_update_aspect_filter (GstCameraBin * camera, GstCaps * new_caps)
|
||||||
GST_DEBUG_OBJECT (camera, "new caps with %dx%d", in_w, in_h);
|
GST_DEBUG_OBJECT (camera, "new caps with %dx%d", in_w, in_h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
gst_caps_unref (sink_caps);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we get bigger frames than view finder sink accepts, then we scale.
|
/* If we get bigger frames than view finder sink accepts, then we scale.
|
||||||
|
|
Loading…
Reference in a new issue