From: <ds...@fr...> - 2005-05-16 15:36:06
|
CVS Root: /cvs/gstreamer Module: gst-plugins-base Changes by: ds Date: Mon May 16 2005 08:36:04 PDT Log message: 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: Modified files: . : ChangeLog ext/ogg : gstoggdemux.c gstoggmux.c gstogmparse.c ext/theora : theoradec.c theoraenc.c ext/vorbis : vorbisdec.c vorbisenc.c vorbisparse.c gst-libs/gst/audio: gstaudiofilter.c gst-libs/gst/tag: gstvorbistag.c gst/audioconvert: gstaudioconvert.c gst/playback : gstdecodebin.c gstplaybasebin.c gstplaybin.c gst/volume : gstvolume.c sys/ximage : ximagesink.c ximagesink.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ChangeLog.diff?r1=1.1695&r2=1.1696 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ext/ogg/gstoggdemux.c.diff?r1=1.75&r2=1.76 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ext/ogg/gstoggmux.c.diff?r1=1.25&r2=1.26 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ext/ogg/gstogmparse.c.diff?r1=1.8&r2=1.9 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ext/theora/theoradec.c.diff?r1=1.35&r2=1.36 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ext/theora/theoraenc.c.diff?r1=1.23&r2=1.24 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ext/vorbis/vorbisdec.c.diff?r1=1.60&r2=1.61 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ext/vorbis/vorbisenc.c.diff?r1=1.69&r2=1.70 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ext/vorbis/vorbisparse.c.diff?r1=1.3&r2=1.4 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/gst-libs/gst/audio/gstaudiofilter.c.diff?r1=1.11&r2=1.12 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/gst-libs/gst/tag/gstvorbistag.c.diff?r1=1.2&r2=1.3 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/gst/audioconvert/gstaudioconvert.c.diff?r1=1.69&r2=1.70 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/gst/playback/gstdecodebin.c.diff?r1=1.30&r2=1.31 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/gst/playback/gstplaybasebin.c.diff?r1=1.67&r2=1.68 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/gst/playback/gstplaybin.c.diff?r1=1.40&r2=1.41 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/gst/volume/gstvolume.c.diff?r1=1.46&r2=1.47 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/sys/ximage/ximagesink.c.diff?r1=1.117&r2=1.118 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/sys/ximage/ximagesink.h.diff?r1=1.30&r2=1.31 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-base/ChangeLog,v retrieving revision 1.1695 retrieving revision 1.1696 diff -u -d -r1.1695 -r1.1696 --- ChangeLog 12 May 2005 17:05:15 -0000 1.1695 +++ ChangeLog 16 May 2005 15:35:48 -0000 1.1696 @@ -1,3 +1,37 @@ +2005-05-16 David Schleef <ds...@sc...> + + 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 <rb...@ro...> * gst/playback/gstplaybasebin.c: (gst_play_base_bin_class_init), Index: gstoggdemux.c RCS file: /cvs/gstreamer/gst-plugins-base/ext/ogg/gstoggdemux.c,v retrieving revision 1.75 retrieving revision 1.76 diff -u -d -r1.75 -r1.76 --- gstoggdemux.c 12 May 2005 11:28:40 -0000 1.75 +++ gstoggdemux.c 16 May 2005 15:35:49 -0000 1.76 @@ -274,7 +274,7 @@ 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; Index: gstoggmux.c RCS file: /cvs/gstreamer/gst-plugins-base/ext/ogg/gstoggmux.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- gstoggmux.c 9 May 2005 10:56:12 -0000 1.25 +++ gstoggmux.c 16 May 2005 15:35:49 -0000 1.26 @@ -485,7 +485,7 @@ 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; } @@ -577,7 +577,7 @@ 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 */ @@ -682,7 +682,7 @@ 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); @@ -959,7 +959,7 @@ /* 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 */ Index: gstogmparse.c RCS file: /cvs/gstreamer/gst-plugins-base/ext/ogg/gstogmparse.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- gstogmparse.c 9 May 2005 10:56:12 -0000 1.8 +++ gstogmparse.c 16 May 2005 15:35:49 -0000 1.9 @@ -667,7 +667,7 @@ 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; Index: theoradec.c RCS file: /cvs/gstreamer/gst-plugins-base/ext/theora/theoradec.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- theoradec.c 9 May 2005 10:56:13 -0000 1.35 +++ theoradec.c 16 May 2005 15:35:49 -0000 1.36 @@ -634,7 +634,6 @@ 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, @@ -825,11 +824,11 @@ * 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; Index: theoraenc.c RCS file: /cvs/gstreamer/gst-plugins-base/ext/theora/theoraenc.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- theoraenc.c 9 May 2005 07:03:12 -0000 1.23 +++ theoraenc.c 16 May 2005 15:35:49 -0000 1.24 @@ -377,9 +377,9 @@ /* 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++; @@ -425,9 +425,9 @@ 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); @@ -546,15 +546,15 @@ /* 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; @@ -579,11 +579,11 @@ 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; Index: vorbisdec.c RCS file: /cvs/gstreamer/gst-plugins-base/ext/vorbis/vorbisdec.c,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- vorbisdec.c 11 May 2005 03:20:15 -0000 1.60 +++ vorbisdec.c 16 May 2005 15:35:50 -0000 1.61 @@ -429,7 +429,7 @@ 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); @@ -450,7 +450,6 @@ gst_tag_list_from_vorbiscomment_buffer (buf, (guint8 *) "\003vorbis", 7, Index: vorbisenc.c RCS file: /cvs/gstreamer/gst-plugins-base/ext/vorbis/vorbisenc.c,v retrieving revision 1.69 retrieving revision 1.70 diff -u -d -r1.69 -r1.70 --- vorbisenc.c 9 May 2005 17:07:27 -0000 1.69 +++ vorbisenc.c 16 May 2005 15:35:50 -0000 1.70 @@ -795,9 +795,9 @@ Index: vorbisparse.c RCS file: /cvs/gstreamer/gst-plugins-base/ext/vorbis/vorbisparse.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- vorbisparse.c 31 Mar 2005 09:43:44 -0000 1.3 +++ vorbisparse.c 16 May 2005 15:35:50 -0000 1.4 @@ -121,9 +121,9 @@ Index: gstaudiofilter.c RCS file: /cvs/gstreamer/gst-plugins-base/gst-libs/gst/audio/gstaudiofilter.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- gstaudiofilter.c 31 Mar 2005 09:43:47 -0000 1.11 +++ gstaudiofilter.c 16 May 2005 15:35:50 -0000 1.12 @@ -222,7 +222,7 @@ 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; Index: gstvorbistag.c RCS file: /cvs/gstreamer/gst-plugins-base/gst-libs/gst/tag/gstvorbistag.c,v retrieving revision 1.2 diff -u -d -r1.2 -r1.3 --- gstvorbistag.c 5 May 2005 14:57:20 -0000 1.2 +++ gstvorbistag.c 16 May 2005 15:35:50 -0000 1.3 @@ -618,7 +618,7 @@ 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")); @@ -640,7 +640,7 @@ if (tag->output == OUTPUT_DATA) { gst_pad_push (tag->srcpad, out); - gst_data_unref (GST_DATA (out)); + gst_buffer_unref (out); return GST_FLOW_OK; Index: gstaudioconvert.c RCS file: /cvs/gstreamer/gst-plugins-base/gst/audioconvert/gstaudioconvert.c,v --- gstaudioconvert.c 9 May 2005 17:07:27 -0000 1.69 +++ gstaudioconvert.c 16 May 2005 15:35:51 -0000 1.70 @@ -647,21 +647,20 @@ 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; 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; Index: gstdecodebin.c RCS file: /cvs/gstreamer/gst-plugins-base/gst/playback/gstdecodebin.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- gstdecodebin.c 12 May 2005 16:16:14 -0000 1.30 +++ gstdecodebin.c 16 May 2005 15:35:51 -0000 1.31 @@ -205,8 +205,8 @@ 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); Index: gstplaybasebin.c RCS file: /cvs/gstreamer/gst-plugins-base/gst/playback/gstplaybasebin.c,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- gstplaybasebin.c 12 May 2005 17:05:15 -0000 1.67 +++ gstplaybasebin.c 16 May 2005 15:35:51 -0000 1.68 @@ -69,7 +69,7 @@ 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); @@ -446,7 +446,7 @@ 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"); @@ -758,7 +758,7 @@ -probe_triggered (GstProbe * probe, GstData ** data, gpointer user_data) +probe_triggered (GstProbe * probe, GstMiniObject ** data, gpointer user_data) GstPlayBaseGroup *group; GstPlayBaseBin *play_base_bin; @@ -869,7 +869,7 @@ /* Mute stream on first data - for header-is-in-stream-stuff * (vorbis, ogmtext). */ -mute_stream (GstProbe * probe, GstData ** d, gpointer data) +mute_stream (GstProbe * probe, GstMiniObject ** d, gpointer data) GstStreamInfo *info = GST_STREAM_INFO (data); @@ -885,7 +885,7 @@ /* Eat data. */ -silence_stream (GstProbe * probe, GstData ** d, gpointer data) +silence_stream (GstProbe * probe, GstMiniObject ** d, gpointer data) /* no data */ return FALSE; Index: gstplaybin.c RCS file: /cvs/gstreamer/gst-plugins-base/gst/playback/gstplaybin.c,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- gstplaybin.c 12 May 2005 16:16:14 -0000 1.40 +++ gstplaybin.c 16 May 2005 15:35:51 -0000 1.41 @@ -174,7 +174,7 @@ 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, Index: gstvolume.c RCS file: /cvs/gstreamer/gst-plugins-base/gst/volume/gstvolume.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- gstvolume.c 9 May 2005 21:37:17 -0000 1.46 +++ gstvolume.c 16 May 2005 15:35:51 -0000 1.47 @@ -346,7 +346,7 @@ } - *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)); Index: ximagesink.c RCS file: /cvs/gstreamer/gst-plugins-base/sys/ximage/ximagesink.c,v retrieving revision 1.117 retrieving revision 1.118 diff -u -d -r1.117 -r1.118 --- ximagesink.c 9 May 2005 10:56:13 -0000 1.117 +++ ximagesink.c 16 May 2005 15:35:52 -0000 1.118 @@ -45,9 +45,9 @@ #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); @@ -88,6 +88,96 @@ /* */ /* ============================================================= */ +/* 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) { + XSync (ximagesink->xcontext->disp, FALSE); + g_mutex_unlock (ximagesink->x_lock); +} +gst_ximage_buffer_init (GTypeInstance * instance, gpointer g_class) +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, + gst_ximage_buffer_class_init, + 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 @@ -109,13 +199,13 @@ #ifndef HAVE_XSHM #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 */ @@ -170,25 +260,25 @@ 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) gboolean succeeded = FALSE; g_return_val_if_fail (GST_IS_XIMAGESINK (ximagesink), NULL); GST_DEBUG_OBJECT (ximagesink, "creating %dx%d", width, height); ximage->width = width; ximage->height = height; @@ -263,16 +353,17 @@ 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)); @@ -310,9 +401,9 @@ g_free (ximage); -/* This function puts a GstXImage on a GstXImageSink's window */ +/* This function puts a GstXImageBuffer on a GstXImageSink's window */ -gst_ximagesink_ximage_put (GstXImageSink * ximagesink, GstXImage * ximage) +gst_ximagesink_ximage_put (GstXImageSink * ximagesink, GstXImageBuffer * ximage) gint x, y; gint w, h; @@ -887,7 +978,7 @@ 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); @@ -1133,9 +1224,9 @@ /* 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 we have to copy the data into our private image, */ /* if we have one... */ @@ -1171,11 +1262,12 @@ /* Buffer management */ +#if 0 gst_ximagesink_buffer_free (GstBuffer * buffer) GstXImageSink *ximagesink; - GstXImage *ximage; + GstXImageBuffer *ximage; ximage = GST_BUFFER_PRIVATE (buffer); @@ -1193,14 +1285,14 @@ g_mutex_unlock (ximagesink->pool_lock); +#endif static GstBuffer * gst_ximagesink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size, GstCaps * caps) - GstBuffer *buffer; gboolean not_found = TRUE; ximagesink = GST_XIMAGESINK (bsink); @@ -1246,18 +1338,7 @@ 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 */ Index: ximagesink.h RCS file: /cvs/gstreamer/gst-plugins-base/sys/ximage/ximagesink.h,v --- ximagesink.h 15 Feb 2005 14:12:11 -0000 1.30 +++ ximagesink.h 16 May 2005 15:35:52 -0000 1.31 @@ -53,7 +53,9 @@ 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; @@ -93,7 +95,9 @@ }; /* XImage stuff */ -struct _GstXImage { +struct _GstXImageBuffer { + GstBuffer buffer; /* Reference to the ximagesink we belong to */ @@ -114,8 +118,8 @@ GstXContext *xcontext; GstXWindow *xwindow; - GstXImage *cur_image; + GstXImageBuffer *cur_image; gdouble framerate; GMutex *x_lock; |