camerabin: use gst_caps_replace instead of separate calls
This fixes setting snapshot caps back to NULL also.
This commit is contained in:
parent
b1d353e2de
commit
4ef918df28
@ -2862,12 +2862,8 @@ gst_camerabin_set_property (GObject * object, guint prop_id,
|
|||||||
break;
|
break;
|
||||||
case ARG_FILTER_CAPS:
|
case ARG_FILTER_CAPS:
|
||||||
GST_OBJECT_LOCK (camera);
|
GST_OBJECT_LOCK (camera);
|
||||||
if (camera->view_finder_caps) {
|
gst_caps_replace (&camera->view_finder_caps,
|
||||||
gst_caps_unref (camera->view_finder_caps);
|
(GstCaps *) gst_value_get_caps (value));
|
||||||
}
|
|
||||||
/* just ref, we don't modify it inplace */
|
|
||||||
camera->view_finder_caps =
|
|
||||||
gst_caps_ref ((GstCaps *) gst_value_get_caps (value));
|
|
||||||
GST_OBJECT_UNLOCK (camera);
|
GST_OBJECT_UNLOCK (camera);
|
||||||
if (GST_STATE (camera) != GST_STATE_NULL) {
|
if (GST_STATE (camera) != GST_STATE_NULL) {
|
||||||
gst_camerabin_set_capsfilter_caps (camera, camera->view_finder_caps);
|
gst_camerabin_set_capsfilter_caps (camera, camera->view_finder_caps);
|
||||||
@ -2875,10 +2871,8 @@ gst_camerabin_set_property (GObject * object, guint prop_id,
|
|||||||
break;
|
break;
|
||||||
case ARG_PREVIEW_CAPS:
|
case ARG_PREVIEW_CAPS:
|
||||||
GST_OBJECT_LOCK (camera);
|
GST_OBJECT_LOCK (camera);
|
||||||
if (camera->preview_caps) {
|
gst_caps_replace (&camera->preview_caps,
|
||||||
gst_caps_unref (camera->preview_caps);
|
(GstCaps *) gst_value_get_caps (value));
|
||||||
}
|
|
||||||
camera->preview_caps = gst_caps_copy (gst_value_get_caps (value));
|
|
||||||
GST_OBJECT_UNLOCK (camera);
|
GST_OBJECT_UNLOCK (camera);
|
||||||
gst_camerabin_preview_create_pipeline (camera);
|
gst_camerabin_preview_create_pipeline (camera);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user