rpicamsrc: Improve timeout error
Propagate timeout errors so they're not reported generically
This commit is contained in:
parent
41f41f1fdd
commit
c907deb15f
@ -942,7 +942,7 @@ raspi_capture_fill_buffer(RASPIVID_STATE *state, GstBuffer **bufp,
|
|||||||
buffer = mmal_queue_timedwait(state->encoded_buffer_q, 500);
|
buffer = mmal_queue_timedwait(state->encoded_buffer_q, 500);
|
||||||
|
|
||||||
if (G_UNLIKELY(buffer == NULL)) {
|
if (G_UNLIKELY(buffer == NULL)) {
|
||||||
return GST_FLOW_ERROR;
|
return GST_FLOW_ERROR_TIMEOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (G_LIKELY (config->useSTC && clock)) {
|
if (G_LIKELY (config->useSTC && clock)) {
|
||||||
|
@ -66,6 +66,8 @@ GST_DEBUG_CATEGORY_EXTERN (gst_rpi_cam_src_debug);
|
|||||||
#undef vcos_log_warn
|
#undef vcos_log_warn
|
||||||
#define vcos_log_warn GST_WARNING
|
#define vcos_log_warn GST_WARNING
|
||||||
|
|
||||||
|
#define GST_FLOW_ERROR_TIMEOUT GST_FLOW_CUSTOM_ERROR
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
@ -1439,6 +1439,13 @@ gst_rpi_cam_src_create (GstPushSrc * parent, GstBuffer ** buf)
|
|||||||
GST_BUFFER_DURATION (*buf) = src->duration;
|
GST_BUFFER_DURATION (*buf) = src->duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ret == GST_FLOW_ERROR_TIMEOUT) {
|
||||||
|
GST_ELEMENT_ERROR (src, STREAM, FAILED,
|
||||||
|
("Camera capture timed out."),
|
||||||
|
("Waiting for a buffer from the camera took too long."));
|
||||||
|
ret = GST_FLOW_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
if (clock)
|
if (clock)
|
||||||
gst_object_unref (clock);
|
gst_object_unref (clock);
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user