7
main (int argc, char **argv)
11
GstAllocationParams params;
15
gst_init (&argc, &argv);
17
/* memory using the default API */
20
alloc = gst_allocator_find ("MyMemory");
22
gst_allocation_params_init (¶ms);
23
mem = gst_allocator_alloc (alloc, 1024, ¶ms);
25
gst_memory_map (mem, &info, GST_MAP_READ);
26
gst_memory_unmap (mem, &info);
28
gst_memory_unref (mem);
29
gst_object_unref (alloc);
31
/* allocator with custom alloc API */
34
/* we can get the allocator but we can only make objects from it when we know
36
alloc = gst_allocator_find ("MyVidmem");
38
/* use custom api to alloc */
39
mem = my_vidmem_alloc (0, 640, 480);
40
g_assert (my_is_vidmem (mem));
42
my_vidmem_get_format (mem, &f, &w, &h);
47
gst_memory_map (mem, &info, GST_MAP_READ);
48
gst_memory_unmap (mem, &info);
50
gst_memory_unref (mem);
51
gst_object_unref (alloc);