equal
deleted
inserted
replaced
28 #include "interfaces-marshal.h" |
28 #include "interfaces-marshal.h" |
29 |
29 |
30 /** |
30 /** |
31 * SECTION:gstcolorbalance |
31 * SECTION:gstcolorbalance |
32 * @short_description: Interface for adjusting color balance settings |
32 * @short_description: Interface for adjusting color balance settings |
33 * |
|
34 * <refsect2><para> |
|
35 * This interface is implemented by elements which can perform some color |
|
36 * balance operation on video frames they process. For example, modifying |
|
37 * the brightness, contrast, hue or saturation. |
|
38 * </para><para> |
|
39 * Example elements are 'xvimagesink' and 'colorbalance' |
|
40 * </para> |
|
41 * </refsect2> |
|
42 */ |
33 */ |
43 |
34 |
44 enum |
35 enum |
45 { |
36 { |
46 VALUE_CHANGED, |
37 VALUE_CHANGED, |
86 gst_color_balance_class_init (GstColorBalanceClass * klass) |
77 gst_color_balance_class_init (GstColorBalanceClass * klass) |
87 { |
78 { |
88 static gboolean initialized = FALSE; |
79 static gboolean initialized = FALSE; |
89 |
80 |
90 if (!initialized) { |
81 if (!initialized) { |
91 /** |
|
92 * GstColorBalance::value-changed: |
|
93 * @colorbalance: The GstColorBalance instance |
|
94 * @channel: The #GstColorBalanceChannel |
|
95 * @value: The new value |
|
96 * |
|
97 * Fired when the value of the indicated channel has changed. |
|
98 */ |
|
99 gst_color_balance_signals[VALUE_CHANGED] = |
82 gst_color_balance_signals[VALUE_CHANGED] = |
100 g_signal_new ("value-changed", |
83 g_signal_new ("value-changed", |
101 GST_TYPE_COLOR_BALANCE, G_SIGNAL_RUN_LAST, |
84 GST_TYPE_COLOR_BALANCE, G_SIGNAL_RUN_LAST, |
102 G_STRUCT_OFFSET (GstColorBalanceClass, value_changed), |
85 G_STRUCT_OFFSET (GstColorBalanceClass, value_changed), |
103 NULL, NULL, |
86 NULL, NULL, |
112 /* default virtual functions */ |
95 /* default virtual functions */ |
113 klass->list_channels = NULL; |
96 klass->list_channels = NULL; |
114 klass->set_value = NULL; |
97 klass->set_value = NULL; |
115 klass->get_value = NULL; |
98 klass->get_value = NULL; |
116 } |
99 } |
117 |
|
118 /** |
|
119 * gst_color_balance_list_channels: |
|
120 * @balance: A #GstColorBalance instance |
|
121 * |
|
122 * Retrieve a list of the available channels. |
|
123 * |
|
124 * Returns: A GList containing pointers to #GstColorBalanceChannel objects. |
|
125 * The list is owned by the #GstColorBalance instance and must not |
|
126 * be freed. |
|
127 */ |
|
128 #ifdef __SYMBIAN32__ |
100 #ifdef __SYMBIAN32__ |
129 EXPORT_C |
101 EXPORT_C |
130 #endif |
102 #endif |
|
103 |
131 |
104 |
132 const GList * |
105 const GList * |
133 gst_color_balance_list_channels (GstColorBalance * balance) |
106 gst_color_balance_list_channels (GstColorBalance * balance) |
134 { |
107 { |
135 GstColorBalanceClass *klass = GST_COLOR_BALANCE_GET_CLASS (balance); |
108 GstColorBalanceClass *klass = GST_COLOR_BALANCE_GET_CLASS (balance); |
138 return klass->list_channels (balance); |
111 return klass->list_channels (balance); |
139 } |
112 } |
140 |
113 |
141 return NULL; |
114 return NULL; |
142 } |
115 } |
143 |
|
144 /** |
|
145 * gst_color_balance_set_value: |
|
146 * @balance: A #GstColorBalance instance |
|
147 * @channel: A #GstColorBalanceChannel instance |
|
148 * @value: The new value for the channel. |
|
149 * |
|
150 * Sets the current value of the channel to the passed value, which must |
|
151 * be between min_value and max_value. |
|
152 * |
|
153 * See Also: The #GstColorBalanceChannel::min_value and |
|
154 * #GstColorBalanceChannel::max_value members of the |
|
155 * #GstColorBalanceChannel object. |
|
156 */ |
|
157 #ifdef __SYMBIAN32__ |
116 #ifdef __SYMBIAN32__ |
158 EXPORT_C |
117 EXPORT_C |
159 #endif |
118 #endif |
|
119 |
160 |
120 |
161 void |
121 void |
162 gst_color_balance_set_value (GstColorBalance * balance, |
122 gst_color_balance_set_value (GstColorBalance * balance, |
163 GstColorBalanceChannel * channel, gint value) |
123 GstColorBalanceChannel * channel, gint value) |
164 { |
124 { |
166 |
126 |
167 if (klass->set_value) { |
127 if (klass->set_value) { |
168 klass->set_value (balance, channel, value); |
128 klass->set_value (balance, channel, value); |
169 } |
129 } |
170 } |
130 } |
171 |
|
172 /** |
|
173 * gst_color_balance_get_value: |
|
174 * @balance: A #GstColorBalance instance |
|
175 * @channel: A #GstColorBalanceChannel instance |
|
176 * |
|
177 * Retrieve the current value of the indicated channel, between min_value |
|
178 * and max_value. |
|
179 * |
|
180 * See Also: The #GstColorBalanceChannel::min_value and |
|
181 * #GstColorBalanceChannel::max_value members of the |
|
182 * #GstColorBalanceChannel object. |
|
183 * |
|
184 * Returns: The current value of the channel. |
|
185 */ |
|
186 #ifdef __SYMBIAN32__ |
131 #ifdef __SYMBIAN32__ |
187 EXPORT_C |
132 EXPORT_C |
188 #endif |
133 #endif |
|
134 |
189 |
135 |
190 gint |
136 gint |
191 gst_color_balance_get_value (GstColorBalance * balance, |
137 gst_color_balance_get_value (GstColorBalance * balance, |
192 GstColorBalanceChannel * channel) |
138 GstColorBalanceChannel * channel) |
193 { |
139 { |
197 return klass->get_value (balance, channel); |
143 return klass->get_value (balance, channel); |
198 } |
144 } |
199 |
145 |
200 return channel->min_value; |
146 return channel->min_value; |
201 } |
147 } |
202 |
148 #ifdef __SYMBIAN32__ |
203 /** |
|
204 * gst_color_balance_get_balance_type: |
|
205 * @balance: The #GstColorBalance implementation |
|
206 * |
|
207 * Get the #GstColorBalanceType of this implementation. |
|
208 * |
|
209 * Returns: A the #GstColorBalanceType. |
|
210 * |
|
211 * Since: 0.10.24 |
|
212 */ |
|
213 |
|
214 #ifdef __SYMBIAN32__ |
|
215 EXPORT_C |
149 EXPORT_C |
216 #endif |
150 #endif |
217 |
151 |
218 GstColorBalanceType |
|
219 gst_color_balance_get_balance_type (GstColorBalance * balance) |
|
220 { |
|
221 GstColorBalanceClass *klass = GST_COLOR_BALANCE_GET_CLASS (balance); |
|
222 |
|
223 return klass->balance_type; |
|
224 } |
|
225 |
|
226 /** |
|
227 * gst_color_balance_value_changed: |
|
228 * @balance: A #GstColorBalance instance |
|
229 * @channel: A #GstColorBalanceChannel whose value has changed |
|
230 * @value: The new value of the channel |
|
231 * |
|
232 * A helper function called by implementations of the GstColorBalance |
|
233 * interface. It fires the #GstColorBalance::value-changed signal on the |
|
234 * instance, and the #GstColorBalanceChannel::value-changed signal on the |
|
235 * channel object. |
|
236 */ |
|
237 #ifdef __SYMBIAN32__ |
|
238 EXPORT_C |
|
239 #endif |
|
240 |
152 |
241 void |
153 void |
242 gst_color_balance_value_changed (GstColorBalance * balance, |
154 gst_color_balance_value_changed (GstColorBalance * balance, |
243 GstColorBalanceChannel * channel, gint value) |
155 GstColorBalanceChannel * channel, gint value) |
244 { |
156 { |