v4l2allocator: Add a method to read number of allocated group

This commit is contained in:
Nicolas Dufresne 2014-05-05 12:06:44 -04:00 committed by Nicolas Dufresne
parent 972cf80957
commit 7aed4a9806
2 changed files with 16 additions and 0 deletions

View file

@ -1361,3 +1361,17 @@ gst_v4l2_allocator_reset_group (GstV4l2Allocator * allocator,
break; 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;
}

View file

@ -149,6 +149,8 @@ GstV4l2MemoryGroup* gst_v4l2_allocator_dqbuf (GstV4l2Allocator * alloc
void gst_v4l2_allocator_reset_group (GstV4l2Allocator * allocator, void gst_v4l2_allocator_reset_group (GstV4l2Allocator * allocator,
GstV4l2MemoryGroup * group); GstV4l2MemoryGroup * group);
gsize gst_v4l2_allocator_num_allocated (GstV4l2Allocator * allocator);
G_END_DECLS G_END_DECLS
#endif /* __GST_V4L2_ALLOCATOR_H__ */ #endif /* __GST_V4L2_ALLOCATOR_H__ */