From e088f4158a62f8b8db24835a7476caeadaacd069 Mon Sep 17 00:00:00 2001 From: Carlos Rafael Giani Date: Thu, 5 Oct 2017 22:11:07 +0200 Subject: [PATCH] v4l2src: Add GstImxV4l2Meta init function This avoids the g_assert() that was caused by the missing init function Signed-off-by: Carlos Rafael Giani --- src/v4l2src/v4l2_buffer_pool.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/v4l2src/v4l2_buffer_pool.c b/src/v4l2src/v4l2_buffer_pool.c index 3024089e..67242433 100644 --- a/src/v4l2src/v4l2_buffer_pool.c +++ b/src/v4l2src/v4l2_buffer_pool.c @@ -42,6 +42,13 @@ GType gst_imx_v4l2_meta_api_get_type(void) return type; } +static gboolean gst_imx_v4l2_meta_init(GstMeta *meta, G_GNUC_UNUSED gpointer params, G_GNUC_UNUSED GstBuffer *buffer) +{ + GstImxV4l2Meta *v4l2meta = (GstImxV4l2Meta *)meta; + v4l2meta->mem = NULL; + return TRUE; +} + const GstMetaInfo *gst_imx_v4l2_meta_get_info(void) { static const GstMetaInfo *meta_info = NULL; @@ -52,7 +59,7 @@ const GstMetaInfo *gst_imx_v4l2_meta_get_info(void) gst_imx_v4l2_meta_api_get_type(), "GstImxV4l2Meta", sizeof(GstImxV4l2Meta), - (GstMetaInitFunction)NULL, + (GstMetaInitFunction)gst_imx_v4l2_meta_init, (GstMetaFreeFunction)NULL, (GstMetaTransformFunction)NULL); g_once_init_leave(&meta_info, meta);