summaryrefslogtreecommitdiff
path: root/v4l2-mfc-example/queue.c
diff options
context:
space:
mode:
Diffstat (limited to 'v4l2-mfc-example/queue.c')
-rw-r--r--v4l2-mfc-example/queue.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/v4l2-mfc-example/queue.c b/v4l2-mfc-example/queue.c
index 62b7dfd..f1fce13 100644
--- a/v4l2-mfc-example/queue.c
+++ b/v4l2-mfc-example/queue.c
@@ -72,6 +72,15 @@ int queue_remove(struct queue *q)
return x;
}
+int queue_empty(struct queue *q)
+{
+ int x;
+ pthread_mutex_lock(&q->mutex);
+ x = (q->n == 0);
+ pthread_mutex_unlock(&q->mutex);
+ return x;
+}
+
void queue_free(struct queue *q)
{
free(q->q);