pleorasrc: more useful error messages
This commit is contained in:
parent
a7f4657547
commit
e1d0574ecf
@ -461,6 +461,11 @@ gst_pleorasrc_setup_device (GstPleoraSrc * src)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (lSystem.GetDeviceCount () < 1) {
|
||||||
|
GST_WARNING_OBJECT (src, "No Pleora-compatible devices found");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
device_info = lSystem.GetDeviceInfo (src->device_index);
|
device_info = lSystem.GetDeviceInfo (src->device_index);
|
||||||
|
|
||||||
if (device_info == NULL) {
|
if (device_info == NULL) {
|
||||||
@ -546,7 +551,8 @@ gst_pleorasrc_setup_device (GstPleoraSrc * src)
|
|||||||
src->device = PvDevice::CreateAndConnect (device_info, &pvRes);
|
src->device = PvDevice::CreateAndConnect (device_info, &pvRes);
|
||||||
if (src->device == NULL) {
|
if (src->device == NULL) {
|
||||||
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
|
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
|
||||||
("Unable to create and connect to device"), (NULL));
|
("Unable to create and connect to device: %s",
|
||||||
|
pvRes.GetDescription ().GetAscii ()), (NULL));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
GST_DEBUG_OBJECT (src, "Connected to device");
|
GST_DEBUG_OBJECT (src, "Connected to device");
|
||||||
@ -573,7 +579,8 @@ gst_pleorasrc_setup_device (GstPleoraSrc * src)
|
|||||||
|
|
||||||
if (src->stream == NULL) {
|
if (src->stream == NULL) {
|
||||||
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
|
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
|
||||||
("Unable to create and connect to device"), (NULL));
|
("Unable to create and open stream: %s",
|
||||||
|
pvRes.GetDescription ().GetAscii ()), (NULL));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
GST_DEBUG_OBJECT (src, "Stream created for device");
|
GST_DEBUG_OBJECT (src, "Stream created for device");
|
||||||
@ -829,8 +836,8 @@ gst_pleorasrc_start (GstBaseSrc * bsrc)
|
|||||||
GST_DEBUG_OBJECT (src, "Starting pipeline");
|
GST_DEBUG_OBJECT (src, "Starting pipeline");
|
||||||
pvRes = src->pipeline->Start ();
|
pvRes = src->pipeline->Start ();
|
||||||
if (!pvRes.IsOK ()) {
|
if (!pvRes.IsOK ()) {
|
||||||
GST_ELEMENT_ERROR (src, RESOURCE, FAILED, ("Failed to start pipeline"),
|
GST_ELEMENT_ERROR (src, RESOURCE, FAILED, ("Failed to start pipeline: %s",
|
||||||
(NULL));
|
pvRes.GetDescription ().GetAscii ()), (NULL));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -851,15 +858,16 @@ gst_pleorasrc_start (GstBaseSrc * bsrc)
|
|||||||
}
|
}
|
||||||
pvRes = src->device->StreamEnable ();
|
pvRes = src->device->StreamEnable ();
|
||||||
if (!pvRes.IsOK ()) {
|
if (!pvRes.IsOK ()) {
|
||||||
GST_ELEMENT_ERROR (src, RESOURCE, FAILED, ("Failed to enable stream"),
|
GST_ELEMENT_ERROR (src, RESOURCE, FAILED, ("Failed to enable stream: %s",
|
||||||
(NULL));
|
pvRes.GetDescription ().GetAscii ()), (NULL));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
pvRes = start_cmd->Execute ();
|
pvRes = start_cmd->Execute ();
|
||||||
if (!pvRes.IsOK ()) {
|
if (!pvRes.IsOK ()) {
|
||||||
GST_ELEMENT_ERROR (src, RESOURCE, FAILED, ("Failed to start acquisition"),
|
GST_ELEMENT_ERROR (src, RESOURCE, FAILED,
|
||||||
(NULL));
|
("Failed to start acquisition: %s",
|
||||||
|
pvRes.GetDescription ().GetAscii ()), (NULL));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user