alternative to assert
[gtkD.git] / gtkD / srcgstreamer / gstreamer / Structure.d
blob177dec8591c646aa6cb61b74a5205962437f7a61
1 /*
2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = gstreamer-GstStructure.html
26 * outPack = gstreamer
27 * outFile = Structure
28 * strct = GstStructure
29 * realStrct=
30 * ctorStrct=
31 * clss = Structure
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gst_structure_
40 * - gst_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * imports:
45 * - glib.Str
46 * - gobject.Value
47 * structWrap:
48 * - GValue* -> Value
49 * - GstStructure* -> Structure
50 * module aliases:
51 * local aliases:
54 module gstreamer.Structure;
56 private import gstreamerc.gstreamertypes;
58 private import gstreamerc.gstreamer;
60 private import glib.Str;
61 private import gobject.Value;
65 /**
66 * Description
67 * A GstStructure is a collection of key/value pairs. The keys are expressed
68 * as GQuarks and the values can be of any GType.
69 * In addition to the key/value pairs, a GstStructure also has a name.
70 * GstStructure is used by various GStreamer subsystems to store information
71 * in a flexible and extensible way. A GstStructure does not have a refcount
72 * because it usually is part of a higher level object such as GstCaps. It
73 * provides a means to enforce mutability using the refcount of the parent
74 * with the gst_structure_set_parent_refcount() method.
75 * A GstStructure can be created with gst_structure_empty_new() or
76 * gst_structure_new(), which both take a name and an optional set of
77 * key/value pairs along with the types of the values.
78 * Field values can be changed with gst_structure_set_value() or
79 * gst_structure_set().
80 * Field values can be retrieved with gst_structure_get_value() or the more
81 * convenient gst_structure_get_*() functions.
82 * Fields can be removed with gst_structure_remove_field() or
83 * gst_structure_remove_fields().
84 * Last reviewed on 2005-11-09 (0.9.4)
86 public class Structure
89 /** the main Gtk struct */
90 protected GstStructure* gstStructure;
93 public GstStructure* getStructureStruct()
95 return gstStructure;
99 /** the main Gtk struct as a void* */
100 protected void* getStruct()
102 return cast(void*)gstStructure;
106 * Sets our main struct and passes it to the parent class
108 public this (GstStructure* gstStructure)
110 this.gstStructure = gstStructure;
120 * Creates a new, empty GstStructure with the given name.
121 * name:
122 * name of new structure
123 * Returns:
124 * a new, empty GstStructure
126 public static Structure emptyNew(char[] name)
128 // GstStructure* gst_structure_empty_new (const gchar *name);
129 return new Structure( gst_structure_empty_new(Str.toStringz(name)) );
133 * Creates a new, empty GstStructure with the given name as a GQuark.
134 * quark:
135 * name of new structure
136 * Returns:
137 * a new, empty GstStructure
139 public static Structure idEmptyNew(GQuark quark)
141 // GstStructure* gst_structure_id_empty_new (GQuark quark);
142 return new Structure( gst_structure_id_empty_new(quark) );
146 * Creates a new GstStructure with the given name. Parses the
147 * list of variable arguments and sets fields to the values listed.
148 * Variable arguments should be passed as field name, field type,
149 * and value. Last variable argument should be NULL.
150 * name:
151 * name of new structure
152 * firstfield:
153 * name of first field to set
154 * ...:
155 * additional arguments
156 * Returns:
157 * a new GstStructure
159 public this (char[] name, char[] firstfield, ... )
161 // GstStructure* gst_structure_new (const gchar *name, const gchar *firstfield, ...);
162 this(cast(GstStructure*)gst_structure_new(Str.toStringz(name), Str.toStringz(firstfield)) );
166 * Creates a new GstStructure with the given name. Structure fields
167 * are set according to the varargs in a manner similar to
168 * gst_structure_new.
169 * name:
170 * name of new structure
171 * firstfield:
172 * name of first field to set
173 * varargs:
174 * variable argument list
175 * Returns:
176 * a new GstStructure
178 public this (char[] name, char[] firstfield, void* varargs)
180 // GstStructure* gst_structure_new_valist (const gchar *name, const gchar *firstfield, va_list varargs);
181 this(cast(GstStructure*)gst_structure_new_valist(Str.toStringz(name), Str.toStringz(firstfield), varargs) );
185 * Duplicates a GstStructure and all its fields and values.
186 * structure:
187 * a GstStructure to duplicate
188 * Returns:
189 * a new GstStructure.
191 public Structure copy()
193 // GstStructure* gst_structure_copy (const GstStructure *structure);
194 return new Structure( gst_structure_copy(gstStructure) );
198 * Frees a GstStructure and all its fields and values. The structure must not
199 * have a parent when this function is called.
200 * structure:
201 * the GstStructure to free
203 public void free()
205 // void gst_structure_free (GstStructure *structure);
206 gst_structure_free(gstStructure);
210 * Get the name of structure as a string.
211 * structure:
212 * a GstStructure
213 * Returns:
214 * the name of the structure.
216 public char[] getName()
218 // const gchar* gst_structure_get_name (const GstStructure *structure);
219 return Str.toString(gst_structure_get_name(gstStructure) );
223 * Checks if the structure has the given name
224 * structure:
225 * a GstStructure
226 * name:
227 * structure name to check for
228 * Returns:
229 * TRUE if name matches the name of the structure.
231 public int hasName(char[] name)
233 // gboolean gst_structure_has_name (const GstStructure *structure, const gchar *name);
234 return gst_structure_has_name(gstStructure, Str.toStringz(name));
238 * Sets the name of the structure to the given name. The string
239 * provided is copied before being used.
240 * structure:
241 * a GstStructure
242 * name:
243 * the new name of the structure
245 public void setName(char[] name)
247 // void gst_structure_set_name (GstStructure *structure, const gchar *name);
248 gst_structure_set_name(gstStructure, Str.toStringz(name));
252 * Get the name of structure as a GQuark.
253 * structure:
254 * a GstStructure
255 * Returns:
256 * the quark representing the name of the structure.
258 public GQuark getNameId()
260 // GQuark gst_structure_get_name_id (const GstStructure *structure);
261 return gst_structure_get_name_id(gstStructure);
265 * Get the value of the field with GQuark field.
266 * structure:
267 * a GstStructure
268 * field:
269 * the GQuark of the field to get
270 * Returns:
271 * the GValue corresponding to the field with the given name
272 * identifier.
274 public Value idGetValue(GQuark field)
276 // const GValue* gst_structure_id_get_value (const GstStructure *structure, GQuark field);
277 return new Value( gst_structure_id_get_value(gstStructure, field) );
281 * Sets the field with the given GQuark field to value. If the field
282 * does not exist, it is created. If the field exists, the previous
283 * value is replaced and freed.
284 * structure:
285 * a GstStructure
286 * field:
287 * a GQuark representing a field
288 * value:
289 * the new value of the field
291 public void idSetValue(GQuark field, Value value)
293 // void gst_structure_id_set_value (GstStructure *structure, GQuark field, const GValue *value);
294 gst_structure_id_set_value(gstStructure, field, (value is null) ? null : value.getValueStruct());
298 * Get the value of the field with name fieldname.
299 * structure:
300 * a GstStructure
301 * fieldname:
302 * the name of the field to get
303 * Returns:
304 * the GValue corresponding to the field with the given name.
306 public Value getValue(char[] fieldname)
308 // const GValue* gst_structure_get_value (const GstStructure *structure, const gchar *fieldname);
309 return new Value( gst_structure_get_value(gstStructure, Str.toStringz(fieldname)) );
313 * Sets the field with the given name field to value. If the field
314 * does not exist, it is created. If the field exists, the previous
315 * value is replaced and freed.
316 * structure:
317 * a GstStructure
318 * fieldname:
319 * the name of the field to set
320 * value:
321 * the new value of the field
323 public void setValue(char[] fieldname, Value value)
325 // void gst_structure_set_value (GstStructure *structure, const gchar *fieldname, const GValue *value);
326 gst_structure_set_value(gstStructure, Str.toStringz(fieldname), (value is null) ? null : value.getValueStruct());
330 * Parses the variable arguments and sets fields accordingly.
331 * Variable arguments should be in the form field name, field type
332 * (as a GType), value(s). The last variable argument should be NULL.
333 * structure:
334 * a GstStructure
335 * fieldname:
336 * the name of the field to set
337 * ...:
338 * variable arguments
340 public void set(char[] fieldname, ... )
342 // void gst_structure_set (GstStructure *structure, const gchar *fieldname, ...);
343 gst_structure_set(gstStructure, Str.toStringz(fieldname));
347 * va_list form of gst_structure_set().
348 * structure:
349 * a GstStructure
350 * fieldname:
351 * the name of the field to set
352 * varargs:
353 * variable arguments
355 public void setValist(char[] fieldname, void* varargs)
357 // void gst_structure_set_valist (GstStructure *structure, const gchar *fieldname, va_list varargs);
358 gst_structure_set_valist(gstStructure, Str.toStringz(fieldname), varargs);
362 * Identical to gst_structure_set, except that field names are
363 * passed using the GQuark for the field name. This allows more efficient
364 * setting of the structure if the caller already knows the associated
365 * quark values.
366 * The last variable argument must be NULL.
367 * structure:
368 * a GstStructure
369 * fieldname:
370 * the GQuark for the name of the field to set
371 * ...:
372 * variable arguments
373 * Since 0.10.10
375 public void idSet(GQuark fieldname, ... )
377 // void gst_structure_id_set (GstStructure *structure, GQuark fieldname, ...);
378 gst_structure_id_set(gstStructure, fieldname);
382 * va_list form of gst_structure_id_set().
383 * structure:
384 * a GstStructure
385 * fieldname:
386 * the name of the field to set
387 * varargs:
388 * variable arguments
389 * Since 0.10.10
391 public void idSetValist(GQuark fieldname, void* varargs)
393 // void gst_structure_id_set_valist (GstStructure *structure, GQuark fieldname, va_list varargs);
394 gst_structure_id_set_valist(gstStructure, fieldname, varargs);
398 * Removes the field with the given name. If the field with the given
399 * name does not exist, the structure is unchanged.
400 * structure:
401 * a GstStructure
402 * fieldname:
403 * the name of the field to remove
405 public void removeField(char[] fieldname)
407 // void gst_structure_remove_field (GstStructure *structure, const gchar *fieldname);
408 gst_structure_remove_field(gstStructure, Str.toStringz(fieldname));
412 * Removes the fields with the given names. If a field does not exist, the
413 * argument is ignored.
414 * structure:
415 * a GstStructure
416 * fieldname:
417 * the name of the field to remove
418 * ...:
419 * NULL-terminated list of more fieldnames to remove
421 public void removeFields(char[] fieldname, ... )
423 // void gst_structure_remove_fields (GstStructure *structure, const gchar *fieldname, ...);
424 gst_structure_remove_fields(gstStructure, Str.toStringz(fieldname));
428 * va_list form of gst_structure_remove_fields().
429 * structure:
430 * a GstStructure
431 * fieldname:
432 * the name of the field to remove
433 * varargs:
434 * NULL-terminated list of more fieldnames to remove
436 public void removeFieldsValist(char[] fieldname, void* varargs)
438 // void gst_structure_remove_fields_valist (GstStructure *structure, const gchar *fieldname, va_list varargs);
439 gst_structure_remove_fields_valist(gstStructure, Str.toStringz(fieldname), varargs);
443 * Removes all fields in a GstStructure.
444 * structure:
445 * a GstStructure
447 public void removeAllFields()
449 // void gst_structure_remove_all_fields (GstStructure *structure);
450 gst_structure_remove_all_fields(gstStructure);
454 * Finds the field with the given name, and returns the type of the
455 * value it contains. If the field is not found, G_TYPE_INVALID is
456 * returned.
457 * structure:
458 * a GstStructure
459 * fieldname:
460 * the name of the field
461 * Returns:
462 * the GValue of the field
464 public GType getFieldType(char[] fieldname)
466 // GType gst_structure_get_field_type (const GstStructure *structure, const gchar *fieldname);
467 return gst_structure_get_field_type(gstStructure, Str.toStringz(fieldname));
471 * Calls the provided function once for each field in the GstStructure. The
472 * function must not modify the fields. Also see gst_structure_map_in_place().
473 * structure:
474 * a GstStructure
475 * func:
476 * a function to call for each field
477 * user_data:
478 * private data
479 * Returns:
480 * TRUE if the supplied function returns TRUE For each of the fields,
481 * FALSE otherwise.
483 public int foreac(GstStructureForeachFunc func, void* userData)
485 // gboolean gst_structure_foreach (const GstStructure *structure, GstStructureForeachFunc func, gpointer user_data);
486 return gst_structure_foreach(gstStructure, func, userData);
490 * Get the number of fields in the structure.
491 * structure:
492 * a GstStructure
493 * Returns:
494 * the number of fields in the structure
496 public int nFields()
498 // gint gst_structure_n_fields (const GstStructure *structure);
499 return gst_structure_n_fields(gstStructure);
503 * Check if structure contains a field named fieldname.
504 * structure:
505 * a GstStructure
506 * fieldname:
507 * the name of a field
508 * Returns:
509 * TRUE if the structure contains a field with the given name
511 public int hasField(char[] fieldname)
513 // gboolean gst_structure_has_field (const GstStructure *structure, const gchar *fieldname);
514 return gst_structure_has_field(gstStructure, Str.toStringz(fieldname));
518 * Check if structure contains a field named fieldname and with GType type.
519 * structure:
520 * a GstStructure
521 * fieldname:
522 * the name of a field
523 * type:
524 * the type of a value
525 * Returns:
526 * TRUE if the structure contains a field with the given name and type
528 public int hasFieldTyped(char[] fieldname, GType type)
530 // gboolean gst_structure_has_field_typed (const GstStructure *structure, const gchar *fieldname, GType type);
531 return gst_structure_has_field_typed(gstStructure, Str.toStringz(fieldname), type);
535 * Sets the boolean pointed to by value corresponding to the value of the
536 * given field. Caller is responsible for making sure the field exists
537 * and has the correct type.
538 * structure:
539 * a GstStructure
540 * fieldname:
541 * the name of a field
542 * value:
543 * a pointer to a gboolean to set
544 * Returns:
545 * TRUE if the value could be set correctly. If there was no field
546 * with fieldname or the existing field did not contain a boolean, this
547 * function returns FALSE.
549 public int getBoolean(char[] fieldname, int* value)
551 // gboolean gst_structure_get_boolean (const GstStructure *structure, const gchar *fieldname, gboolean *value);
552 return gst_structure_get_boolean(gstStructure, Str.toStringz(fieldname), value);
556 * Sets the int pointed to by value corresponding to the value of the
557 * given field. Caller is responsible for making sure the field exists
558 * and has the correct type.
559 * Returns: TRUE if the value could be set correctly. If there was no field
560 * with fieldname or the existing field did not contain an int, this function
561 * structure:
562 * a GstStructure
563 * fieldname:
564 * the name of a field
565 * value:
566 * a pointer to an int to set
567 * Returns:
568 * FALSE.
570 public int getInt(char[] fieldname, int* value)
572 // gboolean gst_structure_get_int (const GstStructure *structure, const gchar *fieldname, gint *value);
573 return gst_structure_get_int(gstStructure, Str.toStringz(fieldname), value);
577 * Sets the GstFourcc pointed to by value corresponding to the value of the
578 * given field. Caller is responsible for making sure the field exists
579 * and has the correct type.
580 * Returns: TRUE if the value could be set correctly. If there was no field
581 * with fieldname or the existing field did not contain a fourcc, this function
582 * structure:
583 * a GstStructure
584 * fieldname:
585 * the name of a field
586 * value:
587 * a pointer to a GstFourcc to set
588 * Returns:
589 * FALSE.
591 public int getFourcc(char[] fieldname, uint* value)
593 // gboolean gst_structure_get_fourcc (const GstStructure *structure, const gchar *fieldname, guint32 *value);
594 return gst_structure_get_fourcc(gstStructure, Str.toStringz(fieldname), value);
598 * Sets the double pointed to by value corresponding to the value of the
599 * given field. Caller is responsible for making sure the field exists
600 * and has the correct type.
601 * structure:
602 * a GstStructure
603 * fieldname:
604 * the name of a field
605 * value:
606 * a pointer to a GstFourcc to set
607 * Returns:
608 * TRUE if the value could be set correctly. If there was no field
609 * with fieldname or the existing field did not contain a double, this
610 * function returns FALSE.
612 public int getDouble(char[] fieldname, double* value)
614 // gboolean gst_structure_get_double (const GstStructure *structure, const gchar *fieldname, gdouble *value);
615 return gst_structure_get_double(gstStructure, Str.toStringz(fieldname), value);
619 * Finds the field corresponding to fieldname, and returns the string
620 * contained in the field's value. Caller is responsible for making
621 * sure the field exists and has the correct type.
622 * The string should not be modified, and remains valid until the next
623 * call to a gst_structure_*() function with the given structure.
624 * structure:
625 * a GstStructure
626 * fieldname:
627 * the name of a field
628 * Returns:
629 * a pointer to the string or NULL when the field did not exist
630 * or did not contain a string.
632 public char[] getString(char[] fieldname)
634 // const gchar* gst_structure_get_string (const GstStructure *structure, const gchar *fieldname);
635 return Str.toString(gst_structure_get_string(gstStructure, Str.toStringz(fieldname)) );
639 * Sets the date pointed to by value corresponding to the date of the
640 * given field. Caller is responsible for making sure the field exists
641 * and has the correct type.
642 * Returns: TRUE if the value could be set correctly. If there was no field
643 * with fieldname or the existing field did not contain a data, this function
644 * structure:
645 * a GstStructure
646 * fieldname:
647 * the name of a field
648 * value:
649 * a pointer to a GDate to set
650 * Returns:
651 * FALSE.
653 public int getDate(char[] fieldname, GDate** value)
655 // gboolean gst_structure_get_date (const GstStructure *structure, const gchar *fieldname, GDate **value);
656 return gst_structure_get_date(gstStructure, Str.toStringz(fieldname), value);
660 * Sets the clock time pointed to by value corresponding to the clock time
661 * of the given field. Caller is responsible for making sure the field exists
662 * and has the correct type.
663 * structure:
664 * a GstStructure
665 * fieldname:
666 * the name of a field
667 * value:
668 * a pointer to a GstClockTime to set
669 * Returns:
670 * TRUE if the value could be set correctly. If there was no field
671 * with fieldname or the existing field did not contain a GstClockTime, this
672 * function returns FALSE.
674 public int getClockTime(char[] fieldname, GstClockTime* value)
676 // gboolean gst_structure_get_clock_time (const GstStructure *structure, const gchar *fieldname, GstClockTime *value);
677 return gst_structure_get_clock_time(gstStructure, Str.toStringz(fieldname), value);
681 * Sets the int pointed to by value corresponding to the value of the
682 * given field. Caller is responsible for making sure the field exists,
683 * has the correct type and that the enumtype is correct.
684 * structure:
685 * a GstStructure
686 * fieldname:
687 * the name of a field
688 * enumtype:
689 * the enum type of a field
690 * value:
691 * a pointer to an int to set
692 * Returns:
693 * TRUE if the value could be set correctly. If there was no field
694 * with fieldname or the existing field did not contain an enum of the given
695 * type, this function returns FALSE.
697 public int getEnum(char[] fieldname, GType enumtype, int* value)
699 // gboolean gst_structure_get_enum (const GstStructure *structure, const gchar *fieldname, GType enumtype, gint *value);
700 return gst_structure_get_enum(gstStructure, Str.toStringz(fieldname), enumtype, value);
704 * Sets the integers pointed to by value_numerator and value_denominator
705 * corresponding to the value of the given field. Caller is responsible
706 * for making sure the field exists and has the correct type.
707 * structure:
708 * a GstStructure
709 * fieldname:
710 * the name of a field
711 * value_numerator:
712 * a pointer to an int to set
713 * value_denominator:
714 * a pointer to an int to set
715 * Returns:
716 * TRUE if the values could be set correctly. If there was no field
717 * with fieldname or the existing field did not contain a GstFraction, this
718 * function returns FALSE.
720 public int getFraction(char[] fieldname, int* valueNumerator, int* valueDenominator)
722 // gboolean gst_structure_get_fraction (const GstStructure *structure, const gchar *fieldname, gint *value_numerator, gint *value_denominator);
723 return gst_structure_get_fraction(gstStructure, Str.toStringz(fieldname), valueNumerator, valueDenominator);
727 * Calls the provided function once for each field in the GstStructure. In
728 * contrast to gst_structure_foreach(), the function may modify but not delete the
729 * fields. The structure must be mutable.
730 * structure:
731 * a GstStructure
732 * func:
733 * a function to call for each field
734 * user_data:
735 * private data
736 * Returns:
737 * TRUE if the supplied function returns TRUE For each of the fields,
738 * FALSE otherwise.
740 public int mapInPlace(GstStructureMapFunc func, void* userData)
742 // gboolean gst_structure_map_in_place (GstStructure *structure, GstStructureMapFunc func, gpointer user_data);
743 return gst_structure_map_in_place(gstStructure, func, userData);
747 * Get the name of the given field number, counting from 0 onwards.
748 * structure:
749 * a GstStructure
750 * index:
751 * the index to get the name of
752 * Returns:
753 * the name of the given field number
755 public char[] nthFieldName(uint index)
757 // const gchar* gst_structure_nth_field_name (const GstStructure *structure, guint index);
758 return Str.toString(gst_structure_nth_field_name(gstStructure, index) );
762 * Sets the parent_refcount field of GstStructure. This field is used to
763 * determine whether a structure is mutable or not. This function should only be
764 * called by code implementing parent objects of GstStructure, as described in
765 * the MT Refcounting section of the design documents.
766 * structure:
767 * a GstStructure
768 * refcount:
769 * a pointer to the parent's refcount
771 public void setParentRefcount(int* refcount)
773 // void gst_structure_set_parent_refcount (GstStructure *structure, gint *refcount);
774 gst_structure_set_parent_refcount(gstStructure, refcount);
778 * Converts structure to a human-readable string representation.
779 * structure:
780 * a GstStructure
781 * Returns:
782 * a pointer to string allocated by g_malloc(). g_free() after
783 * usage.
785 public char[] toString()
787 // gchar* gst_structure_to_string (const GstStructure *structure);
788 return Str.toString(gst_structure_to_string(gstStructure) );
792 * Creates a GstStructure from a string representation.
793 * If end is not NULL, a pointer to the place inside the given string
794 * where parsing ended will be returned.
795 * string:
796 * a string representation of a GstStructure.
797 * end:
798 * pointer to store the end of the string in.
799 * Returns:
800 * a new GstStructure or NULL when the string could not
801 * be parsed. Free after usage.
803 public static Structure fromString(char[] string, char** end)
805 // GstStructure* gst_structure_from_string (const gchar *string, gchar **end);
806 return new Structure( gst_structure_from_string(Str.toStringz(string), end) );
810 * Fixates a GstStructure by changing the given field to the nearest
811 * integer to target that is a subset of the existing field.
812 * structure:
813 * a GstStructure
814 * field_name:
815 * a field in structure
816 * target:
817 * the target value of the fixation
818 * Returns:
819 * TRUE if the structure could be fixated
821 public int fixateFieldNearestInt(char[] fieldName, int target)
823 // gboolean gst_structure_fixate_field_nearest_int (GstStructure *structure, const char *field_name, int target);
824 return gst_structure_fixate_field_nearest_int(gstStructure, Str.toStringz(fieldName), target);
828 * Fixates a GstStructure by changing the given field to the nearest
829 * double to target that is a subset of the existing field.
830 * structure:
831 * a GstStructure
832 * field_name:
833 * a field in structure
834 * target:
835 * the target value of the fixation
836 * Returns:
837 * TRUE if the structure could be fixated
839 public int fixateFieldNearestDouble(char[] fieldName, double target)
841 // gboolean gst_structure_fixate_field_nearest_double (GstStructure *structure, const char *field_name, double target);
842 return gst_structure_fixate_field_nearest_double(gstStructure, Str.toStringz(fieldName), target);
846 * Fixates a GstStructure by changing the given field to the nearest
847 * fraction to target_numerator/target_denominator that is a subset
848 * of the existing field.
849 * structure:
850 * a GstStructure
851 * field_name:
852 * a field in structure
853 * target_numerator:
854 * The numerator of the target value of the fixation
855 * target_denominator:
856 * The denominator of the target value of the fixation
857 * Returns:
858 * TRUE if the structure could be fixated
860 public int fixateFieldNearestFraction(char[] fieldName, int targetNumerator, int targetDenominator)
862 // gboolean gst_structure_fixate_field_nearest_fraction (GstStructure *structure, const char *field_name, const gint target_numerator, const gint target_denominator);
863 return gst_structure_fixate_field_nearest_fraction(gstStructure, Str.toStringz(fieldName), targetNumerator, targetDenominator);
867 * Fixates a GstStructure by changing the given field_name field to the given
868 * target boolean if that field is not fixed yet.
869 * structure:
870 * a GstStructure
871 * field_name:
872 * a field in structure
873 * target:
874 * the target value of the fixation
875 * Returns:
876 * TRUE if the structure could be fixated
877 * See Also
878 * GstCaps, GstMessage, GstEvent, GstQuery
880 public int fixateFieldBoolean(char[] fieldName, int target)
882 // gboolean gst_structure_fixate_field_boolean (GstStructure *structure, const char *field_name, gboolean target);
883 return gst_structure_fixate_field_boolean(gstStructure, Str.toStringz(fieldName), target);