summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sf.net>2009-06-26 18:32:40 +0300
committerStefan Kost <ensonic@users.sf.net>2009-06-26 18:36:25 +0300
commitc9208657b11669f1820feed4c177ca24366182be (patch)
tree06df21bcdde1a1ac43c9396c5eb876168d9116bc /gst
parenta5e9a5eebc10553e4a8b5a154e328ed36cf2a819 (diff)
downloadgst-plugins-bad-c9208657b11669f1820feed4c177ca24366182be.tar.gz
gst-plugins-bad-c9208657b11669f1820feed4c177ca24366182be.tar.bz2
gst-plugins-bad-c9208657b11669f1820feed4c177ca24366182be.zip
camerabin: don't leak sink_caps if they would be any-caps
Diffstat (limited to 'gst')
-rw-r--r--gst/camerabin/gstcamerabin.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/gst/camerabin/gstcamerabin.c b/gst/camerabin/gstcamerabin.c
index 9faefd11..3f084b8c 100644
--- a/gst/camerabin/gstcamerabin.c
+++ b/gst/camerabin/gstcamerabin.c
@@ -2210,30 +2210,32 @@ gst_camerabin_update_aspect_filter (GstCameraBin * camera, GstCaps * new_caps)
if (sink_pad) {
sink_caps = gst_pad_get_caps (sink_pad);
gst_object_unref (sink_pad);
- if (sink_caps && !gst_caps_is_any (sink_caps)) {
- GST_DEBUG_OBJECT (camera, "sink element caps %" GST_PTR_FORMAT,
- sink_caps);
- /* Get maximum resolution that view finder sink accepts */
- st = gst_caps_get_structure (sink_caps, 0);
- if (gst_structure_has_field_typed (st, "width", GST_TYPE_INT_RANGE)) {
- range = gst_structure_get_value (st, "width");
- sink_w = gst_value_get_int_range_max (range);
- }
- if (gst_structure_has_field_typed (st, "height", GST_TYPE_INT_RANGE)) {
- range = gst_structure_get_value (st, "height");
- sink_h = gst_value_get_int_range_max (range);
+ if (sink_caps) {
+ if (!gst_caps_is_any (sink_caps)) {
+ GST_DEBUG_OBJECT (camera, "sink element caps %" GST_PTR_FORMAT,
+ sink_caps);
+ /* Get maximum resolution that view finder sink accepts */
+ st = gst_caps_get_structure (sink_caps, 0);
+ if (gst_structure_has_field_typed (st, "width", GST_TYPE_INT_RANGE)) {
+ range = gst_structure_get_value (st, "width");
+ sink_w = gst_value_get_int_range_max (range);
+ }
+ if (gst_structure_has_field_typed (st, "height", GST_TYPE_INT_RANGE)) {
+ range = gst_structure_get_value (st, "height");
+ sink_h = gst_value_get_int_range_max (range);
+ }
+ GST_DEBUG_OBJECT (camera, "sink element accepts max %dx%d", sink_w,
+ sink_h);
+
+ /* Get incoming frames' resolution */
+ if (sink_h && sink_w) {
+ st = gst_caps_get_structure (new_caps, 0);
+ gst_structure_get_int (st, "width", &in_w);
+ gst_structure_get_int (st, "height", &in_h);
+ GST_DEBUG_OBJECT (camera, "new caps with %dx%d", in_w, in_h);
+ }
}
gst_caps_unref (sink_caps);
- GST_DEBUG_OBJECT (camera, "sink element accepts max %dx%d", sink_w,
- sink_h);
-
- /* Get incoming frames' resolution */
- if (sink_h && sink_w) {
- st = gst_caps_get_structure (new_caps, 0);
- gst_structure_get_int (st, "width", &in_w);
- gst_structure_get_int (st, "height", &in_h);
- GST_DEBUG_OBJECT (camera, "new caps with %dx%d", in_w, in_h);
- }
}
}