From aa6ebf67fa2601a5fc087423be3ad40d742e1cd3 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Wed, 23 Feb 2011 10:26:25 +0100 Subject: Set camera name (so we have at least some kind of feedback which camera is used) --- src/cameras/uca_pco.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/cameras') diff --git a/src/cameras/uca_pco.c b/src/cameras/uca_pco.c index 413d389..7de8955 100644 --- a/src/cameras/uca_pco.c +++ b/src/cameras/uca_pco.c @@ -1,5 +1,6 @@ #include +#include #include #include #include @@ -56,6 +57,7 @@ static uint32_t uca_pco_destroy(struct uca_t *uca) Fg_FreeGrabber(GET_FG(uca)); pco_destroy(GET_PCO(uca)); free(uca->user); + free(uca->camera_name); } uint32_t uca_pco_init(struct uca_t *uca) @@ -70,7 +72,7 @@ uint32_t uca_pco_init(struct uca_t *uca) return UCA_ERR_INIT_NOT_FOUND; } - pco_cam->fg = Fg_Init("libFullAreaGray8.so", 0); + Fg_Struct *fg = pco_cam->fg = Fg_Init("libFullAreaGray8.so", 0); pco_scan_and_set_baud_rate(pco); @@ -85,6 +87,10 @@ uint32_t uca_pco_init(struct uca_t *uca) /* ... and some properties */ pco_get_actual_size(pco, &uca->image_width, &uca->image_height); + SC2_Camera_Name_Response name; + if (pco_read_property(pco, GET_CAMERA_NAME, &name, sizeof(name)) == PCO_NOERROR) + uca->camera_name = strdup(name.szName); + /* Prepare camera for recording */ pco_set_rec_state(pco, 0); pco_set_timestamp_mode(pco, 2); -- cgit v1.2.3