summaryrefslogtreecommitdiffstats
path: root/gst/camerabin/gstcamerabin.c
diff options
context:
space:
mode:
authorDave Robillard <dave@drobilla.net>2009-07-22 14:02:16 -0400
committerDave Robillard <dave@drobilla.net>2009-07-22 14:02:16 -0400
commitef6dbf9be87af7a91a50a910f8578ce3de75846c (patch)
treeef2ba06906d155c8dee835bdaafa06d09628e8bc /gst/camerabin/gstcamerabin.c
parentba89c9e518ded3d919461903a444799a5115c34f (diff)
parent87a97e24d4b4e63dc2fa3a3a12f9b30bfbe54368 (diff)
downloadgst-plugins-bad-ef6dbf9be87af7a91a50a910f8578ce3de75846c.tar.gz
gst-plugins-bad-ef6dbf9be87af7a91a50a910f8578ce3de75846c.tar.bz2
gst-plugins-bad-ef6dbf9be87af7a91a50a910f8578ce3de75846c.zip
Merge branch 'master' of git://anongit.freedesktop.org/gstreamer/gst-plugins-bad into fdo
Diffstat (limited to 'gst/camerabin/gstcamerabin.c')
-rw-r--r--gst/camerabin/gstcamerabin.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/gst/camerabin/gstcamerabin.c b/gst/camerabin/gstcamerabin.c
index 9d8a14cc..22a33477 100644
--- a/gst/camerabin/gstcamerabin.c
+++ b/gst/camerabin/gstcamerabin.c
@@ -954,7 +954,7 @@ gst_camerabin_change_mode (GstCameraBin * camera, gint mode)
camera->mode = mode;
if (camera->active_bin) {
GST_DEBUG_OBJECT (camera, "stopping active bin");
- gst_element_set_state (camera->active_bin, GST_STATE_NULL);
+ gst_element_set_state (camera->active_bin, GST_STATE_READY);
}
if (camera->mode == MODE_IMAGE) {
GstStateChangeReturn state_ret;
@@ -1031,6 +1031,10 @@ gst_camerabin_set_element_zoom (GstCameraBin * camera, gint zoom)
if (zoom != ZOOM_1X) {
w2_crop = (camera->width - (camera->width * ZOOM_1X / zoom)) / 2;
h2_crop = (camera->height - (camera->height * ZOOM_1X / zoom)) / 2;
+
+ /* force number of pixels cropped from left to be even, to avoid slow code
+ * path on videoscale */
+ w2_crop &= 0xFFFE;
}
pad_zoom_sink = gst_element_get_static_pad (camera->src_zoom_crop, "sink");
@@ -2862,12 +2866,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 +2875,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;