diff options
| author | Matthias Vogelgesang <matthias.vogelgesang@gmail.com> | 2012-04-20 11:00:32 +0200 | 
|---|---|---|
| committer | Matthias Vogelgesang <matthias.vogelgesang@gmail.com> | 2012-04-20 11:00:32 +0200 | 
| commit | 025dfc0c41367d5b29381e6ab26d3d58fe75d931 (patch) | |
| tree | 818390e2b089a63606f61f953df283690d185280 /src | |
| parent | 1b019c9b661c4dc23fbba4af7659745570ec7473 (diff) | |
| download | libuca-025dfc0c41367d5b29381e6ab26d3d58fe75d931.tar.gz libuca-025dfc0c41367d5b29381e6ab26d3d58fe75d931.tar.bz2 libuca-025dfc0c41367d5b29381e6ab26d3d58fe75d931.tar.xz libuca-025dfc0c41367d5b29381e6ab26d3d58fe75d931.zip  | |
Leave properties for later
Diffstat (limited to 'src')
| -rw-r--r-- | src/cameras/uca-pf-camera.c | 44 | 
1 files changed, 14 insertions, 30 deletions
diff --git a/src/cameras/uca-pf-camera.c b/src/cameras/uca-pf-camera.c index 2724aa5..3bbd406 100644 --- a/src/cameras/uca-pf-camera.c +++ b/src/cameras/uca-pf-camera.c @@ -104,36 +104,20 @@ UcaPfCamera *uca_pf_camera_new(GError **error)      static const int camera_link_type = FG_CL_8BIT_FULL_8;      static const int camera_format = FG_GRAY; -    /* gint num_ports; */ -    /* if (pfPortInit(&num_ports) < 0) { */ -    /*     g_set_error(error, UCA_PF_CAMERA_ERROR, UCA_PF_CAMERA_ERROR_INIT, */ -    /*             "Could not initialize ports"); */  -    /*     return NULL; */ -    /* } */ - -    /* g_print("We have %i ports\n", num_ports); */ -    /* gchar vendor[256]; */ -    /* gint vendor_size; */ -    /* gchar name[256]; */ -    /* gint name_size; */ -    /* int version, type; */ -    /* for (guint i = 0; i < num_ports; i++) { */ -    /*     int result = pfPortInfo(i, vendor, &vendor_size, name, &name_size, &version, &type); */ -    /*     if (result < 0) { */ -    /*         g_print("[%i] could not retrieve information\n", i); */  -    /*     } */ -    /*     else { */ -    /*         int baudrate; */ -    /*         pfGetBaudRate(i, &baudrate); */ -    /*         g_print("[%i] %s %s %i %i at %i bps\n", i, vendor, name, version, type, baudrate); */ -    /*     } */ -    /* } */ - -    /* if (pfDeviceOpen(0) != 0) { */ -    /*     g_set_error(error, UCA_PF_CAMERA_ERROR, UCA_PF_CAMERA_ERROR_INIT, */ -    /*             "Could not open device"); */  -    /*     return NULL; */ -    /* } */ +    /* +    gint num_ports; +    if (pfPortInit(&num_ports) < 0) { +        g_set_error(error, UCA_PF_CAMERA_ERROR, UCA_PF_CAMERA_ERROR_INIT, +                "Could not initialize ports");  +        return NULL; +    } + +    if (pfDeviceOpen(0) < 0) { +        g_set_error(error, UCA_PF_CAMERA_ERROR, UCA_PF_CAMERA_ERROR_INIT, +                "Could not open device");  +        return NULL; +    } +    */      UcaPfCamera *camera = g_object_new(UCA_TYPE_PF_CAMERA, NULL);      UcaPfCameraPrivate *priv = UCA_PF_CAMERA_GET_PRIVATE(camera);  | 
