![]() |
![]() |
![]() |
GStreamer 0.10 Core Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <gst/gst.h> #define GST_BOILERPLATE_WITH_INTERFACE (type, type_as_function, parent_type, parent_type_as_macro, interface_type, interface_type_as_macro, interface_as_function) #define GST_BOILERPLATE_FULL (type, type_as_function, parent_type, parent_type_macro, additional_initializations) #define GST_BOILERPLATE (type, type_as_function, parent_type, parent_type_macro) #define GST_CALL_PARENT (parent_class_cast, name, args) #define GST_CALL_PARENT_WITH_DEFAULT (parent_class_cast, name, args, def_return) #define GDOUBLE_FROM_BE (val) #define GDOUBLE_FROM_LE (val) #define GDOUBLE_TO_BE (val) #define GDOUBLE_TO_LE (val) gdouble GDOUBLE_SWAP_LE_BE (gdouble in
); #define GFLOAT_FROM_BE (val) #define GFLOAT_FROM_LE (val) #define GFLOAT_TO_BE (val) #define GFLOAT_TO_LE (val) gfloat GFLOAT_SWAP_LE_BE (gfloat in
); #define GST_READ_UINT8 (data) #define GST_READ_UINT16_LE (data) #define GST_READ_UINT16_BE (data) #define GST_READ_UINT24_LE (data) #define GST_READ_UINT24_BE (data) #define GST_READ_UINT32_LE (data) #define GST_READ_UINT32_BE (data) #define GST_READ_UINT64_LE (data) #define GST_READ_UINT64_BE (data) gfloat GST_READ_FLOAT_LE (const guint8 *data
); gfloat GST_READ_FLOAT_BE (const guint8 *data
); gdouble GST_READ_DOUBLE_LE (const guint8 *data
); gdouble GST_READ_DOUBLE_BE (const guint8 *data
); #define GST_WRITE_UINT8 (data, num) #define GST_WRITE_UINT16_LE (data, num) #define GST_WRITE_UINT16_BE (data, num) #define GST_WRITE_UINT24_LE (data, num) #define GST_WRITE_UINT24_BE (data, num) #define GST_WRITE_UINT32_LE (data, num) #define GST_WRITE_UINT32_BE (data, num) #define GST_WRITE_UINT64_LE (data, num) #define GST_WRITE_UINT64_BE (data, num) void GST_WRITE_FLOAT_LE (guint8 *data
,gfloat num
); void GST_WRITE_FLOAT_BE (guint8 *data
,gfloat num
); void GST_WRITE_DOUBLE_LE (guint8 *data
,gdouble num
); void GST_WRITE_DOUBLE_BE (guint8 *data
,gdouble num
); #define GST_ROUND_UP_2 (num) #define GST_ROUND_UP_4 (num) #define GST_ROUND_UP_8 (num) #define GST_ROUND_UP_16 (num) #define GST_ROUND_UP_32 (num) #define GST_ROUND_UP_64 (num) #define GST_ROUND_DOWN_2 (num) #define GST_ROUND_DOWN_4 (num) #define GST_ROUND_DOWN_8 (num) #define GST_ROUND_DOWN_16 (num) #define GST_ROUND_DOWN_32 (num) #define GST_ROUND_DOWN_64 (num) void gst_atomic_int_set (gint *atomic_int
,gint value
); const gchar * gst_flow_get_name (GstFlowReturn ret
); GQuark gst_flow_to_quark (GstFlowReturn ret
); void gst_print_element_args (GString *buf
,gint indent
,GstElement *element
); void gst_print_pad_caps (GString *buf
,gint indent
,GstPad *pad
); #define gst_guint64_to_gdouble (value) #define gst_gdouble_to_guint64 (value) GType gst_type_register_static_full (GType parent_type
,const gchar *type_name
,guint class_size
,GBaseInitFunc base_init
,GBaseFinalizeFunc base_finalize
,GClassInitFunc class_init
,GClassFinalizeFunc class_finalize
,gconstpointer class_data
,guint instance_size
,guint16 n_preallocs
,GInstanceInitFunc instance_init
,const GTypeValueTable *value_table
,GTypeFlags flags
); void gst_util_dump_mem (const guchar *mem
,guint size
); 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
); 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
); 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
,gint *res_n
,gint *res_d
); gint gst_util_fraction_compare (gint a_n
,gint a_d
,gint b_n
,gint b_d
); guint32 gst_util_seqnum_next (void
); gint32 gst_util_seqnum_compare (guint32 s1
,guint32 s2
); void gst_util_set_object_arg (GObject *object
,const gchar *name
,const gchar *value
); void gst_util_set_value_from_string (GValue *value
,const gchar *value_str
); GstClockTime gst_util_get_timestamp (void
); enum GstSearchMode; 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
);
#define GST_BOILERPLATE_WITH_INTERFACE(type, type_as_function, \ parent_type, parent_type_as_macro, interface_type, \ interface_type_as_macro, interface_as_function)
Like GST_BOILERPLATE, but makes the type 1) implement an interface, and 2) implement GstImplementsInterface for that type.
After this you will need to implement interface_as_function ## _supported and interface_as_function ## _interface_init
|
the name of the type struct |
|
the prefix for the functions |
|
the parent type struct name |
|
the parent type macro |
|
the name of the interface type struct |
|
the interface type macro |
|
the interface function name prefix |
#define GST_BOILERPLATE_FULL(type, type_as_function, parent_type, parent_type_macro, additional_initializations)
Define the boilerplate type stuff to reduce typos and code size. Defines the get_type method and the parent_class static variable.
1 |
GST_BOILERPLATE_FULL (GstFdSink, gst_fdsink, GstElement, GST_TYPE_ELEMENT, _do_init); |
|
the name of the type struct |
|
the prefix for the functions |
|
the parent type struct name |
|
the parent type macro |
|
function pointer in the form of void additional_initializations (GType type) that can be used for initializing interfaces and the like |
#define GST_BOILERPLATE(type,type_as_function,parent_type,parent_type_macro)
Define the boilerplate type stuff to reduce typos and code size. Defines the get_type method and the parent_class static variable.
1 |
GST_BOILERPLATE (GstFdSink, gst_fdsink, GstElement, GST_TYPE_ELEMENT); |
|
the name of the type struct |
|
the prefix for the functions |
|
the parent type struct name |
|
the parent type macro |
#define GST_CALL_PARENT(parent_class_cast, name, args)
Just call the parent handler. This assumes that there is a variable 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 the _WITH_DEFAULT version for that
|
the name of the class cast macro for the parent type |
|
name of the function to call |
|
arguments enclosed in '( )' |
#define GST_CALL_PARENT_WITH_DEFAULT(parent_class_cast, name, args, def_return)
Same as GST_CALL_PARENT()
, but in case there is no implementation, it
evaluates to def_return
.
|
the name of the class cast macro for the parent type |
|
name of the function to call |
|
arguments enclosed in '( )' |
|
default result |
#define GDOUBLE_FROM_BE(val) (GDOUBLE_TO_BE (val))
Convert 64-bit floating point value (double) from big endian byte order into native byte order.
|
value |
Since 0.10.22
#define GDOUBLE_FROM_LE(val) (GDOUBLE_TO_LE (val))
Convert 64-bit floating point value (double) from little endian byte order into native byte order.
|
value |
Since 0.10.22
#define GDOUBLE_TO_BE(val) (GDOUBLE_SWAP_LE_BE (val))
Convert 64-bit floating point value (double) from native byte order into big endian byte order.
|
value |
Since 0.10.22
#define GDOUBLE_TO_LE(val) ((gdouble) (val))
Convert 64-bit floating point value (double) from native byte order into little endian byte order.
|
value |
Since 0.10.22
gdouble GDOUBLE_SWAP_LE_BE (gdouble in
);
Swap byte order of a 64-bit floating point value (double).
|
input value |
Returns : |
in byte-swapped. |
Since 0.10.22
#define GFLOAT_FROM_BE(val) (GFLOAT_TO_BE (val))
Convert 32-bit floating point value (float) from big endian byte order into native byte order.
|
value |
Since 0.10.22
#define GFLOAT_FROM_LE(val) (GFLOAT_TO_LE (val))
Convert 32-bit floating point value (float) from little endian byte order into native byte order.
|
value |
Since 0.10.22
#define GFLOAT_TO_BE(val) (GFLOAT_SWAP_LE_BE (val))
Convert 32-bit floating point value (float) from native byte order into big endian byte order.
|
value |
Since 0.10.22
#define GFLOAT_TO_LE(val) ((gfloat) (val))
Convert 32-bit floating point value (float) from native byte order into little endian byte order.
|
value |
Since 0.10.22
gfloat GFLOAT_SWAP_LE_BE (gfloat in
);
Swap byte order of a 32-bit floating point value (float).
|
input value |
Returns : |
in byte-swapped. |
Since 0.10.22
#define GST_READ_UINT8(data) (_GST_GET (data, 0, 8, 0))
Read an 8 bit unsigned integer value from the memory buffer.
|
memory location |
#define GST_READ_UINT16_LE(data)
Read a 16 bit unsigned integer value in little endian format from the memory buffer.
|
memory location |
#define GST_READ_UINT16_BE(data)
Read a 16 bit unsigned integer value in big endian format from the memory buffer.
|
memory location |
#define GST_READ_UINT24_LE(data)
Read a 24 bit unsigned integer value in little endian format from the memory buffer.
|
memory location |
Since 0.10.22
#define GST_READ_UINT24_BE(data)
Read a 24 bit unsigned integer value in big endian format from the memory buffer.
|
memory location |
Since 0.10.22
#define GST_READ_UINT32_LE(data)
Read a 32 bit unsigned integer value in little endian format from the memory buffer.
|
memory location |
#define GST_READ_UINT32_BE(data)
Read a 32 bit unsigned integer value in big endian format from the memory buffer.
|
memory location |
#define GST_READ_UINT64_LE(data)
Read a 64 bit unsigned integer value in little endian format from the memory buffer.
|
memory location |
#define GST_READ_UINT64_BE(data)
Read a 64 bit unsigned integer value in big endian format from the memory buffer.
|
memory location |
gfloat GST_READ_FLOAT_LE (const guint8 *data
);
Read a 32 bit float value in little endian format from the memory buffer.
|
memory location |
Returns : |
The floating point value read from data
|
Since 0.10.22
gfloat GST_READ_FLOAT_BE (const guint8 *data
);
Read a 32 bit float value in big endian format from the memory buffer.
|
memory location |
Returns : |
The floating point value read from data
|
Since 0.10.22
gdouble GST_READ_DOUBLE_LE (const guint8 *data
);
Read a 64 bit double value in little endian format from the memory buffer.
|
memory location |
Returns : |
The double-precision floating point value read from data
|
Since 0.10.22
gdouble GST_READ_DOUBLE_BE (const guint8 *data
);
Read a 64 bit double value in big endian format from the memory buffer.
|
memory location |
Returns : |
The double-precision floating point value read from data
|
Since 0.10.22
#define GST_WRITE_UINT8(data, num)
Store an 8 bit unsigned integer value into the memory buffer.
|
memory location |
|
value to store |
#define GST_WRITE_UINT16_LE(data, num)
Store a 16 bit unsigned integer value in little endian format into the memory buffer.
|
memory location |
|
value to store |
#define GST_WRITE_UINT16_BE(data, num)
Store a 16 bit unsigned integer value in big endian format into the memory buffer.
|
memory location |
|
value to store |
#define GST_WRITE_UINT24_LE(data, num)
Store a 24 bit unsigned integer value in little endian format into the memory buffer.
|
memory location |
|
value to store |
Since 0.10.22
#define GST_WRITE_UINT24_BE(data, num)
Store a 24 bit unsigned integer value in big endian format into the memory buffer.
|
memory location |
|
value to store |
Since 0.10.22
#define GST_WRITE_UINT32_LE(data, num)
Store a 32 bit unsigned integer value in little endian format into the memory buffer.
|
memory location |
|
value to store |
#define GST_WRITE_UINT32_BE(data, num)
Store a 32 bit unsigned integer value in big endian format into the memory buffer.
|
memory location |
|
value to store |
#define GST_WRITE_UINT64_LE(data, num)
Store a 64 bit unsigned integer value in little endian format into the memory buffer.
|
memory location |
|
value to store |
#define GST_WRITE_UINT64_BE(data, num)
Store a 64 bit unsigned integer value in big endian format into the memory buffer.
|
memory location |
|
value to store |
void GST_WRITE_FLOAT_LE (guint8 *data
,gfloat num
);
Store a 32 bit float value in little endian format into the memory buffer.
|
memory location |
|
value to store |
Since 0.10.22
void GST_WRITE_FLOAT_BE (guint8 *data
,gfloat num
);
Store a 32 bit float value in big endian format into the memory buffer.
|
memory location |
|
value to store |
Since 0.10.22
void GST_WRITE_DOUBLE_LE (guint8 *data
,gdouble num
);
Store a 64 bit double value in little endian format into the memory buffer.
|
memory location |
|
value to store |
Since 0.10.22
void GST_WRITE_DOUBLE_BE (guint8 *data
,gdouble num
);
Store a 64 bit double value in big endian format into the memory buffer.
|
memory location |
|
value to store |
Since 0.10.22
#define GST_ROUND_UP_2(num) (((num)+1)&~1)
Rounds an integer value up to the next multiple of 2.
|
integer value to round up |
#define GST_ROUND_UP_4(num) (((num)+3)&~3)
Rounds an integer value up to the next multiple of 4.
|
integer value to round up |
#define GST_ROUND_UP_8(num) (((num)+7)&~7)
Rounds an integer value up to the next multiple of 8.
|
integer value to round up |
#define GST_ROUND_UP_16(num) (((num)+15)&~15)
Rounds an integer value up to the next multiple of 16.
|
integer value to round up |
#define GST_ROUND_UP_32(num) (((num)+31)&~31)
Rounds an integer value up to the next multiple of 32.
|
integer value to round up |
#define GST_ROUND_UP_64(num) (((num)+63)&~63)
Rounds an integer value up to the next multiple of 64.
|
integer value to round up |
#define GST_ROUND_DOWN_2(num) ((num)&(~1))
Rounds an integer value down to the next multiple of 2.
|
integer value to round down |
Since 0.10.12
#define GST_ROUND_DOWN_4(num) ((num)&(~3))
Rounds an integer value down to the next multiple of 4.
|
integer value to round down |
Since 0.10.12
#define GST_ROUND_DOWN_8(num) ((num)&(~7))
Rounds an integer value down to the next multiple of 8.
|
integer value to round down |
Since 0.10.12
#define GST_ROUND_DOWN_16(num) ((num)&(~15))
Rounds an integer value down to the next multiple of 16.
|
integer value to round down |
Since 0.10.12
#define GST_ROUND_DOWN_32(num) ((num)&(~31))
Rounds an integer value down to the next multiple of 32.
|
integer value to round down |
Since 0.10.12
#define GST_ROUND_DOWN_64(num) ((num)&(~63))
Rounds an integer value down to the next multiple of 64.
|
integer value to round down |
Since 0.10.12
void gst_atomic_int_set (gint *atomic_int
,gint value
);
gst_atomic_int_set
is deprecated and should not be used in newly-written code. Use g_atomic_int_set()
.
Unconditionally sets the atomic integer to value
.
|
pointer to an atomic integer. [inout] |
|
value to set |
const gchar * gst_flow_get_name (GstFlowReturn ret
);
Gets a string representing the given flow return.
|
a GstFlowReturn to get the name of. |
Returns : |
a static string with the name of the flow return. |
GQuark gst_flow_to_quark (GstFlowReturn ret
);
Get the unique quark for the given GstFlowReturn.
|
a GstFlowReturn to get the quark of. |
Returns : |
the quark associated with the flow return or 0 if an invalid return was specified. |
void gst_print_element_args (GString *buf
,gint indent
,GstElement *element
);
Print the element argument in a human readable format in the given GString.
|
the buffer to print the args in |
|
initial indentation |
|
the element to print the args of. [transfer none] |
void gst_print_pad_caps (GString *buf
,gint indent
,GstPad *pad
);
Write the pad capabilities in a human readable format into the given GString.
|
the buffer to print the caps in |
|
initial indentation |
|
the pad to print the caps from. [transfer none] |
#define gst_guint64_to_gdouble(value) gst_util_guint64_to_gdouble(value)
Convert value
to a gdouble.
#define gst_gdouble_to_guint64(value) gst_util_gdouble_to_guint64(value)
Convert value
to a guint64.
GType gst_type_register_static_full (GType parent_type
,const gchar *type_name
,guint class_size
,GBaseInitFunc base_init
,GBaseFinalizeFunc base_finalize
,GClassInitFunc class_init
,GClassFinalizeFunc class_finalize
,gconstpointer class_data
,guint instance_size
,guint16 n_preallocs
,GInstanceInitFunc instance_init
,const GTypeValueTable *value_table
,GTypeFlags flags
);
Helper function which constructs a GTypeInfo structure and registers a GType, but which generates less linker overhead than a static const GTypeInfo structure. For further details of the parameters, please see GTypeInfo in the GLib documentation.
Registers type_name as the name of a new static type derived from
parent_type. The value of flags determines the nature (e.g. abstract or
not) of the type. It works by filling a GTypeInfo struct and calling
g_type_register_static()
.
|
The GType of the parent type the newly registered type will derive from |
|
NULL-terminated string used as the name of the new type |
|
Size of the class structure. |
|
Location of the base initialization function (optional). |
|
Location of the base finalization function (optional). |
|
Location of the class initialization function for class types Location of the default vtable inititalization function for interface types. (optional) |
|
Location of the class finalization function for class types. Location of the default vtable finalization function for interface types. (optional) |
|
User-supplied data passed to the class init/finalize functions. |
|
Size of the instance (object) structure (required for instantiatable types only). |
|
The number of pre-allocated (cached) instances to reserve memory for (0 indicates no caching). Ignored on recent GLib's. |
|
Location of the instance initialization function (optional, for instantiatable types only). |
|
A GTypeValueTable function table for generic handling of GValues of this type (usually only useful for fundamental types). |
|
GTypeFlags for this GType. E.g: G_TYPE_FLAG_ABSTRACT |
Returns : |
A GType for the newly-registered type. |
Since 0.10.14
void gst_util_dump_mem (const guchar *mem
,guint size
);
Dumps the memory block into a hex representation. Useful for debugging.
|
a pointer to the memory to dump |
|
the size of the memory block to dump |
guint64 gst_util_uint64_scale (guint64 val
,guint64 num
,guint64 denom
);
Scale val
by the rational number num
/ denom
, avoiding overflows and
underflows and without loss of precision.
This function can potentially be very slow if val and num are both greater than G_MAXUINT32.
|
the number to scale |
|
the numerator of the scale ratio |
|
the denominator of the scale ratio |
Returns : |
val * num / denom . In the case of an overflow, this
function returns G_MAXUINT64. If the result is not exactly
representable as an integer it is truncated. See also
gst_util_uint64_scale_round() , gst_util_uint64_scale_ceil() ,
gst_util_uint64_scale_int() , gst_util_uint64_scale_int_round() ,
gst_util_uint64_scale_int_ceil() . |
guint64 gst_util_uint64_scale_round (guint64 val
,guint64 num
,guint64 denom
);
Scale val
by the rational number num
/ denom
, avoiding overflows and
underflows and without loss of precision.
This function can potentially be very slow if val and num are both greater than G_MAXUINT32.
|
the number to scale |
|
the numerator of the scale ratio |
|
the denominator of the scale ratio |
Returns : |
val * num / denom . In the case of an overflow, this
function returns G_MAXUINT64. If the result is not exactly
representable as an integer, it is rounded to the nearest integer
(half-way cases are rounded up). See also gst_util_uint64_scale() ,
gst_util_uint64_scale_ceil() , gst_util_uint64_scale_int() ,
gst_util_uint64_scale_int_round() , gst_util_uint64_scale_int_ceil() . |
guint64 gst_util_uint64_scale_ceil (guint64 val
,guint64 num
,guint64 denom
);
Scale val
by the rational number num
/ denom
, avoiding overflows and
underflows and without loss of precision.
This function can potentially be very slow if val and num are both greater than G_MAXUINT32.
|
the number to scale |
|
the numerator of the scale ratio |
|
the denominator of the scale ratio |
Returns : |
val * num / denom . In the case of an overflow, this
function returns G_MAXUINT64. If the result is not exactly
representable as an integer, it is rounded up. See also
gst_util_uint64_scale() , gst_util_uint64_scale_round() ,
gst_util_uint64_scale_int() , gst_util_uint64_scale_int_round() ,
gst_util_uint64_scale_int_ceil() . |
guint64 gst_util_uint64_scale_int (guint64 val
,gint num
,gint denom
);
Scale val
by the rational number num
/ denom
, avoiding overflows and
underflows and without loss of precision. num
must be non-negative and
denom
must be positive.
|
guint64 (such as a GstClockTime) to scale. |
|
numerator of the scale factor. |
|
denominator of the scale factor. |
Returns : |
val * num / denom . In the case of an overflow, this
function returns G_MAXUINT64. If the result is not exactly
representable as an integer, it is truncated. See also
gst_util_uint64_scale_int_round() , gst_util_uint64_scale_int_ceil() ,
gst_util_uint64_scale() , gst_util_uint64_scale_round() ,
gst_util_uint64_scale_ceil() . |
guint64 gst_util_uint64_scale_int_round (guint64 val
,gint num
,gint denom
);
Scale val
by the rational number num
/ denom
, avoiding overflows and
underflows and without loss of precision. num
must be non-negative and
denom
must be positive.
|
guint64 (such as a GstClockTime) to scale. |
|
numerator of the scale factor. |
|
denominator of the scale factor. |
Returns : |
val * num / denom . In the case of an overflow, this
function returns G_MAXUINT64. If the result is not exactly
representable as an integer, it is rounded to the nearest integer
(half-way cases are rounded up). See also gst_util_uint64_scale_int() ,
gst_util_uint64_scale_int_ceil() , gst_util_uint64_scale() ,
gst_util_uint64_scale_round() , gst_util_uint64_scale_ceil() . |
guint64 gst_util_uint64_scale_int_ceil (guint64 val
,gint num
,gint denom
);
Scale val
by the rational number num
/ denom
, avoiding overflows and
underflows and without loss of precision. num
must be non-negative and
denom
must be positive.
|
guint64 (such as a GstClockTime) to scale. |
|
numerator of the scale factor. |
|
denominator of the scale factor. |
Returns : |
val * num / denom . In the case of an overflow, this
function returns G_MAXUINT64. If the result is not exactly
representable as an integer, it is rounded up. See also
gst_util_uint64_scale_int() , gst_util_uint64_scale_int_round() ,
gst_util_uint64_scale() , gst_util_uint64_scale_round() ,
gst_util_uint64_scale_ceil() . |
gint gst_util_greatest_common_divisor (gint a
,gint b
);
Calculates the greatest common divisor of a
and b
.
Since 0.10.26
void gst_util_fraction_to_double (gint src_n
,gint src_d
,gdouble *dest
);
Transforms a gdouble to a fraction and simplifies the result.
|
Fraction numerator as gint |
|
Fraction denominator gint |
|
pointer to a gdouble for the result. [out] |
Since 0.10.26
void gst_util_double_to_fraction (gdouble src
,gint *dest_n
,gint *dest_d
);
Transforms a gdouble to a fraction and simplifies the result.
|
gdouble to transform |
|
pointer to a gint to hold the result numerator. [out] |
|
pointer to a gint to hold the result denominator. [out] |
Since 0.10.26
gboolean gst_util_fraction_multiply (gint a_n
,gint a_d
,gint b_n
,gint b_d
,gint *res_n
,gint *res_d
);
Multiplies the fractions a_n
/a_d
and b_n
/b_d
and stores
the result in res_n
and res_d
.
|
Numerator of first value |
|
Denominator of first value |
|
Numerator of second value |
|
Denominator of second value |
|
Pointer to gint to hold the result numerator. [out] |
|
Pointer to gint to hold the result denominator. [out] |
Returns : |
FALSE on overflow, TRUE otherwise. |
Since 0.10.26
gboolean gst_util_fraction_add (gint a_n
,gint a_d
,gint b_n
,gint b_d
,gint *res_n
,gint *res_d
);
Adds the fractions a_n
/a_d
and b_n
/b_d
and stores
the result in res_n
and res_d
.
|
Numerator of first value |
|
Denominator of first value |
|
Numerator of second value |
|
Denominator of second value |
|
Pointer to gint to hold the result numerator. [out] |
|
Pointer to gint to hold the result denominator. [out] |
Returns : |
FALSE on overflow, TRUE otherwise. |
Since 0.10.26
gint gst_util_fraction_compare (gint a_n
,gint a_d
,gint b_n
,gint b_d
);
Compares the fractions a_n
/a_d
and b_n
/b_d
and returns
-1 if a < b, 0 if a = b and 1 if a > b.
|
Numerator of first value |
|
Denominator of first value |
|
Numerator of second value |
|
Denominator of second value |
Returns : |
-1 if a < b; 0 if a = b; 1 if a > b. |
Since 0.10.31
guint32 gst_util_seqnum_next (void
);
Return a constantly incrementing sequence number.
This function is used internally to GStreamer to be able to determine which events and messages are "the same". For example, elements may set the seqnum on a segment-done message to be the same as that of the last seek event, to indicate that event and the message correspond to the same segment.
Returns : |
A constantly incrementing 32-bit unsigned integer, which might
overflow back to 0 at some point. Use gst_util_seqnum_compare() to make sure
you handle wraparound correctly. |
Since 0.10.22
gint32 gst_util_seqnum_compare (guint32 s1
,guint32 s2
);
Compare two sequence numbers, handling wraparound.
The current implementation just returns (gint32)(s1
- s2
).
|
A sequence number. |
|
Another sequence number. |
Returns : |
A negative number if s1 is before s2 , 0 if they are equal, or a
positive number if s1 is after s2 . |
Since 0.10.22
void gst_util_set_object_arg (GObject *object
,const gchar *name
,const gchar *value
);
Convertes the string value to the type of the objects argument and sets the argument with it.
Note that this function silently returns if object
has no property named
name
or when value
cannot be converted to the type of the property.
|
the object to set the argument of |
|
the name of the argument to set |
|
the string value to set |
void gst_util_set_value_from_string (GValue *value
,const gchar *value_str
);
Converts the string to the type of the value and sets the value with it.
Note that this function is dangerous as it does not return any indication if the conversion worked or not.
|
the value to set. [out caller-allocates] |
|
the string to get the value from |
GstClockTime gst_util_get_timestamp (void
);
Get a timestamp as GstClockTime to be used for interval meassurements. The timestamp should not be interpreted in any other way.
Returns : |
the timestamp |
Since 0.10.16
typedef enum { GST_SEARCH_MODE_EXACT = 0, GST_SEARCH_MODE_BEFORE, GST_SEARCH_MODE_AFTER } GstSearchMode;
The different search modes.
Only search for exact matches. | |
Search for an exact match or the element just before. | |
Search for an exact match or the element just after. |
Since 0.10.23
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
);
Searches inside array
for search_data
by using the comparison function
search_func
. array
must be sorted ascending.
As search_data
is always passed as second argument to search_func
it's
not required that search_data
has the same type as the array elements.
The complexity of this search function is O(log (num_elements)).
|
the sorted input array |
|
number of elements in the array |
|
size of every element in bytes |
|
function to compare two elements, search_data will always be passed as second argument |
|
search mode that should be used |
|
element that should be found |
|
data to pass to search_func . [closure]
|
Returns : |
The address of the found element or NULL if nothing was found |
Since 0.10.23