summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/pco/CMakeLists.txt4
-rw-r--r--plugins/pco/uca-pco-camera.c12
-rw-r--r--src/uca-camera.c16
-rw-r--r--src/uca-camera.h1
-rw-r--r--src/uca-plugin-manager.c6
-rw-r--r--src/uca-ring-buffer.c20
-rw-r--r--test/test-mock.c10
-rw-r--r--test/test-ring-buffer.c2
8 files changed, 58 insertions, 13 deletions
diff --git a/plugins/pco/CMakeLists.txt b/plugins/pco/CMakeLists.txt
index 25f1ca8..1ab4c50 100644
--- a/plugins/pco/CMakeLists.txt
+++ b/plugins/pco/CMakeLists.txt
@@ -7,9 +7,9 @@ find_package(ClSerMe4)
if (PCO_FOUND AND CLSERME4_FOUND AND FGLIB5_FOUND)
set(UCA_CAMERA_NAME "pco")
- set(PLUGIN_VERSION "1.1.0")
+ set(PLUGIN_VERSION "1.2.0")
set(PLUGIN_REVISION "1")
- set(PLUGIN_REQUIRES "libuca >= 1.1.0")
+ set(PLUGIN_REQUIRES "libuca >= 1.5.0")
set(PLUGIN_SUMMARY "libpco plugin for libuca")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../package-plugin.sh.in
diff --git a/plugins/pco/uca-pco-camera.c b/plugins/pco/uca-pco-camera.c
index bae7b53..6e53279 100644
--- a/plugins/pco/uca-pco-camera.c
+++ b/plugins/pco/uca-pco-camera.c
@@ -819,9 +819,19 @@ uca_pco_camera_set_property(GObject *object, guint property_id, const GValue *va
static void
uca_pco_camera_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
{
- UcaPcoCameraPrivate *priv = UCA_PCO_CAMERA_GET_PRIVATE(object);
+ UcaPcoCameraPrivate *priv;
guint err = PCO_NOERROR;
+ priv = UCA_PCO_CAMERA_GET_PRIVATE(object);
+
+ /* Should fix #20 */
+ if (uca_camera_is_recording (UCA_CAMERA (object))) {
+ if (priv->description->type == CAMERATYPE_PCO_EDGE ||
+ priv->description->type == CAMERATYPE_PCO4000) {
+ return;
+ }
+ }
+
switch (property_id) {
case PROP_SENSOR_EXTENDED:
{
diff --git a/src/uca-camera.c b/src/uca-camera.c
index 2f0744e..ee2c432 100644
--- a/src/uca-camera.c
+++ b/src/uca-camera.c
@@ -597,6 +597,22 @@ uca_camera_stop_recording (UcaCamera *camera, GError **error)
}
/**
+ * uca_camera_is_recording:
+ * @camera: A #UcaCamera object
+ *
+ * Convenience function to ask the current recording status
+ *
+ * Return value: %TRUE if recording is ongoing
+ * Since: 1.5
+ */
+gboolean
+uca_camera_is_recording (UcaCamera *camera)
+{
+ g_return_val_if_fail (UCA_IS_CAMERA (camera), FALSE);
+ return camera->priv->is_recording;
+}
+
+/**
* uca_camera_start_readout:
* @camera: A #UcaCamera object
* @error: Location to store a #UcaCameraError error or %NULL
diff --git a/src/uca-camera.h b/src/uca-camera.h
index cf21609..c11644d 100644
--- a/src/uca-camera.h
+++ b/src/uca-camera.h
@@ -143,6 +143,7 @@ void uca_camera_start_recording (UcaCamera *camera,
GError **error);
void uca_camera_stop_recording (UcaCamera *camera,
GError **error);
+gboolean uca_camera_is_recording (UcaCamera *camera);
void uca_camera_start_readout (UcaCamera *camera,
GError **error);
void uca_camera_stop_readout (UcaCamera *camera,
diff --git a/src/uca-plugin-manager.c b/src/uca-plugin-manager.c
index 5013981..7cb65b4 100644
--- a/src/uca-plugin-manager.c
+++ b/src/uca-plugin-manager.c
@@ -30,7 +30,7 @@
* By default, any path listed in the %UCA_CAMERA_PATH environment variable is
* added to the search path.
*
- * @Since: 1.1
+ * Since: 1.1
*/
#include <gio/gio.h>
#include <gmodule.h>
@@ -264,7 +264,7 @@ get_camera_type (UcaPluginManagerPrivate *priv,
* Create a new camera instance with camera @name.
*
* Returns: (transfer full): A new #UcaCamera object.
- * @Since: 1.2
+ * Since: 1.2
*/
UcaCamera *
uca_plugin_manager_get_camerav (UcaPluginManager *manager,
@@ -304,7 +304,7 @@ uca_plugin_manager_get_camerav (UcaPluginManager *manager,
* Create a new camera instance with camera @name.
*
* Returns: (transfer full): A new #UcaCamera object.
- * @Since: 1.2: Pass construction properties.
+ * Since: 1.2: Pass construction properties.
*/
UcaCamera *
uca_plugin_manager_get_camera (UcaPluginManager *manager,
diff --git a/src/uca-ring-buffer.c b/src/uca-ring-buffer.c
index 2f5bfe1..40d7a25 100644
--- a/src/uca-ring-buffer.c
+++ b/src/uca-ring-buffer.c
@@ -68,6 +68,16 @@ uca_ring_buffer_get_block_size (UcaRingBuffer *buffer)
return buffer->priv->block_size;
}
+/**
+ * uca_ring_buffer_get_current_pointer:
+ * @buffer: A #UcaRingBuffer object
+ *
+ * Get a pointer to the data for the block that is currently in use, that means
+ * the number uca_ring_buffer_proceed() has been called modulo the number of
+ * total blocks.
+ *
+ * Return value: (transfer none): Pointer to data block
+ */
gpointer
uca_ring_buffer_get_current_pointer (UcaRingBuffer *buffer)
{
@@ -87,6 +97,16 @@ uca_ring_buffer_set_current_pointer (UcaRingBuffer *buffer,
buffer->priv->current_index = index;
}
+/**
+ * uca_ring_buffer_get_pointer:
+ * @buffer: A #UcaRingBuffer object
+ * @index: Block index to get the pointer for
+ *
+ * Get a pointer to the data for @index block. @index must be less than
+ * :num-blocks.
+ *
+ * Return value: (transfer none): Pointer to data block
+ */
gpointer
uca_ring_buffer_get_pointer (UcaRingBuffer *buffer,
guint index)
diff --git a/test/test-mock.c b/test/test-mock.c
index 7876f5b..e66ef8f 100644
--- a/test/test-mock.c
+++ b/test/test-mock.c
@@ -136,16 +136,14 @@ test_recording_property (Fixture *fixture, gconstpointer data)
gboolean is_recording = FALSE;
uca_camera_start_recording (camera, NULL);
- g_object_get (G_OBJECT (camera),
- "is-recording", &is_recording,
- NULL);
+ g_object_get (G_OBJECT (camera), "is-recording", &is_recording, NULL);
g_assert (is_recording == TRUE);
+ g_assert (uca_camera_is_recording (camera));
uca_camera_stop_recording (camera, NULL);
- g_object_get (G_OBJECT (camera),
- "is-recording", &is_recording,
- NULL);
+ g_object_get (G_OBJECT (camera), "is-recording", &is_recording, NULL);
g_assert (is_recording == FALSE);
+ g_assert (!uca_camera_is_recording (camera));
}
static void
diff --git a/test/test-ring-buffer.c b/test/test-ring-buffer.c
index cc99ef9..2026408 100644
--- a/test/test-ring-buffer.c
+++ b/test/test-ring-buffer.c
@@ -62,7 +62,7 @@ test_ring (void)
}
int
-main (int argc, char const* argv[])
+main (int argc, char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);