17 #define GST_TENSOR_ALLOCATOR "GstTensorAllocator"
45 _alloc (GstAllocator * allocator, gsize size, GstAllocationParams * params)
47 GstAllocator *sysmem_alloc;
48 GstAllocatorClass *sysmem_aclass;
49 GstAllocationParams *_params;
52 sysmem_alloc = gst_allocator_find (GST_ALLOCATOR_SYSMEM);
53 sysmem_aclass = GST_ALLOCATOR_GET_CLASS (sysmem_alloc);
54 _params = gst_allocation_params_copy (params);
57 mem = sysmem_aclass->alloc (allocator, size, _params);
59 gst_allocation_params_free (_params);
60 gst_object_unref (sysmem_alloc);
70 GstAllocatorClass *allocator_class, *sysmem_aclass;
71 GstAllocator *sysmem_alloc;
73 allocator_class = (GstAllocatorClass *) klass;
74 sysmem_alloc = gst_allocator_find (GST_ALLOCATOR_SYSMEM);
75 sysmem_aclass = GST_ALLOCATOR_GET_CLASS (sysmem_alloc);
77 allocator_class->alloc =
_alloc;
78 allocator_class->free = sysmem_aclass->free;
80 gst_object_unref (sysmem_alloc);
89 GstAllocator *sysmem_alloc, *alloc;
91 alloc = GST_ALLOCATOR_CAST (allocator);
92 sysmem_alloc = gst_allocator_find (GST_ALLOCATOR_SYSMEM);
94 alloc->mem_type = sysmem_alloc->mem_type;
95 alloc->mem_map = sysmem_alloc->mem_map;
96 alloc->mem_unmap = sysmem_alloc->mem_unmap;
97 alloc->mem_copy = sysmem_alloc->mem_copy;
98 alloc->mem_share = sysmem_alloc->mem_share;
99 alloc->mem_is_span = sysmem_alloc->mem_is_span;
101 gst_object_unref (sysmem_alloc);
111 GstAllocator *allocator;
116 if (alignment == 0) {
117 gst_allocator_set_default (gst_allocator_find (GST_ALLOCATOR_SYSMEM));
123 if (allocator == NULL) {
127 gst_allocator_set_default (allocator);