X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=libs%2Fgst%2Fbase%2Fgstbytewriter.c;h=705a35e48d15e9ad5e4931da00c91959b3020ba8;hb=5bf13cdd5314bc3c6c81bd620e712acdcab14eb2;hp=969b70514361291bca04ec5c6ed2f1d9e307b7d2;hpb=e10666a9d008d019cad1903f636e92b21163806d;p=platform%2Fupstream%2Fgstreamer.git diff --git a/libs/gst/base/gstbytewriter.c b/libs/gst/base/gstbytewriter.c index 969b705..705a35e 100644 --- a/libs/gst/base/gstbytewriter.c +++ b/libs/gst/base/gstbytewriter.c @@ -14,8 +14,8 @@ * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H @@ -27,6 +27,7 @@ /** * SECTION:gstbytewriter + * @title: GstByteWriter * @short_description: Writes different integer, string and floating point * types to a memory buffer and allows reading * @@ -39,15 +40,13 @@ */ /** - * gst_byte_writer_new: + * gst_byte_writer_new: (skip) * * Creates a new, empty #GstByteWriter instance * * Free-function: gst_byte_writer_free * * Returns: (transfer full): a new, empty #GstByteWriter instance - * - * Since: 0.10.26 */ GstByteWriter * gst_byte_writer_new (void) @@ -59,7 +58,7 @@ gst_byte_writer_new (void) } /** - * gst_byte_writer_new_with_size: + * gst_byte_writer_new_with_size: (skip) * @size: Initial size of data * @fixed: If %TRUE the data can't be reallocated * @@ -69,8 +68,6 @@ gst_byte_writer_new (void) * Free-function: gst_byte_writer_free * * Returns: (transfer full): a new #GstByteWriter instance - * - * Since: 0.10.26 */ GstByteWriter * gst_byte_writer_new_with_size (guint size, gboolean fixed) @@ -86,7 +83,7 @@ gst_byte_writer_new_with_size (guint size, gboolean fixed) } /** - * gst_byte_writer_new_with_data: + * gst_byte_writer_new_with_data: (skip) * @data: Memory area for writing * @size: Size of @data in bytes * @initialized: If %TRUE the complete data can be read from the beginning @@ -98,8 +95,6 @@ gst_byte_writer_new_with_size (guint size, gboolean fixed) * Free-function: gst_byte_writer_free * * Returns: (transfer full): a new #GstByteWriter instance - * - * Since: 0.10.26 */ GstByteWriter * gst_byte_writer_new_with_data (guint8 * data, guint size, gboolean initialized) @@ -120,8 +115,6 @@ gst_byte_writer_new_with_data (guint8 * data, guint size, gboolean initialized) * @writer: #GstByteWriter instance * * Initializes @writer to an empty instance - * - * Since: 0.10.26 */ void gst_byte_writer_init (GstByteWriter * writer) @@ -140,8 +133,6 @@ gst_byte_writer_init (GstByteWriter * writer) * @fixed: If %TRUE the data can't be reallocated * * Initializes @writer with the given initial data size. - * - * Since: 0.10.26 */ void gst_byte_writer_init_with_size (GstByteWriter * writer, guint size, @@ -160,16 +151,13 @@ gst_byte_writer_init_with_size (GstByteWriter * writer, guint size, /** * gst_byte_writer_init_with_data: * @writer: #GstByteWriter instance - * @data: (in callee-allocated) (array length=size) (transfer none): Memory - * area for writing + * @data: (array length=size) (transfer none): Memory area for writing * @size: Size of @data in bytes * @initialized: If %TRUE the complete data can be read from the beginning * * Initializes @writer with the given * memory area. If @initialized is %TRUE it is possible to * read @size bytes from the #GstByteWriter from the beginning. - * - * Since: 0.10.26 */ void gst_byte_writer_init_with_data (GstByteWriter * writer, guint8 * data, @@ -192,8 +180,6 @@ gst_byte_writer_init_with_data (GstByteWriter * writer, guint8 * data, * * Resets @writer and frees the data if it's * owned by @writer. - * - * Since: 0.10.26 */ void gst_byte_writer_reset (GstByteWriter * writer) @@ -213,9 +199,8 @@ gst_byte_writer_reset (GstByteWriter * writer) * * Free-function: g_free * - * Returns: (transfer full): the current data. g_free() after usage. - * - * Since: 0.10.26 + * Returns: (array) (transfer full): the current data. g_free() after + * usage. */ guint8 * gst_byte_writer_reset_and_get_data (GstByteWriter * writer) @@ -243,8 +228,6 @@ gst_byte_writer_reset_and_get_data (GstByteWriter * writer) * * Returns: (transfer full): the current data as buffer. gst_buffer_unref() * after usage. - * - * Since: 0.10.26 */ GstBuffer * gst_byte_writer_reset_and_get_buffer (GstByteWriter * writer) @@ -260,8 +243,8 @@ gst_byte_writer_reset_and_get_buffer (GstByteWriter * writer) buffer = gst_buffer_new (); if (data != NULL) { - gst_buffer_take_memory (buffer, -1, - gst_memory_new_wrapped (0, data, g_free, size, 0, size)); + gst_buffer_append_memory (buffer, + gst_memory_new_wrapped (0, data, size, 0, size, data, g_free)); } return buffer; @@ -272,8 +255,6 @@ gst_byte_writer_reset_and_get_buffer (GstByteWriter * writer) * @writer: (in) (transfer full): #GstByteWriter instance * * Frees @writer and all memory allocated by it. - * - * Since: 0.10.26 */ void gst_byte_writer_free (GstByteWriter * writer) @@ -294,8 +275,6 @@ gst_byte_writer_free (GstByteWriter * writer) * Free-function: g_free * * Returns: (transfer full): the current data. g_free() after usage. - * - * Since: 0.10.26 */ guint8 * gst_byte_writer_free_and_get_data (GstByteWriter * writer) @@ -321,8 +300,6 @@ gst_byte_writer_free_and_get_data (GstByteWriter * writer) * * Returns: (transfer full): the current data as buffer. gst_buffer_unref() * after usage. - * - * Since: 0.10.26 */ GstBuffer * gst_byte_writer_free_and_get_buffer (GstByteWriter * writer) @@ -345,8 +322,6 @@ gst_byte_writer_free_and_get_buffer (GstByteWriter * writer) * -1 is returned the remaining size is only limited by system resources. * * Returns: the remaining size of data that can still be written - * - * Since: 0.10.26 */ guint gst_byte_writer_get_remaining (const GstByteWriter * writer) @@ -368,8 +343,6 @@ gst_byte_writer_get_remaining (const GstByteWriter * writer) * available and reallocates if necessary. * * Returns: %TRUE if at least @size bytes are still available - * - * Since: 0.10.26 */ gboolean gst_byte_writer_ensure_free_space (GstByteWriter * writer, guint size) @@ -458,8 +431,6 @@ CREATE_WRITE_STRING_FUNC (32, guint32); * Writes a unsigned 8 bit integer to @writer. * * Returns: %TRUE if the value could be written - * - * Since: 0.10.26 */ /** * gst_byte_writer_put_uint16_be: @@ -469,8 +440,6 @@ CREATE_WRITE_STRING_FUNC (32, guint32); * Writes a unsigned big endian 16 bit integer to @writer. * * Returns: %TRUE if the value could be written - * - * Since: 0.10.26 */ /** * gst_byte_writer_put_uint24_be: @@ -480,8 +449,6 @@ CREATE_WRITE_STRING_FUNC (32, guint32); * Writes a unsigned big endian 24 bit integer to @writer. * * Returns: %TRUE if the value could be written - * - * Since: 0.10.26 */ /** * gst_byte_writer_put_uint32_be: @@ -491,8 +458,6 @@ CREATE_WRITE_STRING_FUNC (32, guint32); * Writes a unsigned big endian 32 bit integer to @writer. * * Returns: %TRUE if the value could be written - * - * Since: 0.10.26 */ /** * gst_byte_writer_put_uint64_be: @@ -502,8 +467,6 @@ CREATE_WRITE_STRING_FUNC (32, guint32); * Writes a unsigned big endian 64 bit integer to @writer. * * Returns: %TRUE if the value could be written - * - * Since: 0.10.26 */ /** * gst_byte_writer_put_uint16_le: @@ -513,8 +476,6 @@ CREATE_WRITE_STRING_FUNC (32, guint32); * Writes a unsigned little endian 16 bit integer to @writer. * * Returns: %TRUE if the value could be written - * - * Since: 0.10.26 */ /** * gst_byte_writer_put_uint24_le: @@ -524,8 +485,6 @@ CREATE_WRITE_STRING_FUNC (32, guint32); * Writes a unsigned little endian 24 bit integer to @writer. * * Returns: %TRUE if the value could be written - * - * Since: 0.10.26 */ /** * gst_byte_writer_put_uint32_le: @@ -535,8 +494,6 @@ CREATE_WRITE_STRING_FUNC (32, guint32); * Writes a unsigned little endian 32 bit integer to @writer. * * Returns: %TRUE if the value could be written - * - * Since: 0.10.26 */ /** * gst_byte_writer_put_uint64_le: @@ -546,8 +503,6 @@ CREATE_WRITE_STRING_FUNC (32, guint32); * Writes a unsigned little endian 64 bit integer to @writer. * * Returns: %TRUE if the value could be written - * - * Since: 0.10.26 */ /** * gst_byte_writer_put_int8: @@ -557,8 +512,6 @@ CREATE_WRITE_STRING_FUNC (32, guint32); * Writes a signed 8 bit integer to @writer. * * Returns: %TRUE if the value could be written - * - * Since: 0.10.26 */ /** * gst_byte_writer_put_int16_be: @@ -568,8 +521,6 @@ CREATE_WRITE_STRING_FUNC (32, guint32); * Writes a signed big endian 16 bit integer to @writer. * * Returns: %TRUE if the value could be written - * - * Since: 0.10.26 */ /** * gst_byte_writer_put_int24_be: @@ -579,8 +530,6 @@ CREATE_WRITE_STRING_FUNC (32, guint32); * Writes a signed big endian 24 bit integer to @writer. * * Returns: %TRUE if the value could be written - * - * Since: 0.10.26 */ /** * gst_byte_writer_put_int32_be: @@ -590,8 +539,6 @@ CREATE_WRITE_STRING_FUNC (32, guint32); * Writes a signed big endian 32 bit integer to @writer. * * Returns: %TRUE if the value could be written - * - * Since: 0.10.26 */ /** * gst_byte_writer_put_int64_be: @@ -601,8 +548,6 @@ CREATE_WRITE_STRING_FUNC (32, guint32); * Writes a signed big endian 64 bit integer to @writer. * * Returns: %TRUE if the value could be written - * - * Since: 0.10.26 */ /** * gst_byte_writer_put_int16_le: @@ -612,8 +557,6 @@ CREATE_WRITE_STRING_FUNC (32, guint32); * Writes a signed little endian 16 bit integer to @writer. * * Returns: %TRUE if the value could be written - * - * Since: 0.10.26 */ /** * gst_byte_writer_put_int24_le: @@ -623,8 +566,6 @@ CREATE_WRITE_STRING_FUNC (32, guint32); * Writes a signed little endian 24 bit integer to @writer. * * Returns: %TRUE if the value could be written - * - * Since: 0.10.26 */ /** * gst_byte_writer_put_int32_le: @@ -634,8 +575,6 @@ CREATE_WRITE_STRING_FUNC (32, guint32); * Writes a signed little endian 32 bit integer to @writer. * * Returns: %TRUE if the value could be written - * - * Since: 0.10.26 */ /** * gst_byte_writer_put_int64_le: @@ -645,8 +584,6 @@ CREATE_WRITE_STRING_FUNC (32, guint32); * Writes a signed little endian 64 bit integer to @writer. * * Returns: %TRUE if the value could be written - * - * Since: 0.10.26 */ /** * gst_byte_writer_put_float32_be: @@ -656,8 +593,6 @@ CREATE_WRITE_STRING_FUNC (32, guint32); * Writes a big endian 32 bit float to @writer. * * Returns: %TRUE if the value could be written - * - * Since: 0.10.27 */ /** * gst_byte_writer_put_float64_be: @@ -667,8 +602,6 @@ CREATE_WRITE_STRING_FUNC (32, guint32); * Writes a big endian 64 bit float to @writer. * * Returns: %TRUE if the value could be written - * - * Since: 0.10.27 */ /** * gst_byte_writer_put_float32_le: @@ -678,8 +611,6 @@ CREATE_WRITE_STRING_FUNC (32, guint32); * Writes a little endian 32 bit float to @writer. * * Returns: %TRUE if the value could be written - * - * Since: 0.10.27 */ /** * gst_byte_writer_put_float64_le: @@ -689,20 +620,15 @@ CREATE_WRITE_STRING_FUNC (32, guint32); * Writes a little endian 64 bit float to @writer. * * Returns: %TRUE if the value could be written - * - * Since: 0.10.27 */ /** * gst_byte_writer_put_string_utf8: * @writer: #GstByteWriter instance - * @data: (transfer none) (array zero-terminated=1) (type utf8): UTF8 string to - * write + * @data: (transfer none): UTF8 string to write * * Writes a NUL-terminated UTF8 string to @writer (including the terminator). * * Returns: %TRUE if the value could be written - * - * Since: 0.10.26 */ /** * gst_byte_writer_put_string_utf16: @@ -712,8 +638,6 @@ CREATE_WRITE_STRING_FUNC (32, guint32); * Writes a NUL-terminated UTF16 string to @writer (including the terminator). * * Returns: %TRUE if the value could be written - * - * Since: 0.10.26 */ /** * gst_byte_writer_put_string_utf32: @@ -723,8 +647,6 @@ CREATE_WRITE_STRING_FUNC (32, guint32); * Writes a NUL-terminated UTF32 string to @writer (including the terminator). * * Returns: %TRUE if the value could be written - * - * Since: 0.10.26 */ /** * gst_byte_writer_put_data: @@ -735,18 +657,27 @@ CREATE_WRITE_STRING_FUNC (32, guint32); * Writes @size bytes of @data to @writer. * * Returns: %TRUE if the value could be written - * - * Since: 0.10.26 */ /** * gst_byte_writer_fill: * @writer: #GstByteWriter instance - * @value: Value to be writen - * @size: Number of bytes to be writen + * @value: Value to be written + * @size: Number of bytes to be written * * Writes @size bytes containing @value to @writer. * * Returns: %TRUE if the value could be written + */ + +/** + * gst_byte_writer_put_buffer: + * @writer: #GstByteWriter instance + * @buffer: (transfer none): source #GstBuffer + * @offset: offset to copy from + * @size: total size to copy. If -1, all data is copied + * + * Writes @size bytes of @data to @writer. + * + * Returns: %TRUE if the data could be written * - * Since: 0.10.27 */