Skip to content

Instantly share code, notes, and snippets.

@yashi
Last active December 11, 2015 09:30
Show Gist options
  • Save yashi/bde0e3699adf94e520e7 to your computer and use it in GitHub Desktop.
Save yashi/bde0e3699adf94e520e7 to your computer and use it in GitHub Desktop.
mem = gst_allocator_alloc(NULL, 3, NULL);
size = gst_memory_get_sizes(mem, NULL, &maxsize);
g_print("mem 1:\n");
g_print(" size: %" G_GSIZE_FORMAT "\n", size);
g_print(" maxsize: %" G_GSIZE_FORMAT "\n", maxsize);
gst_memory_map(mem, &info, GST_MAP_WRITE);
memcpy(info.data, "abc", 3);
gst_memory_unmap(mem, &info);
gst_buffer_insert_memory(buf, -1, mem);
size = gst_buffer_get_sizes(buf, NULL, &maxsize);
g_print("buf:\n");
g_print(" size: %" G_GSIZE_FORMAT "\n", size);
g_print(" maxsize: %" G_GSIZE_FORMAT "\n", maxsize);
g_print(" nr: %u\n", gst_buffer_n_memory(buf));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment