+2005-05-16 David Schleef <ds@schleef.org>
+
+ Port from GstData to GstMiniObject.
+ * ext/ogg/gstoggdemux.c: (gst_ogg_pad_dispose):
+ * ext/ogg/gstoggmux.c: (gst_ogg_mux_buffer_from_page),
+ (gst_ogg_mux_queue_pads), (gst_ogg_mux_set_header_on_caps),
+ (gst_ogg_mux_collected):
+ * ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
+ * ext/theora/theoradec.c: (theora_handle_comment_packet),
+ (theora_handle_data_packet):
+ * ext/theora/theoraenc.c: (theora_buffer_from_packet),
+ (theora_set_header_on_caps), (theora_enc_chain):
+ * ext/vorbis/vorbisdec.c: (vorbis_dec_sink_event),
+ (vorbis_handle_comment_packet):
+ * ext/vorbis/vorbisenc.c: (gst_vorbisenc_set_header_on_caps):
+ * ext/vorbis/vorbisparse.c: (vorbis_parse_set_header_on_caps):
+ * gst-libs/gst/audio/gstaudiofilter.c: (gst_audiofilter_chain):
+ * gst-libs/gst/tag/gstvorbistag.c: (gst_vorbis_tag_chain):
+ * gst/audioconvert/gstaudioconvert.c:
+ (gst_audio_convert_get_buffer):
+ * gst/playback/gstdecodebin.c: (gst_decode_bin_class_init):
+ * gst/playback/gstplaybasebin.c: (check_queue), (probe_triggered),
+ (mute_stream), (silence_stream):
+ * gst/playback/gstplaybin.c: (gst_play_bin_class_init):
+ * gst/volume/gstvolume.c: (volume_transform):
+ * sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize),
+ (gst_ximage_buffer_init), (gst_ximage_buffer_class_init),
+ (gst_ximage_buffer_get_type), (gst_ximagesink_check_xshm_calls),
+ (gst_ximagesink_ximage_new), (gst_ximagesink_ximage_destroy),
+ (gst_ximagesink_ximage_put), (gst_ximagesink_imagepool_clear),
+ (gst_ximagesink_show_frame), (gst_ximagesink_buffer_free),
+ (gst_ximagesink_buffer_alloc):
+ * sys/ximage/ximagesink.h:
+
2005-05-12 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/playback/gstplaybasebin.c: (gst_play_base_bin_class_init),
pad->chain = NULL;
pad->ogg = NULL;
- g_list_foreach (pad->headers, (GFunc) gst_data_unref, NULL);
+ g_list_foreach (pad->headers, (GFunc) gst_mini_object_unref, NULL);
g_list_free (pad->headers);
pad->headers = NULL;
mux->offset += GST_BUFFER_SIZE (buffer);
GST_BUFFER_OFFSET_END (buffer) = mux->offset;
if (delta)
- GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_DELTA_UNIT);
+ GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DELTA_UNIT);
return buffer;
}
buf = gst_collectpads_pop (ogg_mux->collect, data);
- incaps = GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_IN_CAPS);
+ incaps = GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_IN_CAPS);
/* if we need headers */
if (pad->state == GST_OGG_PAD_STATE_CONTROL) {
/* and we have one */
walk = walk->next;
/* mark buffer */
- GST_BUFFER_FLAG_SET (buf, GST_BUFFER_IN_CAPS);
+ GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_IN_CAPS);
g_value_init (&value, GST_TYPE_BUFFER);
g_value_set_boxed (&value, buf);
/* now see if we have a buffer */
buf = pad->buffer;
- delta_unit = GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_DELTA_UNIT);
+ delta_unit = GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT);
duration = GST_BUFFER_DURATION (buf);
/* create a packet from the buffer */
gint samples = (ogm->hdr.streamtype[0] == 'v') ? 1 : xsize;
if (!keyframe)
- GST_BUFFER_FLAG_SET (sbuf, GST_BUFFER_DELTA_UNIT);
+ GST_BUFFER_FLAG_SET (sbuf, GST_BUFFER_FLAG_DELTA_UNIT);
GST_BUFFER_TIMESTAMP (sbuf) = (GST_SECOND / 10000000) *
ogm->next_granulepos * ogm->hdr.time_unit;
buf = gst_buffer_new_and_alloc (packet->bytes);
GST_BUFFER_DATA (buf) = packet->packet;
- GST_BUFFER_FLAG_SET (buf, GST_BUFFER_DONTFREE);
list =
gst_tag_list_from_vorbiscomment_buffer (buf, (guint8 *) "\201theora", 7,
* offset or size is odd (see above).
*/
{
- char *dest_y, *src_y;
- char *dest_u, *src_u;
- char *dest_v, *src_v;
+ guint8 *dest_y, *src_y;
+ guint8 *dest_u, *src_u;
+ guint8 *dest_v, *src_v;
- dest_y = (char *) GST_BUFFER_DATA (out);
+ dest_y = (guint8 *) GST_BUFFER_DATA (out);
dest_u = dest_y + stride_y * height;
dest_v = dest_u + stride_uv * cheight;
/* the second most significant bit of the first data byte is cleared
* for keyframes */
if ((packet->packet[0] & 0x40) == 0) {
- GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_DELTA_UNIT);
+ GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_FLAG_DELTA_UNIT);
} else {
- GST_BUFFER_FLAG_SET (buf, GST_BUFFER_DELTA_UNIT);
+ GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT);
}
enc->packetno++;
structure = gst_caps_get_structure (caps, 0);
/* mark buffers */
- GST_BUFFER_FLAG_SET (buf1, GST_BUFFER_IN_CAPS);
- GST_BUFFER_FLAG_SET (buf2, GST_BUFFER_IN_CAPS);
- GST_BUFFER_FLAG_SET (buf3, GST_BUFFER_IN_CAPS);
+ GST_BUFFER_FLAG_SET (buf1, GST_BUFFER_FLAG_IN_CAPS);
+ GST_BUFFER_FLAG_SET (buf2, GST_BUFFER_FLAG_IN_CAPS);
+ GST_BUFFER_FLAG_SET (buf3, GST_BUFFER_FLAG_IN_CAPS);
/* put buffers in a fixed list */
g_value_init (&list, GST_TYPE_FIXED_LIST);
/* easy case, no cropping/conversion needed */
pixels = GST_BUFFER_DATA (buffer);
- yuv.y = (char *) pixels;
+ yuv.y = (guint8 *) pixels;
yuv.u = yuv.y + y_size;
yuv.v = yuv.u + y_size / 4;
} else {
GstBuffer *newbuf;
gint i;
- char *dest_y, *src_y;
- char *dest_u, *src_u;
- char *dest_v, *src_v;
+ guint8 *dest_y, *src_y;
+ guint8 *dest_u, *src_u;
+ guint8 *dest_v, *src_v;
gint src_y_stride, src_uv_stride;
gint dst_y_stride, dst_uv_stride;
gint width, height;
newbuf = gst_pad_alloc_buffer (enc->srcpad,
GST_BUFFER_OFFSET_NONE, y_size * 3 / 2, GST_PAD_CAPS (enc->srcpad));
- dest_y = yuv.y = (char *) GST_BUFFER_DATA (newbuf);
+ dest_y = yuv.y = (guint8 *) GST_BUFFER_DATA (newbuf);
dest_u = yuv.u = yuv.y + y_size;
dest_v = yuv.v = yuv.u + y_size / 4;
- src_y = (char *) GST_BUFFER_DATA (buffer);
+ src_y = (guint8 *) GST_BUFFER_DATA (buffer);
src_u = src_y + src_y_stride * ROUND_UP_2 (height);
src_v = src_u + src_uv_stride * ROUND_UP_2 (height) / 2;
vorbis_synthesis_restart (&dec->vd);
#endif
}
- gst_data_unref (GST_DATA (event));
+ gst_event_unref (event);
break;
default:
ret = gst_pad_event_default (dec->sinkpad, event);
buf = gst_buffer_new_and_alloc (packet->bytes);
GST_BUFFER_DATA (buf) = packet->packet;
- GST_BUFFER_FLAG_SET (buf, GST_BUFFER_DONTFREE);
list =
gst_tag_list_from_vorbiscomment_buffer (buf, (guint8 *) "\003vorbis", 7,
structure = gst_caps_get_structure (caps, 0);
/* mark buffers */
- GST_BUFFER_FLAG_SET (buf1, GST_BUFFER_IN_CAPS);
- GST_BUFFER_FLAG_SET (buf2, GST_BUFFER_IN_CAPS);
- GST_BUFFER_FLAG_SET (buf3, GST_BUFFER_IN_CAPS);
+ GST_BUFFER_FLAG_SET (buf1, GST_BUFFER_FLAG_IN_CAPS);
+ GST_BUFFER_FLAG_SET (buf2, GST_BUFFER_FLAG_IN_CAPS);
+ GST_BUFFER_FLAG_SET (buf3, GST_BUFFER_FLAG_IN_CAPS);
/* put buffers in a fixed list */
g_value_init (&list, GST_TYPE_FIXED_LIST);
structure = gst_caps_get_structure (caps, 0);
/* mark buffers */
- GST_BUFFER_FLAG_SET (buf1, GST_BUFFER_IN_CAPS);
- GST_BUFFER_FLAG_SET (buf2, GST_BUFFER_IN_CAPS);
- GST_BUFFER_FLAG_SET (buf3, GST_BUFFER_IN_CAPS);
+ GST_BUFFER_FLAG_SET (buf1, GST_BUFFER_FLAG_IN_CAPS);
+ GST_BUFFER_FLAG_SET (buf2, GST_BUFFER_FLAG_IN_CAPS);
+ GST_BUFFER_FLAG_SET (buf3, GST_BUFFER_FLAG_IN_CAPS);
/* put buffers in a fixed list */
g_value_init (&list, GST_TYPE_FIXED_LIST);
audiofilter->size = GST_BUFFER_SIZE (inbuf);
audiofilter->n_samples = audiofilter->size / audiofilter->bytes_per_sample;
- if (gst_data_is_writable (GST_DATA (buffer))) {
+ if (gst_buffer_is_writable (buffer)) {
if (audiofilter_class->filter_inplace) {
(audiofilter_class->filter_inplace) (audiofilter, inbuf);
outbuf = inbuf;
7, &vendor);
const GstTagList *found_tags;
- gst_data_unref (GST_DATA (buffer));
+ gst_buffer_unref (buffer);
if (list == NULL) {
GST_ELEMENT_ERROR (tag, CORE, TAG, (NULL),
("invalid data in vorbis comments"));
if (tag->output == OUTPUT_DATA) {
gst_pad_push (tag->srcpad, out);
} else {
- gst_data_unref (GST_DATA (out));
+ gst_buffer_unref (out);
}
return GST_FLOW_OK;
}
g_assert (GST_IS_BUFFER (buf));
GST_LOG
- ("new buffer of size %u requested. Current is: data: %p - size: %u - maxsize: %u",
- size, buf->data, buf->size, buf->maxsize);
- if (buf->maxsize >= size && gst_buffer_is_writable (buf)) {
+ ("new buffer of size %u requested. Current is: data: %p - size: %u",
+ size, buf->data, buf->size);
+ if (buf->size >= size && gst_buffer_is_writable (buf)) {
gst_buffer_ref (buf);
buf->size = size;
GST_LOG
- ("returning same buffer with adjusted values. data: %p - size: %u - maxsize: %u",
- buf->data, buf->size, buf->maxsize);
+ ("returning same buffer with adjusted values. data: %p - size: %u",
+ buf->data, buf->size);
return buf;
} else {
ret = gst_buffer_new_and_alloc (size);
g_assert (ret);
//gst_buffer_stamp (ret, buf);
- GST_LOG ("returning new buffer. data: %p - size: %u - maxsize: %u",
- ret->data, ret->size, ret->maxsize);
+ GST_LOG ("returning new buffer. data: %p - size: %u", ret->data, ret->size);
return ret;
}
}
gst_decode_bin_signals[SIGNAL_UNKNOWN_TYPE] =
g_signal_new ("unknown-type", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstDecodeBinClass, unknown_type),
- NULL, NULL, gst_marshal_VOID__OBJECT_BOXED, G_TYPE_NONE, 2,
- GST_TYPE_PAD, GST_TYPE_CAPS);
+ NULL, NULL, gst_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2,
+ GST_TYPE_PAD, GST_TYPE_MINI_OBJECT);
gobject_klass->dispose = GST_DEBUG_FUNCPTR (gst_decode_bin_dispose);
static gboolean prepare_output (GstPlayBaseBin * play_base_bin);
static void set_active_source (GstPlayBaseBin * play_base_bin,
GstStreamType type, gint source_num);
-static gboolean probe_triggered (GstProbe * probe, GstData ** data,
+static gboolean probe_triggered (GstProbe * probe, GstMiniObject ** data,
gpointer user_data);
static void setup_substreams (GstPlayBaseBin * play_base_bin);
}
static gboolean
-check_queue (GstProbe * probe, GstData ** data, gpointer user_data)
+check_queue (GstProbe * probe, GstMiniObject ** data, gpointer user_data)
{
GstElement *queue = GST_ELEMENT (user_data);
GstPlayBaseBin *play_base_bin = g_object_get_data (G_OBJECT (queue), "pbb");
}
static gboolean
-probe_triggered (GstProbe * probe, GstData ** data, gpointer user_data)
+probe_triggered (GstProbe * probe, GstMiniObject ** data, gpointer user_data)
{
GstPlayBaseGroup *group;
GstPlayBaseBin *play_base_bin;
/* Mute stream on first data - for header-is-in-stream-stuff
* (vorbis, ogmtext). */
static gboolean
-mute_stream (GstProbe * probe, GstData ** d, gpointer data)
+mute_stream (GstProbe * probe, GstMiniObject ** d, gpointer data)
{
GstStreamInfo *info = GST_STREAM_INFO (data);
/* Eat data. */
static gboolean
-silence_stream (GstProbe * probe, GstData ** d, gpointer data)
+silence_stream (GstProbe * probe, GstMiniObject ** d, gpointer data)
{
/* no data */
return FALSE;
g_param_spec_double ("volume", "volume", "volume",
0.0, VOLUME_MAX_DOUBLE, 1.0, G_PARAM_READWRITE));
g_object_class_install_property (gobject_klass, ARG_FRAME,
- g_param_spec_boxed ("frame", "Frame",
+ gst_param_spec_mini_object ("frame", "Frame",
"The last frame (NULL = no video available)",
GST_TYPE_BUFFER, G_PARAM_READABLE));
g_object_class_install_property (gobject_klass, ARG_FONT_DESC,
}
}
- *outbuf = gst_buffer_copy_on_write (gst_buffer_ref (inbuf));
+ *outbuf = gst_buffer_make_writable (gst_buffer_ref (inbuf));
filter->process (filter, GST_BUFFER_TIMESTAMP (*outbuf),
GST_BUFFER_DATA (*outbuf), GST_BUFFER_SIZE (*outbuf));
#define MWM_HINTS_DECORATIONS (1L << 1)
-static void gst_ximagesink_buffer_free (GstBuffer * buffer);
+//static void gst_ximagesink_buffer_free (GstBuffer * buffer);
static void gst_ximagesink_ximage_destroy (GstXImageSink * ximagesink,
- GstXImage * ximage);
+ GstXImageBuffer * ximage);
#if 0
static void gst_ximagesink_send_pending_navigation (GstXImageSink * ximagesink);
#endif
/* */
/* ============================================================= */
+/* ximage buffers */
+
+#define GST_TYPE_XIMAGE_BUFFER (gst_ximage_buffer_get_type())
+
+#define GST_IS_XIMAGE_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_XIMAGE_BUFFER))
+#define GST_XIMAGE_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_XIMAGE_BUFFER, GstXImageBuffer))
+
+
+static void
+gst_ximage_buffer_finalize (GstXImageBuffer * ximage_buffer)
+{
+ GstXImageSink *ximagesink;
+
+ g_return_if_fail (ximage_buffer != NULL);
+
+ if (ximage_buffer->ximagesink == NULL) {
+ return;
+ }
+ ximagesink = ximage_buffer->ximagesink;
+
+ /* If the destroyed image is the current one we destroy our reference too */
+ if (ximagesink->cur_image == ximage_buffer)
+ ximagesink->cur_image = NULL;
+
+ g_mutex_lock (ximagesink->x_lock);
+
+#ifdef HAVE_XSHM
+ if (ximagesink->xcontext->use_xshm) {
+ if (ximage_buffer->SHMInfo.shmaddr != ((void *) -1)) {
+ XShmDetach (ximagesink->xcontext->disp, &ximage_buffer->SHMInfo);
+ XSync (ximagesink->xcontext->disp, 0);
+ shmdt (ximage_buffer->SHMInfo.shmaddr);
+ }
+ if (ximage_buffer->SHMInfo.shmid > 0)
+ shmctl (ximage_buffer->SHMInfo.shmid, IPC_RMID, 0);
+ if (ximage_buffer->ximage)
+ XDestroyImage (ximage_buffer->ximage);
+
+ } else
+#endif /* HAVE_XSHM */
+ {
+ if (ximage_buffer->ximage) {
+ XDestroyImage (ximage_buffer->ximage);
+ }
+ }
+
+ XSync (ximagesink->xcontext->disp, FALSE);
+
+ g_mutex_unlock (ximagesink->x_lock);
+}
+
+static void
+gst_ximage_buffer_init (GTypeInstance * instance, gpointer g_class)
+{
+
+}
+
+static void
+gst_ximage_buffer_class_init (gpointer g_class, gpointer class_data)
+{
+ GstMiniObjectClass *mini_object_class = GST_MINI_OBJECT_CLASS (g_class);
+
+ mini_object_class->finalize = (GstMiniObjectFinalizeFunction)
+ gst_ximage_buffer_finalize;
+}
+
+GType
+gst_ximage_buffer_get_type (void)
+{
+ static GType _gst_ximage_buffer_type;
+
+ if (G_UNLIKELY (_gst_ximage_buffer_type == 0)) {
+ static const GTypeInfo ximage_buffer_info = {
+ sizeof (GstBufferClass),
+ NULL,
+ NULL,
+ gst_ximage_buffer_class_init,
+ NULL,
+ NULL,
+ sizeof (GstXImageBuffer),
+ 0,
+ gst_ximage_buffer_init,
+ NULL
+ };
+ _gst_ximage_buffer_type = g_type_register_static (GST_TYPE_BUFFER,
+ "GstXImageBuffer", &ximage_buffer_info, 0);
+ }
+ return _gst_ximage_buffer_type;
+}
+
/* X11 stuff */
static int
#ifndef HAVE_XSHM
return FALSE;
#else
- GstXImage *ximage = NULL;
+ GstXImageBuffer *ximage = NULL;
int (*handler) (Display *, XErrorEvent *);
gboolean result = FALSE;
g_return_val_if_fail (xcontext != NULL, FALSE);
- ximage = g_new0 (GstXImage, 1);
+ ximage = (GstXImageBuffer *) gst_mini_object_new (GST_TYPE_XIMAGE_BUFFER);
g_return_val_if_fail (ximage != NULL, FALSE);
/* Setting an error handler to catch failure */
beach:
XSetErrorHandler (handler);
- if (ximage->ximage)
- XFree (ximage->ximage);
- g_free (ximage);
+
+ gst_buffer_unref (GST_BUFFER (ximage));
+
XSync (xcontext->disp, FALSE);
return result;
#endif /* HAVE_XSHM */
}
-/* This function handles GstXImage creation depending on XShm availability */
-static GstXImage *
+/* This function handles GstXImageBuffer creation depending on XShm availability */
+static GstXImageBuffer *
gst_ximagesink_ximage_new (GstXImageSink * ximagesink, gint width, gint height)
{
- GstXImage *ximage = NULL;
+ GstXImageBuffer *ximage = NULL;
gboolean succeeded = FALSE;
g_return_val_if_fail (GST_IS_XIMAGESINK (ximagesink), NULL);
GST_DEBUG_OBJECT (ximagesink, "creating %dx%d", width, height);
- ximage = g_new0 (GstXImage, 1);
+ ximage = (GstXImageBuffer *) gst_mini_object_new (GST_TYPE_XIMAGE_BUFFER);
ximage->width = width;
ximage->height = height;
beach:
if (!succeeded) {
- gst_ximagesink_ximage_destroy (ximagesink, ximage);
+ gst_buffer_unref (GST_BUFFER (ximage));
ximage = NULL;
}
return ximage;
}
-/* This function destroys a GstXImage handling XShm availability */
+/* This function destroys a GstXImageBuffer handling XShm availability */
static void
-gst_ximagesink_ximage_destroy (GstXImageSink * ximagesink, GstXImage * ximage)
+gst_ximagesink_ximage_destroy (GstXImageSink * ximagesink,
+ GstXImageBuffer * ximage)
{
g_return_if_fail (ximage != NULL);
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
g_free (ximage);
}
-/* This function puts a GstXImage on a GstXImageSink's window */
+/* This function puts a GstXImageBuffer on a GstXImageSink's window */
static void
-gst_ximagesink_ximage_put (GstXImageSink * ximagesink, GstXImage * ximage)
+gst_ximagesink_ximage_put (GstXImageSink * ximagesink, GstXImageBuffer * ximage)
{
gint x, y;
gint w, h;
g_mutex_lock (ximagesink->pool_lock);
while (ximagesink->image_pool) {
- GstXImage *ximage = ximagesink->image_pool->data;
+ GstXImageBuffer *ximage = ximagesink->image_pool->data;
ximagesink->image_pool = g_slist_delete_link (ximagesink->image_pool,
ximagesink->image_pool);
/* If this buffer has been allocated using our buffer management we simply
put the ximage which is in the PRIVATE pointer */
- if (GST_BUFFER_FREE_DATA_FUNC (buf) == gst_ximagesink_buffer_free) {
+ if (GST_IS_XIMAGE_BUFFER (buf)) {
GST_LOG_OBJECT (ximagesink, "buffer from our pool, writing directly");
- gst_ximagesink_ximage_put (ximagesink, GST_BUFFER_PRIVATE (buf));
+ gst_ximagesink_ximage_put (ximagesink, GST_XIMAGE_BUFFER (buf));
} else {
/* Else we have to copy the data into our private image, */
/* if we have one... */
/* Buffer management */
+#if 0
static void
gst_ximagesink_buffer_free (GstBuffer * buffer)
{
GstXImageSink *ximagesink;
- GstXImage *ximage;
+ GstXImageBuffer *ximage;
ximage = GST_BUFFER_PRIVATE (buffer);
g_mutex_unlock (ximagesink->pool_lock);
}
}
+#endif
static GstBuffer *
gst_ximagesink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size,
GstCaps * caps)
{
GstXImageSink *ximagesink;
- GstBuffer *buffer;
- GstXImage *ximage = NULL;
+ GstXImageBuffer *ximage = NULL;
gboolean not_found = TRUE;
ximagesink = GST_XIMAGESINK (bsink);
GST_VIDEOSINK_WIDTH (ximagesink), GST_VIDEOSINK_HEIGHT (ximagesink));
}
- if (ximage) {
- buffer = gst_buffer_new ();
-
- /* Storing some pointers in the buffer */
- GST_BUFFER_PRIVATE (buffer) = ximage;
-
- GST_BUFFER_DATA (buffer) = (guchar *) ximage->ximage->data;
- GST_BUFFER_FREE_DATA_FUNC (buffer) = gst_ximagesink_buffer_free;
- GST_BUFFER_SIZE (buffer) = ximage->size;
- return buffer;
- } else
- return NULL;
+ return GST_BUFFER (ximage);
}
/* Interfaces stuff */
typedef struct _GstXContext GstXContext;
typedef struct _GstXWindow GstXWindow;
-typedef struct _GstXImage GstXImage;
+
+typedef struct _GstXImageBuffer GstXImageBuffer;
+typedef struct _GstXImageBufferClass GstXImageBufferClass;
typedef struct _GstXImageSink GstXImageSink;
typedef struct _GstXImageSinkClass GstXImageSinkClass;
};
/* XImage stuff */
-struct _GstXImage {
+struct _GstXImageBuffer {
+ GstBuffer buffer;
+
/* Reference to the ximagesink we belong to */
GstXImageSink *ximagesink;
GstXContext *xcontext;
GstXWindow *xwindow;
- GstXImage *ximage;
- GstXImage *cur_image;
+ GstXImageBuffer *ximage;
+ GstXImageBuffer *cur_image;
gdouble framerate;
GMutex *x_lock;