X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gst%2Fgstvalue.h;h=38413b96a9edb0264d32a715e79f4191c0034dcd;hb=066b515985897495cae32fca5b7eeeec260c40c9;hp=5de7449cd532d87d776e581e879f3099f1cf7070;hpb=373be6f14ea8f548360dc565c6124c5368cc273c;p=platform%2Fupstream%2Fgstreamer.git diff --git a/gst/gstvalue.h b/gst/gstvalue.h index 5de7449..38413b9 100644 --- a/gst/gstvalue.h +++ b/gst/gstvalue.h @@ -86,14 +86,6 @@ G_BEGIN_DECLS ((gchar) (((fourcc)>>24)&0xff)) /** - * GST_VALUE_HOLDS_FOURCC: - * @x: the #GValue to check - * - * Checks if the given #GValue contains a #GST_TYPE_FOURCC value. - */ -#define GST_VALUE_HOLDS_FOURCC(x) (G_VALUE_HOLDS((x), gst_fourcc_get_type ())) - -/** * GST_VALUE_HOLDS_INT_RANGE: * @x: the #GValue to check * @@ -133,7 +125,7 @@ G_BEGIN_DECLS * * Checks if the given #GValue contains a #GST_TYPE_LIST value. */ -#define GST_VALUE_HOLDS_LIST(x) (G_VALUE_HOLDS((x), gst_value_list_get_type ())) +#define GST_VALUE_HOLDS_LIST(x) (G_VALUE_HOLDS((x), gst_value_list_get_type ())) /** * GST_VALUE_HOLDS_ARRAY: @@ -141,7 +133,7 @@ G_BEGIN_DECLS * * Checks if the given #GValue contains a #GST_TYPE_ARRAY value. */ -#define GST_VALUE_HOLDS_ARRAY(x) (G_VALUE_HOLDS((x), gst_value_array_get_type ())) +#define GST_VALUE_HOLDS_ARRAY(x) (G_VALUE_HOLDS((x), gst_value_array_get_type ())) /** * GST_VALUE_HOLDS_CAPS: @@ -149,7 +141,7 @@ G_BEGIN_DECLS * * Checks if the given #GValue contains a #GST_TYPE_CAPS value. */ -#define GST_VALUE_HOLDS_CAPS(x) (G_VALUE_HOLDS((x), GST_TYPE_CAPS)) +#define GST_VALUE_HOLDS_CAPS(x) (G_VALUE_HOLDS((x), GST_TYPE_CAPS)) /** * GST_VALUE_HOLDS_STRUCTURE: @@ -159,7 +151,7 @@ G_BEGIN_DECLS * * Since: 0.10.15 */ -#define GST_VALUE_HOLDS_STRUCTURE(x) (G_VALUE_HOLDS((x), GST_TYPE_STRUCTURE)) +#define GST_VALUE_HOLDS_STRUCTURE(x) (G_VALUE_HOLDS((x), GST_TYPE_STRUCTURE)) /** * GST_VALUE_HOLDS_BUFFER: @@ -170,20 +162,20 @@ G_BEGIN_DECLS #define GST_VALUE_HOLDS_BUFFER(x) (G_VALUE_HOLDS((x), GST_TYPE_BUFFER)) /** - * GST_VALUE_HOLDS_FRACTION: + * GST_VALUE_HOLDS_SAMPLE: * @x: the #GValue to check * - * Checks if the given #GValue contains a #GST_TYPE_FRACTION value. + * Checks if the given #GValue contains a #GST_TYPE_SAMPLE value. */ -#define GST_VALUE_HOLDS_FRACTION(x) (G_VALUE_HOLDS((x), gst_fraction_get_type ())) +#define GST_VALUE_HOLDS_SAMPLE(x) (G_VALUE_HOLDS((x), GST_TYPE_SAMPLE)) /** - * GST_VALUE_HOLDS_DATE: + * GST_VALUE_HOLDS_FRACTION: * @x: the #GValue to check * - * Checks if the given #GValue contains a #GST_TYPE_DATE value. + * Checks if the given #GValue contains a #GST_TYPE_FRACTION value. */ -#define GST_VALUE_HOLDS_DATE(x) (G_VALUE_HOLDS((x), gst_date_get_type ())) +#define GST_VALUE_HOLDS_FRACTION(x) (G_VALUE_HOLDS((x), gst_fraction_get_type ())) /** * GST_VALUE_HOLDS_DATE_TIME: @@ -196,13 +188,12 @@ G_BEGIN_DECLS #define GST_VALUE_HOLDS_DATE_TIME(x) (G_VALUE_HOLDS((x), gst_date_time_get_type ())) /** - * GST_TYPE_FOURCC: - * - * a #GValue type that represents 4 byte identifier (e.g. used for codecs) + * GST_VALUE_HOLDS_BITMASK: + * @x: the #GValue to check * - * Returns: the #GType of GstFourcc + * Checks if the given #GValue contains a #GST_TYPE_BITMASK value. */ -#define GST_TYPE_FOURCC gst_fourcc_get_type () +#define GST_VALUE_HOLDS_BITMASK(x) (G_VALUE_HOLDS((x), gst_bitmask_get_type ())) /** * GST_TYPE_INT_RANGE: @@ -267,7 +258,7 @@ G_BEGIN_DECLS * * Returns: the #GType of GstArrayList (which is not explicitly typed) */ -#define GST_TYPE_ARRAY gst_value_array_get_type () +#define GST_TYPE_ARRAY gst_value_array_get_type () /** * GST_TYPE_FRACTION: @@ -281,25 +272,25 @@ G_BEGIN_DECLS #define GST_TYPE_FRACTION gst_fraction_get_type () /** - * GST_TYPE_DATE: + * GST_TYPE_DATE_TIME: * - * a boxed #GValue type for #GDate that represents a date. + * a boxed #GValue type for #GstDateTime that represents a date and time. * - * Returns: the #GType of GstDate + * Returns: the #GType of GstDateTime + * Since: 0.10.31 */ -#define GST_TYPE_DATE gst_date_get_type () +#define GST_TYPE_DATE_TIME gst_date_time_get_type () /** - * GST_TYPE_DATE_TIME: + * GST_TYPE_BITMASK: * - * a boxed #GValue type for #GstDateTime that represents a date and time. + * a #GValue type that represents a 64-bit bitmask. * - * Returns: the #GType of GstDateTime - * Since: 0.10.31 + * Returns: the #GType of GstBitmask (which is not explicitly typed) */ -#define GST_TYPE_DATE_TIME gst_date_time_get_type () +#define GST_TYPE_BITMASK gst_bitmask_get_type () /** * GST_VALUE_LESS_THAN: @@ -344,7 +335,7 @@ G_BEGIN_DECLS * or GST_VALUE_UNORDERED */ typedef gint (* GstValueCompareFunc) (const GValue *value1, - const GValue *value2); + const GValue *value2); /** * GstValueSerializeFunc: @@ -368,55 +359,7 @@ typedef gchar * (* GstValueSerializeFunc) (const GValue *value1); * Returns: %TRUE for success */ typedef gboolean (* GstValueDeserializeFunc) (GValue *dest, - const gchar *s); - -/** - * GstValueUnionFunc: - * @dest: a #GValue for the result - * @value1: a #GValue operand - * @value2: a #GValue operand - * - * Used by gst_value_union() to perform unification for a specific #GValue - * type. Register a new implementation with gst_value_register_union_func(). - * - * Returns: %TRUE if a union was successful - */ -typedef gboolean (* GstValueUnionFunc) (GValue *dest, - const GValue *value1, - const GValue *value2); - -/** - * GstValueIntersectFunc: - * @dest: (out caller-allocates): a #GValue for the result - * @value1: a #GValue operand - * @value2: a #GValue operand - * - * Used by gst_value_intersect() to perform intersection for a specific #GValue - * type. If the intersection is non-empty, the result is - * placed in @dest and TRUE is returned. If the intersection is - * empty, @dest is unmodified and FALSE is returned. - * Register a new implementation with gst_value_register_intersect_func(). - * - * Returns: %TRUE if the values can intersect - */ -typedef gboolean (* GstValueIntersectFunc) (GValue *dest, - const GValue *value1, - const GValue *value2); - -/** - * GstValueSubtractFunc: - * @dest: (out caller-allocates): a #GValue for the result - * @minuend: a #GValue operand - * @subtrahend: a #GValue operand - * - * Used by gst_value_subtract() to perform subtraction for a specific #GValue - * type. Register a new implementation with gst_value_register_subtract_func(). - * - * Returns: %TRUE if the subtraction is not empty - */ -typedef gboolean (* GstValueSubtractFunc) (GValue *dest, - const GValue *minuend, - const GValue *subtrahend); + const gchar *s); typedef struct _GstValueTable GstValueTable; /** @@ -435,161 +378,157 @@ struct _GstValueTable { GstValueDeserializeFunc deserialize; /*< private >*/ - void *_gst_reserved [GST_PADDING]; + gpointer _gst_reserved [GST_PADDING]; }; GType gst_int_range_get_type (void); GType gst_int64_range_get_type (void); GType gst_double_range_get_type (void); GType gst_fraction_range_get_type (void); -GType gst_fourcc_get_type (void); GType gst_fraction_get_type (void); GType gst_value_list_get_type (void); GType gst_value_array_get_type (void); +GType gst_bitmask_get_type (void); -GType gst_date_get_type (void); GType gst_date_time_get_type (void); -void gst_value_register (const GstValueTable *table); -void gst_value_init_and_copy (GValue *dest, - const GValue *src); +void gst_value_register (const GstValueTable *table); +void gst_value_init_and_copy (GValue *dest, + const GValue *src); -gchar * gst_value_serialize (const GValue *value); -gboolean gst_value_deserialize (GValue *dest, - const gchar *src); +gchar * gst_value_serialize (const GValue *value) G_GNUC_MALLOC; +gboolean gst_value_deserialize (GValue *dest, + const gchar *src); /* list */ -void gst_value_list_append_value (GValue *value, - const GValue *append_value); -void gst_value_list_prepend_value (GValue *value, - const GValue *prepend_value); -void gst_value_list_concat (GValue *dest, - const GValue *value1, - const GValue *value2); -void gst_value_list_merge (GValue *dest, - const GValue *value1, - const GValue *value2); -guint gst_value_list_get_size (const GValue *value); -G_CONST_RETURN GValue * - gst_value_list_get_value (const GValue *value, - guint index); +void gst_value_list_append_value (GValue *value, + const GValue *append_value); +void gst_value_list_prepend_value (GValue *value, + const GValue *prepend_value); +void gst_value_list_concat (GValue *dest, + const GValue *value1, + const GValue *value2); +void gst_value_list_merge (GValue *dest, + const GValue *value1, + const GValue *value2); +guint gst_value_list_get_size (const GValue *value); +const GValue * gst_value_list_get_value (const GValue *value, + guint index); /* array */ -void gst_value_array_append_value (GValue *value, - const GValue *append_value); -void gst_value_array_prepend_value (GValue *value, - const GValue *prepend_value); -guint gst_value_array_get_size (const GValue *value); -G_CONST_RETURN GValue * - gst_value_array_get_value (const GValue *value, - guint index); - -/* fourcc */ -void gst_value_set_fourcc (GValue *value, - guint32 fourcc); -guint32 gst_value_get_fourcc (const GValue *value); +void gst_value_array_append_value (GValue *value, + const GValue *append_value); +void gst_value_array_prepend_value (GValue *value, + const GValue *prepend_value); +guint gst_value_array_get_size (const GValue *value); +const GValue * gst_value_array_get_value (const GValue *value, + guint index); /* int range */ -void gst_value_set_int_range (GValue *value, - gint start, - gint end); -gint gst_value_get_int_range_min (const GValue *value); -gint gst_value_get_int_range_max (const GValue *value); +void gst_value_set_int_range (GValue *value, + gint start, + gint end); +void gst_value_set_int_range_step (GValue *value, + gint start, + gint end, + gint step); +gint gst_value_get_int_range_min (const GValue *value); +gint gst_value_get_int_range_max (const GValue *value); +gint gst_value_get_int_range_step (const GValue *value); /* int64 range */ -void gst_value_set_int64_range (GValue *value, - gint64 start, - gint64 end); -gint64 gst_value_get_int64_range_min (const GValue *value); -gint64 gst_value_get_int64_range_max (const GValue *value); +void gst_value_set_int64_range (GValue *value, + gint64 start, + gint64 end); +void gst_value_set_int64_range_step (GValue *value, + gint64 start, + gint64 end, + gint64 step); +gint64 gst_value_get_int64_range_min (const GValue *value); +gint64 gst_value_get_int64_range_max (const GValue *value); +gint64 gst_value_get_int64_range_step (const GValue *value); /* double range */ -void gst_value_set_double_range (GValue *value, - gdouble start, - gdouble end); -gdouble gst_value_get_double_range_min (const GValue *value); -gdouble gst_value_get_double_range_max (const GValue *value); +void gst_value_set_double_range (GValue *value, + gdouble start, + gdouble end); +gdouble gst_value_get_double_range_min (const GValue *value); +gdouble gst_value_get_double_range_max (const GValue *value); /* caps */ -G_CONST_RETURN GstCaps * - gst_value_get_caps (const GValue *value); -void gst_value_set_caps (GValue *value, - const GstCaps *caps); +const GstCaps * gst_value_get_caps (const GValue *value); +void gst_value_set_caps (GValue *value, + const GstCaps *caps); /* structure */ -G_CONST_RETURN GstStructure * - gst_value_get_structure (const GValue *value); -void gst_value_set_structure (GValue *value, - const GstStructure *structure); +const GstStructure * + gst_value_get_structure (const GValue *value); +void gst_value_set_structure (GValue *value, + const GstStructure *structure); /* fraction */ -void gst_value_set_fraction (GValue *value, - gint numerator, - gint denominator); -gint gst_value_get_fraction_numerator (const GValue *value); -gint gst_value_get_fraction_denominator(const GValue *value); -gboolean gst_value_fraction_multiply (GValue *product, - const GValue *factor1, - const GValue *factor2); -gboolean gst_value_fraction_subtract (GValue * dest, - const GValue * minuend, - const GValue * subtrahend); +void gst_value_set_fraction (GValue *value, + gint numerator, + gint denominator); +gint gst_value_get_fraction_numerator (const GValue *value); +gint gst_value_get_fraction_denominator (const GValue *value); +gboolean gst_value_fraction_multiply (GValue *product, + const GValue *factor1, + const GValue *factor2); +gboolean gst_value_fraction_subtract (GValue * dest, + const GValue * minuend, + const GValue * subtrahend); /* fraction range */ -void gst_value_set_fraction_range (GValue *value, - const GValue *start, - const GValue *end); -void gst_value_set_fraction_range_full (GValue *value, - gint numerator_start, - gint denominator_start, - gint numerator_end, - gint denominator_end); -const GValue *gst_value_get_fraction_range_min (const GValue *value); -const GValue *gst_value_get_fraction_range_max (const GValue *value); - -/* date */ -G_CONST_RETURN GDate * - gst_value_get_date (const GValue *value); -void gst_value_set_date (GValue *value, - const GDate *date); +void gst_value_set_fraction_range (GValue *value, + const GValue *start, + const GValue *end); +void gst_value_set_fraction_range_full (GValue *value, + gint numerator_start, + gint denominator_start, + gint numerator_end, + gint denominator_end); +const GValue *gst_value_get_fraction_range_min (const GValue *value); +const GValue *gst_value_get_fraction_range_max (const GValue *value); + +/* bitmask */ +guint64 gst_value_get_bitmask (const GValue *value); +void gst_value_set_bitmask (GValue *value, + guint64 bitmask); /* compare */ -gint gst_value_compare (const GValue *value1, - const GValue *value2); -gboolean gst_value_can_compare (const GValue *value1, - const GValue *value2); +gint gst_value_compare (const GValue *value1, + const GValue *value2); +gboolean gst_value_can_compare (const GValue *value1, + const GValue *value2); +gboolean gst_value_is_subset (const GValue *value1, + const GValue *value2); + /* union */ -gboolean gst_value_union (GValue *dest, - const GValue *value1, - const GValue *value2); -gboolean gst_value_can_union (const GValue *value1, - const GValue *value2); -void gst_value_register_union_func (GType type1, - GType type2, - GstValueUnionFunc func); +gboolean gst_value_union (GValue *dest, + const GValue *value1, + const GValue *value2); +gboolean gst_value_can_union (const GValue *value1, + const GValue *value2); /* intersection */ -gboolean gst_value_intersect (GValue *dest, - const GValue *value1, - const GValue *value2); -gboolean gst_value_can_intersect (const GValue *value1, - const GValue *value2); -void gst_value_register_intersect_func (GType type1, - GType type2, - GstValueIntersectFunc func); +gboolean gst_value_intersect (GValue *dest, + const GValue *value1, + const GValue *value2); +gboolean gst_value_can_intersect (const GValue *value1, + const GValue *value2); /* subtraction */ -gboolean gst_value_subtract (GValue *dest, - const GValue *minuend, - const GValue *subtrahend); -gboolean gst_value_can_subtract (const GValue *minuend, - const GValue *subtrahend); -void gst_value_register_subtract_func (GType minuend_type, - GType subtrahend_type, - GstValueSubtractFunc func); +gboolean gst_value_subtract (GValue *dest, + const GValue *minuend, + const GValue *subtrahend); +gboolean gst_value_can_subtract (const GValue *minuend, + const GValue *subtrahend); /* fixation */ -gboolean gst_value_is_fixed (const GValue *value); +gboolean gst_value_is_fixed (const GValue *value); +gboolean gst_value_fixate (GValue *dest, + const GValue *src); G_END_DECLS