Skip to content

Instantly share code, notes, and snippets.

@yashi
Created December 11, 2015 09:29
Show Gist options
  • Save yashi/c2afa2541608d65a95de to your computer and use it in GitHub Desktop.
Save yashi/c2afa2541608d65a95de to your computer and use it in GitHub Desktop.
mem = gst_allocator_alloc(NULL, 6, NULL);
size = gst_memory_get_sizes(mem, NULL, &maxsize);
g_print("mem 2:\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, "12345", 6);
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