| 1 | /* GStreamer - GParamSpecs for some of our types |
| 2 | * Copyright (C) 2007 Tim-Philipp Müller <tim centricular net> |
| 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Library General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library 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 GNU |
| 12 | * Library General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Library General Public |
| 15 | * License along with this library; if not, write to the |
| 16 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, |
| 17 | * Boston, MA 02110-1301, USA. |
| 18 | */ |
| 19 | |
| 20 | #ifndef __GST_PARAMSPECS_H__ |
| 21 | #define __GST_PARAMSPECS_H__ |
| 22 | |
| 23 | #include <gst/gstvalue.h> |
| 24 | |
| 25 | G_BEGIN_DECLS |
| 26 | |
| 27 | /* --- paramspec flags */ |
| 28 | |
| 29 | /** |
| 30 | * GST_PARAM_CONTROLLABLE: (value 512) |
| 31 | * |
| 32 | * Use this flag on GObject properties to signal they can make sense to be. |
| 33 | * controlled over time. This hint is used by the GstController. |
| 34 | */ |
| 35 | #define GST_PARAM_CONTROLLABLE (1 << (G_PARAM_USER_SHIFT + 1)) |
| 36 | |
| 37 | /** |
| 38 | * GST_PARAM_MUTABLE_READY: (value 1024) |
| 39 | * |
| 40 | * Use this flag on GObject properties of GstElements to indicate that |
| 41 | * they can be changed when the element is in the READY or lower state. |
| 42 | */ |
| 43 | #define GST_PARAM_MUTABLE_READY (1 << (G_PARAM_USER_SHIFT + 2)) |
| 44 | |
| 45 | /** |
| 46 | * GST_PARAM_MUTABLE_PAUSED: (value 2048) |
| 47 | * |
| 48 | * Use this flag on GObject properties of GstElements to indicate that |
| 49 | * they can be changed when the element is in the PAUSED or lower state. |
| 50 | * This flag implies GST_PARAM_MUTABLE_READY. |
| 51 | */ |
| 52 | #define GST_PARAM_MUTABLE_PAUSED (1 << (G_PARAM_USER_SHIFT + 3)) |
| 53 | |
| 54 | /** |
| 55 | * GST_PARAM_MUTABLE_PLAYING: (value 4096) |
| 56 | * |
| 57 | * Use this flag on GObject properties of GstElements to indicate that |
| 58 | * they can be changed when the element is in the PLAYING or lower state. |
| 59 | * This flag implies GST_PARAM_MUTABLE_PAUSED. |
| 60 | */ |
| 61 | #define GST_PARAM_MUTABLE_PLAYING (1 << (G_PARAM_USER_SHIFT + 4)) |
| 62 | |
| 63 | /** |
| 64 | * GST_PARAM_DOC_SHOW_DEFAULT: (value 8192) |
| 65 | * |
| 66 | * Use this flag on GObject properties of GstObject to indicate that |
| 67 | * during `gst-inspect` and friends, the default value should be used |
| 68 | * as default instead of the current value. |
| 69 | * |
| 70 | * Since: 1.18 |
| 71 | */ |
| 72 | #define GST_PARAM_DOC_SHOW_DEFAULT (1 << (G_PARAM_USER_SHIFT + 5)) |
| 73 | |
| 74 | /** |
| 75 | * GST_PARAM_CONDITIONALLY_AVAILABLE: (value 16384) |
| 76 | * |
| 77 | * Use this flag on GObject properties of GstObject to indicate that |
| 78 | * they might not be available depending on environment such as OS, device, etc, |
| 79 | * so such properties will be installed conditionally only if the GstObject is |
| 80 | * able to support it. |
| 81 | * |
| 82 | * Since: 1.18 |
| 83 | */ |
| 84 | #define GST_PARAM_CONDITIONALLY_AVAILABLE (1 << (G_PARAM_USER_SHIFT + 6)) |
| 85 | |
| 86 | /** |
| 87 | * GST_PARAM_USER_SHIFT: (value 65536) |
| 88 | * |
| 89 | * Bits based on GST_PARAM_USER_SHIFT can be used by 3rd party applications. |
| 90 | */ |
| 91 | #define GST_PARAM_USER_SHIFT (1 << (G_PARAM_USER_SHIFT + 8)) |
| 92 | |
| 93 | |
| 94 | /* --- type macros --- */ |
| 95 | |
| 96 | /** |
| 97 | * GstParamFraction: |
| 98 | * |
| 99 | * A fundamental type that describes a #GParamSpec for fractional |
| 100 | * properties |
| 101 | */ |
| 102 | |
| 103 | #define GST_TYPE_PARAM_FRACTION (gst_param_spec_fraction_get_type ()) |
| 104 | #define GST_IS_PARAM_SPEC_FRACTION(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GST_TYPE_PARAM_FRACTION)) |
| 105 | #define GST_PARAM_SPEC_FRACTION(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GST_TYPE_PARAM_FRACTION, GstParamSpecFraction)) |
| 106 | |
| 107 | /** |
| 108 | * GstParamArray: |
| 109 | * |
| 110 | * A fundamental type that describes a #GParamSpec for arrays of |
| 111 | * values |
| 112 | * |
| 113 | * Since: 1.12 |
| 114 | */ |
| 115 | |
| 116 | #define GST_TYPE_PARAM_ARRAY_LIST (gst_param_spec_array_get_type ()) |
| 117 | #define GST_IS_PARAM_SPEC_ARRAY_LIST(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GST_TYPE_PARAM_ARRAY_LIST)) |
| 118 | #define GST_PARAM_SPEC_ARRAY_LIST(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GST_TYPE_PARAM_ARRAY_LIST, GstParamSpecArray)) |
| 119 | |
| 120 | |
| 121 | /* --- get_type functions --- */ |
| 122 | |
| 123 | GST_API |
| 124 | GType gst_param_spec_fraction_get_type (void); |
| 125 | |
| 126 | GST_API |
| 127 | GType gst_param_spec_array_get_type (void); |
| 128 | |
| 129 | |
| 130 | /* --- typedefs & structures --- */ |
| 131 | |
| 132 | typedef struct _GstParamSpecFraction GstParamSpecFraction; |
| 133 | typedef struct _GstParamSpecArray GstParamSpecArray; |
| 134 | |
| 135 | /** |
| 136 | * GstParamSpecFraction: |
| 137 | * @parent_instance: super class |
| 138 | * @min_num: minimal numerator |
| 139 | * @min_den: minimal denominator |
| 140 | * @max_num: maximal numerator |
| 141 | * @max_den: maximal denominator |
| 142 | * @def_num: default numerator |
| 143 | * @def_den: default denominator |
| 144 | * |
| 145 | * A GParamSpec derived structure that contains the meta data for fractional |
| 146 | * properties. |
| 147 | */ |
| 148 | struct _GstParamSpecFraction { |
| 149 | GParamSpec parent_instance; |
| 150 | |
| 151 | gint min_num, min_den; |
| 152 | gint max_num, max_den; |
| 153 | gint def_num, def_den; |
| 154 | }; |
| 155 | |
| 156 | /** |
| 157 | * GstParamSpecArray: |
| 158 | * @parent_instance: super class |
| 159 | * @element_spec: the #GParamSpec of the type of values in the array |
| 160 | * |
| 161 | * A GParamSpec derived structure for arrays of values. |
| 162 | */ |
| 163 | struct _GstParamSpecArray { |
| 164 | GParamSpec parent_instance; |
| 165 | |
| 166 | GParamSpec * element_spec; |
| 167 | }; |
| 168 | |
| 169 | |
| 170 | /* --- GParamSpec prototypes --- */ |
| 171 | |
| 172 | GST_API |
| 173 | GParamSpec * gst_param_spec_fraction (const gchar * name, |
| 174 | const gchar * nick, |
| 175 | const gchar * blurb, |
| 176 | gint min_num, gint min_denom, |
| 177 | gint max_num, gint max_denom, |
| 178 | gint default_num, gint default_denom, |
| 179 | GParamFlags flags) G_GNUC_MALLOC; |
| 180 | GST_API |
| 181 | GParamSpec * gst_param_spec_array (const gchar * name, |
| 182 | const gchar * nick, |
| 183 | const gchar * blurb, |
| 184 | GParamSpec * element_spec, |
| 185 | GParamFlags flags) G_GNUC_MALLOC; |
| 186 | |
| 187 | G_END_DECLS |
| 188 | |
| 189 | #endif /* __GST_PARAMSPECS_H__ */ |
| 190 | |
| 191 | |