gstutils.h   gstutils.h 
skipping to change at line 37 skipping to change at line 37
#include <glib.h> #include <glib.h>
#include <gst/gstbin.h> #include <gst/gstbin.h>
#include <gst/gstparse.h> #include <gst/gstparse.h>
G_BEGIN_DECLS G_BEGIN_DECLS
void gst_util_set_value_from_string (GValue *value, const gchar *value_str); void gst_util_set_value_from_string (GValue *value, const gchar *value_str);
void gst_util_set_object_arg (GObject *object, const gcha r *name, const gchar *value); void gst_util_set_object_arg (GObject *object, const gcha r *name, const gchar *value);
void gst_util_dump_mem (const guchar *mem, guint si ze); void gst_util_dump_mem (const guchar *mem, guint si ze);
guint64 gst_util_gdouble_to_guint64 (gdouble value) G_GNUC_PUR guint64 gst_util_gdouble_to_guint64 (gdouble value) G_GNUC_CON
E; ST;
gdouble gst_util_guint64_to_gdouble (guint64 value) G_GNUC_PUR gdouble gst_util_guint64_to_gdouble (guint64 value) G_GNUC_CON
E; ST;
/** /**
* gst_guint64_to_gdouble: * gst_guint64_to_gdouble:
* @value: the #guint64 value to convert * @value: the #guint64 value to convert
* *
* Convert @value to a gdouble. * Convert @value to a gdouble.
* *
* Returns: @value converted to a #gdouble. * Returns: @value converted to a #gdouble.
*/ */
skipping to change at line 65 skipping to change at line 65
* Returns: @value converted to a #guint64. * Returns: @value converted to a #guint64.
*/ */
#ifdef WIN32 #ifdef WIN32
#define gst_gdouble_to_guint64(value) gst_util_gdouble_to_guint64 (value) #define gst_gdouble_to_guint64(value) gst_util_gdouble_to_guint64 (value)
#define gst_guint64_to_gdouble(value) gst_util_guint64_to_gdouble (value) #define gst_guint64_to_gdouble(value) gst_util_guint64_to_gdouble (value)
#else #else
#define gst_gdouble_to_guint64(value) ((guint64) (value)) #define gst_gdouble_to_guint64(value) ((guint64) (value))
#define gst_guint64_to_gdouble(value) ((gdouble) (value)) #define gst_guint64_to_gdouble(value) ((gdouble) (value))
#endif #endif
guint64 gst_util_uint64_scale (guint64 val, guint6 guint64 gst_util_uint64_scale (guint64 val, guint6
4 num, guint64 denom) G_GNUC_PURE; 4 num, guint64 denom);
guint64 gst_util_uint64_scale_round (guint64 val, guint6
guint64 gst_util_uint64_scale_int (guint64 val, gint num, gin 4 num, guint64 denom);
t denom) G_GNUC_PURE; guint64 gst_util_uint64_scale_ceil (guint64 val, guint6
4 num, guint64 denom);
guint64 gst_util_uint64_scale_int (guint64 val, gint num, gin
t denom);
guint64 gst_util_uint64_scale_int_round (guint64 val, gint num, gin
t denom);
guint64 gst_util_uint64_scale_int_ceil (guint64 val, gint num, gin
t denom);
guint32 gst_util_seqnum_next (void); guint32 gst_util_seqnum_next (void);
gint32 gst_util_seqnum_compare (guint32 s1, guint32 s2); gint32 gst_util_seqnum_compare (guint32 s1, guint32 s2);
void gst_print_pad_caps (GString *buf, gint indent, GstPad *pad); void gst_print_pad_caps (GString *buf, gint indent, GstPad *pad);
void gst_print_element_args (GString *buf, gint indent, GstElement *element); void gst_print_element_args (GString *buf, gint indent, GstElement *element);
GType gst_type_register_static_full (GType parent_type, GType gst_type_register_static_full (GType parent_type,
const gchar *type_name, const gchar *type_name,
guint class_size, guint class_size,
skipping to change at line 119 skipping to change at line 123
* </informalexample> * </informalexample>
*/ */
#define GST_BOILERPLATE_FULL(type, type_as_function, parent_type, parent_ty pe_macro, additional_initializations) \ #define GST_BOILERPLATE_FULL(type, type_as_function, parent_type, parent_ty pe_macro, additional_initializations) \
\ \
static void type_as_function ## _base_init (gpointer g_class); \ static void type_as_function ## _base_init (gpointer g_class); \
static void type_as_function ## _class_init (type ## Class *g_class);\ static void type_as_function ## _class_init (type ## Class *g_class);\
static void type_as_function ## _init (type *object, \ static void type_as_function ## _init (type *object, \
type ## Class *g_class);\ type ## Class *g_class);\
static parent_type ## Class *parent_class = NULL; \ static parent_type ## Class *parent_class = NULL; \
static void \ static void \
type_as_function ## _class_init_trampoline (gpointer g_class, \ type_as_function ## _class_init_trampoline (gpointer g_class) \
gpointer data) \
{ \ { \
parent_class = (parent_type ## Class *) \ parent_class = (parent_type ## Class *) \
g_type_class_peek_parent (g_class); \ g_type_class_peek_parent (g_class); \
type_as_function ## _class_init ((type ## Class *)g_class); \ type_as_function ## _class_init ((type ## Class *)g_class); \
} \ } \
\ \
GType type_as_function ## _get_type (void); \
\
GType \ GType \
type_as_function ## _get_type (void) \ type_as_function ## _get_type (void) \
{ \ { \
/* The typedef for GType may be gulong or gsize, depending on the \ /* The typedef for GType may be gulong or gsize, depending on the \
* system and whether the compiler is c++ or not. The g_once_init_* \ * system and whether the compiler is c++ or not. The g_once_init_* \
* functions always take a gsize * though ... */ \ * functions always take a gsize * though ... */ \
static volatile gsize gonce_data = 0; \ static volatile gsize gonce_data = 0; \
if (g_once_init_enter (&gonce_data)) { \ if (g_once_init_enter (&gonce_data)) { \
GType _type; \ GType _type; \
_type = gst_type_register_static_full (parent_type_macro, \ _type = gst_type_register_static_full (parent_type_macro, \
g_intern_static_string (#type), \ g_intern_static_string (#type), \
sizeof (type ## Class), \ sizeof (type ## Class), \
type_as_function ## _base_init, \ type_as_function ## _base_init, \
NULL, /* base_finalize */ \ NULL, /* base_finalize */ \
type_as_function ## _class_init_trampoline, \ (GClassInitFunc) type_as_function ## _class_init_trampoline, \
NULL, /* class_finalize */ \ NULL, /* class_finalize */ \
NULL, /* class_data */ \ NULL, /* class_data */ \
sizeof (type), \ sizeof (type), \
0, /* n_preallocs */ \ 0, /* n_preallocs */ \
(GInstanceInitFunc) type_as_function ## _init, \ (GInstanceInitFunc) type_as_function ## _init, \
NULL, \ NULL, \
(GTypeFlags) 0); \ (GTypeFlags) 0); \
additional_initializations (_type); \ additional_initializations (_type); \
g_once_init_leave (&gonce_data, (gsize) _type); \ g_once_init_leave (&gonce_data, (gsize) _type); \
} \ } \
skipping to change at line 268 skipping to change at line 269
* *
* Same as GST_CALL_PARENT(), but in case there is no implementation, it * Same as GST_CALL_PARENT(), but in case there is no implementation, it
* evaluates to @def_return. * evaluates to @def_return.
*/ */
#define GST_CALL_PARENT_WITH_DEFAULT(parent_class_cast, name, args, def_ret urn)\ #define GST_CALL_PARENT_WITH_DEFAULT(parent_class_cast, name, args, def_ret urn)\
((parent_class_cast(parent_class)->name != NULL) ? \ ((parent_class_cast(parent_class)->name != NULL) ? \
parent_class_cast(parent_class)->name args : def_return) parent_class_cast(parent_class)->name args : def_return)
/* Define PUT and GET functions for unaligned memory */ /* Define PUT and GET functions for unaligned memory */
#define _GST_GET(__data, __idx, __size, __shift) \ #define _GST_GET(__data, __idx, __size, __shift) \
(((guint##__size) (((guint8 *) (__data))[__idx])) << __shift) (((guint##__size) (((const guint8 *) (__data))[__idx])) << (__shift))
#define _GST_PUT(__data, __idx, __size, __shift, __num) \ #define _GST_PUT(__data, __idx, __size, __shift, __num) \
(((guint8 *) (__data))[__idx] = (((guint##__size) __num) >> __shift) & 0xff) (((guint8 *) (__data))[__idx] = (((guint##__size) (__num)) >> (__shift) ) & 0xff)
/** /**
* GST_READ_UINT64_BE: * GST_READ_UINT64_BE:
* @data: memory location * @data: memory location
* *
* Read a 64 bit unsigned integer value in big endian format from the memor y buffer. * Read a 64 bit unsigned integer value in big endian format from the memor y buffer.
*/ */
#define GST_READ_UINT64_BE(data) (_GST_GET (data, 0, 64, 56) | \ #define GST_READ_UINT64_BE(data) (_GST_GET (data, 0, 64, 56) | \
_GST_GET (data, 1, 64, 48) | \ _GST_GET (data, 1, 64, 48) | \
_GST_GET (data, 2, 64, 40) | \ _GST_GET (data, 2, 64, 40) | \
skipping to change at line 514 skipping to change at line 515
/* Float endianess conversion macros */ /* Float endianess conversion macros */
/* FIXME: Remove this once we depend on a GLib version with this */ /* FIXME: Remove this once we depend on a GLib version with this */
#ifndef GFLOAT_FROM_LE #ifndef GFLOAT_FROM_LE
/** /**
* GFLOAT_SWAP_LE_BE: * GFLOAT_SWAP_LE_BE:
* @in: input value * @in: input value
* *
* Swap byte order of a 32-bit floating point value (float). * Swap byte order of a 32-bit floating point value (float).
* *
* Returns: @in byte-swapped.
*
* Since: 0.10.22 * Since: 0.10.22
* *
*/ */
#ifdef _FOOL_GTK_DOC_ #ifdef _FOOL_GTK_DOC_
G_INLINE_FUNC gfloat GFLOAT_SWAP_LE_BE (gfloat in); G_INLINE_FUNC gfloat GFLOAT_SWAP_LE_BE (gfloat in);
#endif #endif
inline static gfloat inline static gfloat
GFLOAT_SWAP_LE_BE(gfloat in) GFLOAT_SWAP_LE_BE(gfloat in)
{ {
skipping to change at line 541 skipping to change at line 544
u.i = GUINT32_SWAP_LE_BE (u.i); u.i = GUINT32_SWAP_LE_BE (u.i);
return u.f; return u.f;
} }
/** /**
* GDOUBLE_SWAP_LE_BE: * GDOUBLE_SWAP_LE_BE:
* @in: input value * @in: input value
* *
* Swap byte order of a 64-bit floating point value (double). * Swap byte order of a 64-bit floating point value (double).
* *
* Returns: @in byte-swapped.
*
* Since: 0.10.22 * Since: 0.10.22
* *
*/ */
#ifdef _FOOL_GTK_DOC_ #ifdef _FOOL_GTK_DOC_
G_INLINE_FUNC gdouble GDOUBLE_SWAP_LE_BE (gdouble in); G_INLINE_FUNC gdouble GDOUBLE_SWAP_LE_BE (gdouble in);
#endif #endif
inline static gdouble inline static gdouble
GDOUBLE_SWAP_LE_BE(gdouble in) GDOUBLE_SWAP_LE_BE(gdouble in)
{ {
skipping to change at line 673 skipping to change at line 678
#define GDOUBLE_FROM_BE(val) (GDOUBLE_TO_BE (val)) #define GDOUBLE_FROM_BE(val) (GDOUBLE_TO_BE (val))
#endif /* !defined(GFLOAT_FROM_LE) */ #endif /* !defined(GFLOAT_FROM_LE) */
/** /**
* GST_READ_FLOAT_LE: * GST_READ_FLOAT_LE:
* @data: memory location * @data: memory location
* *
* Read a 32 bit float value in little endian format from the memory buffer . * Read a 32 bit float value in little endian format from the memory buffer .
* *
* Returns: The floating point value read from @data
*
* Since: 0.10.22 * Since: 0.10.22
* *
*/ */
#ifdef _FOOL_GTK_DOC_ #ifdef _FOOL_GTK_DOC_
G_INLINE_FUNC gfloat GST_READ_FLOAT_LE (const guint8 *data); G_INLINE_FUNC gfloat GST_READ_FLOAT_LE (const guint8 *data);
#endif #endif
inline static gfloat inline static gfloat
GST_READ_FLOAT_LE(const guint8 *data) GST_READ_FLOAT_LE(const guint8 *data)
{ {
skipping to change at line 699 skipping to change at line 706
u.i = GST_READ_UINT32_LE (data); u.i = GST_READ_UINT32_LE (data);
return u.f; return u.f;
} }
/** /**
* GST_READ_FLOAT_BE: * GST_READ_FLOAT_BE:
* @data: memory location * @data: memory location
* *
* Read a 32 bit float value in big endian format from the memory buffer. * Read a 32 bit float value in big endian format from the memory buffer.
* *
* Returns: The floating point value read from @data
*
* Since: 0.10.22 * Since: 0.10.22
* *
*/ */
#ifdef _FOOL_GTK_DOC_ #ifdef _FOOL_GTK_DOC_
G_INLINE_FUNC gfloat GST_READ_FLOAT_BE (const guint8 *data); G_INLINE_FUNC gfloat GST_READ_FLOAT_BE (const guint8 *data);
#endif #endif
inline static gfloat inline static gfloat
GST_READ_FLOAT_BE(const guint8 *data) GST_READ_FLOAT_BE(const guint8 *data)
{ {
skipping to change at line 725 skipping to change at line 734
u.i = GST_READ_UINT32_BE (data); u.i = GST_READ_UINT32_BE (data);
return u.f; return u.f;
} }
/** /**
* GST_READ_DOUBLE_LE: * GST_READ_DOUBLE_LE:
* @data: memory location * @data: memory location
* *
* Read a 64 bit double value in little endian format from the memory buffe r. * Read a 64 bit double value in little endian format from the memory buffe r.
* *
* Returns: The double-precision floating point value read from @data
*
* Since: 0.10.22 * Since: 0.10.22
* *
*/ */
#ifdef _FOOL_GTK_DOC_ #ifdef _FOOL_GTK_DOC_
G_INLINE_FUNC gdouble GST_READ_DOUBLE_LE (const guint8 *data); G_INLINE_FUNC gdouble GST_READ_DOUBLE_LE (const guint8 *data);
#endif #endif
inline static gdouble inline static gdouble
GST_READ_DOUBLE_LE(const guint8 *data) GST_READ_DOUBLE_LE(const guint8 *data)
{ {
skipping to change at line 751 skipping to change at line 762
u.i = GST_READ_UINT64_LE (data); u.i = GST_READ_UINT64_LE (data);
return u.d; return u.d;
} }
/** /**
* GST_READ_DOUBLE_BE: * GST_READ_DOUBLE_BE:
* @data: memory location * @data: memory location
* *
* Read a 64 bit double value in big endian format from the memory buffer. * Read a 64 bit double value in big endian format from the memory buffer.
* *
* Returns: The double-precision floating point value read from @data
*
* Since: 0.10.22 * Since: 0.10.22
* *
*/ */
#ifdef _FOOL_GTK_DOC_ #ifdef _FOOL_GTK_DOC_
G_INLINE_FUNC gdouble GST_READ_DOUBLE_BE (const guint8 *data); G_INLINE_FUNC gdouble GST_READ_DOUBLE_BE (const guint8 *data);
#endif #endif
inline static gdouble inline static gdouble
GST_READ_DOUBLE_BE(const guint8 *data) GST_READ_DOUBLE_BE(const guint8 *data)
{ {
skipping to change at line 979 skipping to change at line 992
/** /**
* GST_ROUND_DOWN_64: * GST_ROUND_DOWN_64:
* @num: integer value to round down * @num: integer value to round down
* *
* Rounds an integer value down to the next multiple of 64. * Rounds an integer value down to the next multiple of 64.
* *
* Since: 0.10.12 * Since: 0.10.12
*/ */
#define GST_ROUND_DOWN_64(num) ((num)&(~63)) #define GST_ROUND_DOWN_64(num) ((num)&(~63))
void gst_object_default_error (GstObject * source, void gst_object_default_error (GstObject * sour
GError * error, gch ce,
ar * debug); const GError * erro
r,
const gchar * debu
g);
/* element functions */ /* element functions */
void gst_element_create_all_pads (GstElement *elemen t); void gst_element_create_all_pads (GstElement *elemen t);
GstPad* gst_element_get_compatible_pad (GstElement *elemen t, GstPad *pad, GstPad* gst_element_get_compatible_pad (GstElement *elemen t, GstPad *pad,
const GstCaps *caps ); const GstCaps *caps );
GstPadTemplate* gst_element_get_compatible_pad_template (GstElement *element, GstPadTemplate *compattempl); GstPadTemplate* gst_element_get_compatible_pad_template (GstElement *element, GstPadTemplate *compattempl);
G_CONST_RETURN gchar* gst_element_state_get_name (GstState state); G_CONST_RETURN gchar* gst_element_state_get_name (GstState state);
G_CONST_RETURN gchar * gst_element_state_change_return_get_name (GstStateC hangeReturn state_ret); G_CONST_RETURN gchar * gst_element_state_change_return_get_name (GstStateC hangeReturn state_ret);
skipping to change at line 1004 skipping to change at line 1018
GstElement *element _2, ...) G_GNUC_NULL_TERMINATED; GstElement *element _2, ...) G_GNUC_NULL_TERMINATED;
gboolean gst_element_link_filtered (GstElement * src, gboolean gst_element_link_filtered (GstElement * src,
GstElement * dest, GstElement * dest,
GstCaps *filter); GstCaps *filter);
void gst_element_unlink (GstElement *src, G stElement *dest); void gst_element_unlink (GstElement *src, G stElement *dest);
void gst_element_unlink_many (GstElement *elemen t_1, void gst_element_unlink_many (GstElement *elemen t_1,
GstElement *element _2, ...) G_GNUC_NULL_TERMINATED; GstElement *element _2, ...) G_GNUC_NULL_TERMINATED;
gboolean gst_element_link_pads (GstElement *src, co nst gchar *srcpadname, gboolean gst_element_link_pads (GstElement *src, co nst gchar *srcpadname,
GstElement *dest, c onst gchar *destpadname); GstElement *dest, c onst gchar *destpadname);
gboolean gst_element_link_pads_full (GstElement *src, co
nst gchar *srcpadname,
GstElement *dest, c
onst gchar *destpadname,
GstPadLinkCheck fla
gs);
void gst_element_unlink_pads (GstElement *src, c onst gchar *srcpadname, void gst_element_unlink_pads (GstElement *src, c onst gchar *srcpadname,
GstElement *dest, c onst gchar *destpadname); GstElement *dest, c onst gchar *destpadname);
gboolean gst_element_link_pads_filtered (GstElement * src, c onst gchar * srcpadname, gboolean gst_element_link_pads_filtered (GstElement * src, c onst gchar * srcpadname,
GstElement * dest, const gchar * destpadname, GstElement * dest, const gchar * destpadname,
GstCaps *filter); GstCaps *filter);
gboolean gst_element_seek_simple (GstElement *elem ent, gboolean gst_element_seek_simple (GstElement *elem ent,
GstFormat form at, GstFormat form at,
GstSeekFlags seek _flags, GstSeekFlags seek _flags,
skipping to change at line 1150 skipping to change at line 1167
GST_SEARCH_MODE_EXACT = 0, GST_SEARCH_MODE_EXACT = 0,
GST_SEARCH_MODE_BEFORE, GST_SEARCH_MODE_BEFORE,
GST_SEARCH_MODE_AFTER GST_SEARCH_MODE_AFTER
} GstSearchMode; } GstSearchMode;
gpointer gst_util_array_binary_search (gpointer array, guint num_elements, gpointer gst_util_array_binary_search (gpointer array, guint num_elements,
gsize element_si ze, GCompareDataFunc search_func, gsize element_si ze, GCompareDataFunc search_func,
GstSearchMode mod e, gconstpointer search_data, GstSearchMode mod e, gconstpointer search_data,
gpointer user_dat a); gpointer user_dat a);
gint gst_util_greatest_common_divisor (gint a, gint b);
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, gin
t *res_n, gint *res_d);
gint gst_util_fraction_compare (gint a_n, gint a_d, gint b_n, gint b_d);
/* sink message event
*
* FIXME: This should be in gstevent.h but can't because
* it needs GstMessage and this would introduce circular
* header includes. And forward declarations of typedefs
* are unfortunately not possible. The implementation of
* these functions is in gstevent.c.
*/
GstEvent* gst_event_new_sink_message (GstMessage *msg);
void gst_event_parse_sink_message (GstEvent *event, GstMessag
e **msg);
G_END_DECLS G_END_DECLS
#endif /* __GST_UTILS_H__ */ #endif /* __GST_UTILS_H__ */
 End of changes. 16 change blocks. 
19 lines changed or deleted 66 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/