1 /* GStreamer
2 *
3 * Copyright (C) 2008 Nokia Corporation <multimedia@maemo.org>
4 *
5 * photography.c: photography interface for digital imaging
6 *
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
17 *
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22 */
23
24 #ifdef HAVE_CONFIG_H
25 #include "config.h"
26 #endif
27
28 #include "photography.h"
29
30 /**
31 * SECTION:gstphotography
32 * @short_description: Interface for digital image capture elements
33 * @stability: Unstable
34 *
35 * The interface allows access to some common digital image capture parameters.
36 *
37 * <note>
38 * The GstPhotography interface is unstable API and may change in future.
39 * One can define GST_USE_UNSTABLE_API to acknowledge and avoid this warning.
40 * </note>
41 */
42
43 static void gst_photography_iface_base_init (GstPhotographyInterface * iface);
44 static void gst_photography_iface_class_init (gpointer g_class);
45
46 GType
gst_photography_get_type(void)47 gst_photography_get_type (void)
48 {
49 static GType gst_photography_type = 0;
50
51 if (!gst_photography_type) {
52 static const GTypeInfo gst_photography_info = {
53 sizeof (GstPhotographyInterface),
54 (GBaseInitFunc) gst_photography_iface_base_init, /* base_init */
55 NULL, /* base_finalize */
56 (GClassInitFunc) gst_photography_iface_class_init, /* class_init */
57 NULL, /* class_finalize */
58 NULL, /* class_data */
59 0,
60 0, /* n_preallocs */
61 NULL, /* instance_init */
62 };
63
64 gst_photography_type = g_type_register_static (G_TYPE_INTERFACE,
65 "GstPhotography", &gst_photography_info, 0);
66 }
67
68 return gst_photography_type;
69 }
70
71 static void
gst_photography_iface_base_init(GstPhotographyInterface * iface)72 gst_photography_iface_base_init (GstPhotographyInterface * iface)
73 {
74 /* default virtual functions */
75 iface->get_ev_compensation = NULL;
76 iface->get_iso_speed = NULL;
77 iface->get_aperture = NULL;
78 iface->get_exposure = NULL;
79 iface->get_white_balance_mode = NULL;
80 iface->get_color_tone_mode = NULL;
81 iface->get_scene_mode = NULL;
82 iface->get_flash_mode = NULL;
83 iface->get_noise_reduction = NULL;
84 iface->get_zoom = NULL;
85 iface->get_flicker_mode = NULL;
86 iface->get_focus_mode = NULL;
87
88 iface->set_ev_compensation = NULL;
89 iface->set_iso_speed = NULL;
90 iface->set_aperture = NULL;
91 iface->set_exposure = NULL;
92 iface->set_white_balance_mode = NULL;
93 iface->set_color_tone_mode = NULL;
94 iface->set_scene_mode = NULL;
95 iface->set_flash_mode = NULL;
96 iface->set_noise_reduction = NULL;
97 iface->set_zoom = NULL;
98 iface->set_flicker_mode = NULL;
99 iface->set_focus_mode = NULL;
100
101 iface->get_capabilities = NULL;
102 iface->prepare_for_capture = NULL;
103 iface->set_autofocus = NULL;
104 iface->set_config = NULL;
105 iface->get_config = NULL;
106 }
107
108 #define GST_PHOTOGRAPHY_FUNC_TEMPLATE(function_name, param_type) \
109 gboolean \
110 gst_photography_set_ ## function_name (GstPhotography * photo, param_type param) \
111 { \
112 GstPhotographyInterface *iface; \
113 g_return_val_if_fail (photo != NULL, FALSE); \
114 iface = GST_PHOTOGRAPHY_GET_INTERFACE (photo); \
115 if (iface->set_ ## function_name) { \
116 return iface->set_ ## function_name (photo, param); \
117 } \
118 return FALSE; \
119 } \
120 gboolean \
121 gst_photography_get_ ## function_name (GstPhotography * photo, param_type * param) \
122 { \
123 GstPhotographyInterface *iface; \
124 g_return_val_if_fail (photo != NULL, FALSE); \
125 iface = GST_PHOTOGRAPHY_GET_INTERFACE (photo); \
126 if (iface->get_ ## function_name) { \
127 return iface->get_ ## function_name (photo, param); \
128 } \
129 return FALSE; \
130 }
131
132
133 /**
134 * gst_photography_set_ev_compensation:
135 * @photo: #GstPhotography interface of a #GstElement
136 * @ev_comp: ev compensation value to set
137 *
138 * Set the ev compensation value for the #GstElement
139 *
140 * Returns: %TRUE if setting the value succeeded, %FALSE otherwise
141 */
142 /**
143 * gst_photography_get_ev_compensation:
144 * @photo: #GstPhotography interface of a #GstElement
145 * @ev_comp: ev compensation value to get
146 *
147 * Get the ev compensation value for the #GstElement
148 *
149 * Returns: %TRUE if getting the value succeeded, %FALSE otherwise
150 */
151 GST_PHOTOGRAPHY_FUNC_TEMPLATE (ev_compensation, gfloat);
152
153 /**
154 * gst_photography_set_iso_speed:
155 * @photo: #GstPhotography interface of a #GstElement
156 * @iso_speed: ISO speed value to set
157 *
158 * Set the ISO value (light sensivity) for the #GstElement
159 *
160 * Returns: %TRUE if setting the value succeeded, %FALSE otherwise
161 */
162 /**
163 * gst_photography_get_iso_speed:
164 * @photo: #GstPhotography interface of a #GstElement
165 * @iso_speed: ISO speed value to get
166 *
167 * Get the ISO value (light sensivity) for the #GstElement
168 *
169 * Returns: %TRUE if getting the value succeeded, %FALSE otherwise
170 */
171 GST_PHOTOGRAPHY_FUNC_TEMPLATE (iso_speed, guint);
172
173 /**
174 * gst_photography_set_aperture:
175 * @photo: #GstPhotography interface of a #GstElement
176 * @aperture: aperture value to set
177 *
178 * Set the aperture value for the #GstElement
179 *
180 * Returns: %TRUE if setting the value succeeded, %FALSE otherwise
181 */
182 /**
183 * gst_photography_get_aperture:
184 * @photo: #GstPhotography interface of a #GstElement
185 * @aperture: aperture value to get
186 *
187 * Get the aperture value for the #GstElement
188 *
189 * Returns: %TRUE if getting the value succeeded, %FALSE otherwise
190 */
191 GST_PHOTOGRAPHY_FUNC_TEMPLATE (aperture, guint);
192
193 /**
194 * gst_photography_set_exposure:
195 * @photo: #GstPhotography interface of a #GstElement
196 * @exposure: exposure time to set
197 *
198 * Set the fixed exposure time (in us) for the #GstElement
199 *
200 * Returns: %TRUE if setting the value succeeded, %FALSE otherwise
201 */
202 /**
203 * gst_photography_get_exposure:
204 * @photo: #GstPhotography interface of a #GstElement
205 * @exposure: exposure time to get
206 *
207 * Get the fixed exposure time (in us) for the #GstElement
208 *
209 * Returns: %TRUE if getting the value succeeded, %FALSE otherwise
210 */
211 GST_PHOTOGRAPHY_FUNC_TEMPLATE (exposure, guint32);
212
213 /**
214 * gst_photography_set_white_balance_mode:
215 * @photo: #GstPhotography interface of a #GstElement
216 * @wb_mode: #GstPhotographyWhiteBalanceMode to set
217 *
218 * Set the white balance mode for the #GstElement
219 *
220 * Returns: %TRUE if setting the value succeeded, %FALSE otherwise
221 */
222 /**
223 * gst_photography_get_white_balance_mode:
224 * @photo: #GstPhotography interface of a #GstElement
225 * @wb_mode: #GstPhotographyWhiteBalanceMode to get
226 *
227 * Get the white balance mode for the #GstElement
228 *
229 * Returns: %TRUE if getting the value succeeded, %FALSE otherwise
230 */
231 GST_PHOTOGRAPHY_FUNC_TEMPLATE (white_balance_mode,
232 GstPhotographyWhiteBalanceMode);
233
234 /**
235 * gst_photography_set_color_tone_mode:
236 * @photo: #GstPhotography interface of a #GstElement
237 * @tone_mode: #GstPhotographyColorToneMode to set
238 *
239 * Set the color tone mode for the #GstElement
240 *
241 * Returns: %TRUE if setting the value succeeded, %FALSE otherwise
242 */
243 /**
244 * gst_photography_get_color_tone_mode:
245 * @photo: #GstPhotography interface of a #GstElement
246 * @tone_mode: #GstPhotographyColorToneMode to get
247 *
248 * Get the color tone mode for the #GstElement
249 *
250 * Returns: %TRUE if getting the value succeeded, %FALSE otherwise
251 */
252 GST_PHOTOGRAPHY_FUNC_TEMPLATE (color_tone_mode, GstPhotographyColorToneMode);
253
254 /**
255 * gst_photography_set_scene_mode:
256 * @photo: #GstPhotography interface of a #GstElement
257 * @scene_mode: #GstPhotographySceneMode to set
258 *
259 * Set the scene mode for the #GstElement
260 *
261 * Returns: %TRUE if setting the value succeeded, %FALSE otherwise
262 */
263 /**
264 * gst_photography_get_scene_mode:
265 * @photo: #GstPhotography interface of a #GstElement
266 * @scene_mode: #GstPhotographySceneMode to get
267 *
268 * Get the scene mode for the #GstElement
269 *
270 * Returns: %TRUE if getting the value succeeded, %FALSE otherwise
271 */
272 GST_PHOTOGRAPHY_FUNC_TEMPLATE (scene_mode, GstPhotographySceneMode);
273
274 /**
275 * gst_photography_set_flash_mode:
276 * @photo: #GstPhotography interface of a #GstElement
277 * @flash_mode: #GstPhotographyFlashMode to set
278 *
279 * Set the flash mode for the #GstElement
280 *
281 * Returns: %TRUE if setting the value succeeded, %FALSE otherwise
282 */
283 /**
284 * gst_photography_get_flash_mode:
285 * @photo: #GstPhotography interface of a #GstElement
286 * @flash_mode: #GstPhotographyFlashMode to get
287 *
288 * Get the flash mode for the #GstElement
289 *
290 * Returns: %TRUE if getting the value succeeded, %FALSE otherwise
291 */
292 GST_PHOTOGRAPHY_FUNC_TEMPLATE (flash_mode, GstPhotographyFlashMode);
293
294 /**
295 * gst_photography_set_noise_reduction:
296 * @photo: #GstPhotography interface of a #GstElement
297 * @noise_reduction: #GstPhotographyNoiseReductionMode to set
298 *
299 * Set the noise reduction mode for the #GstElement
300 *
301 * Returns: %TRUE if setting the value succeeded, %FALSE otherwise
302 */
303 /**
304 * gst_photography_get_noise_reduction:
305 * @photo: #GstPhotography interface of a #GstElement
306 * @noise_reduction: #GstPhotographyNoiseReductionMode to get
307 *
308 * Get the noise reduction mode for the #GstElement
309 *
310 * Returns: %TRUE if getting the value succeeded, %FALSE otherwise
311 */
312 GST_PHOTOGRAPHY_FUNC_TEMPLATE (noise_reduction, GstPhotographyNoiseReduction);
313
314 /**
315 * gst_photography_set_zoom:
316 * @photo: #GstPhotography interface of a #GstElement
317 * @zoom: zoom value to set
318 *
319 * Set the zoom value for the #GstElement.
320 * E.g. 1.0 to get original image and 3.0 for 3x zoom and so on.
321 *
322 * Returns: %TRUE if setting the value succeeded, %FALSE otherwise
323 */
324 /**
325 * gst_photography_get_zoom:
326 * @photo: #GstPhotography interface of a #GstElement
327 * @zoom: zoom value to get
328 *
329 * Get the zoom value for the #GstElement
330 *
331 * Returns: %TRUE if getting the value succeeded, %FALSE otherwise
332 */
333 GST_PHOTOGRAPHY_FUNC_TEMPLATE (zoom, gfloat);
334
335 /**
336 * gst_photography_set_flicker_mode:
337 * @photo: #GstPhotography interface of a #GstElement
338 * @flicker_mode: flicker mode value to set
339 *
340 * Set the flicker mode value for the #GstElement.
341 *
342 * Returns: %TRUE if setting the value succeeded, %FALSE otherwise
343 */
344 /**
345 * gst_photography_get_flicker_mode:
346 * @photo: #GstPhotography interface of a #GstElement
347 * @flicker_mode: flicker mode value to get
348 *
349 * Get the flicker mode value for the #GstElement
350 *
351 * Returns: %TRUE if getting the value succeeded, %FALSE otherwise
352 */
353 GST_PHOTOGRAPHY_FUNC_TEMPLATE (flicker_mode,
354 GstPhotographyFlickerReductionMode);
355
356 /**
357 * gst_photography_set_focus_mode:
358 * @photo: #GstPhotography interface of a #GstElement
359 * @focus_mode: focus mode value to set
360 *
361 * Set the focus mode value for the #GstElement.
362 *
363 * Returns: %TRUE if setting the value succeeded, %FALSE otherwise
364 */
365 /**
366 * gst_photography_get_focus_mode:
367 * @photo: #GstPhotography interface of a #GstElement
368 * @focus_mode: focus_mode value to get
369 *
370 * Get the focus mode value for the #GstElement
371 *
372 * Returns: %TRUE if getting the value succeeded, %FALSE otherwise
373 */
374 GST_PHOTOGRAPHY_FUNC_TEMPLATE (focus_mode, GstPhotographyFocusMode);
375
376 /**
377 * gst_photography_get_capabilities:
378 * @photo: #GstPhotography interface of a #GstElement
379 *
380 * Get #GstPhotographyCaps bitmask value that indicates what photography
381 * interface features the #GstElement supports
382 *
383 * Returns: #GstPhotographyCaps value
384 */
385 GstPhotographyCaps
gst_photography_get_capabilities(GstPhotography * photo)386 gst_photography_get_capabilities (GstPhotography * photo)
387 {
388 GstPhotographyInterface *iface;
389 g_return_val_if_fail (photo != NULL, GST_PHOTOGRAPHY_CAPS_NONE);
390
391 iface = GST_PHOTOGRAPHY_GET_INTERFACE (photo);
392 if (iface->get_capabilities) {
393 return iface->get_capabilities (photo);
394 } else {
395 return GST_PHOTOGRAPHY_CAPS_NONE;
396 }
397 }
398
399 /**
400 * gst_photography_prepare_for_capture:
401 * @photo: #GstPhotography interface of a #GstElement
402 * @func: callback that is called after capturing has been prepared
403 * @capture_caps: #GstCaps defining the desired format of the captured image
404 * @user_data: user data that will be passed to the callback @func
405 *
406 * Start preparations for capture. Preparations can take indeterminate
407 * amount of time and @func callback is called after preparations are
408 * done. Image capture will begin after callback returns.
409 *
410 * Returns: %TRUE if preparations were started (caps were OK), otherwise %FALSE.
411 */
412 gboolean
gst_photography_prepare_for_capture(GstPhotography * photo,GstPhotographyCapturePrepared func,GstCaps * capture_caps,gpointer user_data)413 gst_photography_prepare_for_capture (GstPhotography * photo,
414 GstPhotographyCapturePrepared func, GstCaps * capture_caps,
415 gpointer user_data)
416 {
417 GstPhotographyInterface *iface;
418 gboolean ret = TRUE;
419
420 g_return_val_if_fail (photo != NULL, FALSE);
421
422 iface = GST_PHOTOGRAPHY_GET_INTERFACE (photo);
423 if (iface->prepare_for_capture) {
424 ret = iface->prepare_for_capture (photo, func, capture_caps, user_data);
425 }
426
427 return ret;
428 }
429
430 /**
431 * gst_photography_set_autofocus:
432 * @photo: #GstPhotography interface of a #GstElement
433 * @on: %TRUE to start autofocusing, %FALSE to stop autofocusing
434 *
435 * Start or stop autofocusing. %GST_PHOTOGRAPHY_AUTOFOCUS_DONE
436 * message is posted to bus when autofocusing has finished.
437 */
438 void
gst_photography_set_autofocus(GstPhotography * photo,gboolean on)439 gst_photography_set_autofocus (GstPhotography * photo, gboolean on)
440 {
441 GstPhotographyInterface *iface;
442 g_return_if_fail (photo != NULL);
443
444 iface = GST_PHOTOGRAPHY_GET_INTERFACE (photo);
445 if (iface->set_autofocus) {
446 iface->set_autofocus (photo, on);
447 }
448 }
449
450 /**
451 * gst_photography_set_config:
452 * @photo: #GstPhotography interface of a #GstElement
453 * @config: #GstPhotographySettings containg the configuration
454 *
455 * Set all configuration settings at once.
456 *
457 * Returns: TRUE if configuration was set successfully, otherwise FALSE.
458 */
459 gboolean
gst_photography_set_config(GstPhotography * photo,GstPhotographySettings * config)460 gst_photography_set_config (GstPhotography * photo,
461 GstPhotographySettings * config)
462 {
463 GstPhotographyInterface *iface;
464 gboolean ret = FALSE;
465
466 g_return_val_if_fail (photo != NULL, FALSE);
467
468 iface = GST_PHOTOGRAPHY_GET_INTERFACE (photo);
469 if (iface->set_config) {
470 ret = iface->set_config (photo, config);
471 }
472
473 return ret;
474 }
475
476 /**
477 * gst_photography_get_config:
478 * @photo: #GstPhotography interface of a #GstElement
479 * @config: #GstPhotographySettings containg the configuration
480 *
481 * Get all configuration settings at once.
482 *
483 * Returns: TRUE if configuration was got successfully, otherwise FALSE.
484 */
485 gboolean
gst_photography_get_config(GstPhotography * photo,GstPhotographySettings * config)486 gst_photography_get_config (GstPhotography * photo,
487 GstPhotographySettings * config)
488 {
489 GstPhotographyInterface *iface;
490 gboolean ret = FALSE;
491
492 g_return_val_if_fail (photo != NULL, FALSE);
493
494 iface = GST_PHOTOGRAPHY_GET_INTERFACE (photo);
495 if (iface->get_config) {
496 ret = iface->get_config (photo, config);
497 }
498
499 return ret;
500 }
501
502 /* Photography class initialization stuff */
503 static void
gst_photography_iface_class_init(gpointer g_class)504 gst_photography_iface_class_init (gpointer g_class)
505 {
506 /* create interface signals and properties here. */
507
508 /* White balance */
509 g_object_interface_install_property (g_class,
510 g_param_spec_enum (GST_PHOTOGRAPHY_PROP_WB_MODE,
511 "White balance mode property",
512 "White balance affects the color temperature of the photo",
513 GST_TYPE_PHOTOGRAPHY_WHITE_BALANCE_MODE,
514 GST_PHOTOGRAPHY_WB_MODE_AUTO,
515 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
516
517 /* Color tone */
518 g_object_interface_install_property (g_class,
519 g_param_spec_enum (GST_PHOTOGRAPHY_PROP_COLOR_TONE,
520 "Color tone mode property",
521 "Color tone setting changes color shading in the photo",
522 GST_TYPE_PHOTOGRAPHY_COLOR_TONE_MODE,
523 GST_PHOTOGRAPHY_COLOR_TONE_MODE_NORMAL,
524 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
525
526 /* Scene mode */
527 g_object_interface_install_property (g_class,
528 g_param_spec_enum (GST_PHOTOGRAPHY_PROP_SCENE_MODE,
529 "Scene mode property",
530 "Scene mode works as a preset for different photo shooting mode settings",
531 GST_TYPE_PHOTOGRAPHY_SCENE_MODE,
532 GST_PHOTOGRAPHY_SCENE_MODE_AUTO,
533 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
534
535 /* Flash mode */
536 g_object_interface_install_property (g_class,
537 g_param_spec_enum (GST_PHOTOGRAPHY_PROP_FLASH_MODE,
538 "Flash mode property",
539 "Flash mode defines how the flash light should be used",
540 GST_TYPE_PHOTOGRAPHY_FLASH_MODE,
541 GST_PHOTOGRAPHY_FLASH_MODE_AUTO,
542 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
543
544 /* Flicker reduction mode */
545 g_object_interface_install_property (g_class,
546 g_param_spec_enum (GST_PHOTOGRAPHY_PROP_FLICKER_MODE,
547 "Flicker reduction mode property",
548 "Flicker reduction mode defines a line frequency for flickering prevention",
549 GST_TYPE_PHOTOGRAPHY_FLICKER_REDUCTION_MODE,
550 GST_PHOTOGRAPHY_FLICKER_REDUCTION_OFF,
551 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
552
553 /* Focus mode */
554 g_object_interface_install_property (g_class,
555 g_param_spec_enum (GST_PHOTOGRAPHY_PROP_FOCUS_MODE,
556 "Focus mode property",
557 "Focus mode defines the range of focal lengths to use in autofocus search",
558 GST_TYPE_PHOTOGRAPHY_FOCUS_MODE,
559 GST_PHOTOGRAPHY_FOCUS_MODE_AUTO,
560 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
561
562 /* Capabilities */
563 g_object_interface_install_property (g_class,
564 g_param_spec_ulong (GST_PHOTOGRAPHY_PROP_CAPABILITIES,
565 "Photo capabilities bitmask",
566 "Tells the photo capabilities of the device",
567 0, G_MAXULONG, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
568
569 /* EV_compensation */
570 g_object_interface_install_property (g_class,
571 g_param_spec_float (GST_PHOTOGRAPHY_PROP_EV_COMP,
572 "EV compensation property",
573 "EV compensation affects the brightness of the image",
574 -2.5, 2.5, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
575
576 /* ISO value */
577 g_object_interface_install_property (g_class,
578 g_param_spec_uint (GST_PHOTOGRAPHY_PROP_ISO_SPEED,
579 "ISO speed property",
580 "ISO speed defines the light sensitivity (0 = auto)",
581 0, 6400, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
582
583 /* Aperture */
584 g_object_interface_install_property (g_class,
585 g_param_spec_uint (GST_PHOTOGRAPHY_PROP_APERTURE,
586 "Aperture property",
587 "Aperture defines the size of lens opening (0 = auto)",
588 0, G_MAXUINT8, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
589
590 /* Exposure */
591 g_object_interface_install_property (g_class,
592 g_param_spec_uint (GST_PHOTOGRAPHY_PROP_EXPOSURE_TIME,
593 "Exposure time in milliseconds",
594 "Exposure time defines how long the shutter will stay open (0 = auto)",
595 0, G_MAXUINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
596
597 /**
598 * GstPhotography:image-capture-supported-caps:
599 *
600 * Query caps that describe supported formats for image capture. Sometimes
601 * element may support different formats for image capture than for video
602 * streaming.
603 */
604 g_object_interface_install_property (g_class,
605 g_param_spec_boxed (GST_PHOTOGRAPHY_PROP_IMAGE_CAPTURE_SUPPORTED_CAPS,
606 "Image capture supported caps",
607 "Caps describing supported image capture formats", GST_TYPE_CAPS,
608 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
609
610 /**
611 * GstPhotography:image-preview-supported-caps:
612 *
613 * Query caps that describe supported formats for preview image. Sometimes
614 * element may support different formats for preview image than for video
615 * streaming.
616 */
617 g_object_interface_install_property (g_class,
618 g_param_spec_boxed (GST_PHOTOGRAPHY_PROP_IMAGE_PREVIEW_SUPPORTED_CAPS,
619 "Image preview supported caps",
620 "Caps describing supported image preview formats", GST_TYPE_CAPS,
621 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
622
623 /* Zoom */
624 g_object_interface_install_property (g_class,
625 g_param_spec_float (GST_PHOTOGRAPHY_PROP_ZOOM,
626 "Zoom property",
627 "How much the resulted image will be zoomed",
628 1.0f, 10.0f, 1.0f, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
629
630 /**
631 * GstPhotography:color-temperature:
632 *
633 * Color temperature parameter for manual white balance.
634 * Control color temperature in Kelvin units.
635 */
636 g_object_interface_install_property (g_class,
637 g_param_spec_uint (GST_PHOTOGRAPHY_PROP_COLOR_TEMPERATURE,
638 "Color temperature in Kelvin units",
639 "Color temperature in Kelvin units for manual white balance",
640 0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
641
642 /**
643 * GstPhotography:white-point:
644 *
645 * White point parameter for manual white balance.
646 * Describes the color "white" as raw values.
647 *
648 * FIXME: check and document correct representation for white point
649 */
650 g_object_interface_install_property (g_class,
651 g_param_spec_value_array (GST_PHOTOGRAPHY_PROP_WHITE_POINT,
652 "White point",
653 "Describe color white as raw values",
654 g_param_spec_uint ("raw-value", "Raw value",
655 "Raw value", 0, G_MAXUINT, 0,
656 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS),
657 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
658
659 /**
660 * GstPhotography:analog-gain:
661 *
662 * Linear multiplicative value how much amplification is applied to the signal
663 * before A-D conversion.
664 */
665 g_object_interface_install_property (g_class,
666 g_param_spec_float (GST_PHOTOGRAPHY_PROP_ANALOG_GAIN,
667 "Analog gain applied to the sensor",
668 "Analog gain applied to the sensor",
669 1.0f, G_MAXFLOAT, 1.0f, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
670
671 /**
672 * GstPhotography:lens-focus:
673 *
674 * Manual changing of lens focus in diopter units.
675 * Inteded use with GST_PHOTOGRAPHY_FOCUS_MODE_MANUAL focus mode, otherwise
676 * to be ignored.
677 *
678 */
679 g_object_interface_install_property (g_class,
680 g_param_spec_float (GST_PHOTOGRAPHY_PROP_LENS_FOCUS,
681 "Manual lens focus",
682 "Focus point in diopter units",
683 0.0f, G_MAXFLOAT, 0.0f, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
684
685 /**
686 * GstPhotography:min-exposure-time:
687 *
688 * Minimum exposure time for automatic exposure mode.
689 */
690 g_object_interface_install_property (g_class,
691 g_param_spec_uint (GST_PHOTOGRAPHY_PROP_MIN_EXPOSURE_TIME,
692 "Minimum exposure time",
693 "Minimum exposure time for automatic exposure mode",
694 0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
695
696 /**
697 * GstPhotography:max-exposure-time:
698 *
699 * Maximum exposure time for automatic exposure mode.
700 */
701 g_object_interface_install_property (g_class,
702 g_param_spec_uint (GST_PHOTOGRAPHY_PROP_MAX_EXPOSURE_TIME,
703 "Maximum exposure time",
704 "Maximum exposure time for automatic exposure mode",
705 0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
706
707 /* Noise Reduction, Bayer an YCC noise reduction are enabled by default */
708 g_object_interface_install_property (g_class,
709 g_param_spec_flags (GST_PHOTOGRAPHY_PROP_NOISE_REDUCTION,
710 "Noise Reduction settings",
711 "Which noise reduction modes are enabled (0 = disabled)",
712 GST_TYPE_PHOTOGRAPHY_NOISE_REDUCTION,
713 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
714 }
715