gstvalue.h 20.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/* GStreamer
 * Copyright (C) <2003> David A. Schleef <ds@schleef.org>
 *
 * 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
Tim-Philipp Müller's avatar
Tim-Philipp Müller committed
16 17
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA 02110-1301, USA.
18 19 20 21 22 23
 */

#ifndef __GST_VALUE_H__
#define __GST_VALUE_H__

#include <gst/gstconfig.h>
24
#include <gst/gstcaps.h>
25
#include <gst/gststructure.h>
26
#include <gst/gstcapsfeatures.h>
27 28

G_BEGIN_DECLS
29

30 31 32 33 34 35 36 37 38
/**
 * GST_MAKE_FOURCC:
 * @a: the first character
 * @b: the second character
 * @c: the third character
 * @d: the fourth character
 *
 * Transform four characters into a #guint32 fourcc value with host
 * endianness.
39 40
 *
 * |[
41
 * guint32 fourcc = GST_MAKE_FOURCC ('M', 'J', 'P', 'G');
42 43
 * ]|
 *
44
 */
45
#define GST_MAKE_FOURCC(a,b,c,d)        ((guint32)((a)|(b)<<8|(c)<<16|(d)<<24))
46 47 48 49 50 51 52 53 54

/**
 * GST_STR_FOURCC:
 * @f: a string with at least four characters
 *
 * Transform an input string into a #guint32 fourcc value with host
 * endianness.
 * Caller is responsible for ensuring the input string consists of at least
 * four characters.
55 56
 *
 * |[
57
 * guint32 fourcc = GST_STR_FOURCC ("MJPG");
58 59
 * ]|
 *
60
 */
61
#define GST_STR_FOURCC(f)               ((guint32)(((f)[0])|((f)[1]<<8)|((f)[2]<<16)|((f)[3]<<24)))
Benjamin Otte's avatar
Benjamin Otte committed
62

63 64 65 66 67
/**
 * GST_FOURCC_FORMAT:
 *
 * Can be used together with #GST_FOURCC_ARGS to properly output a
 * #guint32 fourcc value in a printf()-style text message.
68 69
 *
 * |[
70
 * printf ("fourcc: %" GST_FOURCC_FORMAT "\n", GST_FOURCC_ARGS (fcc));
71 72
 * ]|
 *
73
 */
74
#define GST_FOURCC_FORMAT "c%c%c%c"
75 76 77 78 79 80 81 82

/**
 * GST_FOURCC_ARGS:
 * @fourcc: a #guint32 fourcc value to output
 *
 * Can be used together with #GST_FOURCC_FORMAT to properly output a
 * #guint32 fourcc value in a printf()-style text message.
 */
83

84 85 86 87 88 89 90
#define __GST_PRINT_CHAR(c) \
  g_ascii_isprint(c) ? (c) : '.'
#define GST_FOURCC_ARGS(fourcc)               \
  __GST_PRINT_CHAR((fourcc) & 0xff),          \
  __GST_PRINT_CHAR(((fourcc) >> 8) & 0xff),   \
  __GST_PRINT_CHAR(((fourcc) >> 16) & 0xff),  \
  __GST_PRINT_CHAR(((fourcc) >> 24) & 0xff)
91 92
/**
 * GST_VALUE_HOLDS_INT_RANGE:
93
 * @x: the #GValue to check
94 95 96
 *
 * Checks if the given #GValue contains a #GST_TYPE_INT_RANGE value.
 */
97
#define GST_VALUE_HOLDS_INT_RANGE(x)      ((x) != NULL && G_VALUE_TYPE(x) == _gst_int_range_type)
98

99 100 101 102 103 104
/**
 * GST_VALUE_HOLDS_INT64_RANGE:
 * @x: the #GValue to check
 *
 * Checks if the given #GValue contains a #GST_TYPE_INT64_RANGE value.
 */
105
#define GST_VALUE_HOLDS_INT64_RANGE(x)    ((x) != NULL && G_VALUE_TYPE(x) == _gst_int64_range_type)
106

107 108
/**
 * GST_VALUE_HOLDS_DOUBLE_RANGE:
109
 * @x: the #GValue to check
110 111 112
 *
 * Checks if the given #GValue contains a #GST_TYPE_DOUBLE_RANGE value.
 */
113
#define GST_VALUE_HOLDS_DOUBLE_RANGE(x)   ((x) != NULL && G_VALUE_TYPE(x) == _gst_double_range_type)
114

115 116 117 118 119 120
/**
 * GST_VALUE_HOLDS_FRACTION_RANGE:
 * @x: the #GValue to check
 *
 * Checks if the given #GValue contains a #GST_TYPE_FRACTION_RANGE value.
 */
121
#define GST_VALUE_HOLDS_FRACTION_RANGE(x) ((x) != NULL && G_VALUE_TYPE(x) == _gst_fraction_range_type)
122

123 124 125 126 127 128
/**
 * GST_VALUE_HOLDS_LIST:
 * @x: the #GValue to check
 *
 * Checks if the given #GValue contains a #GST_TYPE_LIST value.
 */
129
#define GST_VALUE_HOLDS_LIST(x)         ((x) != NULL && G_VALUE_TYPE(x) == _gst_value_list_type)
130 131 132 133 134 135 136

/**
 * GST_VALUE_HOLDS_ARRAY:
 * @x: the #GValue to check
 *
 * Checks if the given #GValue contains a #GST_TYPE_ARRAY value.
 */
137
#define GST_VALUE_HOLDS_ARRAY(x)        ((x) != NULL && G_VALUE_TYPE(x) == _gst_value_array_type)
138 139 140 141 142 143 144

/**
 * GST_VALUE_HOLDS_CAPS:
 * @x: the #GValue to check
 *
 * Checks if the given #GValue contains a #GST_TYPE_CAPS value.
 */
145
#define GST_VALUE_HOLDS_CAPS(x)         ((x) != NULL && G_VALUE_TYPE(x) == _gst_caps_type)
146

147 148 149 150 151 152
/**
 * GST_VALUE_HOLDS_STRUCTURE:
 * @x: the #GValue to check
 *
 * Checks if the given #GValue contains a #GST_TYPE_STRUCTURE value.
 */
153
#define GST_VALUE_HOLDS_STRUCTURE(x)            (G_VALUE_HOLDS((x), _gst_structure_type))
154

155 156 157 158 159 160
/**
 * GST_VALUE_HOLDS_CAPS_FEATURES:
 * @x: the #GValue to check
 *
 * Checks if the given #GValue contains a #GST_TYPE_CAPS_FEATURES value.
 */
161
#define GST_VALUE_HOLDS_CAPS_FEATURES(x)        (G_VALUE_HOLDS((x), _gst_caps_features_type))
162

163 164 165 166 167 168
/**
 * GST_VALUE_HOLDS_BUFFER:
 * @x: the #GValue to check
 *
 * Checks if the given #GValue contains a #GST_TYPE_BUFFER value.
 */
169
#define GST_VALUE_HOLDS_BUFFER(x)       ((x) != NULL && G_VALUE_TYPE(x) == _gst_buffer_type)
170

171 172 173 174 175 176
/**
 * GST_VALUE_HOLDS_SAMPLE:
 * @x: the #GValue to check
 *
 * Checks if the given #GValue contains a #GST_TYPE_SAMPLE value.
 */
177
#define GST_VALUE_HOLDS_SAMPLE(x)       ((x) != NULL && G_VALUE_TYPE(x) == _gst_sample_type)
178

179 180 181 182 183 184
/**
 * GST_VALUE_HOLDS_FRACTION:
 * @x: the #GValue to check
 *
 * Checks if the given #GValue contains a #GST_TYPE_FRACTION value.
 */
185
#define GST_VALUE_HOLDS_FRACTION(x)     ((x) != NULL && G_VALUE_TYPE(x) == _gst_fraction_type)
186

187 188 189 190 191 192
/**
 * GST_VALUE_HOLDS_DATE_TIME:
 * @x: the #GValue to check
 *
 * Checks if the given #GValue contains a #GST_TYPE_DATE_TIME value.
 */
193
#define GST_VALUE_HOLDS_DATE_TIME(x)    ((x) != NULL && G_VALUE_TYPE(x) == _gst_date_time_type)
194

195 196 197 198 199 200
/**
 * GST_VALUE_HOLDS_BITMASK:
 * @x: the #GValue to check
 *
 * Checks if the given #GValue contains a #GST_TYPE_BITMASK value.
 */
201
#define GST_VALUE_HOLDS_BITMASK(x)      ((x) != NULL && G_VALUE_TYPE(x) == _gst_bitmask_type)
202

Jan Schmidt's avatar
Jan Schmidt committed
203 204 205 206 207 208 209 210 211 212
/**
 * GST_VALUE_HOLDS_FLAG_SET:
 * @x: the #GValue to check
 *
 * Checks if the given #GValue contains a #GST_TYPE_FLAG_SET value.
 *
 * Since: 1.6
 */
#define GST_VALUE_HOLDS_FLAG_SET(x)     (G_TYPE_CHECK_VALUE_TYPE ((x), GST_TYPE_FLAG_SET))

213 214 215
/**
 * GST_FLAG_SET_MASK_EXACT: (value 4294967295) (type guint)
 *
Jan Schmidt's avatar
Jan Schmidt committed
216 217 218 219 220 221 222 223
 * A mask value with all bits set, for use as a
 * #GstFlagSet mask where all flag bits must match
 * exactly
 *
 * Since: 1.6
 */
#define GST_FLAG_SET_MASK_EXACT ((guint)(-1))

224 225
GST_EXPORT GType _gst_int_range_type;

226 227 228 229 230 231 232
/**
 * GST_TYPE_INT_RANGE:
 *
 * a #GValue type that represents an integer range
 *
 * Returns: the #GType of GstIntRange
 */
233 234 235
#define GST_TYPE_INT_RANGE               (_gst_int_range_type)

GST_EXPORT GType _gst_int64_range_type;
236

237 238 239 240 241 242 243
/**
 * GST_TYPE_INT64_RANGE:
 *
 * a #GValue type that represents an #gint64 range
 *
 * Returns: the #GType of GstInt64Range
 */
244 245 246
#define GST_TYPE_INT64_RANGE             (_gst_int64_range_type)

GST_EXPORT GType _gst_double_range_type;
247

248 249 250
/**
 * GST_TYPE_DOUBLE_RANGE:
 *
251
 * a #GValue type that represents a floating point range with double precision
252 253 254
 *
 * Returns: the #GType of GstIntRange
 */
255 256 257
#define GST_TYPE_DOUBLE_RANGE            (_gst_double_range_type)

GST_EXPORT GType _gst_fraction_range_type;
258

259 260 261 262 263 264 265
/**
 * GST_TYPE_FRACTION_RANGE:
 *
 * a #GValue type that represents a GstFraction range
 *
 * Returns: the #GType of GstFractionRange
 */
266 267 268
#define GST_TYPE_FRACTION_RANGE           (_gst_fraction_range_type)

GST_EXPORT GType _gst_value_list_type;
269

270 271 272
/**
 * GST_TYPE_LIST:
 *
273 274 275 276 277
 * a #GValue type that represents an unordered list of #GValue values. This
 * is used for example to express a list of possible values for a field in
 * a caps structure, like a list of possible sample rates, of which only one
 * will be chosen in the end. This means that all values in the list are
 * meaningful on their own.
278 279 280
 *
 * Returns: the #GType of GstValueList (which is not explicitly typed)
 */
281 282 283
#define GST_TYPE_LIST                    (_gst_value_list_type)

GST_EXPORT GType _gst_value_array_type;
284 285 286 287

/**
 * GST_TYPE_ARRAY:
 *
288 289 290 291 292 293
 * a #GValue type that represents an ordered list of #GValue values. This is
 * used to express a set of values that is meaningful only in their specific
 * combination and order of values. Each value on its own is not particularly
 * meaningful, only the ordered array in its entirety is meaningful. This is
 * used for example to express channel layouts for multichannel audio where
 * each channel needs to be mapped to a position in the room.
294 295 296
 *
 * Returns: the #GType of GstArrayList (which is not explicitly typed)
 */
297 298 299
#define GST_TYPE_ARRAY                   (_gst_value_array_type)

GST_EXPORT GType _gst_fraction_type;
300 301 302 303 304 305 306 307 308 309

/**
 * GST_TYPE_FRACTION:
 *
 * a #GValue type that represents a fraction of an integer numerator over
 * an integer denominator
 *
 * Returns: the #GType of GstFraction (which is not explicitly typed)
 */

310 311 312
#define GST_TYPE_FRACTION                (_gst_fraction_type)

GST_EXPORT GType _gst_bitmask_type;
313

314 315 316 317 318 319 320 321
/**
 * GST_TYPE_BITMASK:
 *
 * a #GValue type that represents a 64-bit bitmask.
 *
 * Returns: the #GType of GstBitmask (which is not explicitly typed)
 */

322
#define GST_TYPE_BITMASK                 (_gst_bitmask_type)
323

Jan Schmidt's avatar
Jan Schmidt committed
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338
GST_EXPORT GType _gst_flagset_type;

/**
 * GST_TYPE_FLAG_SET:
 *
 * a #GValue type that represents a 32-bit flag bitfield, with 32-bit
 * mask indicating which of the bits in the field are explicitly set.
 * Useful for negotiation.
 *
 * Returns: the #GType of GstFlags (which is not explicitly typed)
 *
 * Since: 1.6
 */
#define GST_TYPE_FLAG_SET                   (_gst_flagset_type)

339 340 341 342 343 344 345 346 347 348
/**
 * GST_TYPE_G_THREAD:
 *
 * a boxed #GValue type for #GThread that represents a thread.
 *
 * Returns: the #GType of GstGThread
 */

#define GST_TYPE_G_THREAD                gst_g_thread_get_type ()

349 350 351 352 353 354
/**
 * GST_VALUE_LESS_THAN:
 *
 * Indicates that the first value provided to a comparison function
 * (gst_value_compare()) is lesser than the second one.
 */
355
#define GST_VALUE_LESS_THAN              (-1)
356 357 358 359 360 361 362

/**
 * GST_VALUE_EQUAL:
 *
 * Indicates that the first value provided to a comparison function
 * (gst_value_compare()) is equal to the second one.
 */
363
#define GST_VALUE_EQUAL                   0
364 365 366 367 368 369 370

/**
 * GST_VALUE_GREATER_THAN:
 *
 * Indicates that the first value provided to a comparison function
 * (gst_value_compare()) is greater than the second one.
 */
371
#define GST_VALUE_GREATER_THAN            1
372 373 374 375 376 377 378

/**
 * GST_VALUE_UNORDERED:
 *
 * Indicates that the comparison function (gst_value_compare()) can not
 * determine a order for the two provided values.
 */
379 380
#define GST_VALUE_UNORDERED               2

381 382
/**
 * GstValueCompareFunc:
Tim-Philipp Müller's avatar
Tim-Philipp Müller committed
383 384
 * @value1: first value for comparison
 * @value2: second value for comparison
385
 *
Stefan Kost's avatar
Stefan Kost committed
386
 * Used together with gst_value_compare() to compare #GValue items.
387 388 389 390
 *
 * Returns: one of GST_VALUE_LESS_THAN, GST_VALUE_EQUAL, GST_VALUE_GREATER_THAN
 * or GST_VALUE_UNORDERED
 */
391
typedef gint     (* GstValueCompareFunc)     (const GValue *value1,
Wim Taymans's avatar
Wim Taymans committed
392
                                              const GValue *value2);
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
393

Stefan Kost's avatar
Stefan Kost committed
394 395 396 397 398 399
/**
 * GstValueSerializeFunc:
 * @value1: a #GValue
 *
 * Used by gst_value_serialize() to obtain a non-binary form of the #GValue.
 *
400 401 402
 * Free-function: g_free
 *
 * Returns: (transfer full): the string representation of the value
Stefan Kost's avatar
Stefan Kost committed
403
 */
404
typedef gchar *  (* GstValueSerializeFunc)   (const GValue *value1);
405

Stefan Kost's avatar
Stefan Kost committed
406 407 408 409 410 411 412 413 414
/**
 * GstValueDeserializeFunc:
 * @dest: a #GValue
 * @s: a string
 *
 * Used by gst_value_deserialize() to parse a non-binary form into the #GValue.
 *
 * Returns: %TRUE for success
 */
415
typedef gboolean (* GstValueDeserializeFunc) (GValue       *dest,
Wim Taymans's avatar
Wim Taymans committed
416
                                              const gchar  *s);
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
417

418
typedef struct _GstValueTable GstValueTable;
Stefan Kost's avatar
Stefan Kost committed
419 420 421 422 423 424 425 426 427
/**
 * GstValueTable:
 * @type: a #GType
 * @compare: a #GstValueCompareFunc
 * @serialize: a #GstValueSerializeFunc
 * @deserialize: a #GstValueDeserializeFunc
 *
 * VTable for the #GValue @type.
 */
428 429 430 431 432
struct _GstValueTable {
  GType type;
  GstValueCompareFunc compare;
  GstValueSerializeFunc serialize;
  GstValueDeserializeFunc deserialize;
Benjamin Otte's avatar
Benjamin Otte committed
433

434
  /*< private >*/
Wim Taymans's avatar
Wim Taymans committed
435
  gpointer _gst_reserved [GST_PADDING];
436
};
437

438
GType gst_int_range_get_type (void);
439
GType gst_int64_range_get_type (void);
440
GType gst_double_range_get_type (void);
441
GType gst_fraction_range_get_type (void);
442 443 444
GType gst_fraction_get_type (void);
GType gst_value_list_get_type (void);
GType gst_value_array_get_type (void);
445
GType gst_bitmask_get_type (void);
Jan Schmidt's avatar
Jan Schmidt committed
446
GType gst_flagset_get_type (void);
447 448 449

/* Hide this compatibility type from introspection */
#ifndef __GI_SCANNER__
450
GType gst_g_thread_get_type (void);
451
#endif
452

Wim Taymans's avatar
Wim Taymans committed
453 454 455
void            gst_value_register              (const GstValueTable   *table);
void            gst_value_init_and_copy         (GValue                *dest,
                                                 const GValue          *src);
456

457
gchar *         gst_value_serialize             (const GValue          *value) G_GNUC_MALLOC;
Wim Taymans's avatar
Wim Taymans committed
458 459
gboolean        gst_value_deserialize           (GValue                *dest,
                                                 const gchar           *src);
460

461
/* list */
Wim Taymans's avatar
Wim Taymans committed
462 463
void            gst_value_list_append_value     (GValue         *value,
                                                 const GValue   *append_value);
464 465
void            gst_value_list_append_and_take_value (GValue         *value,
                                                 GValue   *append_value);
Wim Taymans's avatar
Wim Taymans committed
466 467 468 469 470 471 472 473 474 475 476
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);
477

478
/* array */
Wim Taymans's avatar
Wim Taymans committed
479 480
void            gst_value_array_append_value    (GValue         *value,
                                                 const GValue   *append_value);
481 482
void            gst_value_array_append_and_take_value    (GValue         *value,
                                                 GValue   *append_value);
Wim Taymans's avatar
Wim Taymans committed
483 484 485 486 487
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);
488

489
/* int range */
Wim Taymans's avatar
Wim Taymans committed
490 491 492
void            gst_value_set_int_range         (GValue         *value,
                                                 gint           start,
                                                 gint           end);
493 494 495 496
void            gst_value_set_int_range_step    (GValue         *value,
                                                 gint           start,
                                                 gint           end,
                                                 gint           step);
Wim Taymans's avatar
Wim Taymans committed
497 498
gint            gst_value_get_int_range_min     (const GValue   *value);
gint            gst_value_get_int_range_max     (const GValue   *value);
499
gint            gst_value_get_int_range_step    (const GValue   *value);
500

501
/* int64 range */
Wim Taymans's avatar
Wim Taymans committed
502 503 504
void            gst_value_set_int64_range       (GValue         *value,
                                                 gint64         start,
                                                 gint64         end);
505 506 507 508
void            gst_value_set_int64_range_step  (GValue         *value,
                                                 gint64         start,
                                                 gint64         end,
                                                 gint64         step);
Wim Taymans's avatar
Wim Taymans committed
509 510
gint64          gst_value_get_int64_range_min   (const GValue   *value);
gint64          gst_value_get_int64_range_max   (const GValue   *value);
511
gint64          gst_value_get_int64_range_step  (const GValue   *value);
512

513
/* double range */
Wim Taymans's avatar
Wim Taymans committed
514 515 516 517 518
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);
Benjamin Otte's avatar
Benjamin Otte committed
519

520
/* caps */
Wim Taymans's avatar
Wim Taymans committed
521 522 523
const GstCaps * gst_value_get_caps              (const GValue   *value);
void            gst_value_set_caps              (GValue         *value,
                                                 const GstCaps  *caps);
524

525
/* structure */
526
const GstStructure *
Wim Taymans's avatar
Wim Taymans committed
527 528 529
                gst_value_get_structure         (const GValue   *value);
void            gst_value_set_structure         (GValue         *value,
                                                 const GstStructure  *structure);
530

531 532 533 534 535 536
/* caps features */
const GstCapsFeatures *
                gst_value_get_caps_features     (const GValue   *value);
void            gst_value_set_caps_features     (GValue         *value,
                                                 const GstCapsFeatures  *features);

537
/* fraction */
Wim Taymans's avatar
Wim Taymans committed
538 539 540 541 542 543 544 545 546 547 548
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);
549 550

/* fraction range */
Wim Taymans's avatar
Wim Taymans committed
551 552 553 554 555 556 557 558 559 560
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);
561

562 563 564 565
/* bitmask */
guint64         gst_value_get_bitmask           (const GValue   *value);
void            gst_value_set_bitmask           (GValue         *value,
                                                 guint64         bitmask);
Jan Schmidt's avatar
Jan Schmidt committed
566 567 568 569
/* flagset */
void            gst_value_set_flagset (GValue * value, guint flags, guint mask);
guint           gst_value_get_flagset_flags (const GValue * value);
guint           gst_value_get_flagset_mask (const GValue * value);
570

571
/* compare */
Wim Taymans's avatar
Wim Taymans committed
572 573 574 575
gint            gst_value_compare               (const GValue   *value1,
                                                 const GValue   *value2);
gboolean        gst_value_can_compare           (const GValue   *value1,
                                                 const GValue   *value2);
576 577 578
gboolean        gst_value_is_subset             (const GValue   *value1,
                                                 const GValue   *value2);

579
/* union */
Wim Taymans's avatar
Wim Taymans committed
580 581 582 583 584
gboolean        gst_value_union                 (GValue         *dest,
                                                 const GValue   *value1,
                                                 const GValue   *value2);
gboolean        gst_value_can_union             (const GValue   *value1,
                                                 const GValue   *value2);
585 586

/* intersection */
Wim Taymans's avatar
Wim Taymans committed
587 588 589 590 591
gboolean        gst_value_intersect             (GValue         *dest,
                                                 const GValue   *value1,
                                                 const GValue   *value2);
gboolean        gst_value_can_intersect         (const GValue   *value1,
                                                 const GValue   *value2);
592

593
/* subtraction */
Wim Taymans's avatar
Wim Taymans committed
594 595 596 597 598
gboolean        gst_value_subtract              (GValue         *dest,
                                                 const GValue   *minuend,
                                                 const GValue   *subtrahend);
gboolean        gst_value_can_subtract          (const GValue   *minuend,
                                                 const GValue   *subtrahend);
599 600

/* fixation */
Wim Taymans's avatar
Wim Taymans committed
601
gboolean        gst_value_is_fixed              (const GValue   *value);
602 603
gboolean        gst_value_fixate                (GValue         *dest,
                                                 const GValue   *src);
604

Jan Schmidt's avatar
Jan Schmidt committed
605 606 607
/* Flagset registration wrapper */
GType		gst_flagset_register (GType flags_type);

608
G_END_DECLS
609

610
#endif
611 612