diff options
author | Thiago Santos <thiago.sousa.santos@collabora.com> | 2012-05-02 09:43:33 -0300 |
---|---|---|
committer | Thiago Santos <thiago.sousa.santos@collabora.com> | 2012-05-02 09:43:33 -0300 |
commit | a944578ef97d0fbffc87523367972fb768f53380 (patch) | |
tree | 79f877d62250267626f8f5b42fc7064190ce5219 /gst-libs | |
parent | b5ba142b0636c191ae77b02d4eee6ef277737784 (diff) | |
download | gstreamer-plugins-bad-a944578ef97d0fbffc87523367972fb768f53380.tar.gz |
basecamerasrc: null caps are not valid in 1.0
Use any caps for the preview-caps property, as NULL caps are
not valid caps in 1.0 anymore
Diffstat (limited to 'gst-libs')
-rw-r--r-- | gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c b/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c index c34221671..42d13435a 100644 --- a/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c +++ b/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c @@ -287,14 +287,22 @@ gst_base_camera_src_set_property (GObject * object, self->post_preview = g_value_get_boolean (value); break; case PROP_PREVIEW_CAPS:{ - GstCaps *new_caps = NULL; + GstCaps *new_caps; + new_caps = (GstCaps *) gst_value_get_caps (value); + if (new_caps == NULL) { + new_caps = gst_caps_new_any (); + } else { + new_caps = gst_caps_ref (new_caps); + } + if (!gst_caps_is_equal (self->preview_caps, new_caps)) { gst_caps_replace (&self->preview_caps, new_caps); gst_base_camera_src_setup_preview (self, new_caps); } else { GST_DEBUG_OBJECT (self, "New preview caps equal current preview caps"); } + gst_caps_unref (new_caps); } break; case PROP_PREVIEW_FILTER: @@ -477,7 +485,7 @@ gst_base_camera_src_class_init (GstBaseCameraSrcClass * klass) g_object_class_install_property (gobject_class, PROP_PREVIEW_CAPS, g_param_spec_boxed ("preview-caps", "Preview caps", - "The caps of the preview image to be posted", + "The caps of the preview image to be posted (NULL means ANY)", GST_TYPE_CAPS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_PREVIEW_FILTER, @@ -546,6 +554,7 @@ gst_base_camera_src_init (GstBaseCameraSrc * self) g_mutex_init (&self->capturing_mutex); self->post_preview = DEFAULT_POST_PREVIEW; + self->preview_caps = gst_caps_new_any (); self->preview_pipeline = gst_camerabin_create_preview_pipeline (GST_ELEMENT_CAST (self), NULL); |