rpicamsrc: RaspiCapture: use mmal_queue_timedwait() for buffer queueing

If an external camera was disconnected, there were no feedback in an
application. It seems reasonable to wait on mmal_queue no longer than
100ms. If it's stuck we just return a FLOW_ERROR and let the application
decide what to do later.
This commit is contained in:
Georgii Staroselskii 2017-11-08 09:14:35 +00:00 committed by Tim-Philipp Müller
parent 149fdee7fb
commit b45e239128

View file

@ -938,8 +938,12 @@ raspi_capture_fill_buffer(RASPIVID_STATE *state, GstBuffer **bufp,
GstClockTime gst_pts = GST_CLOCK_TIME_NONE;
/* FIXME: Use our own interruptible cond wait: */
buffer = mmal_queue_wait(state->encoded_buffer_q);
buffer = mmal_queue_timedwait(state->encoded_buffer_q, 100);
if (G_UNLIKELY(buffer == NULL)) {
return GST_FLOW_ERROR;
}
if (G_LIKELY (config->useSTC && clock)) {
MMAL_PARAMETER_INT64_T param;