X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=sys%2Fv4l2%2Fgstv4l2allocator.h;h=25ec2d52586b3f2488ad56f8bbb926a79eb2b1a9;hb=1e4c9a1fb85d617292c41b1b12c2a8eca0fc26fe;hp=982681585588960557d224344ded347207e15d75;hpb=6c75e6c5e0d5ae128b52437c790c9130acf89a7b;p=platform%2Fupstream%2Fgst-plugins-good.git diff --git a/sys/v4l2/gstv4l2allocator.h b/sys/v4l2/gstv4l2allocator.h index 9826815..25ec2d5 100644 --- a/sys/v4l2/gstv4l2allocator.h +++ b/sys/v4l2/gstv4l2allocator.h @@ -26,6 +26,10 @@ #include "ext/videodev2.h" #include #include +#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT +#include +#include +#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */ G_BEGIN_DECLS @@ -41,6 +45,10 @@ G_BEGIN_DECLS (GST_OBJECT_FLAG_IS_SET (obj, GST_V4L2_ALLOCATOR_FLAG_ ## type ## _REQBUFS)) #define GST_V4L2_ALLOCATOR_CAN_ALLOCATE(obj,type) \ (GST_OBJECT_FLAG_IS_SET (obj, GST_V4L2_ALLOCATOR_FLAG_ ## type ## _CREATE_BUFS)) +#define GST_V4L2_ALLOCATOR_CAN_ORPHAN_BUFS(obj) \ + (GST_OBJECT_FLAG_IS_SET (obj, GST_V4L2_ALLOCATOR_FLAG_SUPPORTS_ORPHANED_BUFS)) +#define GST_V4L2_ALLOCATOR_IS_ORPHANED(obj) \ + (GST_OBJECT_FLAG_IS_SET (obj, GST_V4L2_ALLOCATOR_FLAG_ORPHANED)) #define GST_V4L2_MEMORY_QUARK gst_v4l2_memory_quark () @@ -50,7 +58,6 @@ typedef struct _GstV4l2MemoryGroup GstV4l2MemoryGroup; typedef struct _GstV4l2Memory GstV4l2Memory; typedef enum _GstV4l2Capabilities GstV4l2Capabilities; typedef enum _GstV4l2Return GstV4l2Return; -typedef struct _GstV4l2Object GstV4l2Object; enum _GstV4l2AllocatorFlags { @@ -60,6 +67,8 @@ enum _GstV4l2AllocatorFlags GST_V4L2_ALLOCATOR_FLAG_USERPTR_CREATE_BUFS = (GST_ALLOCATOR_FLAG_LAST << 3), GST_V4L2_ALLOCATOR_FLAG_DMABUF_REQBUFS = (GST_ALLOCATOR_FLAG_LAST << 4), GST_V4L2_ALLOCATOR_FLAG_DMABUF_CREATE_BUFS = (GST_ALLOCATOR_FLAG_LAST << 5), + GST_V4L2_ALLOCATOR_FLAG_SUPPORTS_ORPHANED_BUFS = (GST_ALLOCATOR_FLAG_LAST << 6), + GST_V4L2_ALLOCATOR_FLAG_ORPHANED = (GST_ALLOCATOR_FLAG_LAST << 7), }; enum _GstV4l2Return @@ -85,6 +94,9 @@ struct _GstV4l2MemoryGroup gint mems_allocated; struct v4l2_buffer buffer; struct v4l2_plane planes[VIDEO_MAX_PLANES]; +#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT + tbm_surface_h surface; +#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */ }; struct _GstV4l2Allocator @@ -99,7 +111,11 @@ struct _GstV4l2Allocator GstV4l2MemoryGroup * groups[VIDEO_MAX_FRAME]; GstAtomicQueue *free_queue; GstAtomicQueue *pending_queue; - +#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT + tbm_bufmgr bufmgr; + tbm_surface_info_s s_info; + gint live_buffer_count; +#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */ }; struct _GstV4l2AllocatorClass { @@ -123,6 +139,8 @@ guint gst_v4l2_allocator_start (GstV4l2Allocator * alloc GstV4l2Return gst_v4l2_allocator_stop (GstV4l2Allocator * allocator); +gboolean gst_v4l2_allocator_orphan (GstV4l2Allocator * allocator); + GstV4l2MemoryGroup* gst_v4l2_allocator_alloc_mmap (GstV4l2Allocator * allocator); GstV4l2MemoryGroup* gst_v4l2_allocator_alloc_dmabuf (GstV4l2Allocator * allocator,