gst/gstbuffer.*: Re-add gst_buffer_join ().

Original commit message from CVS:
* gst/gstbuffer.c: (gst_buffer_join):
* gst/gstbuffer.h:
Re-add gst_buffer_join ().
* gst/gsterror.c: (_gst_stream_errors_init):
* gst/gsterror.h:
Add 'invalid data' as an extra stream error.
This commit is contained in:
Ronald S. Bultje 2005-02-05 16:24:12 +00:00
parent 743c2402f4
commit b5f2f92846
5 changed files with 40 additions and 0 deletions

View file

@ -1,3 +1,12 @@
2005-02-05 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/gstbuffer.c: (gst_buffer_join):
* gst/gstbuffer.h:
Re-add gst_buffer_join ().
* gst/gsterror.c: (_gst_stream_errors_init):
* gst/gsterror.h:
Add 'invalid data' as an extra stream error.
2005-02-03 Wim Taymans <wim@fluendo.com>
* gst/gstcaps.c: (gst_caps_intersect):

View file

@ -415,6 +415,33 @@ gst_buffer_merge (GstBuffer * buf1, GstBuffer * buf2)
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.

View file

@ -168,6 +168,7 @@ 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);
gboolean gst_buffer_is_span_fast (GstBuffer *buf1, GstBuffer *buf2);
GstBuffer* gst_buffer_span (GstBuffer *buf1, guint32 offset, GstBuffer *buf2, guint32 len);

View file

@ -151,6 +151,8 @@ _gst_stream_errors_init (void)
TABLE (t, STREAM, TYPE_NOT_FOUND, N_("Could not determine type of stream."));
TABLE (t, STREAM, WRONG_TYPE,
N_("The stream is of a different type than handled by this element."));
TABLE (t, STREAM, INVALID_DATA,
N_("The stream contained invalid data and cannot be processed."));
TABLE (t, STREAM, CODEC_NOT_FOUND,
N_("There is no codec present that can handle the stream's type."));
TABLE (t, STREAM, DECODE, N_("Could not decode stream."));

View file

@ -102,6 +102,7 @@ typedef enum
GST_STREAM_ERROR_NOT_IMPLEMENTED,
GST_STREAM_ERROR_TYPE_NOT_FOUND,
GST_STREAM_ERROR_WRONG_TYPE,
GST_STREAM_ERROR_INVALID_DATA,
GST_STREAM_ERROR_CODEC_NOT_FOUND,
GST_STREAM_ERROR_DECODE,
GST_STREAM_ERROR_ENCODE,