summaryrefslogtreecommitdiffstats
path: root/src/cameras/uca-pylon-camera.c
diff options
context:
space:
mode:
authorVolker Kaiser <volker.kaiser@softwareschneiderei.de>2012-05-08 14:49:11 +0200
committerVolker Kaiser <volker.kaiser@softwareschneiderei.de>2012-07-26 15:36:43 +0200
commit38d6d18e83b0c33a18ef6f68c22c161d39abc449 (patch)
tree4c21f9374a8ce66834b8869a051315d8b6b304e1 /src/cameras/uca-pylon-camera.c
parentb5c90a21f289bb67c4806a8563d96fc674bba583 (diff)
downloaduca-38d6d18e83b0c33a18ef6f68c22c161d39abc449.tar.gz
uca-38d6d18e83b0c33a18ef6f68c22c161d39abc449.tar.bz2
uca-38d6d18e83b0c33a18ef6f68c22c161d39abc449.tar.xz
uca-38d6d18e83b0c33a18ef6f68c22c161d39abc449.zip
basler camera works
Diffstat (limited to 'src/cameras/uca-pylon-camera.c')
-rw-r--r--src/cameras/uca-pylon-camera.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/cameras/uca-pylon-camera.c b/src/cameras/uca-pylon-camera.c
index 82380bc..1bc8ee2 100644
--- a/src/cameras/uca-pylon-camera.c
+++ b/src/cameras/uca-pylon-camera.c
@@ -77,8 +77,6 @@ static GParamSpec *pylon_properties[N_PROPERTIES] = { NULL, };
struct _UcaPylonCameraPrivate {
- guint frame_width;
- guint frame_height;
guint bit_depth;
gsize num_bytes;
@@ -99,6 +97,11 @@ UcaPylonCamera *uca_pylon_camera_new(GError **error)
return NULL;
}
+ pylon_camera_get_sensor_size(&priv->width, &priv->height, error);
+ if (*error) {
+ g_print("Error when calling pylon_camera_get_sensor_size %s\n", (*error)->message);
+ return NULL;
+ }
return camera;
}
@@ -115,7 +118,6 @@ static void uca_pylon_camera_start_recording(UcaCamera *camera, GError **error)
static void uca_pylon_camera_stop_recording(UcaCamera *camera, GError **error)
{
g_return_if_fail(UCA_IS_PYLON_CAMERA(camera));
- UcaPylonCameraPrivate *priv = UCA_PYLON_CAMERA_GET_PRIVATE(camera);
pylon_camera_stop_acquision(error);
}
@@ -125,14 +127,14 @@ static void uca_pylon_camera_grab(UcaCamera *camera, gpointer *data, GError **er
UcaPylonCameraPrivate *priv = UCA_PYLON_CAMERA_GET_PRIVATE(camera);
if (*data == NULL) {
- *data = g_malloc0(priv->frame_width * priv->frame_height * priv->num_bytes);
+ *data = g_malloc0(priv->width * priv->height * priv->num_bytes);
}
pylon_camera_grab(data, error);
}
static void uca_pylon_camera_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
{
- UcaPylonCameraPrivate *priv = UCA_PYLON_CAMERA_GET_PRIVATE(object);
+ /*UcaPylonCameraPrivate *priv = UCA_PYLON_CAMERA_GET_PRIVATE(object);*/
switch (property_id) {
default:
@@ -143,7 +145,7 @@ static void uca_pylon_camera_set_property(GObject *object, guint property_id, co
static void uca_pylon_camera_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
{
- printf("pylon_get_property\n");
+ fprintf(stderr, "pylon_get_property\n");
UcaPylonCameraPrivate *priv = UCA_PYLON_CAMERA_GET_PRIVATE(object);
GError* error = NULL;
@@ -152,13 +154,13 @@ static void uca_pylon_camera_get_property(GObject *object, guint property_id, GV
case PROP_SENSOR_WIDTH:
pylon_camera_get_sensor_size(&priv->width, &priv->height, &error);
g_value_set_uint(value, priv->width);
- printf("pylon_get_property sensor width %d\n", priv->width);
+ g_print("pylon_get_property sensor width %d\n", priv->width);
break;
case PROP_SENSOR_HEIGHT:
pylon_camera_get_sensor_size(&priv->width, &priv->height, &error);
g_value_set_uint(value, priv->height);
- printf("pylon_get_property sensor height %d\n", priv->height);
+ g_print("pylon_get_property sensor height %d\n", priv->height);
break;
/*
@@ -170,7 +172,7 @@ static void uca_pylon_camera_get_property(GObject *object, guint property_id, GV
case PROP_SENSOR_BITDEPTH:
pylon_camera_get_bit_depth(&priv->bit_depth, &error);
g_value_set_uint(value, priv->bit_depth);
- printf("pylon_get_property depth %d\n", priv->bit_depth);
+ g_print("pylon_get_property depth %d\n", priv->bit_depth);
break;
/*