return NULL;
}
- memcpy (dinfo.data, (guint8 *) sinfo.data + offset, size);
+ memcpy (dinfo.data, sinfo.data + offset, size);
gst_memory_unmap (copy, &dinfo);
gst_memory_unmap (mem, &sinfo);
info->memory = mem;
info->size = mem->size;
info->maxsize = mem->maxsize - mem->offset;
- info->data = (guint8 *) info->data + mem->offset;
+ info->data = info->data + mem->offset;
return TRUE;
*/
typedef struct {
GstMemory *memory;
- gpointer data;
+ guint8 *data;
gsize size;
gsize maxsize;
} GstMapInfo;
fail_unless (gst_buffer_map (sub, &sinfo, GST_MAP_READ));
fail_unless (sinfo.size == 2, "subbuffer has wrong size");
- fail_unless (memcmp ((guint8 *) info.data + 1, sinfo.data, 2) == 0,
+ fail_unless (memcmp (info.data + 1, sinfo.data, 2) == 0,
"subbuffer contains the wrong data");
ASSERT_BUFFER_REFCOUNT (sub, "subbuffer", 1);
fail_unless (GST_BUFFER_TIMESTAMP (sub) == -1,
fail_if (sub == NULL, "copy_region of buffer returned NULL");
fail_unless (gst_buffer_map (sub, &sinfo, GST_MAP_READ));
fail_unless (sinfo.size == 0, "subbuffer has wrong size");
- fail_unless (memcmp ((guint8 *) info.data + 1, sinfo.data, 0) == 0,
+ fail_unless (memcmp (info.data + 1, sinfo.data, 0) == 0,
"subbuffer contains the wrong data");
ASSERT_BUFFER_REFCOUNT (sub, "subbuffer", 1);
gst_buffer_unmap (sub, &sinfo);
buf = create_read_only_buffer ();
fail_unless (gst_buffer_map (buf, &info, GST_MAP_WRITE));
- ((guint8 *) info.data)[4] = 'a';
+ info.data[4] = 'a';
gst_buffer_unmap (buf, &info);
gst_buffer_unref (buf);
fail_unless (gst_buffer_map (sub_buf, &info, GST_MAP_WRITE));
fail_if (info.data == NULL);
- ((guint8 *) info.data)[4] = 'a';
+ info.data[4] = 'a';
gst_buffer_unmap (sub_buf, &info);
gst_buffer_unref (sub_buf);
gst_buffer_unref (buf);
fail_unless (gst_buffer_map (buf, &info, GST_MAP_WRITE));
fail_unless (info.data != NULL);
fail_unless (info.size == (640 * 480 * 4));
- ((guint8 *) info.data)[640 * 479 * 4 + 479] = 0xff;
+ info.data[640 * 479 * 4 + 479] = 0xff;
gst_buffer_unmap (buf, &info);
gst_buffer_unref (buf);
fail_unless (gst_memory_map (sub, &sinfo, GST_MAP_READ));
fail_unless (sinfo.size == 2, "submemory has wrong size");
- fail_unless (memcmp (((guint8 *) info.data) + 1, sinfo.data, 2) == 0,
+ fail_unless (memcmp (info.data + 1, sinfo.data, 2) == 0,
"submemory contains the wrong data");
ASSERT_MEMORY_REFCOUNT (sub, "submemory", 1);
gst_memory_unmap (sub, &sinfo);
fail_if (sub == NULL, "share memory returned NULL");
fail_unless (gst_memory_map (sub, &sinfo, GST_MAP_READ));
fail_unless (sinfo.size == 0, "submemory has wrong size");
- fail_unless (memcmp (((guint8 *) info.data) + 1, sinfo.data, 0) == 0,
+ fail_unless (memcmp (info.data + 1, sinfo.data, 0) == 0,
"submemory contains the wrong data");
ASSERT_MEMORY_REFCOUNT (sub, "submemory", 1);
gst_memory_unmap (sub, &sinfo);
fail_unless (gst_memory_is_writable (mem2));
fail_unless (gst_memory_map (mem2, &info, GST_MAP_WRITE));
- ((guint8 *) info.data)[4] = 'a';
+ info.data[4] = 'a';
gst_memory_unmap (mem2, &info);
gst_memory_ref (mem2);
gst_memory_unref (mem2);
fail_unless (gst_memory_map (mem2, &info, GST_MAP_WRITE));
- ((guint8 *) info.data)[4] = 'a';
+ info.data[4] = 'a';
gst_memory_unmap (mem2, &info);
gst_memory_unref (mem2);
fail_unless (gst_memory_map (mem, &info, GST_MAP_WRITE));
fail_unless (info.data != NULL);
fail_unless (info.size == (640 * 480 * 4));
- ((guint8 *) info.data)[640 * 479 * 4 + 479] = 0xff;
+ info.data[640 * 479 * 4 + 479] = 0xff;
gst_memory_unmap (mem, &info);
gst_memory_unref (mem);