gst_v4l2_tizen_buffer_new (GstBuffer *v4l2_buffer, int index, GstV4l2BufferPool *v4l2_pool)
{
GstV4l2TizenBuffer *tizen_buffer = NULL;
+ GstVideoInfo *info = NULL;
+ GstVideoMeta *videometa = NULL;
GstMemory *memory = NULL;
+ if (!v4l2_pool || !v4l2_pool->obj) {
+ GST_ERROR_OBJECT (v4l2_pool, "NULL V4L2 pool[%p] or obj", v4l2_pool);
+ return NULL;
+ }
+
+ info = &v4l2_pool->obj->info;
+
tizen_buffer = g_new0 (GstV4l2TizenBuffer, 1);
tizen_buffer->index = index;
tizen_buffer->v4l2_buffer = v4l2_buffer;
tizen_buffer->v4l2_pool = gst_object_ref (v4l2_pool);
memory = gst_tizen_allocator_alloc_surface (v4l2_pool->tallocator,
- &v4l2_pool->obj->info, v4l2_pool->vallocator->groups[index]->surface, (gpointer)tizen_buffer,
+ info, v4l2_pool->vallocator->groups[index]->surface, (gpointer)tizen_buffer,
(GDestroyNotify)gst_v4l2_tizen_buffer_finalize);
gst_buffer_append_memory (tizen_buffer->gst_buffer, memory);
gst_buffer_set_size (tizen_buffer->gst_buffer, v4l2_pool->vallocator->s_info.size);
+ videometa = gst_buffer_add_video_meta_full (tizen_buffer->gst_buffer, GST_VIDEO_FRAME_FLAG_NONE,
+ GST_VIDEO_INFO_FORMAT (info), GST_VIDEO_INFO_WIDTH (info),
+ GST_VIDEO_INFO_HEIGHT (info), GST_VIDEO_INFO_N_PLANES (info),
+ info->offset, info->stride);
+ if (videometa) {
+ videometa->map = gst_tizen_video_meta_map;
+ videometa->unmap = gst_tizen_video_meta_unmap;
+ } else {
+ GST_WARNING_OBJECT (v4l2_pool, "videometa failed");
+ }
+
g_mutex_lock (&v4l2_pool->buffer_lock);
v4l2_pool->live_buffer_count++;