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