idsueyesrc: fix config-file path handling on Linux
Couldn't load config-file. Also added additional debug info and changed filepath conversion to UCS4. Fixes #31
This commit is contained in:
parent
5ad3820ef4
commit
5a4b2ce38c
@ -447,7 +447,7 @@ gst_idsueyesrc_start (GstBaseSrc * bsrc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (strlen (src->config_file)) {
|
if (strlen (src->config_file)) {
|
||||||
gunichar2 *filepath;
|
gunichar *filepath;
|
||||||
if (!g_file_test (src->config_file, G_FILE_TEST_EXISTS)) {
|
if (!g_file_test (src->config_file, G_FILE_TEST_EXISTS)) {
|
||||||
GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND,
|
GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND,
|
||||||
("Camera file does not exist: %s", src->config_file), (NULL));
|
("Camera file does not exist: %s", src->config_file), (NULL));
|
||||||
@ -455,11 +455,29 @@ gst_idsueyesrc_start (GstBaseSrc * bsrc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* function requires unicode (wide character) */
|
/* function requires unicode (wide character) */
|
||||||
filepath = g_utf8_to_utf16 (src->config_file, -1, NULL, NULL, NULL);
|
filepath = g_utf8_to_ucs4 (src->config_file, -1, NULL, NULL, NULL);
|
||||||
ret =
|
ret =
|
||||||
is_ParameterSet (src->hCam, IS_PARAMETERSET_CMD_LOAD_FILE, filepath, 0);
|
is_ParameterSet (src->hCam, IS_PARAMETERSET_CMD_LOAD_FILE, filepath, 0);
|
||||||
g_free (filepath);
|
g_free (filepath);
|
||||||
if (ret != IS_SUCCESS) {
|
if (ret != IS_SUCCESS) {
|
||||||
|
switch (ret) {
|
||||||
|
case IS_INCOMPATIBLE_SETTING:
|
||||||
|
GST_ELEMENT_WARNING (src, RESOURCE, OPEN_READ,
|
||||||
|
("IS_INCOMPATIBLE_SETTING: incompatible setting"), (NULL));
|
||||||
|
break;
|
||||||
|
case IS_INVALID_CAMERA_TYPE:
|
||||||
|
GST_ELEMENT_WARNING (src, RESOURCE, OPEN_READ,
|
||||||
|
("IS_INVALID_CAMERA_TYPE: invalid camera type"), (NULL));
|
||||||
|
break;
|
||||||
|
case IS_NO_SUCCESS:
|
||||||
|
GST_ELEMENT_WARNING (src, RESOURCE, OPEN_READ,
|
||||||
|
("IS_NO_SUCCESS: general error"), (NULL));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
GST_ELEMENT_WARNING (src, RESOURCE, OPEN_READ,
|
||||||
|
("UNKNOWN ERROR: return value=%d", ret), (NULL));
|
||||||
|
break;
|
||||||
|
}
|
||||||
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
|
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
|
||||||
("Failed to load parameter file: %s", src->config_file), (NULL));
|
("Failed to load parameter file: %s", src->config_file), (NULL));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user