![]() |
![]() |
![]() |
GStreamer 0.9 Core Reference Manual | ![]() |
---|
GstUtilsGstUtils — Various utility functions |
#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 GST_READ_UINT8 (data) #define GST_READ_UINT16_LE (data) #define GST_READ_UINT16_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) #define GST_WRITE_UINT8 (data, num) #define GST_WRITE_UINT16_LE (data, num) #define GST_WRITE_UINT16_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) #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) void gst_atomic_int_set (gint *atomic_int, gint value); void gst_bin_watch_for_state_change (GstBin *bin); const gchar* gst_flow_get_name (GstFlowReturn ret); void gst_print_element_args (GString *buf, gint indent, GstElement *element); void gst_print_pad_caps (GString *buf, gint indent, GstPad *pad); void gst_util_dump_mem (const guchar *mem, guint size); guint64 gst_util_uint64_scale (guint64 val, guint64 num, guint64 denom); 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);
#define GST_BOILERPLATE_WITH_INTERFACE(type, type_as_function, parent_type, \ parent_type_as_macro, interface_type, interface_type_as_macro, \ interface_as_function)
type : |
|
type_as_function : |
|
parent_type : |
@\ parent_type_as_macro: @\ parent_type_as_macro: @\ parent_type_as_macro: @\ parent_type_as_macro: @\ parent_type_as_macro: @\ parent_type_as_macro: @\ parent_type_as_macro: @\ parent_type_as_macro: @\ parent_type_as_macro: @\ parent_type_as_macro: |
interface_type : |
|
interface_type_as_macro : |
@\ interface_as_function: @\ interface_as_function: @\ interface_as_function: @\ interface_as_function: @\ interface_as_function: @\ interface_as_function: @\ interface_as_function: @\ interface_as_function: @\ interface_as_function: @\ interface_as_function: |
#define GST_BOILERPLATE_FULL(type, type_as_function, parent_type, parent_type_macro, additional_initializations)
type : |
|
type_as_function : |
|
parent_type : |
|
parent_type_macro : |
|
additional_initializations : |
#define GST_BOILERPLATE(type,type_as_function,parent_type,parent_type_macro)
type : |
|
type_as_function : |
|
parent_type : |
|
parent_type_macro : |
#define GST_CALL_PARENT(parent_class_cast, name, args)
parent_class_cast : |
|
name : |
|
args : |
#define GST_CALL_PARENT_WITH_DEFAULT(parent_class_cast, name, args, def_return)
parent_class_cast : |
|
name : |
|
args : |
|
def_return : |
void gst_atomic_int_set (gint *atomic_int, gint value);
Unconditionally sets the atomic integer to value
.
atomic_int : |
pointer to an atomic integer |
value : |
value to set |
void gst_bin_watch_for_state_change (GstBin *bin);
Spawns a thread calling gst_element_get_state on bin
with infinite timeout.
In practice this is done because if a bin returns GST_STATE_CHANGE_ASYNC
from a
state change it will not commit its state until someone calls
gst_element_get_state()
on it. Thus having another thread checking the bin's
state will ensure that a state-changed message gets posted on the bus
eventually.
This function is admittedly a bit of a hack. Bins should always post messages. However this behavior was broken out into this function to avoid spawning threads when scrubbing, when the bin's state is changing quickly and asynchronously.
bin : |
the bin to watch for state changes |
const gchar* gst_flow_get_name (GstFlowReturn ret);
Gets a string representing the given flow return.
ret : |
a GstFlowReturn to get the name of. |
Returns : | a string with the name of the flow return. |
void gst_print_element_args (GString *buf, gint indent, GstElement *element);
Print the element argument in a human readable format in the given GString.
buf : |
the buffer to print the args in |
indent : |
initial indentation |
element : |
the element to print the args of |
void gst_print_pad_caps (GString *buf, gint indent, GstPad *pad);
Write the pad capabilities in a human readable format into the given GString.
buf : |
the buffer to print the caps in |
indent : |
initial indentation |
pad : |
the pad to print the caps from |
void gst_util_dump_mem (const guchar *mem, guint size);
Dumps the memory block into a hex representation. Useful for debugging.
mem : |
a pointer to the memory to dump |
size : |
the size of the memory block to dump |
guint64 gst_util_uint64_scale (guint64 val, guint64 num, guint64 denom);
Scale val
by num
/ denom
, trying to avoid overflows.
val : |
the number to scale |
num : |
the numerator of the scale ratio |
denom : |
the denominator of the scale ratio |
Returns : | val * num / denom , trying to avoid overflows.
|
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.
object : |
the object to set the argument of |
name : |
the name of the argument to set |
value : |
the string value to set |
<< GstUriType | GstValue >> |