diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.co.uk> | 2014-05-05 12:06:44 -0400 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2014-05-08 15:56:37 -0400 |
commit | 7aed4a98061478aa2a75b8ab5630ac693ef3ce80 (patch) | |
tree | 3f88ef6e09e5ea01265d9ad3693cafd4cf5cc772 | |
parent | 972cf80957ebbc724d843f18f2f52e7756314600 (diff) | |
download | gstreamer-plugins-good-7aed4a98061478aa2a75b8ab5630ac693ef3ce80.tar.gz |
v4l2allocator: Add a method to read number of allocated group
-rw-r--r-- | sys/v4l2/gstv4l2allocator.c | 14 | ||||
-rw-r--r-- | sys/v4l2/gstv4l2allocator.h | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/sys/v4l2/gstv4l2allocator.c b/sys/v4l2/gstv4l2allocator.c index 2057b17dd..6f1487166 100644 --- a/sys/v4l2/gstv4l2allocator.c +++ b/sys/v4l2/gstv4l2allocator.c @@ -1361,3 +1361,17 @@ gst_v4l2_allocator_reset_group (GstV4l2Allocator * allocator, break; } } + +gsize +gst_v4l2_allocator_num_allocated (GstV4l2Allocator * allocator) +{ + gsize num_allocated; + + GST_OBJECT_LOCK (allocator); + + num_allocated = allocator->count; + + GST_OBJECT_UNLOCK (allocator); + + return num_allocated; +} diff --git a/sys/v4l2/gstv4l2allocator.h b/sys/v4l2/gstv4l2allocator.h index 53ac7af2a..54cf1cbc8 100644 --- a/sys/v4l2/gstv4l2allocator.h +++ b/sys/v4l2/gstv4l2allocator.h @@ -149,6 +149,8 @@ GstV4l2MemoryGroup* gst_v4l2_allocator_dqbuf (GstV4l2Allocator * alloc void gst_v4l2_allocator_reset_group (GstV4l2Allocator * allocator, GstV4l2MemoryGroup * group); +gsize gst_v4l2_allocator_num_allocated (GstV4l2Allocator * allocator); + G_END_DECLS #endif /* __GST_V4L2_ALLOCATOR_H__ */ |