diff options
author | Jan Schmidt <thaytan@noraisin.net> | 2018-07-16 12:30:26 +0300 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2020-07-10 18:46:31 +0300 |
commit | c907deb15fda4fe07eadc93f4a83611f4581e2f2 (patch) | |
tree | 750108549e663a8f534576409d0fd1d4d163e411 /sys | |
parent | 41f41f1fdd368a5ee2fe8c4ed4f2b4a45bfa6357 (diff) |
rpicamsrc: Improve timeout error
Propagate timeout errors so they're not reported
generically
Diffstat (limited to 'sys')
-rw-r--r-- | sys/rpicamsrc/RaspiCapture.c | 2 | ||||
-rw-r--r-- | sys/rpicamsrc/RaspiCapture.h | 2 | ||||
-rw-r--r-- | sys/rpicamsrc/gstrpicamsrc.c | 7 |
3 files changed, 10 insertions, 1 deletions
diff --git a/sys/rpicamsrc/RaspiCapture.c b/sys/rpicamsrc/RaspiCapture.c index a7d72a0e1..96c4692b0 100644 --- a/sys/rpicamsrc/RaspiCapture.c +++ b/sys/rpicamsrc/RaspiCapture.c @@ -942,7 +942,7 @@ raspi_capture_fill_buffer(RASPIVID_STATE *state, GstBuffer **bufp, buffer = mmal_queue_timedwait(state->encoded_buffer_q, 500); if (G_UNLIKELY(buffer == NULL)) { - return GST_FLOW_ERROR; + return GST_FLOW_ERROR_TIMEOUT; } if (G_LIKELY (config->useSTC && clock)) { diff --git a/sys/rpicamsrc/RaspiCapture.h b/sys/rpicamsrc/RaspiCapture.h index 571d3b7fc..71e79b26e 100644 --- a/sys/rpicamsrc/RaspiCapture.h +++ b/sys/rpicamsrc/RaspiCapture.h @@ -66,6 +66,8 @@ GST_DEBUG_CATEGORY_EXTERN (gst_rpi_cam_src_debug); #undef vcos_log_warn #define vcos_log_warn GST_WARNING +#define GST_FLOW_ERROR_TIMEOUT GST_FLOW_CUSTOM_ERROR + G_BEGIN_DECLS typedef enum diff --git a/sys/rpicamsrc/gstrpicamsrc.c b/sys/rpicamsrc/gstrpicamsrc.c index da8446023..c2de7619f 100644 --- a/sys/rpicamsrc/gstrpicamsrc.c +++ b/sys/rpicamsrc/gstrpicamsrc.c @@ -1439,6 +1439,13 @@ gst_rpi_cam_src_create (GstPushSrc * parent, GstBuffer ** buf) 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) gst_object_unref (clock); return ret; |