From b10117db35c2f3813a344e312711308d8e33feb5 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Fri, 11 Feb 2005 16:39:14 +0000 Subject: [PATCH] remove buffer_join and keep buffer_merge but move to gstutils Original commit message from CVS: remove buffer_join and keep buffer_merge but move to gstutils --- ChangeLog | 12 +++++++ docs/gst/gstreamer-sections.txt | 1 - docs/gst/tmpl/gstbuffer.sgml | 10 ------ docs/gst/tmpl/gstevent.sgml | 2 -- docs/gst/tmpl/gstpipeline.sgml | 2 +- gst/gstbuffer.c | 55 --------------------------------- gst/gstbuffer.h | 4 +-- gst/gstutils.c | 6 ++-- gst/gstutils.h | 1 + 9 files changed, 17 insertions(+), 76 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2c3fc7c511..5af0c1de9a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2005-02-11 Thomas Vander Stichele + + * docs/gst/gstreamer-sections.txt: + * docs/gst/tmpl/gstbuffer.sgml: + * docs/gst/tmpl/gstevent.sgml: + * docs/gst/tmpl/gstpipeline.sgml: + * gst/gstbuffer.c: + * gst/gstbuffer.h: + * gst/gstutils.c: + * gst/gstutils.h: + remove buffer_join and keep buffer_merge but move to gstutils + 2005-02-11 Thomas Vander Stichele * docs/gst/gstreamer-sections.txt: diff --git a/docs/gst/gstreamer-sections.txt b/docs/gst/gstreamer-sections.txt index d9216034e6..3dca57b029 100644 --- a/docs/gst/gstreamer-sections.txt +++ b/docs/gst/gstreamer-sections.txt @@ -86,7 +86,6 @@ gst_buffer_copy gst_buffer_is_writable gst_buffer_copy_on_write gst_buffer_create_sub -gst_buffer_join gst_buffer_span gst_buffer_is_span_fast gst_buffer_default_free diff --git a/docs/gst/tmpl/gstbuffer.sgml b/docs/gst/tmpl/gstbuffer.sgml index ce5f638c01..6f12f4da89 100644 --- a/docs/gst/tmpl/gstbuffer.sgml +++ b/docs/gst/tmpl/gstbuffer.sgml @@ -301,16 +301,6 @@ If the refcount is 1, this function just returns the original buffer. @Returns: - - - - - -@buf1: -@buf2: -@Returns: - - diff --git a/docs/gst/tmpl/gstevent.sgml b/docs/gst/tmpl/gstevent.sgml index 6e6833c8c0..325b296256 100644 --- a/docs/gst/tmpl/gstevent.sgml +++ b/docs/gst/tmpl/gstevent.sgml @@ -48,8 +48,6 @@ The different major types of events. @GST_EVENT_DISCONTINUOUS: a discontinuous event to indicate the stream has a discontinuity. @GST_EVENT_QOS: a quality of service event @GST_EVENT_SEEK: a seek event. -@GST_EVENT_SEEK_SEGMENT: a segment seek with start and stop position -@GST_EVENT_SEGMENT_DONE: the event that will be emited when the segment seek has ended @GST_EVENT_SIZE: a size suggestion for a peer element @GST_EVENT_RATE: adjust the output rate of an element @GST_EVENT_NAVIGATION: diff --git a/docs/gst/tmpl/gstpipeline.sgml b/docs/gst/tmpl/gstpipeline.sgml index d28933a14e..14129ded1b 100644 --- a/docs/gst/tmpl/gstpipeline.sgml +++ b/docs/gst/tmpl/gstpipeline.sgml @@ -27,8 +27,8 @@ the pipeline, use gst_object_unref() to free its resources. @fixed_clock: -@start_time: @stream_time: +@delay: @eosed: diff --git a/gst/gstbuffer.c b/gst/gstbuffer.c index 5a7b5c2499..2a5fbd4279 100644 --- a/gst/gstbuffer.c +++ b/gst/gstbuffer.c @@ -387,61 +387,6 @@ gst_buffer_create_sub (GstBuffer * parent, guint offset, guint size) return buffer; } - -/** - * gst_buffer_merge: - * @buf1: a first source #GstBuffer to merge. - * @buf2: the second source #GstBuffer to merge. - * - * Create a new buffer that is the concatenation of the two source - * buffers. The original source buffers will not be modified or - * unref'd. - * - * If the buffers point to contiguous areas of memory, the buffer - * is created without copying the data. - * - * Returns: the new #GstBuffer that's the concatenation of the source buffers. - * - * MT safe. - */ -GstBuffer * -gst_buffer_merge (GstBuffer * buf1, GstBuffer * buf2) -{ - GstBuffer *result; - - /* we're just a specific case of the more general gst_buffer_span() */ - result = gst_buffer_span (buf1, 0, buf2, buf1->size + buf2->size); - - return result; -} - -/** - * gst_buffer_join: - * @buf1: a first source #GstBuffer to merge. - * @buf2: the second source #GstBuffer to merge. - * - * Create a new buffer that is the concatenation of the two source - * buffers. The original source buffers are dereferenced. - * - * If the buffers point to contiguous areas of memory, the buffer - * is created without copying the data. - * - * Returns: the new #GstBuffer that's the concatenation of the source buffers. - * - * MT safe. - */ - -GstBuffer * -gst_buffer_join (GstBuffer * buf1, GstBuffer * buf2) -{ - GstBuffer *result = gst_buffer_merge (buf1, buf2); - - gst_buffer_unref (buf1); - gst_buffer_unref (buf2); - - return result; -} - /** * gst_buffer_is_span_fast: * @buf1: a first source #GstBuffer. diff --git a/gst/gstbuffer.h b/gst/gstbuffer.h index c602451298..95d931dc3e 100644 --- a/gst/gstbuffer.h +++ b/gst/gstbuffer.h @@ -166,9 +166,7 @@ void gst_buffer_set_caps (GstBuffer *buffer, GstCaps *caps); /* creating a subbuffer */ GstBuffer* gst_buffer_create_sub (GstBuffer *parent, guint offset, guint size); -/* merge, span, or append two buffers, intelligently */ -GstBuffer* gst_buffer_merge (GstBuffer *buf1, GstBuffer *buf2); -GstBuffer* gst_buffer_join (GstBuffer *buf1, GstBuffer *buf2); +/* span, two buffers, intelligently */ gboolean gst_buffer_is_span_fast (GstBuffer *buf1, GstBuffer *buf2); GstBuffer* gst_buffer_span (GstBuffer *buf1, guint32 offset, GstBuffer *buf2, guint32 len); diff --git a/gst/gstutils.c b/gst/gstutils.c index e82a7c659b..bd67ffeb59 100644 --- a/gst/gstutils.c +++ b/gst/gstutils.c @@ -1606,10 +1606,8 @@ gst_element_class_install_std_props (GstElementClass * klass, * * Create a new buffer that is the concatenation of the two source * buffers. The original source buffers will not be modified or - * unref'd. - * - * WARNING: Incorrect use of this function can lead to memory leaks. - * It is recommended to use gst_buffer_join() instead of this function. + * unref'd. Make sure you unref the source buffers if they are not used + * anymore afterwards. * * If the buffers point to contiguous areas of memory, the buffer * is created without copying the data. diff --git a/gst/gstutils.h b/gst/gstutils.h index 6f71d63ded..bf995c3945 100644 --- a/gst/gstutils.h +++ b/gst/gstutils.h @@ -275,6 +275,7 @@ void gst_bin_remove_many (GstBin *bin, GstElement *eleme /* buffer functions */ GstBuffer * gst_buffer_merge (GstBuffer * buf1, GstBuffer * buf2); void gst_buffer_stamp (GstBuffer * dest, const GstBuffer * src); +void gst_buffer_stamp (GstBuffer * dest, const GstBuffer * src); G_END_DECLS