meta: Initialize all remaining metas in their init function
authorSebastian Dröge <sebastian@centricular.com>
Wed, 13 Apr 2016 07:25:32 +0000 (10:25 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 13 Apr 2016 07:25:32 +0000 (10:25 +0300)
https://bugzilla.gnome.org/show_bug.cgi?id=764902

ext/directfb/dfbvideosink.c
sys/pvr2d/gstpvrbufferpool.c

index 4899147..a6f433b 100644 (file)
@@ -168,6 +168,19 @@ gst_meta_dfbsurface_api_get_type (void)
   return type;
 }
 
+static gboolean
+gst_meta_dfbsurface_init (GstMetaDfbSurface * meta, gpointer params,
+    GstBuffer * buf)
+{
+  meta->surface = NULL;
+  meta->width = meta->height = 0;
+  meta->locked = FALSE;
+  meta->pixel_format = 0;
+  meta->dfbvideosink = NULL;
+
+  return TRUE;
+}
+
 /* our metadata */
 const GstMetaInfo *
 gst_meta_dfbsurface_get_info (void)
@@ -178,7 +191,8 @@ gst_meta_dfbsurface_get_info (void)
     const GstMetaInfo *meta =
         gst_meta_register (gst_meta_dfbsurface_api_get_type (),
         "GstMetaDfbSurface", sizeof (GstMetaDfbSurface),
-        (GstMetaInitFunction) NULL, (GstMetaFreeFunction) NULL,
+        (GstMetaInitFunction) gst_meta_dfbsurface_init,
+        (GstMetaFreeFunction) NULL,
         (GstMetaTransformFunction) NULL);
     g_once_init_leave (&meta_info, meta);
   }
index 81106dc..891e95c 100644 (file)
 GST_DEBUG_CATEGORY_EXTERN (gst_debug_pvrvideosink);
 #define GST_CAT_DEFAULT gst_debug_pvrvideosink
 
+static gboolean
+gst_pvr_meta_init (GstPVRMeta * meta, gpointer params, GstBuffer * buffer)
+{
+  meta->src_mem = NULL;
+  meta->sink = NULL;
+
+  return TRUE;
+}
+
 static void
 gst_pvr_meta_free (GstPVRMeta * meta, GstBuffer * buffer)
 {
@@ -74,7 +83,7 @@ gst_pvr_meta_get_info (void)
   if (g_once_init_enter (&pvr_meta_info)) {
     const GstMetaInfo *meta = gst_meta_register ("GstPVRMeta", "GstPVRMeta",
         sizeof (GstPVRMeta),
-        (GstMetaInitFunction) NULL,
+        (GstMetaInitFunction) gst_pvr_meta_init,
         (GstMetaFreeFunction) gst_pvr_meta_free,
         (GstMetaCopyFunction) NULL, (GstMetaTransformFunction) NULL);
     g_once_init_leave (&pvr_meta_info, meta);