1 /* GStreamer - GParamSpecs for some of our types
2 * Copyright (C) 2007 Tim-Philipp Müller <tim centricular net>
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.
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.
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.
20 #ifndef __GST_PARAMSPECS_H__
21 #define __GST_PARAMSPECS_H__
23 #include <gst/gstvalue.h>
27 /* --- paramspec flags */
30 * GST_PARAM_CONTROLLABLE:
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.
35 #define GST_PARAM_CONTROLLABLE (1 << (G_PARAM_USER_SHIFT + 1))
38 * GST_PARAM_MUTABLE_READY:
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.
43 #define GST_PARAM_MUTABLE_READY (1 << (G_PARAM_USER_SHIFT + 2))
46 * GST_PARAM_MUTABLE_PAUSED:
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.
52 #define GST_PARAM_MUTABLE_PAUSED (1 << (G_PARAM_USER_SHIFT + 3))
55 * GST_PARAM_MUTABLE_PLAYING:
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.
61 #define GST_PARAM_MUTABLE_PLAYING (1 << (G_PARAM_USER_SHIFT + 4))
64 * GST_PARAM_USER_SHIFT:
66 * Bits based on GST_PARAM_USER_SHIFT can be used by 3rd party applications.
68 #define GST_PARAM_USER_SHIFT (1 << (G_PARAM_USER_SHIFT + 8))
71 /* --- type macros --- */
73 #define GST_TYPE_PARAM_FRACTION (gst_param_spec_fraction_get_type ())
74 #define GST_IS_PARAM_SPEC_FRACTION(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GST_TYPE_PARAM_FRACTION))
75 #define GST_PARAM_SPEC_FRACTION(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GST_TYPE_PARAM_FRACTION, GstParamSpecFraction))
78 #define GST_TYPE_PARAM_ARRAY_LIST (gst_param_spec_array_get_type ())
79 #define GST_IS_PARAM_SPEC_ARRAY_LIST(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GST_TYPE_PARAM_ARRAY_LIST))
80 #define GST_PARAM_SPEC_ARRAY_LIST(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GST_TYPE_PARAM_ARRAY_LIST, GstParamSpecArray))
83 /* --- get_type functions --- */
86 GType gst_param_spec_fraction_get_type (void);
89 GType gst_param_spec_array_get_type (void);
92 /* --- typedefs & structures --- */
94 typedef struct _GstParamSpecFraction GstParamSpecFraction;
95 typedef struct _GstParamSpecArray GstParamSpecArray;
98 * GstParamSpecFraction:
99 * @parent_instance: super class
100 * @min_num: minimal numerator
101 * @min_den: minimal denominator
102 * @max_num: maximal numerator
103 * @max_den: maximal denominator
104 * @def_num: default numerator
105 * @def_den: default denominator
107 * A GParamSpec derived structure that contains the meta data for fractional
110 struct _GstParamSpecFraction {
111 GParamSpec parent_instance;
113 gint min_num, min_den;
114 gint max_num, max_den;
115 gint def_num, def_den;
120 * @parent_instance: super class
121 * @value_array: the array of values
123 * A GParamSpec derived structure that contains the meta data for fractional
126 struct _GstParamSpecArray {
127 GParamSpec parent_instance;
129 GParamSpec * element_spec;
133 /* --- GParamSpec prototypes --- */
136 GParamSpec * gst_param_spec_fraction (const gchar * name,
139 gint min_num, gint min_denom,
140 gint max_num, gint max_denom,
141 gint default_num, gint default_denom,
142 GParamFlags flags) G_GNUC_MALLOC;
144 GParamSpec * gst_param_spec_array (const gchar * name,
147 GParamSpec * element_spec,
148 GParamFlags flags) G_GNUC_MALLOC;
152 #endif /* __GST_PARAMSPECS_H__ */