2006-09-07 16:55:34 +00:00
|
|
|
#include <gst/gst.h>
|
|
|
|
|
2009-04-13 11:27:26 +00:00
|
|
|
void
|
|
|
|
gstsharp_gst_buffer_set_data (GstBuffer * buffer, guint8 * new_data, guint size)
|
|
|
|
{
|
|
|
|
g_return_if_fail (gst_buffer_is_writable (buffer));
|
|
|
|
|
|
|
|
if (buffer->malloc_data && buffer->free_func)
|
|
|
|
buffer->free_func (buffer->malloc_data);
|
|
|
|
else if (buffer->malloc_data)
|
|
|
|
g_free (buffer->malloc_data);
|
|
|
|
|
|
|
|
buffer->malloc_data = buffer->data = new_data;
|
|
|
|
buffer->size = size;
|
2009-06-17 11:36:53 +00:00
|
|
|
buffer->free_func = g_free;
|
2009-04-13 11:27:26 +00:00
|
|
|
}
|
|
|
|
|
2009-09-22 05:40:57 +00:00
|
|
|
guint
|
|
|
|
gstsharp_gst_buffer_get_size_offset (void)
|
|
|
|
{
|
|
|
|
return (guint)G_STRUCT_OFFSET (GstBuffer, size);
|
|
|
|
}
|
|
|
|
|
2009-04-13 11:27:26 +00:00
|
|
|
guint
|
|
|
|
gstsharp_gst_buffer_get_data_offset (void)
|
|
|
|
{
|
|
|
|
return (guint) G_STRUCT_OFFSET (GstBuffer, data);
|
|
|
|
}
|
|
|
|
|
|
|
|
guint
|
|
|
|
gstsharp_gst_buffer_get_timestamp_offset (void)
|
|
|
|
{
|
|
|
|
return (guint) G_STRUCT_OFFSET (GstBuffer, timestamp);
|
|
|
|
}
|
|
|
|
|
|
|
|
guint
|
|
|
|
gstsharp_gst_buffer_get_duration_offset (void)
|
|
|
|
{
|
|
|
|
return (guint) G_STRUCT_OFFSET (GstBuffer, duration);
|
|
|
|
}
|
|
|
|
|
|
|
|
guint
|
|
|
|
gstsharp_gst_buffer_get_offset_offset (void)
|
|
|
|
{
|
|
|
|
return (guint) G_STRUCT_OFFSET (GstBuffer, offset);
|
|
|
|
}
|
|
|
|
|
2006-09-07 16:55:34 +00:00
|
|
|
guint
|
2009-04-13 11:27:26 +00:00
|
|
|
gstsharp_gst_buffer_get_offset_end_offset (void)
|
2006-09-07 16:55:34 +00:00
|
|
|
{
|
2009-04-13 11:27:26 +00:00
|
|
|
return (guint) G_STRUCT_OFFSET (GstBuffer, offset_end);
|
2006-09-07 16:55:34 +00:00
|
|
|
}
|