diff options
author | Stefan Kost <ensonic@users.sf.net> | 2009-07-17 15:45:32 +0300 |
---|---|---|
committer | Stefan Kost <ensonic@users.sf.net> | 2009-07-17 15:50:19 +0300 |
commit | 4ef918df28fff5efa67a93a00bfbf0562e8b213f (patch) | |
tree | dc6b1e14291499306220bb7e31c79c5c3f89edf4 /gst | |
parent | b1d353e2de91545128bcd0900799e98aeec1e370 (diff) | |
download | gst-plugins-bad-4ef918df28fff5efa67a93a00bfbf0562e8b213f.tar.gz gst-plugins-bad-4ef918df28fff5efa67a93a00bfbf0562e8b213f.tar.bz2 gst-plugins-bad-4ef918df28fff5efa67a93a00bfbf0562e8b213f.zip |
camerabin: use gst_caps_replace instead of separate calls
This fixes setting snapshot caps back to NULL also.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/camerabin/gstcamerabin.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/gst/camerabin/gstcamerabin.c b/gst/camerabin/gstcamerabin.c index 5eace93b..50f863d3 100644 --- a/gst/camerabin/gstcamerabin.c +++ b/gst/camerabin/gstcamerabin.c @@ -2862,12 +2862,8 @@ gst_camerabin_set_property (GObject * object, guint prop_id, break; case ARG_FILTER_CAPS: GST_OBJECT_LOCK (camera); - if (camera->view_finder_caps) { - gst_caps_unref (camera->view_finder_caps); - } - /* just ref, we don't modify it inplace */ - camera->view_finder_caps = - gst_caps_ref ((GstCaps *) gst_value_get_caps (value)); + gst_caps_replace (&camera->view_finder_caps, + (GstCaps *) gst_value_get_caps (value)); GST_OBJECT_UNLOCK (camera); if (GST_STATE (camera) != GST_STATE_NULL) { gst_camerabin_set_capsfilter_caps (camera, camera->view_finder_caps); @@ -2875,10 +2871,8 @@ gst_camerabin_set_property (GObject * object, guint prop_id, break; case ARG_PREVIEW_CAPS: GST_OBJECT_LOCK (camera); - if (camera->preview_caps) { - gst_caps_unref (camera->preview_caps); - } - camera->preview_caps = gst_caps_copy (gst_value_get_caps (value)); + gst_caps_replace (&camera->preview_caps, + (GstCaps *) gst_value_get_caps (value)); GST_OBJECT_UNLOCK (camera); gst_camerabin_preview_create_pipeline (camera); break; |