cameracontrol: Add new interface for extra preview stream format
[platform/upstream/gstreamer.git] / gst-libs / gst / video / cameracontrol.c
1 /*
2  * GStreamer Camera Control Interface
3  *
4  * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd.
5  *
6  * Contact: Jeongmo Yang <jm80.yang@samsung.com>
7  *
8  * This library is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU Lesser General Public License as published by the
10  * Free Software Foundation; either version 2.1 of the License, or (at your option)
11  * any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but WITHOUT ANY
14  * WARRANTY; without even the implied warranty of MERCHANTABILITY or
15  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16  * License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; if not, write to the Free Software Foundation, Inc., 51
20  * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  */
23
24 /*============================================================================================
25 EDIT HISTORY FOR MODULE
26
27 This section contains comments describing changes made to the module.
28 Notice that changes are listed in reverse chronological order.
29
30 when            who                             what, where, why
31 ---------       ------------------------        ----------------------------------------------
32 12/09/08        jm80.yang@samsung.com           Created
33
34 ============================================================================================*/
35
36
37 #ifdef HAVE_CONFIG_H
38 #include "config.h"
39 #endif
40
41 #include "cameracontrol.h"
42
43 /**
44  * SECTION:gstcameracontrol
45  * @short_description: Interface for camera control
46  */
47
48 enum {
49         CONTROL_VALUE_CHANGED,
50         CONTROL_LAST_SIGNAL
51 };
52
53 static void gst_camera_control_base_init(GstCameraControlInterface *iface);
54
55 static guint gst_camera_control_signals[CONTROL_LAST_SIGNAL] = { 0 };
56
57 GType gst_camera_control_get_type(void)
58 {
59         static GType gst_camera_control_type = 0;
60
61         if (!gst_camera_control_type) {
62                 static const GTypeInfo gst_camera_control_info =
63                 {
64                         sizeof(GstCameraControlInterface),
65                         (GBaseInitFunc)gst_camera_control_base_init,
66                         NULL,
67                         NULL,
68                         NULL,
69                         NULL,
70                         0,
71                         0,
72                         NULL,
73                 };
74
75                 gst_camera_control_type = g_type_register_static(G_TYPE_INTERFACE,
76                         "GstCameraControl", &gst_camera_control_info, 0);
77         }
78
79         return gst_camera_control_type;
80 }
81
82 static void gst_camera_control_base_init(GstCameraControlInterface *iface)
83 {
84         static gboolean initialized = FALSE;
85
86         if (!initialized) {
87                 gst_camera_control_signals[CONTROL_VALUE_CHANGED] =
88                         g_signal_new("control-value-changed",
89                                 GST_TYPE_CAMERA_CONTROL, G_SIGNAL_RUN_LAST,
90                                 G_STRUCT_OFFSET(GstCameraControlInterface, value_changed),
91                                 NULL, NULL, NULL,
92                                 G_TYPE_NONE, 2, GST_TYPE_CAMERA_CONTROL_CHANNEL, G_TYPE_INT);
93
94                 initialized = TRUE;
95         }
96
97         // TODO :
98         iface->camera_control_type = 0;
99
100         /* default virtual functions */
101         iface->list_channels = NULL;
102         iface->set_exposure = NULL;
103         iface->get_exposure = NULL;
104         iface->set_capture_mode = NULL;
105         iface->get_capture_mode = NULL;
106         iface->set_strobe = NULL;
107         iface->get_strobe = NULL;
108         iface->set_detect = NULL;
109         iface->get_detect = NULL;
110         iface->set_value = NULL;
111         iface->get_value = NULL;
112         iface->set_zoom = NULL;
113         iface->get_zoom = NULL;
114         iface->set_focus = NULL;
115         iface->get_focus = NULL;
116         iface->start_auto_focus = NULL;
117         iface->stop_auto_focus = NULL;
118         iface->set_focus_level = NULL;
119         iface->get_focus_level = NULL;
120         iface->set_auto_focus_area = NULL;
121         iface->get_auto_focus_area = NULL;
122         iface->set_wdr = NULL;
123         iface->get_wdr = NULL;
124         iface->set_ahs = NULL;
125         iface->get_ahs = NULL;
126         iface->set_part_color = NULL;
127         iface->get_part_color = NULL;
128         iface->get_exif_info = NULL;
129         iface->set_capture_command = NULL;
130         iface->set_record_command = NULL;
131         iface->start_face_zoom = NULL;
132         iface->stop_face_zoom = NULL;
133         iface->set_ae_lock = NULL;
134         iface->get_ae_lock = NULL;
135         iface->set_awb_lock = NULL;
136         iface->get_awb_lock = NULL;
137 }
138
139 /**
140  * gst_camera_control_list_channels:
141  * @control: A #GstCameraControl instance
142  *
143  * Retrieve a list of the available channels.
144  *
145  * Returns: (element-type GstCameraControlChannel) (transfer none): A
146  *          GList containing pointers to #GstCameraControlChannel
147  *          objects. The list is owned by the #GstCameraControl
148  *          instance and must not be freed.
149  */
150 const GList *gst_camera_control_list_channels(GstCameraControl *control)
151 {
152         GstCameraControlInterface *iface;
153
154         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), NULL);
155
156         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
157
158         if (iface->list_channels)
159                 return iface->list_channels(control);
160
161         return NULL;
162 }
163
164
165 gboolean gst_camera_control_set_value(GstCameraControl *control, GstCameraControlChannel *control_channel, gint value)
166 {
167         GstCameraControlInterface *iface;
168
169         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
170
171         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
172
173         if (iface->set_value)
174                 return iface->set_value(control, control_channel, value);
175
176         return FALSE;
177 }
178
179 gboolean gst_camera_control_get_value(GstCameraControl *control, GstCameraControlChannel *control_channel, gint *value)
180 {
181         GstCameraControlInterface *iface;
182
183         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
184
185         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
186
187         if (iface->get_value)
188                 return iface->get_value(control, control_channel, value);
189
190         return FALSE;
191 }
192
193
194
195 gboolean gst_camera_control_set_exposure(GstCameraControl *control, gint type, gint value1, gint value2)
196 {
197         GstCameraControlInterface *iface;
198
199         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
200
201         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
202
203         if (iface->set_exposure)
204                 return iface->set_exposure(control, type, value1, value2);
205
206         return FALSE;
207 }
208
209 gboolean gst_camera_control_get_exposure(GstCameraControl *control, gint type, gint *value1, gint *value2)
210 {
211         GstCameraControlInterface *iface;
212
213         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
214
215         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
216
217         if (iface->get_exposure)
218                 return iface->get_exposure(control, type, value1, value2);
219
220         return FALSE;
221 }
222
223 gboolean gst_camera_control_set_capture_mode(GstCameraControl *control, gint type, gint value)
224 {
225         GstCameraControlInterface *iface;
226
227         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
228
229         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
230
231         if (iface->set_capture_mode)
232                 return iface->set_capture_mode(control, type, value);
233
234         return FALSE;
235 }
236
237 gboolean gst_camera_control_get_capture_mode(GstCameraControl *control, gint type, gint *value)
238 {
239         GstCameraControlInterface *iface;
240
241         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
242
243         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
244
245         if (iface->get_capture_mode)
246                 return iface->get_capture_mode(control, type, value);
247
248         return FALSE;
249 }
250
251 gboolean gst_camera_control_set_strobe(GstCameraControl *control, gint type, gint value)
252 {
253         GstCameraControlInterface *iface;
254
255         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
256
257         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
258
259         if (iface->set_strobe)
260                 return iface->set_strobe(control, type, value);
261
262         return FALSE;
263 }
264
265 gboolean gst_camera_control_get_strobe(GstCameraControl *control, gint type, gint *value)
266 {
267         GstCameraControlInterface *iface;
268
269         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
270
271         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
272
273         if (iface->get_strobe)
274                 return iface->get_strobe(control, type, value);
275
276         return FALSE;
277 }
278
279 gboolean gst_camera_control_set_detect(GstCameraControl *control, gint type, gint value)
280 {
281         GstCameraControlInterface *iface;
282
283         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
284
285         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
286
287         if (iface->set_detect)
288                 return iface->set_detect(control, type, value);
289
290         return FALSE;
291 }
292
293 gboolean gst_camera_control_get_detect(GstCameraControl *control, gint type, gint *value)
294 {
295         GstCameraControlInterface *iface;
296
297         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
298
299         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
300
301         if (iface->get_detect)
302                 return iface->get_detect(control, type, value);
303
304         return FALSE;
305 }
306
307 gboolean gst_camera_control_set_zoom(GstCameraControl *control, gint type, gint value)
308 {
309         GstCameraControlInterface *iface;
310
311         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
312
313         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
314
315         if (iface->set_zoom)
316                 return iface->set_zoom(control, type, value);
317
318         return FALSE;
319 }
320
321 gboolean gst_camera_control_get_zoom(GstCameraControl *control, gint type, gint *value)
322 {
323         GstCameraControlInterface *iface;
324
325         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
326
327         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
328
329         if (iface->get_zoom)
330                 return iface->get_zoom(control, type, value);
331
332         return FALSE;
333 }
334
335 gboolean gst_camera_control_set_focus(GstCameraControl *control, gint mode, gint range)
336 {
337         GstCameraControlInterface *iface;
338
339         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
340
341         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
342
343         if (iface->set_focus)
344                 return iface->set_focus(control, mode, range);
345
346         return FALSE;
347 }
348
349 gboolean gst_camera_control_get_focus(GstCameraControl *control, gint *mode, gint *range)
350 {
351         GstCameraControlInterface *iface;
352
353         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
354
355         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
356
357         if (iface->get_focus)
358                 return iface->get_focus(control, mode, range);
359
360         return FALSE;
361 }
362
363 gboolean gst_camera_control_start_auto_focus(GstCameraControl *control)
364 {
365         GstCameraControlInterface *iface;
366
367         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
368
369         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
370
371         if (iface->start_auto_focus)
372                 return iface->start_auto_focus(control);
373
374         return FALSE;
375 }
376
377 gboolean gst_camera_control_stop_auto_focus(GstCameraControl *control)
378 {
379         GstCameraControlInterface *iface;
380
381         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
382
383         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
384
385         if (iface->stop_auto_focus)
386                 return iface->stop_auto_focus(control);
387
388         return FALSE;
389 }
390
391 gboolean gst_camera_control_set_focus_level(GstCameraControl *control, gint manual_level)
392 {
393         GstCameraControlInterface *iface;
394
395         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
396
397         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
398
399         if (iface->set_focus_level)
400                 return iface->set_focus_level(control, manual_level);
401
402         return FALSE;
403 }
404
405 gboolean gst_camera_control_get_focus_level(GstCameraControl *control, gint *manual_level)
406 {
407         GstCameraControlInterface *iface;
408
409         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
410
411         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
412
413         if (iface->get_focus_level)
414                 return iface->get_focus_level(control, manual_level);
415
416         return FALSE;
417 }
418
419 gboolean gst_camera_control_set_auto_focus_area(GstCameraControl *control, GstCameraControlRectType rect)
420 {
421         GstCameraControlInterface *iface;
422
423         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
424
425         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
426
427         if (iface->set_auto_focus_area)
428                 return iface->set_auto_focus_area(control, rect);
429
430         return FALSE;
431 }
432
433 gboolean gst_camera_control_get_auto_focus_area(GstCameraControl *control, GstCameraControlRectType *rect)
434 {
435         GstCameraControlInterface *iface;
436
437         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
438
439         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
440
441         if (iface->get_auto_focus_area)
442                 return iface->get_auto_focus_area(control, rect);
443
444         return FALSE;
445 }
446
447 gboolean gst_camera_control_set_wdr(GstCameraControl *control, gint value)
448 {
449         GstCameraControlInterface *iface;
450
451         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
452
453         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
454
455         if (iface->set_wdr)
456                 return iface->set_wdr(control, value);
457
458         return FALSE;
459 }
460
461 gboolean gst_camera_control_get_wdr(GstCameraControl *control, gint *value)
462 {
463         GstCameraControlInterface *iface;
464
465         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
466
467         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
468
469         if (iface->get_wdr)
470                 return iface->get_wdr(control, value);
471
472         return FALSE;
473 }
474
475 gboolean gst_camera_control_set_ahs(GstCameraControl *control, gint value)
476 {
477         GstCameraControlInterface *iface;
478
479         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
480
481         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
482
483         if (iface->set_ahs)
484                 return iface->set_ahs(control, value);
485
486         return FALSE;
487 }
488
489 gboolean gst_camera_control_get_ahs(GstCameraControl *control, gint *value)
490 {
491         GstCameraControlInterface *iface;
492
493         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
494
495         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
496
497         if (iface->get_ahs)
498                 return iface->get_ahs(control, value);
499
500         return FALSE;
501 }
502
503 gboolean gst_camera_control_set_part_color(GstCameraControl *control, gint type, gint value)
504 {
505         GstCameraControlInterface *iface;
506
507         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
508
509         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
510
511         if (iface->set_part_color)
512                 return iface->set_part_color(control, type, value);
513
514         return FALSE;
515 }
516
517 gboolean gst_camera_control_get_part_color(GstCameraControl *control, gint type, gint *value)
518 {
519         GstCameraControlInterface *iface;
520
521         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
522
523         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
524
525         if (iface->get_part_color)
526                 return iface->get_part_color(control, type, value);
527
528         return FALSE;
529 }
530
531 gboolean
532 gst_camera_control_get_exif_info(GstCameraControl *control, GstCameraControlExifInfo *info)
533 {
534         GstCameraControlInterface *iface;
535
536         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
537
538         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
539
540         if (iface->get_exif_info)
541                 return iface->get_exif_info(control, info);
542
543         return FALSE;
544 }
545
546
547 gboolean gst_camera_control_get_basic_dev_info(GstCameraControl *control, gint dev_id, GstCameraControlCapsInfoType *info)
548 {
549         GstCameraControlInterface *iface;
550
551         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
552
553         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
554
555         if (iface->get_basic_dev_info)
556                 return iface->get_basic_dev_info(control, dev_id, info);
557
558         return FALSE;
559 }
560
561 gboolean gst_camera_control_get_misc_dev_info(GstCameraControl *control, gint dev_id, GstCameraControlCtrlListInfoType *info)
562 {
563         GstCameraControlInterface *iface;
564
565         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
566
567         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
568
569         if (iface->get_misc_dev_info)
570                 return iface->get_misc_dev_info(control, dev_id, info);
571
572         return FALSE;
573 }
574
575 gboolean gst_camera_control_get_extra_dev_info(GstCameraControl *control, gint dev_id, GstCameraControlExtraInfoType *info)
576 {
577         GstCameraControlInterface *iface;
578
579         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
580
581         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
582
583         if (iface->get_extra_dev_info)
584                 return iface->get_extra_dev_info(control, dev_id, info);
585
586         return FALSE;
587 }
588
589 void gst_camera_control_set_capture_command(GstCameraControl *control, GstCameraControlCaptureCommand cmd)
590 {
591         GstCameraControlInterface *iface;
592
593         g_return_if_fail(GST_IS_CAMERA_CONTROL(control));
594
595         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
596
597         if (iface->set_capture_command)
598                 iface->set_capture_command(control, cmd);
599
600         return;
601 }
602
603 void gst_camera_control_set_record_command(GstCameraControl *control, GstCameraControlRecordCommand cmd)
604 {
605         GstCameraControlInterface *iface;
606
607         g_return_if_fail(GST_IS_CAMERA_CONTROL(control));
608
609         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
610
611         if (iface->set_record_command)
612                 iface->set_record_command(control, cmd);
613
614         return;
615 }
616
617 gboolean gst_camera_control_start_face_zoom(GstCameraControl *control, gint x, gint y, gint zoom_level)
618 {
619         GstCameraControlInterface *iface;
620
621         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
622
623         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
624
625         if (iface->start_face_zoom)
626                 return iface->start_face_zoom(control, x, y, zoom_level);
627
628         return FALSE;
629 }
630
631 gboolean gst_camera_control_stop_face_zoom(GstCameraControl *control)
632 {
633         GstCameraControlInterface *iface;
634
635         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
636
637         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
638
639         if (iface->stop_face_zoom)
640                 return iface->stop_face_zoom(control);
641
642         return FALSE;
643 }
644
645 gboolean gst_camera_control_set_ae_lock(GstCameraControl *control, gboolean lock)
646 {
647         GstCameraControlInterface *iface;
648
649         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
650
651         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
652
653         if (iface->set_ae_lock)
654                 return iface->set_ae_lock(control, lock);
655
656         return FALSE;
657 }
658
659 gboolean gst_camera_control_get_ae_lock(GstCameraControl *control, gboolean *lock)
660 {
661         GstCameraControlInterface *iface;
662
663         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
664
665         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
666
667         if (iface->get_ae_lock)
668                 return iface->get_ae_lock(control, lock);
669
670         return FALSE;
671 }
672
673 gboolean gst_camera_control_set_awb_lock(GstCameraControl *control, gboolean lock)
674 {
675         GstCameraControlInterface *iface;
676
677         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
678
679         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
680
681         if (iface->set_awb_lock)
682                 return iface->set_awb_lock(control, lock);
683
684         return FALSE;
685 }
686
687 gboolean gst_camera_control_get_awb_lock(GstCameraControl *control, gboolean *lock)
688 {
689         GstCameraControlInterface *iface;
690
691         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
692
693         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
694
695         if (iface->get_awb_lock)
696                 return iface->get_awb_lock(control, lock);
697
698         return FALSE;
699 }
700
701 gboolean gst_camera_control_set_user_buffer_fd(GstCameraControl *control, int *fds, int number)
702 {
703         GstCameraControlInterface *iface;
704
705         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
706
707         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
708
709         if (iface->set_user_buffer_fd)
710                 return iface->set_user_buffer_fd(control, fds, number);
711
712         return FALSE;
713 }
714
715 gboolean gst_camera_control_set_extra_preview_stream_format(GstCameraControl *control, int stream_id, GstCameraControlImageFormat img_fmt, int width, int height, int fps)
716 {
717         GstCameraControlInterface *iface;
718
719         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
720
721         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
722
723         if (iface->set_extra_preview_stream_format)
724                 return iface->set_extra_preview_stream_format(control, stream_id, img_fmt, width, height, fps);
725
726         return FALSE;
727 }
728
729 gboolean gst_camera_control_get_extra_preview_stream_format(GstCameraControl *control, int stream_id, GstCameraControlImageFormat *img_fmt, int *width, int *height, int *fps)
730 {
731         GstCameraControlInterface *iface;
732
733         g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE);
734
735         iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
736
737         if (iface->get_extra_preview_stream_format)
738                 return iface->get_extra_preview_stream_format(control, stream_id, img_fmt, width, height, fps);
739
740         return FALSE;
741 }
742
743 void gst_camera_control_value_changed(GstCameraControl *control, GstCameraControlChannel *control_channel, gint value)
744 {
745         g_signal_emit(G_OBJECT(control), gst_camera_control_signals[CONTROL_VALUE_CHANGED], 0, control_channel, value);
746         g_signal_emit_by_name(G_OBJECT(control_channel), "control-value-changed", value);
747 }