+2005-07-12 Andy Wingo <wingo@pobox.com>
+
+ * sys/v4l/gstv4lsrc.c (gst_v4lsrc_get_property)
+ (gst_v4lsrc_set_property, gst_v4lsrc_class_init, gst_v4lsrc_init)
+ (gst_v4lsrc_create): Re-add the copy-mode property, default to
+ TRUE to avoid deadlocks if an element holds on to our buffers.
+
2005-07-11 Thomas Vander Stichele <thomas at apestaart dot org>
* gst/sine/gstsinesrc.c: (gst_sinesrc_class_init),
PROP_0,
PROP_AUTOPROBE,
PROP_AUTOPROBE_FPS,
+ PROP_COPY_MODE,
PROP_TIMESTAMP_OFFSET
};
g_param_spec_boolean ("autoprobe-fps", "Autoprobe FPS",
"Whether the device should be probed for framerates",
TRUE, G_PARAM_READWRITE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_COPY_MODE,
+ g_param_spec_boolean ("copy-mode", "Copy mode",
+ "Whether to send out copies of buffers, or direct pointers to the mmap region",
+ TRUE, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass),
PROP_TIMESTAMP_OFFSET, g_param_spec_int64 ("timestamp-offset",
"Timestamp offset",
v4lsrc->is_capturing = FALSE;
v4lsrc->autoprobe = TRUE;
v4lsrc->autoprobe_fps = TRUE;
+ v4lsrc->copy_mode = TRUE;
v4lsrc->timestamp_offset = 0;
g_return_if_fail (!GST_V4L_IS_ACTIVE (GST_V4LELEMENT (v4lsrc)));
v4lsrc->autoprobe_fps = g_value_get_boolean (value);
break;
+ case PROP_COPY_MODE:
+ v4lsrc->copy_mode = g_value_get_boolean (value);
+ break;
case PROP_TIMESTAMP_OFFSET:
v4lsrc->timestamp_offset = g_value_get_int (value);
break;
case PROP_AUTOPROBE_FPS:
g_value_set_boolean (value, v4lsrc->autoprobe_fps);
break;
+ case PROP_COPY_MODE:
+ g_value_set_boolean (value, v4lsrc->copy_mode);
+ break;
case PROP_TIMESTAMP_OFFSET:
g_value_set_int (value, v4lsrc->timestamp_offset);
break;
*buf = gst_v4lsrc_buffer_new (v4lsrc, num);
-#if 0
- GstBuffer *copy = gst_buffer_copy (buf);
+ if (v4lsrc->copy_mode) {
+ GstBuffer *copy = gst_buffer_copy (*buf);
- gst_buffer_unref (buf);
- buf = copy;
-#endif
+ gst_buffer_unref (*buf);
+ *buf = copy;
+ }
return GST_FLOW_OK;
}