summaryrefslogtreecommitdiffstats
path: root/src/cameras/dummy.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2011-03-23 12:35:19 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2011-03-23 12:35:19 +0100
commitff7f2398283f5059e3b8e0149e0582ee7d30ad21 (patch)
tree598637736b0c8164dabad2c163b01816279f0051 /src/cameras/dummy.c
parent6c822e1dedff95eeb64733e8ae0f7554b01bcd17 (diff)
downloaduca-ff7f2398283f5059e3b8e0149e0582ee7d30ad21.tar.gz
uca-ff7f2398283f5059e3b8e0149e0582ee7d30ad21.tar.bz2
uca-ff7f2398283f5059e3b8e0149e0582ee7d30ad21.tar.xz
uca-ff7f2398283f5059e3b8e0149e0582ee7d30ad21.zip
Use more flexible error codes
Diffstat (limited to 'src/cameras/dummy.c')
-rw-r--r--src/cameras/dummy.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/cameras/dummy.c b/src/cameras/dummy.c
index 0d6c9d1..5bb609a 100644
--- a/src/cameras/dummy.c
+++ b/src/cameras/dummy.c
@@ -159,8 +159,9 @@ static void *uca_dummy_grab_thread(void *arg)
*/
static uint32_t uca_dummy_set_property(struct uca_camera *cam, enum uca_property_ids property, void *data)
{
+ uint32_t err = UCA_ERR_CAMERA | UCA_ERR_PROP;
if (cam->state == UCA_CAM_RECORDING)
- return UCA_ERR_PROP_CAMERA_RECORDING;
+ return err | UCA_ERR_IS_RECORDING;
switch (property) {
case UCA_PROP_WIDTH:
@@ -176,7 +177,7 @@ static uint32_t uca_dummy_set_property(struct uca_camera *cam, enum uca_property
break;
default:
- return UCA_ERR_PROP_INVALID;
+ return err | UCA_ERR_INVALID;
}
return UCA_NO_ERROR;
@@ -218,7 +219,7 @@ static uint32_t uca_dummy_get_property(struct uca_camera *cam, enum uca_property
break;
default:
- return UCA_ERR_PROP_INVALID;
+ return UCA_ERR_CAMERA | UCA_ERR_PROP | UCA_ERR_INVALID;
}
return UCA_NO_ERROR;
}
@@ -258,7 +259,7 @@ uint32_t uca_dummy_register_callback(struct uca_camera *cam, uca_cam_grab_callba
cam->callback_user = user;
}
else
- return UCA_ERR_GRABBER_CALLBACK_ALREADY_REGISTERED;
+ return UCA_ERR_CAMERA | UCA_ERR_CALLBACK | UCA_ERR_ALREADY_REGISTERED;
return UCA_NO_ERROR;
}
@@ -266,7 +267,7 @@ uint32_t uca_dummy_register_callback(struct uca_camera *cam, uca_cam_grab_callba
uint32_t uca_dummy_grab(struct uca_camera *cam, char *buffer, void *meta_data)
{
if (cam->callback != NULL)
- return UCA_ERR_GRABBER_CALLBACK_ALREADY_REGISTERED;
+ return UCA_ERR_CAMERA | UCA_ERR_CALLBACK | UCA_ERR_ALREADY_REGISTERED;
uca_dummy_memcpy(cam, buffer);
cam->current_frame++;