void
my_vidmem_init (void)
{
  _my_allocator = g_object_new (my_vidmem_allocator_get_type (), NULL);

  gst_allocator_register ("MyVidmem", gst_object_ref (_my_allocator));
}
Beispiel #2
0
static void
gst_dmabuf_mem_init (void)
{
    GstAllocator *allocator =
        g_object_new (dmabuf_mem_allocator_get_type (), NULL);
    gst_allocator_register (ALLOCATOR_NAME, allocator);

    GST_DEBUG_CATEGORY_INIT (dmabuf_debug, "dmabuf", 0, "dmabuf memory");
}
void
my_memory_init (void)
{
  GstAllocator *allocator;

  allocator = g_object_new (my_memory_allocator_get_type (), NULL);

  gst_allocator_register ("MyMemory", allocator);
}
void
gst_wl_shm_allocator_register (void)
{
  GstAllocator *alloc;

  alloc = g_object_new (GST_TYPE_WL_SHM_ALLOCATOR, NULL);
  gst_object_ref_sink (alloc);
  gst_allocator_register (GST_ALLOCATOR_WL_SHM, alloc);
}
static gpointer
gst_egl_image_allocator_init_instance (gpointer data)
{
  GstAllocator *allocator =
      g_object_new (gst_egl_image_allocator_get_type (), NULL);

  GST_DEBUG_CATEGORY_INIT (GST_CAT_EGL_IMAGE_MEMORY, "eglimagememory", 0,
      "EGLImage Memory");

  gst_allocator_register (GST_EGL_IMAGE_MEMORY_TYPE,
      gst_object_ref (allocator));

  return allocator;
}
/**
 * gst_vulkan_memory_init_once:
 *
 * Initializes the Vulkan memory allocator. It is safe to call this function
 * multiple times.  This must be called before any other #GstVulkanMemory operation.
 */
void
gst_vulkan_memory_init_once (void)
{
  static volatile gsize _init = 0;

  if (g_once_init_enter (&_init)) {
    GST_DEBUG_CATEGORY_INIT (GST_CAT_VULKAN_MEMORY, "vulkanmemory", 0,
        "Vulkan Memory");

    _vulkan_memory_allocator =
        g_object_new (gst_vulkan_memory_allocator_get_type (), NULL);

    gst_allocator_register (GST_VULKAN_MEMORY_ALLOCATOR_NAME,
        gst_object_ref (_vulkan_memory_allocator));
    g_once_init_leave (&_init, 1);
  }
}
/**
 * gst_gl_base_buffer_init_once:
 *
 * Initializes the GL Buffer allocator. It is safe to call this function
 * multiple times.  This must be called before any other GstGLBaseBuffer operation.
 */
void
gst_gl_base_buffer_init_once (void)
{
  static volatile gsize _init = 0;

  if (g_once_init_enter (&_init)) {
    GST_DEBUG_CATEGORY_INIT (GST_CAT_GL_BASE_BUFFER, "glbuffer", 0,
        "OpenGL Buffer");

    _gl_base_buffer_allocator =
        g_object_new (gst_gl_base_buffer_allocator_get_type (), NULL);

    gst_allocator_register (GST_GL_BASE_BUFFER_ALLOCATOR_NAME,
        gst_object_ref (_gl_base_buffer_allocator));
    g_once_init_leave (&_init, 1);
  }
}
/**
 * gst_gl_memory_pbo_init:
 *
 * Initializes the GL Memory allocator. It is safe to call this function
 * multiple times.  This must be called before any other GstGLMemoryPBO operation.
 */
void
gst_gl_memory_pbo_init_once (void)
{
  static volatile gsize _init = 0;

  if (g_once_init_enter (&_init)) {
    gst_gl_memory_init_once ();

    GST_DEBUG_CATEGORY_INIT (GST_CAT_GL_MEMORY, "glmemory", 0, "OpenGL Memory");

    _gl_allocator = g_object_new (GST_TYPE_GL_MEMORY_PBO_ALLOCATOR, NULL);

    gst_allocator_register (GST_GL_MEMORY_PBO_ALLOCATOR_NAME,
        gst_object_ref (_gl_allocator));
    g_once_init_leave (&_init, 1);
  }
}
/**
 * gst_vdp_video_memory_init:
 *
 * Initializes the GL Memory allocator. It is safe to call this function
 * multiple times.  This must be called before any other GstVdpVideoMemory operation.
 */
void
gst_vdp_video_memory_init (void)
{
  static volatile gsize _init = 0;

  if (g_once_init_enter (&_init)) {
    _vdp_video_allocator =
        g_object_new (gst_vdp_video_allocator_get_type (), NULL);

    gst_allocator_register (GST_VDP_VIDEO_MEMORY_ALLOCATOR,
        gst_object_ref (_vdp_video_allocator));
    GST_DEBUG_CATEGORY_INIT (gst_vdp_video_mem_debug, "vdpvideomem", 0,
        "VDPAU VideoSurface Memory/Allocator");
    GST_DEBUG_CATEGORY_GET (GST_CAT_PERFORMANCE, "GST_PERFORMANCE");
    g_once_init_leave (&_init, 1);
  }
}
/**
 * gst_apple_core_video_memory_init:
 *
 * Initializes the Core Video Memory allocator. This function must be called
 * before #GstAppleCoreVideoMemory can be created.
 *
 * It is safe to call this function multiple times.
 */
void
gst_apple_core_video_memory_init (void)
{
  static volatile gsize _init = 0;

  if (g_once_init_enter (&_init)) {
    GST_DEBUG_CATEGORY_INIT (GST_CAT_APPLE_CORE_VIDEO_MEMORY, "corevideomemory",
        0, "Apple Core Video Memory");

    _apple_core_video_allocator =
        g_object_new (GST_TYPE_APPLE_CORE_VIDEO_ALLOCATOR, NULL);
    gst_object_ref_sink (_apple_core_video_allocator);

    gst_allocator_register (GST_APPLE_CORE_VIDEO_ALLOCATOR_NAME,
        gst_object_ref (_apple_core_video_allocator));
    g_once_init_leave (&_init, 1);
  }
}
Beispiel #11
0
void
gst_ios_gl_memory_init (void)
{
  static volatile gsize _init = 0;

  if (g_once_init_enter (&_init)) {
    GST_DEBUG_CATEGORY_INIT (GST_CAT_IOS_GL_MEMORY, "iosurface", 0,
        "IOSGL Buffer");

    _ios_gl_memory_allocator =
        g_object_new (GST_TYPE_IOS_GL_MEMORY_ALLOCATOR, NULL);
    gst_object_ref_sink (_ios_gl_memory_allocator);

    gst_allocator_register (GST_IOS_GL_MEMORY_ALLOCATOR_NAME,
        gst_object_ref (_ios_gl_memory_allocator));
    g_once_init_leave (&_init, 1);
  }
}
/**
 * gst_gl_buffer_init_once:
 *
 * Initializes the GL Buffer allocator. It is safe to call this function
 * multiple times.  This must be called before any other #GstGLBuffer operation.
 *
 * Since: 1.8
 */
void
gst_gl_buffer_init_once (void)
{
  static volatile gsize _init = 0;

  if (g_once_init_enter (&_init)) {
    gst_gl_base_memory_init_once ();

    GST_DEBUG_CATEGORY_INIT (GST_CAT_GL_BUFFER, "glbuffer", 0, "OpenGL Buffer");

    _gl_buffer_allocator =
        g_object_new (gst_gl_buffer_allocator_get_type (), NULL);

    /* The allocator is never unreffed */
    GST_OBJECT_FLAG_SET (_gl_buffer_allocator, GST_OBJECT_FLAG_MAY_BE_LEAKED);

    gst_allocator_register (GST_GL_BUFFER_ALLOCATOR_NAME,
        gst_object_ref (_gl_buffer_allocator));
    g_once_init_leave (&_init, 1);
  }
}
Beispiel #13
0
void
_priv_gst_memory_initialize (void)
{
  g_rw_lock_init (&lock);
  allocators = g_hash_table_new (g_str_hash, g_str_equal);

#ifdef HAVE_GETPAGESIZE
#ifdef MEMORY_ALIGNMENT_PAGESIZE
  gst_memory_alignment = getpagesize () - 1;
#endif
#endif

  GST_CAT_DEBUG (GST_CAT_MEMORY, "memory alignment: %" G_GSIZE_FORMAT,
      gst_memory_alignment);

  _sysmem_allocator = g_object_new (gst_allocator_sysmem_get_type (), NULL);

  gst_allocator_register (GST_ALLOCATOR_SYSMEM,
      gst_object_ref (_sysmem_allocator));

  _default_allocator = gst_object_ref (_sysmem_allocator);
}
void
gst_dwl_allocator_new (void)
{
  if (_dwl_allocator) {
    GST_DEBUG ("allocator already registered");
    goto exit;
  }

  _dwl_allocator = g_object_new (gst_dwl_allocator_get_type (), NULL);
  if (!_dwl_allocator) {
    GST_ERROR ("unable to create dwl allocator");
    goto exit;
  }

  gst_allocator_register (GST_ALLOCATOR_DWL, _dwl_allocator);
  GST_DEBUG (GST_ALLOCATOR_DWL " successfully registered");

exit:
  {
    return;
  }
}
Beispiel #15
0
/**
 * gst_gl_memory_egl_init_once:
 *
 * Initializes the GL Memory allocator. It is safe to call this function
 * multiple times.  This must be called before any other GstGLMemoryEGL operation.
 *
 * Since: 1.10
 */
void
gst_gl_memory_egl_init_once (void)
{
    static volatile gsize _init = 0;

    if (g_once_init_enter (&_init)) {
        gst_gl_memory_init_once ();

        GST_DEBUG_CATEGORY_INIT (GST_CAT_GL_MEMORY, "glmemory", 0,
                                 "OpenGL Texture with EGLImage memory");

        _gl_memory_egl_allocator =
            g_object_new (GST_TYPE_GL_MEMORY_EGL_ALLOCATOR, NULL);

        /* The allocator is never unreffed */
        GST_OBJECT_FLAG_SET (_gl_memory_egl_allocator,
                             GST_OBJECT_FLAG_MAY_BE_LEAKED);

        gst_allocator_register (GST_GL_MEMORY_EGL_ALLOCATOR_NAME,
                                gst_object_ref (_gl_memory_egl_allocator));
        g_once_init_leave (&_init, 1);
    }
}
Beispiel #16
0
static void gst_fsl_vpu_dec_mem_init(void)
{
	GstAllocator *allocator = g_object_new(gst_fsl_vpu_dec_allocator_get_type(), NULL);
	gst_allocator_register(GST_FSL_VPU_DEC_ALLOCATOR_MEM_TYPE, allocator);
}
void
gst_wl_shm_allocator_register (void)
{
  gst_allocator_register (GST_ALLOCATOR_WL_SHM,
      g_object_new (GST_TYPE_WL_SHM_ALLOCATOR, NULL));
}