2000-12-28 22:12:02 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
|
|
|
|
* 2000 Wim Taymans <wtay@chello.be>
|
2006-02-02 09:51:18 +00:00
|
|
|
* 2002 Thomas Vander Stichele <thomas@apestaart.org>
|
2000-12-28 22:12:02 +00:00
|
|
|
*
|
|
|
|
* gstutils.h: Header for various utility functions
|
2000-01-30 09:03:00 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
2012-11-03 20:44:48 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2000-01-30 09:03:00 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __GST_UTILS_H__
|
|
|
|
#define __GST_UTILS_H__
|
|
|
|
|
2001-06-25 01:20:11 +00:00
|
|
|
#include <glib.h>
|
2012-06-06 17:02:00 +00:00
|
|
|
#include <gst/gstconfig.h>
|
2005-03-07 18:27:42 +00:00
|
|
|
#include <gst/gstbin.h>
|
API: gst_parse_launch_full()
Original commit message from CVS:
* docs/gst/gstreamer-sections.txt:
* gst/gst.c: (init_post):
* gst/gst_private.h: (_GstParseContext):
* gst/gstparse.c: (gst_parse_error_quark), (gst_parse_context_new),
(gst_parse_context_free), (gst_parse_context_get_missing_elements),
(gst_parse_launchv), (gst_parse_launchv_full), (gst_parse_launch),
(gst_parse_launch_full):
* gst/gstparse.h: (GST_PARSE_FLAG_NONE), (GST_PARSE_FLAG_FATAL_ERRORS),
(GstParseFlags), (GstParseContext):
* gst/gstutils.c: (gst_parse_bin_from_description),
(gst_parse_bin_from_description_full):
* gst/gstutils.h:
* gst/parse/grammar.y:
* gst/parse/types.h:
* win32/common/libgstreamer.def:
Add new gst_parse_*_full API (#528178):
API: gst_parse_launch_full()
API: gst_parse_launchv_full()
API: gst_parse_bin_from_description_full()
API: gst_parse_context_new()
API: gst_parse_context_free()
API: gst_parse_context_get_missing_elements()
2008-05-24 15:33:53 +00:00
|
|
|
#include <gst/gstparse.h>
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2002-07-08 19:07:30 +00:00
|
|
|
G_BEGIN_DECLS
|
2001-02-25 03:42:51 +00:00
|
|
|
|
2011-11-11 15:52:41 +00:00
|
|
|
void gst_util_set_value_from_string (GValue *value, const gchar *value_str);
|
|
|
|
void gst_util_set_object_arg (GObject *object, const gchar *name, const gchar *value);
|
|
|
|
void gst_util_dump_mem (const guchar *mem, guint size);
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2010-04-02 00:16:16 +00:00
|
|
|
guint64 gst_util_gdouble_to_guint64 (gdouble value) G_GNUC_CONST;
|
|
|
|
gdouble gst_util_guint64_to_gdouble (guint64 value) G_GNUC_CONST;
|
2005-12-04 09:57:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_guint64_to_gdouble:
|
|
|
|
* @value: the #guint64 value to convert
|
|
|
|
*
|
|
|
|
* Convert @value to a gdouble.
|
|
|
|
*
|
|
|
|
* Returns: @value converted to a #gdouble.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_gdouble_to_guint64:
|
|
|
|
* @value: the #gdouble value to convert
|
|
|
|
*
|
|
|
|
* Convert @value to a guint64.
|
|
|
|
*
|
|
|
|
* Returns: @value converted to a #guint64.
|
|
|
|
*/
|
2005-10-10 18:16:37 +00:00
|
|
|
#ifdef WIN32
|
2005-12-05 13:06:37 +00:00
|
|
|
#define gst_gdouble_to_guint64(value) gst_util_gdouble_to_guint64(value)
|
|
|
|
#define gst_guint64_to_gdouble(value) gst_util_guint64_to_gdouble(value)
|
2005-10-10 18:16:37 +00:00
|
|
|
#else
|
2005-12-04 09:57:11 +00:00
|
|
|
#define gst_gdouble_to_guint64(value) ((guint64) (value))
|
|
|
|
#define gst_guint64_to_gdouble(value) ((gdouble) (value))
|
2005-10-10 18:16:37 +00:00
|
|
|
#endif
|
|
|
|
|
2011-11-11 15:52:41 +00:00
|
|
|
guint64 gst_util_uint64_scale (guint64 val, guint64 num, guint64 denom);
|
|
|
|
guint64 gst_util_uint64_scale_round (guint64 val, guint64 num, guint64 denom);
|
|
|
|
guint64 gst_util_uint64_scale_ceil (guint64 val, guint64 num, guint64 denom);
|
2005-08-29 16:10:36 +00:00
|
|
|
|
2010-06-28 08:20:39 +00:00
|
|
|
guint64 gst_util_uint64_scale_int (guint64 val, gint num, gint denom);
|
|
|
|
guint64 gst_util_uint64_scale_int_round (guint64 val, gint num, gint denom);
|
|
|
|
guint64 gst_util_uint64_scale_int_ceil (guint64 val, gint num, gint denom);
|
2005-11-22 15:15:53 +00:00
|
|
|
|
2008-11-04 12:22:53 +00:00
|
|
|
guint32 gst_util_seqnum_next (void);
|
|
|
|
gint32 gst_util_seqnum_compare (guint32 s1, guint32 s2);
|
|
|
|
|
2013-07-22 09:41:35 +00:00
|
|
|
guint gst_util_group_id_next (void);
|
2004-01-08 04:10:18 +00:00
|
|
|
|
2005-11-04 20:12:01 +00:00
|
|
|
/**
|
|
|
|
* GST_CALL_PARENT:
|
|
|
|
* @parent_class_cast: the name of the class cast macro for the parent type
|
|
|
|
* @name: name of the function to call
|
|
|
|
* @args: arguments enclosed in '( )'
|
|
|
|
*
|
|
|
|
* Just call the parent handler. This assumes that there is a variable
|
2004-01-08 04:10:18 +00:00
|
|
|
* named parent_class that points to the (duh!) parent class. Note that
|
|
|
|
* this macro is not to be used with things that return something, use
|
2005-11-04 20:12:01 +00:00
|
|
|
* the _WITH_DEFAULT version for that
|
|
|
|
*/
|
2011-11-11 15:52:41 +00:00
|
|
|
#define GST_CALL_PARENT(parent_class_cast, name, args) \
|
|
|
|
((parent_class_cast(parent_class)->name != NULL) ? \
|
|
|
|
parent_class_cast(parent_class)->name args : (void) 0)
|
2004-01-08 04:10:18 +00:00
|
|
|
|
2005-11-04 20:12:01 +00:00
|
|
|
/**
|
|
|
|
* GST_CALL_PARENT_WITH_DEFAULT:
|
|
|
|
* @parent_class_cast: the name of the class cast macro for the parent type
|
|
|
|
* @name: name of the function to call
|
|
|
|
* @args: arguments enclosed in '( )'
|
|
|
|
* @def_return: default result
|
|
|
|
*
|
|
|
|
* Same as GST_CALL_PARENT(), but in case there is no implementation, it
|
|
|
|
* evaluates to @def_return.
|
|
|
|
*/
|
|
|
|
#define GST_CALL_PARENT_WITH_DEFAULT(parent_class_cast, name, args, def_return)\
|
2011-11-11 15:52:41 +00:00
|
|
|
((parent_class_cast(parent_class)->name != NULL) ? \
|
|
|
|
parent_class_cast(parent_class)->name args : def_return)
|
2004-01-08 04:10:18 +00:00
|
|
|
|
2008-10-07 12:00:49 +00:00
|
|
|
/* Define PUT and GET functions for unaligned memory */
|
|
|
|
#define _GST_GET(__data, __idx, __size, __shift) \
|
2010-09-01 23:01:25 +00:00
|
|
|
(((guint##__size) (((const guint8 *) (__data))[__idx])) << (__shift))
|
2004-04-20 00:17:26 +00:00
|
|
|
|
2008-10-07 12:00:49 +00:00
|
|
|
#define _GST_PUT(__data, __idx, __size, __shift, __num) \
|
2009-05-15 17:42:48 +00:00
|
|
|
(((guint8 *) (__data))[__idx] = (((guint##__size) (__num)) >> (__shift)) & 0xff)
|
2004-04-20 00:17:26 +00:00
|
|
|
|
2014-02-15 20:22:45 +00:00
|
|
|
#ifndef __GTK_DOC_IGNORE__
|
2012-06-06 17:02:00 +00:00
|
|
|
#if GST_HAVE_UNALIGNED_ACCESS
|
|
|
|
static inline guint16 __gst_fast_read16(const guint8 *v) {
|
2015-09-26 10:16:07 +00:00
|
|
|
return *(const guint16*)(const void*)(v);
|
2012-06-06 17:02:00 +00:00
|
|
|
}
|
|
|
|
static inline guint32 __gst_fast_read32(const guint8 *v) {
|
2015-09-26 10:16:07 +00:00
|
|
|
return *(const guint32*)(const void*)(v);
|
2012-06-06 17:02:00 +00:00
|
|
|
}
|
|
|
|
static inline guint64 __gst_fast_read64(const guint8 *v) {
|
2015-09-26 10:16:07 +00:00
|
|
|
return *(const guint64*)(const void*)(v);
|
2012-06-06 17:02:00 +00:00
|
|
|
}
|
|
|
|
static inline guint16 __gst_fast_read_swap16(const guint8 *v) {
|
2015-09-26 10:16:07 +00:00
|
|
|
return GUINT16_SWAP_LE_BE(*(const guint16*)(const void*)(v));
|
2012-06-06 17:02:00 +00:00
|
|
|
}
|
|
|
|
static inline guint32 __gst_fast_read_swap32(const guint8 *v) {
|
2015-09-26 10:16:07 +00:00
|
|
|
return GUINT32_SWAP_LE_BE(*(const guint32*)(const void*)(v));
|
2012-06-06 17:02:00 +00:00
|
|
|
}
|
|
|
|
static inline guint64 __gst_fast_read_swap64(const guint8 *v) {
|
2015-09-26 10:16:07 +00:00
|
|
|
return GUINT64_SWAP_LE_BE(*(const guint64*)(const void*)(v));
|
2012-06-06 17:02:00 +00:00
|
|
|
}
|
|
|
|
# define _GST_FAST_READ(s, d) __gst_fast_read##s((const guint8 *)(d))
|
|
|
|
# define _GST_FAST_READ_SWAP(s, d) __gst_fast_read_swap##s((const guint8 *)(d))
|
|
|
|
#endif
|
2014-02-15 20:22:45 +00:00
|
|
|
#endif
|
2012-06-06 17:02:00 +00:00
|
|
|
|
|
|
|
|
2005-10-08 14:48:17 +00:00
|
|
|
/**
|
|
|
|
* GST_READ_UINT64_BE:
|
|
|
|
* @data: memory location
|
|
|
|
*
|
|
|
|
* Read a 64 bit unsigned integer value in big endian format from the memory buffer.
|
|
|
|
*/
|
2008-10-07 12:00:49 +00:00
|
|
|
|
2005-10-08 14:48:17 +00:00
|
|
|
/**
|
|
|
|
* GST_READ_UINT64_LE:
|
|
|
|
* @data: memory location
|
|
|
|
*
|
|
|
|
* Read a 64 bit unsigned integer value in little endian format from the memory buffer.
|
|
|
|
*/
|
2012-06-06 17:02:00 +00:00
|
|
|
#if GST_HAVE_UNALIGNED_ACCESS
|
|
|
|
# if (G_BYTE_ORDER == G_BIG_ENDIAN)
|
|
|
|
# define GST_READ_UINT64_BE(data) _GST_FAST_READ (64, data)
|
|
|
|
# define GST_READ_UINT64_LE(data) _GST_FAST_READ_SWAP (64, data)
|
|
|
|
# else
|
|
|
|
# define GST_READ_UINT64_BE(data) _GST_FAST_READ_SWAP (64, data)
|
|
|
|
# define GST_READ_UINT64_LE(data) _GST_FAST_READ (64, data)
|
|
|
|
# endif
|
|
|
|
#else
|
2013-03-12 13:53:57 +00:00
|
|
|
#define _GST_READ_UINT64_BE(data) (_GST_GET (data, 0, 64, 56) | \
|
2012-06-06 17:02:00 +00:00
|
|
|
_GST_GET (data, 1, 64, 48) | \
|
|
|
|
_GST_GET (data, 2, 64, 40) | \
|
|
|
|
_GST_GET (data, 3, 64, 32) | \
|
|
|
|
_GST_GET (data, 4, 64, 24) | \
|
|
|
|
_GST_GET (data, 5, 64, 16) | \
|
|
|
|
_GST_GET (data, 6, 64, 8) | \
|
|
|
|
_GST_GET (data, 7, 64, 0))
|
|
|
|
|
2013-03-12 13:53:57 +00:00
|
|
|
#define _GST_READ_UINT64_LE(data) (_GST_GET (data, 7, 64, 56) | \
|
2012-06-06 17:02:00 +00:00
|
|
|
_GST_GET (data, 6, 64, 48) | \
|
|
|
|
_GST_GET (data, 5, 64, 40) | \
|
|
|
|
_GST_GET (data, 4, 64, 32) | \
|
|
|
|
_GST_GET (data, 3, 64, 24) | \
|
|
|
|
_GST_GET (data, 2, 64, 16) | \
|
|
|
|
_GST_GET (data, 1, 64, 8) | \
|
|
|
|
_GST_GET (data, 0, 64, 0))
|
2013-03-12 13:53:57 +00:00
|
|
|
|
|
|
|
#define GST_READ_UINT64_BE(data) __gst_slow_read64_be((const guint8 *)(data))
|
|
|
|
static inline guint64 __gst_slow_read64_be (const guint8 * data) {
|
|
|
|
return _GST_READ_UINT64_BE (data);
|
|
|
|
}
|
|
|
|
#define GST_READ_UINT64_LE(data) __gst_slow_read64_le((const guint8 *)(data))
|
|
|
|
static inline guint64 __gst_slow_read64_le (const guint8 * data) {
|
|
|
|
return _GST_READ_UINT64_LE (data);
|
|
|
|
}
|
2012-06-06 17:02:00 +00:00
|
|
|
#endif
|
2008-10-07 12:00:49 +00:00
|
|
|
|
2005-10-08 14:48:17 +00:00
|
|
|
/**
|
|
|
|
* GST_READ_UINT32_BE:
|
|
|
|
* @data: memory location
|
|
|
|
*
|
|
|
|
* Read a 32 bit unsigned integer value in big endian format from the memory buffer.
|
|
|
|
*/
|
2008-10-07 12:00:49 +00:00
|
|
|
|
2005-10-08 14:48:17 +00:00
|
|
|
/**
|
|
|
|
* GST_READ_UINT32_LE:
|
|
|
|
* @data: memory location
|
|
|
|
*
|
|
|
|
* Read a 32 bit unsigned integer value in little endian format from the memory buffer.
|
|
|
|
*/
|
2012-06-06 17:02:00 +00:00
|
|
|
#if GST_HAVE_UNALIGNED_ACCESS
|
|
|
|
# if (G_BYTE_ORDER == G_BIG_ENDIAN)
|
|
|
|
# define GST_READ_UINT32_BE(data) _GST_FAST_READ (32, data)
|
|
|
|
# define GST_READ_UINT32_LE(data) _GST_FAST_READ_SWAP (32, data)
|
|
|
|
# else
|
|
|
|
# define GST_READ_UINT32_BE(data) _GST_FAST_READ_SWAP (32, data)
|
|
|
|
# define GST_READ_UINT32_LE(data) _GST_FAST_READ (32, data)
|
|
|
|
# endif
|
|
|
|
#else
|
2013-03-12 13:53:57 +00:00
|
|
|
#define _GST_READ_UINT32_BE(data) (_GST_GET (data, 0, 32, 24) | \
|
2012-06-06 17:02:00 +00:00
|
|
|
_GST_GET (data, 1, 32, 16) | \
|
|
|
|
_GST_GET (data, 2, 32, 8) | \
|
|
|
|
_GST_GET (data, 3, 32, 0))
|
|
|
|
|
2013-03-12 13:53:57 +00:00
|
|
|
#define _GST_READ_UINT32_LE(data) (_GST_GET (data, 3, 32, 24) | \
|
2012-06-06 17:02:00 +00:00
|
|
|
_GST_GET (data, 2, 32, 16) | \
|
|
|
|
_GST_GET (data, 1, 32, 8) | \
|
|
|
|
_GST_GET (data, 0, 32, 0))
|
2013-03-12 13:53:57 +00:00
|
|
|
|
|
|
|
#define GST_READ_UINT32_BE(data) __gst_slow_read32_be((const guint8 *)(data))
|
|
|
|
static inline guint32 __gst_slow_read32_be (const guint8 * data) {
|
|
|
|
return _GST_READ_UINT32_BE (data);
|
|
|
|
}
|
|
|
|
#define GST_READ_UINT32_LE(data) __gst_slow_read32_le((const guint8 *)(data))
|
|
|
|
static inline guint32 __gst_slow_read32_le (const guint8 * data) {
|
|
|
|
return _GST_READ_UINT32_LE (data);
|
|
|
|
}
|
2012-06-06 17:02:00 +00:00
|
|
|
#endif
|
2008-10-07 12:00:49 +00:00
|
|
|
|
2005-10-08 14:48:17 +00:00
|
|
|
/**
|
2008-10-07 12:00:49 +00:00
|
|
|
* GST_READ_UINT24_BE:
|
2005-10-08 14:48:17 +00:00
|
|
|
* @data: memory location
|
|
|
|
*
|
2008-10-07 12:00:49 +00:00
|
|
|
* Read a 24 bit unsigned integer value in big endian format from the memory buffer.
|
2005-10-08 14:48:17 +00:00
|
|
|
*/
|
2013-03-12 13:53:57 +00:00
|
|
|
#define _GST_READ_UINT24_BE(data) (_GST_GET (data, 0, 32, 16) | \
|
2011-11-11 15:52:41 +00:00
|
|
|
_GST_GET (data, 1, 32, 8) | \
|
|
|
|
_GST_GET (data, 2, 32, 0))
|
2004-04-20 00:17:26 +00:00
|
|
|
|
2013-03-12 13:53:57 +00:00
|
|
|
#define GST_READ_UINT24_BE(data) __gst_slow_read24_be((const guint8 *)(data))
|
|
|
|
static inline guint32 __gst_slow_read24_be (const guint8 * data) {
|
|
|
|
return _GST_READ_UINT24_BE (data);
|
|
|
|
}
|
|
|
|
|
2005-10-08 14:48:17 +00:00
|
|
|
/**
|
2008-10-07 12:00:49 +00:00
|
|
|
* GST_READ_UINT24_LE:
|
2005-10-08 14:48:17 +00:00
|
|
|
* @data: memory location
|
|
|
|
*
|
2008-10-07 12:00:49 +00:00
|
|
|
* Read a 24 bit unsigned integer value in little endian format from the memory buffer.
|
2005-10-08 14:48:17 +00:00
|
|
|
*/
|
2013-03-12 13:53:57 +00:00
|
|
|
#define _GST_READ_UINT24_LE(data) (_GST_GET (data, 2, 32, 16) | \
|
2011-11-11 15:52:41 +00:00
|
|
|
_GST_GET (data, 1, 32, 8) | \
|
|
|
|
_GST_GET (data, 0, 32, 0))
|
2008-10-07 12:00:49 +00:00
|
|
|
|
2013-03-12 13:53:57 +00:00
|
|
|
#define GST_READ_UINT24_LE(data) __gst_slow_read24_le((const guint8 *)(data))
|
|
|
|
static inline guint32 __gst_slow_read24_le (const guint8 * data) {
|
|
|
|
return _GST_READ_UINT24_LE (data);
|
|
|
|
}
|
|
|
|
|
2005-10-08 14:48:17 +00:00
|
|
|
/**
|
2008-10-07 12:00:49 +00:00
|
|
|
* GST_READ_UINT16_BE:
|
2005-10-08 14:48:17 +00:00
|
|
|
* @data: memory location
|
|
|
|
*
|
2008-10-07 12:00:49 +00:00
|
|
|
* Read a 16 bit unsigned integer value in big endian format from the memory buffer.
|
2005-10-08 14:48:17 +00:00
|
|
|
*/
|
|
|
|
/**
|
2008-10-07 12:00:49 +00:00
|
|
|
* GST_READ_UINT16_LE:
|
2005-10-08 14:48:17 +00:00
|
|
|
* @data: memory location
|
|
|
|
*
|
2008-10-07 12:00:49 +00:00
|
|
|
* Read a 16 bit unsigned integer value in little endian format from the memory buffer.
|
2005-10-08 14:48:17 +00:00
|
|
|
*/
|
2012-06-06 17:02:00 +00:00
|
|
|
#if GST_HAVE_UNALIGNED_ACCESS
|
|
|
|
# if (G_BYTE_ORDER == G_BIG_ENDIAN)
|
|
|
|
# define GST_READ_UINT16_BE(data) _GST_FAST_READ (16, data)
|
|
|
|
# define GST_READ_UINT16_LE(data) _GST_FAST_READ_SWAP (16, data)
|
|
|
|
# else
|
|
|
|
# define GST_READ_UINT16_BE(data) _GST_FAST_READ_SWAP (16, data)
|
|
|
|
# define GST_READ_UINT16_LE(data) _GST_FAST_READ (16, data)
|
|
|
|
# endif
|
|
|
|
#else
|
2013-03-12 13:53:57 +00:00
|
|
|
#define _GST_READ_UINT16_BE(data) (_GST_GET (data, 0, 16, 8) | \
|
2012-06-06 17:02:00 +00:00
|
|
|
_GST_GET (data, 1, 16, 0))
|
|
|
|
|
2013-03-12 13:53:57 +00:00
|
|
|
#define _GST_READ_UINT16_LE(data) (_GST_GET (data, 1, 16, 8) | \
|
2012-06-06 17:02:00 +00:00
|
|
|
_GST_GET (data, 0, 16, 0))
|
2013-03-12 13:53:57 +00:00
|
|
|
|
|
|
|
#define GST_READ_UINT16_BE(data) __gst_slow_read16_be((const guint8 *)(data))
|
|
|
|
static inline guint16 __gst_slow_read16_be (const guint8 * data) {
|
|
|
|
return _GST_READ_UINT16_BE (data);
|
|
|
|
}
|
|
|
|
#define GST_READ_UINT16_LE(data) __gst_slow_read16_le((const guint8 *)(data))
|
|
|
|
static inline guint16 __gst_slow_read16_le (const guint8 * data) {
|
|
|
|
return _GST_READ_UINT16_LE (data);
|
|
|
|
}
|
2012-06-06 17:02:00 +00:00
|
|
|
#endif
|
2008-10-07 12:00:49 +00:00
|
|
|
|
2005-10-08 14:48:17 +00:00
|
|
|
/**
|
2008-10-07 12:00:49 +00:00
|
|
|
* GST_READ_UINT8:
|
2005-10-08 14:48:17 +00:00
|
|
|
* @data: memory location
|
|
|
|
*
|
2008-10-07 12:00:49 +00:00
|
|
|
* Read an 8 bit unsigned integer value from the memory buffer.
|
2005-10-08 14:48:17 +00:00
|
|
|
*/
|
2011-11-11 15:52:41 +00:00
|
|
|
#define GST_READ_UINT8(data) (_GST_GET (data, 0, 8, 0))
|
2008-10-07 12:00:49 +00:00
|
|
|
|
2005-10-08 14:48:17 +00:00
|
|
|
/**
|
2008-10-07 12:00:49 +00:00
|
|
|
* GST_WRITE_UINT64_BE:
|
2005-10-08 14:48:17 +00:00
|
|
|
* @data: memory location
|
|
|
|
* @num: value to store
|
|
|
|
*
|
2008-10-07 12:00:49 +00:00
|
|
|
* Store a 64 bit unsigned integer value in big endian format into the memory buffer.
|
2005-10-08 14:48:17 +00:00
|
|
|
*/
|
2011-11-11 15:52:41 +00:00
|
|
|
#define GST_WRITE_UINT64_BE(data, num) do { \
|
2013-02-19 18:00:48 +00:00
|
|
|
gpointer __put_data = data; \
|
|
|
|
_GST_PUT (__put_data, 0, 64, 56, num); \
|
|
|
|
_GST_PUT (__put_data, 1, 64, 48, num); \
|
|
|
|
_GST_PUT (__put_data, 2, 64, 40, num); \
|
|
|
|
_GST_PUT (__put_data, 3, 64, 32, num); \
|
|
|
|
_GST_PUT (__put_data, 4, 64, 24, num); \
|
|
|
|
_GST_PUT (__put_data, 5, 64, 16, num); \
|
|
|
|
_GST_PUT (__put_data, 6, 64, 8, num); \
|
|
|
|
_GST_PUT (__put_data, 7, 64, 0, num); \
|
2011-11-11 15:52:41 +00:00
|
|
|
} while (0)
|
2004-04-20 00:17:26 +00:00
|
|
|
|
2008-10-07 12:00:49 +00:00
|
|
|
/**
|
|
|
|
* GST_WRITE_UINT64_LE:
|
|
|
|
* @data: memory location
|
|
|
|
* @num: value to store
|
|
|
|
*
|
|
|
|
* Store a 64 bit unsigned integer value in little endian format into the memory buffer.
|
|
|
|
*/
|
2011-11-11 15:52:41 +00:00
|
|
|
#define GST_WRITE_UINT64_LE(data, num) do { \
|
2013-02-19 18:00:48 +00:00
|
|
|
gpointer __put_data = data; \
|
|
|
|
_GST_PUT (__put_data, 0, 64, 0, num); \
|
|
|
|
_GST_PUT (__put_data, 1, 64, 8, num); \
|
|
|
|
_GST_PUT (__put_data, 2, 64, 16, num); \
|
|
|
|
_GST_PUT (__put_data, 3, 64, 24, num); \
|
|
|
|
_GST_PUT (__put_data, 4, 64, 32, num); \
|
|
|
|
_GST_PUT (__put_data, 5, 64, 40, num); \
|
|
|
|
_GST_PUT (__put_data, 6, 64, 48, num); \
|
|
|
|
_GST_PUT (__put_data, 7, 64, 56, num); \
|
2011-11-11 15:52:41 +00:00
|
|
|
} while (0)
|
2004-04-20 00:17:26 +00:00
|
|
|
|
2008-10-07 12:00:49 +00:00
|
|
|
/**
|
|
|
|
* GST_WRITE_UINT32_BE:
|
|
|
|
* @data: memory location
|
|
|
|
* @num: value to store
|
|
|
|
*
|
|
|
|
* Store a 32 bit unsigned integer value in big endian format into the memory buffer.
|
|
|
|
*/
|
2011-11-11 15:52:41 +00:00
|
|
|
#define GST_WRITE_UINT32_BE(data, num) do { \
|
2013-02-19 18:00:48 +00:00
|
|
|
gpointer __put_data = data; \
|
|
|
|
_GST_PUT (__put_data, 0, 32, 24, num); \
|
|
|
|
_GST_PUT (__put_data, 1, 32, 16, num); \
|
|
|
|
_GST_PUT (__put_data, 2, 32, 8, num); \
|
|
|
|
_GST_PUT (__put_data, 3, 32, 0, num); \
|
2011-11-11 15:52:41 +00:00
|
|
|
} while (0)
|
2004-04-20 00:17:26 +00:00
|
|
|
|
2008-10-07 12:00:49 +00:00
|
|
|
/**
|
|
|
|
* GST_WRITE_UINT32_LE:
|
|
|
|
* @data: memory location
|
|
|
|
* @num: value to store
|
|
|
|
*
|
|
|
|
* Store a 32 bit unsigned integer value in little endian format into the memory buffer.
|
|
|
|
*/
|
2011-11-11 15:52:41 +00:00
|
|
|
#define GST_WRITE_UINT32_LE(data, num) do { \
|
2013-02-19 18:00:48 +00:00
|
|
|
gpointer __put_data = data; \
|
|
|
|
_GST_PUT (__put_data, 0, 32, 0, num); \
|
|
|
|
_GST_PUT (__put_data, 1, 32, 8, num); \
|
|
|
|
_GST_PUT (__put_data, 2, 32, 16, num); \
|
|
|
|
_GST_PUT (__put_data, 3, 32, 24, num); \
|
2011-11-11 15:52:41 +00:00
|
|
|
} while (0)
|
2004-04-20 00:17:26 +00:00
|
|
|
|
2008-10-07 12:00:49 +00:00
|
|
|
/**
|
|
|
|
* GST_WRITE_UINT24_BE:
|
|
|
|
* @data: memory location
|
|
|
|
* @num: value to store
|
|
|
|
*
|
|
|
|
* Store a 24 bit unsigned integer value in big endian format into the memory buffer.
|
|
|
|
*/
|
2011-11-11 15:52:41 +00:00
|
|
|
#define GST_WRITE_UINT24_BE(data, num) do { \
|
2013-02-19 18:00:48 +00:00
|
|
|
gpointer __put_data = data; \
|
|
|
|
_GST_PUT (__put_data, 0, 32, 16, num); \
|
|
|
|
_GST_PUT (__put_data, 1, 32, 8, num); \
|
|
|
|
_GST_PUT (__put_data, 2, 32, 0, num); \
|
2011-11-11 15:52:41 +00:00
|
|
|
} while (0)
|
2008-10-07 12:00:49 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GST_WRITE_UINT24_LE:
|
|
|
|
* @data: memory location
|
|
|
|
* @num: value to store
|
|
|
|
*
|
|
|
|
* Store a 24 bit unsigned integer value in little endian format into the memory buffer.
|
|
|
|
*/
|
2011-11-11 15:52:41 +00:00
|
|
|
#define GST_WRITE_UINT24_LE(data, num) do { \
|
2013-02-19 18:00:48 +00:00
|
|
|
gpointer __put_data = data; \
|
|
|
|
_GST_PUT (__put_data, 0, 32, 0, num); \
|
|
|
|
_GST_PUT (__put_data, 1, 32, 8, num); \
|
|
|
|
_GST_PUT (__put_data, 2, 32, 16, num); \
|
2011-11-11 15:52:41 +00:00
|
|
|
} while (0)
|
2008-10-07 12:00:49 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GST_WRITE_UINT16_BE:
|
|
|
|
* @data: memory location
|
|
|
|
* @num: value to store
|
|
|
|
*
|
|
|
|
* Store a 16 bit unsigned integer value in big endian format into the memory buffer.
|
|
|
|
*/
|
2011-11-11 15:52:41 +00:00
|
|
|
#define GST_WRITE_UINT16_BE(data, num) do { \
|
2013-02-19 18:00:48 +00:00
|
|
|
gpointer __put_data = data; \
|
|
|
|
_GST_PUT (__put_data, 0, 16, 8, num); \
|
|
|
|
_GST_PUT (__put_data, 1, 16, 0, num); \
|
2011-11-11 15:52:41 +00:00
|
|
|
} while (0)
|
2004-04-20 00:17:26 +00:00
|
|
|
|
2008-10-07 12:00:49 +00:00
|
|
|
/**
|
|
|
|
* GST_WRITE_UINT16_LE:
|
|
|
|
* @data: memory location
|
|
|
|
* @num: value to store
|
|
|
|
*
|
|
|
|
* Store a 16 bit unsigned integer value in little endian format into the memory buffer.
|
|
|
|
*/
|
2011-11-11 15:52:41 +00:00
|
|
|
#define GST_WRITE_UINT16_LE(data, num) do { \
|
2013-02-19 18:00:48 +00:00
|
|
|
gpointer __put_data = data; \
|
|
|
|
_GST_PUT (__put_data, 0, 16, 0, num); \
|
|
|
|
_GST_PUT (__put_data, 1, 16, 8, num); \
|
2011-11-11 15:52:41 +00:00
|
|
|
} while (0)
|
2004-04-20 00:17:26 +00:00
|
|
|
|
2008-10-07 12:00:49 +00:00
|
|
|
/**
|
|
|
|
* GST_WRITE_UINT8:
|
|
|
|
* @data: memory location
|
|
|
|
* @num: value to store
|
|
|
|
*
|
|
|
|
* Store an 8 bit unsigned integer value into the memory buffer.
|
|
|
|
*/
|
2011-11-11 15:52:41 +00:00
|
|
|
#define GST_WRITE_UINT8(data, num) do { \
|
|
|
|
_GST_PUT (data, 0, 8, 0, num); \
|
|
|
|
} while (0)
|
2004-04-20 00:17:26 +00:00
|
|
|
|
2011-09-07 11:14:38 +00:00
|
|
|
/* Float endianness conversion macros */
|
2011-06-16 09:55:15 +00:00
|
|
|
|
|
|
|
/* FIXME: Remove this once we depend on a GLib version with this */
|
|
|
|
#ifndef GFLOAT_FROM_LE
|
|
|
|
/**
|
|
|
|
* GFLOAT_SWAP_LE_BE:
|
|
|
|
* @in: input value
|
|
|
|
*
|
|
|
|
* Swap byte order of a 32-bit floating point value (float).
|
|
|
|
*
|
|
|
|
* Returns: @in byte-swapped.
|
|
|
|
*/
|
|
|
|
#ifdef _FOOL_GTK_DOC_
|
|
|
|
G_INLINE_FUNC gfloat GFLOAT_SWAP_LE_BE (gfloat in);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
inline static gfloat
|
|
|
|
GFLOAT_SWAP_LE_BE(gfloat in)
|
|
|
|
{
|
|
|
|
union
|
|
|
|
{
|
|
|
|
guint32 i;
|
|
|
|
gfloat f;
|
|
|
|
} u;
|
|
|
|
|
|
|
|
u.f = in;
|
|
|
|
u.i = GUINT32_SWAP_LE_BE (u.i);
|
|
|
|
return u.f;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GDOUBLE_SWAP_LE_BE:
|
|
|
|
* @in: input value
|
|
|
|
*
|
|
|
|
* Swap byte order of a 64-bit floating point value (double).
|
|
|
|
*
|
|
|
|
* Returns: @in byte-swapped.
|
|
|
|
*/
|
|
|
|
#ifdef _FOOL_GTK_DOC_
|
|
|
|
G_INLINE_FUNC gdouble GDOUBLE_SWAP_LE_BE (gdouble in);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
inline static gdouble
|
|
|
|
GDOUBLE_SWAP_LE_BE(gdouble in)
|
|
|
|
{
|
|
|
|
union
|
|
|
|
{
|
|
|
|
guint64 i;
|
|
|
|
gdouble d;
|
|
|
|
} u;
|
|
|
|
|
|
|
|
u.d = in;
|
|
|
|
u.i = GUINT64_SWAP_LE_BE (u.i);
|
|
|
|
return u.d;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GDOUBLE_TO_LE:
|
|
|
|
* @val: value
|
|
|
|
*
|
|
|
|
* Convert 64-bit floating point value (double) from native byte order into
|
|
|
|
* little endian byte order.
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* GDOUBLE_TO_BE:
|
|
|
|
* @val: value
|
|
|
|
*
|
|
|
|
* Convert 64-bit floating point value (double) from native byte order into
|
|
|
|
* big endian byte order.
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* GDOUBLE_FROM_LE:
|
|
|
|
* @val: value
|
|
|
|
*
|
|
|
|
* Convert 64-bit floating point value (double) from little endian byte order
|
|
|
|
* into native byte order.
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* GDOUBLE_FROM_BE:
|
|
|
|
* @val: value
|
|
|
|
*
|
|
|
|
* Convert 64-bit floating point value (double) from big endian byte order
|
|
|
|
* into native byte order.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GFLOAT_TO_LE:
|
|
|
|
* @val: value
|
|
|
|
*
|
|
|
|
* Convert 32-bit floating point value (float) from native byte order into
|
|
|
|
* little endian byte order.
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* GFLOAT_TO_BE:
|
|
|
|
* @val: value
|
|
|
|
*
|
|
|
|
* Convert 32-bit floating point value (float) from native byte order into
|
|
|
|
* big endian byte order.
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* GFLOAT_FROM_LE:
|
|
|
|
* @val: value
|
|
|
|
*
|
|
|
|
* Convert 32-bit floating point value (float) from little endian byte order
|
|
|
|
* into native byte order.
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* GFLOAT_FROM_BE:
|
|
|
|
* @val: value
|
|
|
|
*
|
|
|
|
* Convert 32-bit floating point value (float) from big endian byte order
|
|
|
|
* into native byte order.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
|
|
|
#define GFLOAT_TO_LE(val) ((gfloat) (val))
|
|
|
|
#define GFLOAT_TO_BE(val) (GFLOAT_SWAP_LE_BE (val))
|
|
|
|
#define GDOUBLE_TO_LE(val) ((gdouble) (val))
|
|
|
|
#define GDOUBLE_TO_BE(val) (GDOUBLE_SWAP_LE_BE (val))
|
|
|
|
|
|
|
|
#elif G_BYTE_ORDER == G_BIG_ENDIAN
|
|
|
|
#define GFLOAT_TO_LE(val) (GFLOAT_SWAP_LE_BE (val))
|
|
|
|
#define GFLOAT_TO_BE(val) ((gfloat) (val))
|
|
|
|
#define GDOUBLE_TO_LE(val) (GDOUBLE_SWAP_LE_BE (val))
|
|
|
|
#define GDOUBLE_TO_BE(val) ((gdouble) (val))
|
|
|
|
|
|
|
|
#else /* !G_LITTLE_ENDIAN && !G_BIG_ENDIAN */
|
|
|
|
#error unknown ENDIAN type
|
|
|
|
#endif /* !G_LITTLE_ENDIAN && !G_BIG_ENDIAN */
|
|
|
|
|
|
|
|
#define GFLOAT_FROM_LE(val) (GFLOAT_TO_LE (val))
|
|
|
|
#define GFLOAT_FROM_BE(val) (GFLOAT_TO_BE (val))
|
|
|
|
#define GDOUBLE_FROM_LE(val) (GDOUBLE_TO_LE (val))
|
|
|
|
#define GDOUBLE_FROM_BE(val) (GDOUBLE_TO_BE (val))
|
|
|
|
|
|
|
|
#endif /* !defined(GFLOAT_FROM_LE) */
|
|
|
|
|
API: Move float endianness conversion macros from libgstfloatcast to core as it's useful in general, even in core. Fi...
Original commit message from CVS:
* docs/gst/gstreamer-sections.txt:
* gst/gstutils.h:
API: Move float endianness conversion macros from libgstfloatcast
to core as it's useful in general, even in core. Fixes bug #555196.
This adds GDOUBLE_FROM_BE, GDOUBLE_FROM_LE, GDOUBLE_TO_BE,
GDOUBLE_TO_LE, GDOUBLE_SWAP_LE_BE, GFLOAT_FROM_BE, GFLOAT_FROM_LE,
GFLOAT_TO_BE, GFLOAT_TO_LE, GFLOAT_SWAP_LE_BE.
Also add GST_READ_ and GST_WRITE_ macros for floats and doubles:
GST_READ_FLOAT_LE, GST_READ_FLOAT_BE, GST_READ_DOUBLE_LE,
GST_READ_DOUBLE_BE, GST_WRITE_FLOAT_LE, GST_WRITE_FLOAT_BE,
GST_WRITE_DOUBLE_LE, GST_WRITE_DOUBLE_BE.
2008-10-23 07:09:21 +00:00
|
|
|
/**
|
|
|
|
* GST_READ_FLOAT_LE:
|
|
|
|
* @data: memory location
|
|
|
|
*
|
|
|
|
* Read a 32 bit float value in little endian format from the memory buffer.
|
|
|
|
*
|
2009-05-22 08:33:02 +00:00
|
|
|
* Returns: The floating point value read from @data
|
API: Move float endianness conversion macros from libgstfloatcast to core as it's useful in general, even in core. Fi...
Original commit message from CVS:
* docs/gst/gstreamer-sections.txt:
* gst/gstutils.h:
API: Move float endianness conversion macros from libgstfloatcast
to core as it's useful in general, even in core. Fixes bug #555196.
This adds GDOUBLE_FROM_BE, GDOUBLE_FROM_LE, GDOUBLE_TO_BE,
GDOUBLE_TO_LE, GDOUBLE_SWAP_LE_BE, GFLOAT_FROM_BE, GFLOAT_FROM_LE,
GFLOAT_TO_BE, GFLOAT_TO_LE, GFLOAT_SWAP_LE_BE.
Also add GST_READ_ and GST_WRITE_ macros for floats and doubles:
GST_READ_FLOAT_LE, GST_READ_FLOAT_BE, GST_READ_DOUBLE_LE,
GST_READ_DOUBLE_BE, GST_WRITE_FLOAT_LE, GST_WRITE_FLOAT_BE,
GST_WRITE_DOUBLE_LE, GST_WRITE_DOUBLE_BE.
2008-10-23 07:09:21 +00:00
|
|
|
*/
|
2009-02-22 18:05:20 +00:00
|
|
|
#ifdef _FOOL_GTK_DOC_
|
|
|
|
G_INLINE_FUNC gfloat GST_READ_FLOAT_LE (const guint8 *data);
|
|
|
|
#endif
|
|
|
|
|
API: Move float endianness conversion macros from libgstfloatcast to core as it's useful in general, even in core. Fi...
Original commit message from CVS:
* docs/gst/gstreamer-sections.txt:
* gst/gstutils.h:
API: Move float endianness conversion macros from libgstfloatcast
to core as it's useful in general, even in core. Fixes bug #555196.
This adds GDOUBLE_FROM_BE, GDOUBLE_FROM_LE, GDOUBLE_TO_BE,
GDOUBLE_TO_LE, GDOUBLE_SWAP_LE_BE, GFLOAT_FROM_BE, GFLOAT_FROM_LE,
GFLOAT_TO_BE, GFLOAT_TO_LE, GFLOAT_SWAP_LE_BE.
Also add GST_READ_ and GST_WRITE_ macros for floats and doubles:
GST_READ_FLOAT_LE, GST_READ_FLOAT_BE, GST_READ_DOUBLE_LE,
GST_READ_DOUBLE_BE, GST_WRITE_FLOAT_LE, GST_WRITE_FLOAT_BE,
GST_WRITE_DOUBLE_LE, GST_WRITE_DOUBLE_BE.
2008-10-23 07:09:21 +00:00
|
|
|
inline static gfloat
|
|
|
|
GST_READ_FLOAT_LE(const guint8 *data)
|
|
|
|
{
|
|
|
|
union
|
|
|
|
{
|
|
|
|
guint32 i;
|
|
|
|
gfloat f;
|
|
|
|
} u;
|
|
|
|
|
|
|
|
u.i = GST_READ_UINT32_LE (data);
|
|
|
|
return u.f;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GST_READ_FLOAT_BE:
|
|
|
|
* @data: memory location
|
|
|
|
*
|
|
|
|
* Read a 32 bit float value in big endian format from the memory buffer.
|
|
|
|
*
|
2009-05-22 08:33:02 +00:00
|
|
|
* Returns: The floating point value read from @data
|
API: Move float endianness conversion macros from libgstfloatcast to core as it's useful in general, even in core. Fi...
Original commit message from CVS:
* docs/gst/gstreamer-sections.txt:
* gst/gstutils.h:
API: Move float endianness conversion macros from libgstfloatcast
to core as it's useful in general, even in core. Fixes bug #555196.
This adds GDOUBLE_FROM_BE, GDOUBLE_FROM_LE, GDOUBLE_TO_BE,
GDOUBLE_TO_LE, GDOUBLE_SWAP_LE_BE, GFLOAT_FROM_BE, GFLOAT_FROM_LE,
GFLOAT_TO_BE, GFLOAT_TO_LE, GFLOAT_SWAP_LE_BE.
Also add GST_READ_ and GST_WRITE_ macros for floats and doubles:
GST_READ_FLOAT_LE, GST_READ_FLOAT_BE, GST_READ_DOUBLE_LE,
GST_READ_DOUBLE_BE, GST_WRITE_FLOAT_LE, GST_WRITE_FLOAT_BE,
GST_WRITE_DOUBLE_LE, GST_WRITE_DOUBLE_BE.
2008-10-23 07:09:21 +00:00
|
|
|
*/
|
2009-02-22 18:05:20 +00:00
|
|
|
#ifdef _FOOL_GTK_DOC_
|
|
|
|
G_INLINE_FUNC gfloat GST_READ_FLOAT_BE (const guint8 *data);
|
|
|
|
#endif
|
|
|
|
|
API: Move float endianness conversion macros from libgstfloatcast to core as it's useful in general, even in core. Fi...
Original commit message from CVS:
* docs/gst/gstreamer-sections.txt:
* gst/gstutils.h:
API: Move float endianness conversion macros from libgstfloatcast
to core as it's useful in general, even in core. Fixes bug #555196.
This adds GDOUBLE_FROM_BE, GDOUBLE_FROM_LE, GDOUBLE_TO_BE,
GDOUBLE_TO_LE, GDOUBLE_SWAP_LE_BE, GFLOAT_FROM_BE, GFLOAT_FROM_LE,
GFLOAT_TO_BE, GFLOAT_TO_LE, GFLOAT_SWAP_LE_BE.
Also add GST_READ_ and GST_WRITE_ macros for floats and doubles:
GST_READ_FLOAT_LE, GST_READ_FLOAT_BE, GST_READ_DOUBLE_LE,
GST_READ_DOUBLE_BE, GST_WRITE_FLOAT_LE, GST_WRITE_FLOAT_BE,
GST_WRITE_DOUBLE_LE, GST_WRITE_DOUBLE_BE.
2008-10-23 07:09:21 +00:00
|
|
|
inline static gfloat
|
|
|
|
GST_READ_FLOAT_BE(const guint8 *data)
|
|
|
|
{
|
|
|
|
union
|
|
|
|
{
|
|
|
|
guint32 i;
|
|
|
|
gfloat f;
|
|
|
|
} u;
|
|
|
|
|
|
|
|
u.i = GST_READ_UINT32_BE (data);
|
|
|
|
return u.f;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GST_READ_DOUBLE_LE:
|
|
|
|
* @data: memory location
|
|
|
|
*
|
|
|
|
* Read a 64 bit double value in little endian format from the memory buffer.
|
|
|
|
*
|
2009-05-22 08:33:02 +00:00
|
|
|
* Returns: The double-precision floating point value read from @data
|
API: Move float endianness conversion macros from libgstfloatcast to core as it's useful in general, even in core. Fi...
Original commit message from CVS:
* docs/gst/gstreamer-sections.txt:
* gst/gstutils.h:
API: Move float endianness conversion macros from libgstfloatcast
to core as it's useful in general, even in core. Fixes bug #555196.
This adds GDOUBLE_FROM_BE, GDOUBLE_FROM_LE, GDOUBLE_TO_BE,
GDOUBLE_TO_LE, GDOUBLE_SWAP_LE_BE, GFLOAT_FROM_BE, GFLOAT_FROM_LE,
GFLOAT_TO_BE, GFLOAT_TO_LE, GFLOAT_SWAP_LE_BE.
Also add GST_READ_ and GST_WRITE_ macros for floats and doubles:
GST_READ_FLOAT_LE, GST_READ_FLOAT_BE, GST_READ_DOUBLE_LE,
GST_READ_DOUBLE_BE, GST_WRITE_FLOAT_LE, GST_WRITE_FLOAT_BE,
GST_WRITE_DOUBLE_LE, GST_WRITE_DOUBLE_BE.
2008-10-23 07:09:21 +00:00
|
|
|
*/
|
2009-02-22 18:05:20 +00:00
|
|
|
#ifdef _FOOL_GTK_DOC_
|
|
|
|
G_INLINE_FUNC gdouble GST_READ_DOUBLE_LE (const guint8 *data);
|
|
|
|
#endif
|
|
|
|
|
API: Move float endianness conversion macros from libgstfloatcast to core as it's useful in general, even in core. Fi...
Original commit message from CVS:
* docs/gst/gstreamer-sections.txt:
* gst/gstutils.h:
API: Move float endianness conversion macros from libgstfloatcast
to core as it's useful in general, even in core. Fixes bug #555196.
This adds GDOUBLE_FROM_BE, GDOUBLE_FROM_LE, GDOUBLE_TO_BE,
GDOUBLE_TO_LE, GDOUBLE_SWAP_LE_BE, GFLOAT_FROM_BE, GFLOAT_FROM_LE,
GFLOAT_TO_BE, GFLOAT_TO_LE, GFLOAT_SWAP_LE_BE.
Also add GST_READ_ and GST_WRITE_ macros for floats and doubles:
GST_READ_FLOAT_LE, GST_READ_FLOAT_BE, GST_READ_DOUBLE_LE,
GST_READ_DOUBLE_BE, GST_WRITE_FLOAT_LE, GST_WRITE_FLOAT_BE,
GST_WRITE_DOUBLE_LE, GST_WRITE_DOUBLE_BE.
2008-10-23 07:09:21 +00:00
|
|
|
inline static gdouble
|
|
|
|
GST_READ_DOUBLE_LE(const guint8 *data)
|
|
|
|
{
|
|
|
|
union
|
|
|
|
{
|
|
|
|
guint64 i;
|
|
|
|
gdouble d;
|
|
|
|
} u;
|
|
|
|
|
|
|
|
u.i = GST_READ_UINT64_LE (data);
|
|
|
|
return u.d;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GST_READ_DOUBLE_BE:
|
|
|
|
* @data: memory location
|
|
|
|
*
|
|
|
|
* Read a 64 bit double value in big endian format from the memory buffer.
|
|
|
|
*
|
2009-05-22 08:33:02 +00:00
|
|
|
* Returns: The double-precision floating point value read from @data
|
API: Move float endianness conversion macros from libgstfloatcast to core as it's useful in general, even in core. Fi...
Original commit message from CVS:
* docs/gst/gstreamer-sections.txt:
* gst/gstutils.h:
API: Move float endianness conversion macros from libgstfloatcast
to core as it's useful in general, even in core. Fixes bug #555196.
This adds GDOUBLE_FROM_BE, GDOUBLE_FROM_LE, GDOUBLE_TO_BE,
GDOUBLE_TO_LE, GDOUBLE_SWAP_LE_BE, GFLOAT_FROM_BE, GFLOAT_FROM_LE,
GFLOAT_TO_BE, GFLOAT_TO_LE, GFLOAT_SWAP_LE_BE.
Also add GST_READ_ and GST_WRITE_ macros for floats and doubles:
GST_READ_FLOAT_LE, GST_READ_FLOAT_BE, GST_READ_DOUBLE_LE,
GST_READ_DOUBLE_BE, GST_WRITE_FLOAT_LE, GST_WRITE_FLOAT_BE,
GST_WRITE_DOUBLE_LE, GST_WRITE_DOUBLE_BE.
2008-10-23 07:09:21 +00:00
|
|
|
*/
|
2009-02-22 18:05:20 +00:00
|
|
|
#ifdef _FOOL_GTK_DOC_
|
|
|
|
G_INLINE_FUNC gdouble GST_READ_DOUBLE_BE (const guint8 *data);
|
|
|
|
#endif
|
|
|
|
|
API: Move float endianness conversion macros from libgstfloatcast to core as it's useful in general, even in core. Fi...
Original commit message from CVS:
* docs/gst/gstreamer-sections.txt:
* gst/gstutils.h:
API: Move float endianness conversion macros from libgstfloatcast
to core as it's useful in general, even in core. Fixes bug #555196.
This adds GDOUBLE_FROM_BE, GDOUBLE_FROM_LE, GDOUBLE_TO_BE,
GDOUBLE_TO_LE, GDOUBLE_SWAP_LE_BE, GFLOAT_FROM_BE, GFLOAT_FROM_LE,
GFLOAT_TO_BE, GFLOAT_TO_LE, GFLOAT_SWAP_LE_BE.
Also add GST_READ_ and GST_WRITE_ macros for floats and doubles:
GST_READ_FLOAT_LE, GST_READ_FLOAT_BE, GST_READ_DOUBLE_LE,
GST_READ_DOUBLE_BE, GST_WRITE_FLOAT_LE, GST_WRITE_FLOAT_BE,
GST_WRITE_DOUBLE_LE, GST_WRITE_DOUBLE_BE.
2008-10-23 07:09:21 +00:00
|
|
|
inline static gdouble
|
|
|
|
GST_READ_DOUBLE_BE(const guint8 *data)
|
|
|
|
{
|
|
|
|
union
|
|
|
|
{
|
|
|
|
guint64 i;
|
|
|
|
gdouble d;
|
|
|
|
} u;
|
|
|
|
|
|
|
|
u.i = GST_READ_UINT64_BE (data);
|
|
|
|
return u.d;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GST_WRITE_FLOAT_LE:
|
|
|
|
* @data: memory location
|
|
|
|
* @num: value to store
|
|
|
|
*
|
|
|
|
* Store a 32 bit float value in little endian format into the memory buffer.
|
|
|
|
*/
|
2009-02-22 18:05:20 +00:00
|
|
|
#ifdef _FOOL_GTK_DOC_
|
|
|
|
G_INLINE_FUNC void GST_WRITE_FLOAT_LE (guint8 *data, gfloat num);
|
|
|
|
#endif
|
|
|
|
|
API: Move float endianness conversion macros from libgstfloatcast to core as it's useful in general, even in core. Fi...
Original commit message from CVS:
* docs/gst/gstreamer-sections.txt:
* gst/gstutils.h:
API: Move float endianness conversion macros from libgstfloatcast
to core as it's useful in general, even in core. Fixes bug #555196.
This adds GDOUBLE_FROM_BE, GDOUBLE_FROM_LE, GDOUBLE_TO_BE,
GDOUBLE_TO_LE, GDOUBLE_SWAP_LE_BE, GFLOAT_FROM_BE, GFLOAT_FROM_LE,
GFLOAT_TO_BE, GFLOAT_TO_LE, GFLOAT_SWAP_LE_BE.
Also add GST_READ_ and GST_WRITE_ macros for floats and doubles:
GST_READ_FLOAT_LE, GST_READ_FLOAT_BE, GST_READ_DOUBLE_LE,
GST_READ_DOUBLE_BE, GST_WRITE_FLOAT_LE, GST_WRITE_FLOAT_BE,
GST_WRITE_DOUBLE_LE, GST_WRITE_DOUBLE_BE.
2008-10-23 07:09:21 +00:00
|
|
|
inline static void
|
|
|
|
GST_WRITE_FLOAT_LE(guint8 *data, gfloat num)
|
|
|
|
{
|
|
|
|
union
|
|
|
|
{
|
|
|
|
guint32 i;
|
|
|
|
gfloat f;
|
|
|
|
} u;
|
|
|
|
|
|
|
|
u.f = num;
|
|
|
|
GST_WRITE_UINT32_LE (data, u.i);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GST_WRITE_FLOAT_BE:
|
|
|
|
* @data: memory location
|
|
|
|
* @num: value to store
|
|
|
|
*
|
|
|
|
* Store a 32 bit float value in big endian format into the memory buffer.
|
|
|
|
*/
|
2009-02-22 18:05:20 +00:00
|
|
|
#ifdef _FOOL_GTK_DOC_
|
|
|
|
G_INLINE_FUNC void GST_WRITE_FLOAT_BE (guint8 *data, gfloat num);
|
|
|
|
#endif
|
|
|
|
|
API: Move float endianness conversion macros from libgstfloatcast to core as it's useful in general, even in core. Fi...
Original commit message from CVS:
* docs/gst/gstreamer-sections.txt:
* gst/gstutils.h:
API: Move float endianness conversion macros from libgstfloatcast
to core as it's useful in general, even in core. Fixes bug #555196.
This adds GDOUBLE_FROM_BE, GDOUBLE_FROM_LE, GDOUBLE_TO_BE,
GDOUBLE_TO_LE, GDOUBLE_SWAP_LE_BE, GFLOAT_FROM_BE, GFLOAT_FROM_LE,
GFLOAT_TO_BE, GFLOAT_TO_LE, GFLOAT_SWAP_LE_BE.
Also add GST_READ_ and GST_WRITE_ macros for floats and doubles:
GST_READ_FLOAT_LE, GST_READ_FLOAT_BE, GST_READ_DOUBLE_LE,
GST_READ_DOUBLE_BE, GST_WRITE_FLOAT_LE, GST_WRITE_FLOAT_BE,
GST_WRITE_DOUBLE_LE, GST_WRITE_DOUBLE_BE.
2008-10-23 07:09:21 +00:00
|
|
|
inline static void
|
|
|
|
GST_WRITE_FLOAT_BE(guint8 *data, gfloat num)
|
|
|
|
{
|
|
|
|
union
|
|
|
|
{
|
|
|
|
guint32 i;
|
|
|
|
gfloat f;
|
|
|
|
} u;
|
|
|
|
|
|
|
|
u.f = num;
|
|
|
|
GST_WRITE_UINT32_BE (data, u.i);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GST_WRITE_DOUBLE_LE:
|
|
|
|
* @data: memory location
|
|
|
|
* @num: value to store
|
|
|
|
*
|
|
|
|
* Store a 64 bit double value in little endian format into the memory buffer.
|
|
|
|
*/
|
2009-02-22 18:05:20 +00:00
|
|
|
#ifdef _FOOL_GTK_DOC_
|
|
|
|
G_INLINE_FUNC void GST_WRITE_DOUBLE_LE (guint8 *data, gdouble num);
|
|
|
|
#endif
|
|
|
|
|
API: Move float endianness conversion macros from libgstfloatcast to core as it's useful in general, even in core. Fi...
Original commit message from CVS:
* docs/gst/gstreamer-sections.txt:
* gst/gstutils.h:
API: Move float endianness conversion macros from libgstfloatcast
to core as it's useful in general, even in core. Fixes bug #555196.
This adds GDOUBLE_FROM_BE, GDOUBLE_FROM_LE, GDOUBLE_TO_BE,
GDOUBLE_TO_LE, GDOUBLE_SWAP_LE_BE, GFLOAT_FROM_BE, GFLOAT_FROM_LE,
GFLOAT_TO_BE, GFLOAT_TO_LE, GFLOAT_SWAP_LE_BE.
Also add GST_READ_ and GST_WRITE_ macros for floats and doubles:
GST_READ_FLOAT_LE, GST_READ_FLOAT_BE, GST_READ_DOUBLE_LE,
GST_READ_DOUBLE_BE, GST_WRITE_FLOAT_LE, GST_WRITE_FLOAT_BE,
GST_WRITE_DOUBLE_LE, GST_WRITE_DOUBLE_BE.
2008-10-23 07:09:21 +00:00
|
|
|
inline static void
|
|
|
|
GST_WRITE_DOUBLE_LE(guint8 *data, gdouble num)
|
|
|
|
{
|
|
|
|
union
|
|
|
|
{
|
|
|
|
guint64 i;
|
|
|
|
gdouble d;
|
|
|
|
} u;
|
|
|
|
|
|
|
|
u.d = num;
|
|
|
|
GST_WRITE_UINT64_LE (data, u.i);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GST_WRITE_DOUBLE_BE:
|
|
|
|
* @data: memory location
|
|
|
|
* @num: value to store
|
|
|
|
*
|
|
|
|
* Store a 64 bit double value in big endian format into the memory buffer.
|
|
|
|
*/
|
2009-02-22 18:05:20 +00:00
|
|
|
#ifdef _FOOL_GTK_DOC_
|
|
|
|
G_INLINE_FUNC void GST_WRITE_DOUBLE_BE (guint8 *data, gdouble num);
|
|
|
|
#endif
|
|
|
|
|
API: Move float endianness conversion macros from libgstfloatcast to core as it's useful in general, even in core. Fi...
Original commit message from CVS:
* docs/gst/gstreamer-sections.txt:
* gst/gstutils.h:
API: Move float endianness conversion macros from libgstfloatcast
to core as it's useful in general, even in core. Fixes bug #555196.
This adds GDOUBLE_FROM_BE, GDOUBLE_FROM_LE, GDOUBLE_TO_BE,
GDOUBLE_TO_LE, GDOUBLE_SWAP_LE_BE, GFLOAT_FROM_BE, GFLOAT_FROM_LE,
GFLOAT_TO_BE, GFLOAT_TO_LE, GFLOAT_SWAP_LE_BE.
Also add GST_READ_ and GST_WRITE_ macros for floats and doubles:
GST_READ_FLOAT_LE, GST_READ_FLOAT_BE, GST_READ_DOUBLE_LE,
GST_READ_DOUBLE_BE, GST_WRITE_FLOAT_LE, GST_WRITE_FLOAT_BE,
GST_WRITE_DOUBLE_LE, GST_WRITE_DOUBLE_BE.
2008-10-23 07:09:21 +00:00
|
|
|
inline static void
|
|
|
|
GST_WRITE_DOUBLE_BE(guint8 *data, gdouble num)
|
|
|
|
{
|
|
|
|
union
|
|
|
|
{
|
|
|
|
guint64 i;
|
|
|
|
gdouble d;
|
|
|
|
} u;
|
|
|
|
|
|
|
|
u.d = num;
|
|
|
|
GST_WRITE_UINT64_BE (data, u.i);
|
|
|
|
}
|
|
|
|
|
2005-08-09 16:25:45 +00:00
|
|
|
/* Miscellaneous utility macros */
|
2005-10-08 14:48:17 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GST_ROUND_UP_2:
|
2007-01-29 13:40:38 +00:00
|
|
|
* @num: integer value to round up
|
2005-10-08 14:48:17 +00:00
|
|
|
*
|
2007-05-13 20:11:27 +00:00
|
|
|
* Rounds an integer value up to the next multiple of 2.
|
2005-10-08 14:48:17 +00:00
|
|
|
*/
|
2005-08-09 16:25:45 +00:00
|
|
|
#define GST_ROUND_UP_2(num) (((num)+1)&~1)
|
2005-10-08 14:48:17 +00:00
|
|
|
/**
|
|
|
|
* GST_ROUND_UP_4:
|
2007-01-29 13:40:38 +00:00
|
|
|
* @num: integer value to round up
|
2005-10-08 14:48:17 +00:00
|
|
|
*
|
2007-05-13 20:11:27 +00:00
|
|
|
* Rounds an integer value up to the next multiple of 4.
|
2005-10-08 14:48:17 +00:00
|
|
|
*/
|
2005-08-09 16:25:45 +00:00
|
|
|
#define GST_ROUND_UP_4(num) (((num)+3)&~3)
|
2005-10-08 14:48:17 +00:00
|
|
|
/**
|
|
|
|
* GST_ROUND_UP_8:
|
2007-01-29 13:40:38 +00:00
|
|
|
* @num: integer value to round up
|
2005-10-08 14:48:17 +00:00
|
|
|
*
|
2007-05-13 20:11:27 +00:00
|
|
|
* Rounds an integer value up to the next multiple of 8.
|
2005-10-08 14:48:17 +00:00
|
|
|
*/
|
2005-08-09 16:25:45 +00:00
|
|
|
#define GST_ROUND_UP_8(num) (((num)+7)&~7)
|
2005-10-08 14:48:17 +00:00
|
|
|
/**
|
|
|
|
* GST_ROUND_UP_16:
|
2007-01-29 13:40:38 +00:00
|
|
|
* @num: integer value to round up
|
2005-10-08 14:48:17 +00:00
|
|
|
*
|
2007-05-13 20:11:27 +00:00
|
|
|
* Rounds an integer value up to the next multiple of 16.
|
2005-10-08 14:48:17 +00:00
|
|
|
*/
|
2005-08-09 16:25:45 +00:00
|
|
|
#define GST_ROUND_UP_16(num) (((num)+15)&~15)
|
2005-10-08 14:48:17 +00:00
|
|
|
/**
|
|
|
|
* GST_ROUND_UP_32:
|
2007-01-29 13:40:38 +00:00
|
|
|
* @num: integer value to round up
|
2005-10-08 14:48:17 +00:00
|
|
|
*
|
2007-05-13 20:11:27 +00:00
|
|
|
* Rounds an integer value up to the next multiple of 32.
|
2005-10-08 14:48:17 +00:00
|
|
|
*/
|
2005-08-09 16:25:45 +00:00
|
|
|
#define GST_ROUND_UP_32(num) (((num)+31)&~31)
|
2005-10-08 14:48:17 +00:00
|
|
|
/**
|
|
|
|
* GST_ROUND_UP_64:
|
2007-01-29 13:40:38 +00:00
|
|
|
* @num: integer value to round up
|
2005-10-08 14:48:17 +00:00
|
|
|
*
|
2007-05-13 20:11:27 +00:00
|
|
|
* Rounds an integer value up to the next multiple of 64.
|
2005-10-08 14:48:17 +00:00
|
|
|
*/
|
2005-08-09 16:25:45 +00:00
|
|
|
#define GST_ROUND_UP_64(num) (((num)+63)&~63)
|
2013-11-13 22:06:23 +00:00
|
|
|
/**
|
|
|
|
* GST_ROUND_UP_128:
|
|
|
|
* @num: integer value to round up
|
|
|
|
*
|
|
|
|
* Rounds an integer value up to the next multiple of 128.
|
|
|
|
* Since: 1.4
|
|
|
|
*/
|
|
|
|
#define GST_ROUND_UP_128(num) (((num)+127)&~127)
|
2014-01-14 21:15:02 +00:00
|
|
|
/**
|
|
|
|
* GST_ROUND_UP_N:
|
|
|
|
* @num: integrer value to round up
|
|
|
|
* @align: a power of two to round up to
|
|
|
|
*
|
|
|
|
* Rounds an integer value up to the next multiple of @align. @align MUST be a
|
|
|
|
* power of two.
|
|
|
|
*/
|
|
|
|
#define GST_ROUND_UP_N(num,align) ((((num) + ((align) - 1)) & ~((align) - 1)))
|
2013-11-13 22:06:23 +00:00
|
|
|
|
2005-08-09 16:25:45 +00:00
|
|
|
|
2007-01-29 13:40:38 +00:00
|
|
|
/**
|
|
|
|
* GST_ROUND_DOWN_2:
|
|
|
|
* @num: integer value to round down
|
|
|
|
*
|
2007-05-13 20:11:27 +00:00
|
|
|
* Rounds an integer value down to the next multiple of 2.
|
2007-01-29 13:40:38 +00:00
|
|
|
*/
|
|
|
|
#define GST_ROUND_DOWN_2(num) ((num)&(~1))
|
|
|
|
/**
|
|
|
|
* GST_ROUND_DOWN_4:
|
|
|
|
* @num: integer value to round down
|
|
|
|
*
|
2007-05-13 20:11:27 +00:00
|
|
|
* Rounds an integer value down to the next multiple of 4.
|
2007-01-29 13:40:38 +00:00
|
|
|
*/
|
|
|
|
#define GST_ROUND_DOWN_4(num) ((num)&(~3))
|
|
|
|
/**
|
|
|
|
* GST_ROUND_DOWN_8:
|
|
|
|
* @num: integer value to round down
|
|
|
|
*
|
2007-05-13 20:11:27 +00:00
|
|
|
* Rounds an integer value down to the next multiple of 8.
|
2007-01-29 13:40:38 +00:00
|
|
|
*/
|
|
|
|
#define GST_ROUND_DOWN_8(num) ((num)&(~7))
|
|
|
|
/**
|
|
|
|
* GST_ROUND_DOWN_16:
|
|
|
|
* @num: integer value to round down
|
|
|
|
*
|
2007-05-13 20:11:27 +00:00
|
|
|
* Rounds an integer value down to the next multiple of 16.
|
2007-01-29 13:40:38 +00:00
|
|
|
*/
|
|
|
|
#define GST_ROUND_DOWN_16(num) ((num)&(~15))
|
|
|
|
/**
|
|
|
|
* GST_ROUND_DOWN_32:
|
|
|
|
* @num: integer value to round down
|
|
|
|
*
|
2007-05-13 20:11:27 +00:00
|
|
|
* Rounds an integer value down to the next multiple of 32.
|
2007-01-29 13:40:38 +00:00
|
|
|
*/
|
|
|
|
#define GST_ROUND_DOWN_32(num) ((num)&(~31))
|
|
|
|
/**
|
|
|
|
* GST_ROUND_DOWN_64:
|
|
|
|
* @num: integer value to round down
|
|
|
|
*
|
2007-05-13 20:11:27 +00:00
|
|
|
* Rounds an integer value down to the next multiple of 64.
|
2007-01-29 13:40:38 +00:00
|
|
|
*/
|
|
|
|
#define GST_ROUND_DOWN_64(num) ((num)&(~63))
|
2013-12-20 13:41:06 +00:00
|
|
|
/**
|
|
|
|
* GST_ROUND_DOWN_128:
|
|
|
|
* @num: integer value to round down
|
|
|
|
*
|
|
|
|
* Rounds an integer value down to the next multiple of 128.
|
|
|
|
* Since: 1.4
|
|
|
|
*/
|
|
|
|
#define GST_ROUND_DOWN_128(num) ((num)&(~127))
|
2014-01-14 21:15:02 +00:00
|
|
|
/**
|
|
|
|
* GST_ROUND_DOWN_N:
|
|
|
|
* @num: integrer value to round down
|
|
|
|
* @align: a power of two to round down to
|
|
|
|
*
|
|
|
|
* Rounds an integer value down to the next multiple of @align. @align MUST be a
|
|
|
|
* power of two.
|
|
|
|
*/
|
|
|
|
#define GST_ROUND_DOWN_N(num,align) (((num) & ~((align) - 1)))
|
|
|
|
|
2007-01-29 13:40:38 +00:00
|
|
|
|
2011-11-11 15:52:41 +00:00
|
|
|
void gst_object_default_error (GstObject * source,
|
|
|
|
const GError * error,
|
|
|
|
const gchar * debug);
|
2005-03-07 18:27:42 +00:00
|
|
|
|
|
|
|
/* element functions */
|
2005-04-23 23:29:47 +00:00
|
|
|
void gst_element_create_all_pads (GstElement *element);
|
2005-04-24 21:16:45 +00:00
|
|
|
GstPad* gst_element_get_compatible_pad (GstElement *element, GstPad *pad,
|
2012-03-11 17:57:44 +00:00
|
|
|
GstCaps *caps);
|
2005-03-07 18:27:42 +00:00
|
|
|
|
|
|
|
GstPadTemplate* gst_element_get_compatible_pad_template (GstElement *element, GstPadTemplate *compattempl);
|
|
|
|
|
2011-06-09 16:13:35 +00:00
|
|
|
const gchar* gst_element_state_get_name (GstState state);
|
|
|
|
const gchar * gst_element_state_change_return_get_name (GstStateChangeReturn state_ret);
|
2005-03-07 18:27:42 +00:00
|
|
|
|
2011-11-11 15:52:41 +00:00
|
|
|
gboolean gst_element_link (GstElement *src, GstElement *dest);
|
|
|
|
gboolean gst_element_link_many (GstElement *element_1,
|
|
|
|
GstElement *element_2, ...) G_GNUC_NULL_TERMINATED;
|
|
|
|
gboolean gst_element_link_filtered (GstElement * src,
|
2005-08-31 15:27:55 +00:00
|
|
|
GstElement * dest,
|
|
|
|
GstCaps *filter);
|
2005-03-07 18:27:42 +00:00
|
|
|
void gst_element_unlink (GstElement *src, GstElement *dest);
|
|
|
|
void gst_element_unlink_many (GstElement *element_1,
|
2011-11-11 15:52:41 +00:00
|
|
|
GstElement *element_2, ...) G_GNUC_NULL_TERMINATED;
|
2005-03-07 18:27:42 +00:00
|
|
|
|
2011-11-11 15:52:41 +00:00
|
|
|
gboolean gst_element_link_pads (GstElement *src, const gchar *srcpadname,
|
|
|
|
GstElement *dest, const gchar *destpadname);
|
|
|
|
gboolean gst_element_link_pads_full (GstElement *src, const gchar *srcpadname,
|
|
|
|
GstElement *dest, const gchar *destpadname,
|
|
|
|
GstPadLinkCheck flags);
|
2005-03-07 18:27:42 +00:00
|
|
|
void gst_element_unlink_pads (GstElement *src, const gchar *srcpadname,
|
2011-11-11 15:52:41 +00:00
|
|
|
GstElement *dest, const gchar *destpadname);
|
2005-06-29 15:17:25 +00:00
|
|
|
|
2011-11-11 15:52:41 +00:00
|
|
|
gboolean gst_element_link_pads_filtered (GstElement * src, const gchar * srcpadname,
|
2005-07-13 16:26:07 +00:00
|
|
|
GstElement * dest, const gchar * destpadname,
|
|
|
|
GstCaps *filter);
|
2006-05-19 10:29:07 +00:00
|
|
|
|
2009-03-13 09:56:54 +00:00
|
|
|
gboolean gst_element_seek_simple (GstElement *element,
|
|
|
|
GstFormat format,
|
|
|
|
GstSeekFlags seek_flags,
|
|
|
|
gint64 seek_pos);
|
2006-05-19 10:29:07 +00:00
|
|
|
|
2005-06-29 15:17:25 +00:00
|
|
|
/* util elementfactory functions */
|
2010-06-23 20:00:04 +00:00
|
|
|
gboolean gst_element_factory_can_sink_all_caps (GstElementFactory *factory, const GstCaps *caps);
|
|
|
|
gboolean gst_element_factory_can_src_all_caps (GstElementFactory *factory, const GstCaps *caps);
|
|
|
|
gboolean gst_element_factory_can_sink_any_caps (GstElementFactory *factory, const GstCaps *caps);
|
|
|
|
gboolean gst_element_factory_can_src_any_caps (GstElementFactory *factory, const GstCaps *caps);
|
2005-06-29 15:17:25 +00:00
|
|
|
|
2005-05-09 10:53:13 +00:00
|
|
|
/* util query functions */
|
2011-07-26 23:17:02 +00:00
|
|
|
gboolean gst_element_query_position (GstElement *element, GstFormat format, gint64 *cur);
|
|
|
|
gboolean gst_element_query_duration (GstElement *element, GstFormat format, gint64 *duration);
|
2005-05-09 10:53:13 +00:00
|
|
|
gboolean gst_element_query_convert (GstElement *element, GstFormat src_format, gint64 src_val,
|
2011-11-11 15:52:41 +00:00
|
|
|
GstFormat dest_format, gint64 *dest_val);
|
2005-03-07 18:27:42 +00:00
|
|
|
|
|
|
|
/* pad functions */
|
2011-11-11 15:52:41 +00:00
|
|
|
void gst_pad_use_fixed_caps (GstPad *pad);
|
|
|
|
GstElement* gst_pad_get_parent_element (GstPad *pad);
|
docs/design/: Some more docs in the works.
Original commit message from CVS:
* docs/design/part-dynamic.txt:
* docs/design/part-events.txt:
* docs/design/part-seeking.txt:
Some more docs in the works.
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_getcaps), (gst_base_transform_configure_caps),
(gst_base_transform_setcaps), (gst_base_transform_get_size),
(gst_base_transform_buffer_alloc), (gst_base_transform_event),
(gst_base_transform_handle_buffer),
(gst_base_transform_sink_activate_push),
(gst_base_transform_src_activate_pull),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
Refcounting fixes.
* gst/gstbus.c: (gst_bus_source_dispatch), (gst_bus_poll):
Cleanups.
* gst/gstevent.c: (gst_event_finalize):
Set SRC to NULL.
* gst/gstutils.c: (gst_element_unlink),
(gst_pad_get_parent_element), (gst_pad_proxy_getcaps),
(gst_pad_proxy_setcaps):
* gst/gstutils.h:
Add _get_parent_element() to get a pads parent as an element.
2005-07-18 08:28:48 +00:00
|
|
|
|
2005-05-09 10:53:13 +00:00
|
|
|
/* util query functions */
|
2011-11-15 15:46:37 +00:00
|
|
|
gboolean gst_pad_proxy_query_accept_caps (GstPad *pad, GstQuery *query);
|
|
|
|
gboolean gst_pad_proxy_query_caps (GstPad *pad, GstQuery *query);
|
|
|
|
|
2011-07-26 23:17:02 +00:00
|
|
|
gboolean gst_pad_query_position (GstPad *pad, GstFormat format, gint64 *cur);
|
|
|
|
gboolean gst_pad_query_duration (GstPad *pad, GstFormat format, gint64 *duration);
|
2005-05-09 10:53:13 +00:00
|
|
|
gboolean gst_pad_query_convert (GstPad *pad, GstFormat src_format, gint64 src_val,
|
2011-11-11 15:52:41 +00:00
|
|
|
GstFormat dest_format, gint64 *dest_val);
|
2011-11-15 17:16:24 +00:00
|
|
|
GstCaps * gst_pad_query_caps (GstPad *pad, GstCaps *filter);
|
|
|
|
gboolean gst_pad_query_accept_caps (GstPad *pad, GstCaps *caps);
|
|
|
|
|
2006-03-23 18:45:02 +00:00
|
|
|
|
2011-11-15 16:50:34 +00:00
|
|
|
gboolean gst_pad_peer_query_position (GstPad *pad, GstFormat format, gint64 *cur);
|
|
|
|
gboolean gst_pad_peer_query_duration (GstPad *pad, GstFormat format, gint64 *duration);
|
|
|
|
gboolean gst_pad_peer_query_convert (GstPad *pad, GstFormat src_format, gint64 src_val,
|
2011-11-11 15:52:41 +00:00
|
|
|
GstFormat dest_format, gint64 *dest_val);
|
2011-11-15 17:16:24 +00:00
|
|
|
GstCaps * gst_pad_peer_query_caps (GstPad * pad, GstCaps *filter);
|
|
|
|
gboolean gst_pad_peer_query_accept_caps (GstPad * pad, GstCaps *caps);
|
2005-05-09 10:53:13 +00:00
|
|
|
|
2013-10-30 20:53:36 +00:00
|
|
|
gchar * gst_pad_create_stream_id (GstPad * pad, GstElement * parent, const gchar *stream_id) G_GNUC_MALLOC;
|
|
|
|
gchar * gst_pad_create_stream_id_printf (GstPad * pad, GstElement * parent, const gchar *stream_id, ...) G_GNUC_PRINTF (3, 4) G_GNUC_MALLOC;
|
|
|
|
gchar * gst_pad_create_stream_id_printf_valist (GstPad * pad, GstElement * parent, const gchar *stream_id, va_list var_args) G_GNUC_PRINTF (3, 0) G_GNUC_MALLOC;
|
2012-07-28 06:37:00 +00:00
|
|
|
|
2013-01-19 12:51:56 +00:00
|
|
|
gchar * gst_pad_get_stream_id (GstPad * pad);
|
|
|
|
|
2005-03-07 18:27:42 +00:00
|
|
|
/* bin functions */
|
2006-02-02 09:51:18 +00:00
|
|
|
void gst_bin_add_many (GstBin *bin, GstElement *element_1, ...) G_GNUC_NULL_TERMINATED;
|
|
|
|
void gst_bin_remove_many (GstBin *bin, GstElement *element_1, ...) G_GNUC_NULL_TERMINATED;
|
2008-05-27 10:50:49 +00:00
|
|
|
GstPad * gst_bin_find_unlinked_pad (GstBin *bin, GstPadDirection direction);
|
2005-03-07 18:27:42 +00:00
|
|
|
|
2015-02-23 18:27:32 +00:00
|
|
|
gboolean gst_bin_sync_children_states (GstBin *bin);
|
|
|
|
|
2006-02-02 09:51:18 +00:00
|
|
|
/* parse utility functions */
|
API: gst_parse_launch_full()
Original commit message from CVS:
* docs/gst/gstreamer-sections.txt:
* gst/gst.c: (init_post):
* gst/gst_private.h: (_GstParseContext):
* gst/gstparse.c: (gst_parse_error_quark), (gst_parse_context_new),
(gst_parse_context_free), (gst_parse_context_get_missing_elements),
(gst_parse_launchv), (gst_parse_launchv_full), (gst_parse_launch),
(gst_parse_launch_full):
* gst/gstparse.h: (GST_PARSE_FLAG_NONE), (GST_PARSE_FLAG_FATAL_ERRORS),
(GstParseFlags), (GstParseContext):
* gst/gstutils.c: (gst_parse_bin_from_description),
(gst_parse_bin_from_description_full):
* gst/gstutils.h:
* gst/parse/grammar.y:
* gst/parse/types.h:
* win32/common/libgstreamer.def:
Add new gst_parse_*_full API (#528178):
API: gst_parse_launch_full()
API: gst_parse_launchv_full()
API: gst_parse_bin_from_description_full()
API: gst_parse_context_new()
API: gst_parse_context_free()
API: gst_parse_context_get_missing_elements()
2008-05-24 15:33:53 +00:00
|
|
|
GstElement * gst_parse_bin_from_description (const gchar * bin_description,
|
2008-05-25 16:34:32 +00:00
|
|
|
gboolean ghost_unlinked_pads,
|
API: gst_parse_launch_full()
Original commit message from CVS:
* docs/gst/gstreamer-sections.txt:
* gst/gst.c: (init_post):
* gst/gst_private.h: (_GstParseContext):
* gst/gstparse.c: (gst_parse_error_quark), (gst_parse_context_new),
(gst_parse_context_free), (gst_parse_context_get_missing_elements),
(gst_parse_launchv), (gst_parse_launchv_full), (gst_parse_launch),
(gst_parse_launch_full):
* gst/gstparse.h: (GST_PARSE_FLAG_NONE), (GST_PARSE_FLAG_FATAL_ERRORS),
(GstParseFlags), (GstParseContext):
* gst/gstutils.c: (gst_parse_bin_from_description),
(gst_parse_bin_from_description_full):
* gst/gstutils.h:
* gst/parse/grammar.y:
* gst/parse/types.h:
* win32/common/libgstreamer.def:
Add new gst_parse_*_full API (#528178):
API: gst_parse_launch_full()
API: gst_parse_launchv_full()
API: gst_parse_bin_from_description_full()
API: gst_parse_context_new()
API: gst_parse_context_free()
API: gst_parse_context_get_missing_elements()
2008-05-24 15:33:53 +00:00
|
|
|
GError ** err);
|
|
|
|
|
|
|
|
GstElement * gst_parse_bin_from_description_full (const gchar * bin_description,
|
2008-05-25 16:34:32 +00:00
|
|
|
gboolean ghost_unlinked_pads,
|
API: gst_parse_launch_full()
Original commit message from CVS:
* docs/gst/gstreamer-sections.txt:
* gst/gst.c: (init_post):
* gst/gst_private.h: (_GstParseContext):
* gst/gstparse.c: (gst_parse_error_quark), (gst_parse_context_new),
(gst_parse_context_free), (gst_parse_context_get_missing_elements),
(gst_parse_launchv), (gst_parse_launchv_full), (gst_parse_launch),
(gst_parse_launch_full):
* gst/gstparse.h: (GST_PARSE_FLAG_NONE), (GST_PARSE_FLAG_FATAL_ERRORS),
(GstParseFlags), (GstParseContext):
* gst/gstutils.c: (gst_parse_bin_from_description),
(gst_parse_bin_from_description_full):
* gst/gstutils.h:
* gst/parse/grammar.y:
* gst/parse/types.h:
* win32/common/libgstreamer.def:
Add new gst_parse_*_full API (#528178):
API: gst_parse_launch_full()
API: gst_parse_launchv_full()
API: gst_parse_bin_from_description_full()
API: gst_parse_context_new()
API: gst_parse_context_free()
API: gst_parse_context_get_missing_elements()
2008-05-24 15:33:53 +00:00
|
|
|
GstParseContext * context,
|
|
|
|
GstParseFlags flags,
|
|
|
|
GError ** err);
|
2006-02-02 09:51:18 +00:00
|
|
|
|
2009-03-13 09:56:54 +00:00
|
|
|
GstClockTime gst_util_get_timestamp (void);
|
2007-12-11 20:23:58 +00:00
|
|
|
|
2009-03-02 15:17:45 +00:00
|
|
|
/**
|
|
|
|
* GstSearchMode:
|
|
|
|
* @GST_SEARCH_MODE_EXACT : Only search for exact matches.
|
|
|
|
* @GST_SEARCH_MODE_BEFORE: Search for an exact match or the element just before.
|
|
|
|
* @GST_SEARCH_MODE_AFTER : Search for an exact match or the element just after.
|
|
|
|
*
|
|
|
|
* The different search modes.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
GST_SEARCH_MODE_EXACT = 0,
|
|
|
|
GST_SEARCH_MODE_BEFORE,
|
|
|
|
GST_SEARCH_MODE_AFTER
|
|
|
|
} GstSearchMode;
|
|
|
|
|
2011-11-11 15:52:41 +00:00
|
|
|
gpointer gst_util_array_binary_search (gpointer array, guint num_elements,
|
|
|
|
gsize element_size, GCompareDataFunc search_func,
|
|
|
|
GstSearchMode mode, gconstpointer search_data,
|
|
|
|
gpointer user_data);
|
|
|
|
|
|
|
|
/* fraction operations */
|
|
|
|
gint gst_util_greatest_common_divisor (gint a, gint b);
|
2011-11-30 17:58:07 +00:00
|
|
|
gint64 gst_util_greatest_common_divisor_int64 (gint64 a, gint64 b);
|
2011-11-11 15:52:41 +00:00
|
|
|
|
|
|
|
void gst_util_fraction_to_double (gint src_n, gint src_d, gdouble *dest);
|
|
|
|
void gst_util_double_to_fraction (gdouble src, gint *dest_n, gint *dest_d);
|
|
|
|
|
|
|
|
gboolean gst_util_fraction_multiply (gint a_n, gint a_d, gint b_n, gint b_d,
|
|
|
|
gint *res_n, gint *res_d);
|
|
|
|
gboolean gst_util_fraction_add (gint a_n, gint a_d, gint b_n, gint b_d,
|
|
|
|
gint *res_n, gint *res_d);
|
|
|
|
gint gst_util_fraction_compare (gint a_n, gint a_d, gint b_n, gint b_d);
|
2009-11-16 08:29:10 +00:00
|
|
|
|
2009-11-18 06:52:24 +00:00
|
|
|
|
2002-07-08 19:07:30 +00:00
|
|
|
G_END_DECLS
|
2004-03-15 14:43:35 +00:00
|
|
|
|
2000-01-30 09:03:00 +00:00
|
|
|
#endif /* __GST_UTILS_H__ */
|