summaryrefslogtreecommitdiff
path: root/gst/camerabin/gstcamerabinphotography.c
blob: a5940f483e6a7552359917e5f67ca6c49c232ad5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
/*
 * GStreamer
 * Copyright (C) 2008 Nokia Corporation <multimedia@maemo.org>
 *
 * Photography interface implementation for camerabin.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <string.h>
#include "gstcamerabinphotography.h"
#include "gstcamerabin.h"
#include "gstcamerabin-enum.h"

GST_DEBUG_CATEGORY_STATIC (camerabinphoto_debug);
#define GST_CAT_DEFAULT camerabinphoto_debug

#define PHOTOGRAPHY_IS_OK(photo_elem) (GST_IS_ELEMENT (photo_elem) && \
                                       gst_element_implements_interface (photo_elem, GST_TYPE_PHOTOGRAPHY))
static void
gst_camerabin_handle_scene_mode (GstCameraBin * camera,
    GstSceneMode scene_mode);

static gboolean
gst_camerabin_set_ev_compensation (GstPhotography * photo,
    gfloat ev_compensation)
{
  GstCameraBin *camera;
  gboolean ret = TRUE;

  g_return_val_if_fail (photo != NULL, FALSE);

  camera = GST_CAMERABIN (photo);

  /* Cache the setting */
  camera->photo_settings.ev_compensation = ev_compensation;

  if (PHOTOGRAPHY_IS_OK (camera->src_vid_src)) {
    ret =
        gst_photography_set_ev_compensation (GST_PHOTOGRAPHY
        (camera->src_vid_src), ev_compensation);
  }
  return ret;
}

static gboolean
gst_camerabin_get_ev_compensation (GstPhotography * photo,
    gfloat * ev_compensation)
{
  GstCameraBin *camera;
  gboolean ret = FALSE;

  g_return_val_if_fail (photo != NULL, FALSE);

  camera = GST_CAMERABIN (photo);

  if (PHOTOGRAPHY_IS_OK (camera->src_vid_src)) {
    ret =
        gst_photography_get_ev_compensation (GST_PHOTOGRAPHY
        (camera->src_vid_src), ev_compensation);
  }
  return ret;
}

static gboolean
gst_camerabin_set_iso_speed (GstPhotography * photo, guint iso_speed)
{
  GstCameraBin *camera;
  gboolean ret = TRUE;

  g_return_val_if_fail (photo != NULL, FALSE);

  camera = GST_CAMERABIN (photo);

  /* Cache the setting */
  camera->photo_settings.iso_speed = iso_speed;

  if (PHOTOGRAPHY_IS_OK (camera->src_vid_src)) {
    ret = gst_photography_set_iso_speed (GST_PHOTOGRAPHY (camera->src_vid_src),
        iso_speed);
  }
  return ret;
}

static gboolean
gst_camerabin_get_iso_speed (GstPhotography * photo, guint * iso_speed)
{
  GstCameraBin *camera;
  gboolean ret = FALSE;

  g_return_val_if_fail (photo != NULL, FALSE);

  camera = GST_CAMERABIN (photo);

  if (PHOTOGRAPHY_IS_OK (camera->src_vid_src)) {
    ret = gst_photography_get_iso_speed (GST_PHOTOGRAPHY (camera->src_vid_src),
        iso_speed);
  }
  return ret;
}

static gboolean
gst_camerabin_set_white_balance_mode (GstPhotography * photo,
    GstWhiteBalanceMode white_balance_mode)
{
  GstCameraBin *camera;
  gboolean ret = TRUE;

  g_return_val_if_fail (photo != NULL, FALSE);

  camera = GST_CAMERABIN (photo);

  /* Cache the setting */
  camera->photo_settings.wb_mode = white_balance_mode;

  if (PHOTOGRAPHY_IS_OK (camera->src_vid_src)) {
    ret =
        gst_photography_set_white_balance_mode (GST_PHOTOGRAPHY
        (camera->src_vid_src), white_balance_mode);
  }
  return ret;
}

static gboolean
gst_camerabin_get_white_balance_mode (GstPhotography * photo,
    GstWhiteBalanceMode * white_balance_mode)
{
  GstCameraBin *camera;
  gboolean ret = FALSE;

  g_return_val_if_fail (photo != NULL, FALSE);

  camera = GST_CAMERABIN (photo);

  if (PHOTOGRAPHY_IS_OK (camera->src_vid_src)) {
    ret =
        gst_photography_get_white_balance_mode (GST_PHOTOGRAPHY
        (camera->src_vid_src), white_balance_mode);
  }
  return ret;
}

static gboolean
gst_camerabin_set_colour_tone_mode (GstPhotography * photo,
    GstColourToneMode colour_tone_mode)
{
  GstCameraBin *camera;
  gboolean ret = TRUE;

  g_return_val_if_fail (photo != NULL, FALSE);

  camera = GST_CAMERABIN (photo);

  /* Cache the setting */
  camera->photo_settings.tone_mode = colour_tone_mode;

  if (PHOTOGRAPHY_IS_OK (camera->src_vid_src)) {
    ret =
        gst_photography_set_colour_tone_mode (GST_PHOTOGRAPHY
        (camera->src_vid_src), colour_tone_mode);
  }
  return ret;
}

static gboolean
gst_camerabin_get_colour_tone_mode (GstPhotography * photo,
    GstColourToneMode * colour_tone_mode)
{
  GstCameraBin *camera;
  gboolean ret = FALSE;

  g_return_val_if_fail (photo != NULL, FALSE);

  camera = GST_CAMERABIN (photo);

  if (PHOTOGRAPHY_IS_OK (camera->src_vid_src)) {
    ret =
        gst_photography_get_colour_tone_mode (GST_PHOTOGRAPHY
        (camera->src_vid_src), colour_tone_mode);
  }
  return ret;
}

static gboolean
gst_camerabin_set_flash_mode (GstPhotography * photo, GstFlashMode flash_mode)
{
  GstCameraBin *camera;
  gboolean ret = TRUE;

  g_return_val_if_fail (photo != NULL, FALSE);

  camera = GST_CAMERABIN (photo);

  /* Cache the setting */
  camera->photo_settings.flash_mode = flash_mode;

  if (PHOTOGRAPHY_IS_OK (camera->src_vid_src)) {
    ret = gst_photography_set_flash_mode (GST_PHOTOGRAPHY (camera->src_vid_src),
        flash_mode);
  }
  return ret;
}

static gboolean
gst_camerabin_get_flash_mode (GstPhotography * photo, GstFlashMode * flash_mode)
{
  GstCameraBin *camera;
  gboolean ret = FALSE;

  g_return_val_if_fail (photo != NULL, FALSE);

  camera = GST_CAMERABIN (photo);

  if (PHOTOGRAPHY_IS_OK (camera->src_vid_src)) {
    ret = gst_photography_get_flash_mode (GST_PHOTOGRAPHY (camera->src_vid_src),
        flash_mode);
  }
  return ret;
}

static gboolean
gst_camerabin_set_scene_mode (GstPhotography * photo, GstSceneMode scene_mode)
{
  GstCameraBin *camera;
  gboolean ret = TRUE;

  g_return_val_if_fail (photo != NULL, FALSE);

  camera = GST_CAMERABIN (photo);

  /* Cache the setting */
  camera->photo_settings.scene_mode = scene_mode;

  gst_camerabin_handle_scene_mode (camera, scene_mode);

  if (PHOTOGRAPHY_IS_OK (camera->src_vid_src)) {
    ret = gst_photography_set_scene_mode (GST_PHOTOGRAPHY (camera->src_vid_src),
        scene_mode);
    if (ret) {
      gst_photography_get_config (GST_PHOTOGRAPHY (camera->src_vid_src),
          &camera->photo_settings);
    }
  }
  return ret;
}

static gboolean
gst_camerabin_get_scene_mode (GstPhotography * photo, GstSceneMode * scene_mode)
{
  GstCameraBin *camera;
  gboolean ret = FALSE;

  g_return_val_if_fail (photo != NULL, FALSE);

  camera = GST_CAMERABIN (photo);

  if (PHOTOGRAPHY_IS_OK (camera->src_vid_src)) {
    ret = gst_photography_get_scene_mode (GST_PHOTOGRAPHY (camera->src_vid_src),
        scene_mode);
  }
  return ret;
}

static GstPhotoCaps
gst_camerabin_get_capabilities (GstPhotography * photo)
{
  GstCameraBin *camera;
  /* camerabin can zoom by itself */
  GstPhotoCaps pcaps = GST_PHOTOGRAPHY_CAPS_ZOOM;

  g_return_val_if_fail (photo != NULL, FALSE);

  camera = GST_CAMERABIN (photo);

  if (GST_IS_ELEMENT (camera->src_vid_src) &&
      gst_element_implements_interface (camera->src_vid_src,
          GST_TYPE_PHOTOGRAPHY)) {
    GstPhotography *p2 = GST_PHOTOGRAPHY (camera->src_vid_src);
    pcaps |= gst_photography_get_capabilities (p2);
  }

  return pcaps;
}

static void
gst_camerabin_set_autofocus (GstPhotography * photo, gboolean on)
{
  GstCameraBin *camera;

  g_return_if_fail (photo != NULL);

  camera = GST_CAMERABIN (photo);

  GST_DEBUG_OBJECT (camera, "setting autofocus %s", on ? "ON" : "OFF");

  if (PHOTOGRAPHY_IS_OK (camera->src_vid_src)) {
    gst_photography_set_autofocus (GST_PHOTOGRAPHY (camera->src_vid_src), on);
  }
}

static gboolean
gst_camerabin_get_aperture (GstPhotography * photo, guint * aperture)
{
  GstCameraBin *camera;
  gboolean ret = FALSE;

  g_return_val_if_fail (photo != NULL, FALSE);

  camera = GST_CAMERABIN (photo);

  if (PHOTOGRAPHY_IS_OK (camera->src_vid_src)) {
    ret = gst_photography_get_aperture (GST_PHOTOGRAPHY (camera->src_vid_src),
        aperture);
  }
  return ret;
}

static void
gst_camerabin_set_aperture (GstPhotography * photo, guint aperture)
{
  GstCameraBin *camera;

  g_return_if_fail (photo != NULL);

  camera = GST_CAMERABIN (photo);

  if (PHOTOGRAPHY_IS_OK (camera->src_vid_src)) {
    gst_photography_set_aperture (GST_PHOTOGRAPHY (camera->src_vid_src),
        aperture);
  }
}

static gboolean
gst_camerabin_get_exposure (GstPhotography * photo, guint32 * exposure)
{
  GstCameraBin *camera;
  gboolean ret = FALSE;

  g_return_val_if_fail (photo != NULL, FALSE);

  camera = GST_CAMERABIN (photo);

  if (PHOTOGRAPHY_IS_OK (camera->src_vid_src)) {
    ret = gst_photography_get_exposure (GST_PHOTOGRAPHY (camera->src_vid_src),
        exposure);
  }
  return ret;
}

static void
gst_camerabin_set_exposure (GstPhotography * photo, guint32 exposure)
{
  GstCameraBin *camera;

  g_return_if_fail (photo != NULL);

  camera = GST_CAMERABIN (photo);

  if (PHOTOGRAPHY_IS_OK (camera->src_vid_src)) {
    gst_photography_set_exposure (GST_PHOTOGRAPHY (camera->src_vid_src),
        exposure);
  }
}

static gboolean
gst_camerabin_set_config (GstPhotography * photo, GstPhotoSettings * config)
{
  GstCameraBin *camera;
  gboolean ret = TRUE;
  g_return_val_if_fail (photo != NULL, FALSE);
  camera = GST_CAMERABIN (photo);

  /* Cache the settings */
  memcpy (&camera->photo_settings, config, sizeof (GstPhotoSettings));

  /* Handle night mode */
  gst_camerabin_handle_scene_mode (camera, config->scene_mode);

  if (PHOTOGRAPHY_IS_OK (camera->src_vid_src)) {
    ret =
        gst_photography_set_config (GST_PHOTOGRAPHY (camera->src_vid_src),
        config);
  }
  return ret;
}

static gboolean
gst_camerabin_get_config (GstPhotography * photo, GstPhotoSettings * config)
{
  GstCameraBin *camera;
  gboolean ret = FALSE;
  g_return_val_if_fail (photo != NULL, FALSE);
  camera = GST_CAMERABIN (photo);
  if (PHOTOGRAPHY_IS_OK (camera->src_vid_src)) {
    ret =
        gst_photography_get_config (GST_PHOTOGRAPHY (camera->src_vid_src),
        config);
  }
  return ret;
}

static void
gst_camerabin_handle_scene_mode (GstCameraBin * camera, GstSceneMode scene_mode)
{
  if (scene_mode == GST_PHOTOGRAPHY_SCENE_MODE_NIGHT) {
    if (!camera->night_mode) {
      GST_DEBUG ("enabling night mode, lowering fps");
      /* Make camerabin select the lowest allowed frame rate */
      camera->night_mode = TRUE;
      /* Remember frame rate before setting night mode */
      camera->pre_night_fps_n = camera->fps_n;
      camera->pre_night_fps_d = camera->fps_d;
      g_signal_emit_by_name (camera, "set-video-resolution-fps", camera->width,
          camera->height, 0, 0, 0);
    } else {
      GST_DEBUG ("night mode already enabled");
    }
  } else {
    if (camera->night_mode) {
      GST_DEBUG ("disabling night mode, restoring fps to %d/%d",
          camera->pre_night_fps_n, camera->pre_night_fps_d);
      camera->night_mode = FALSE;
      g_signal_emit_by_name (camera, "set-video-resolution-fps", camera->width,
          camera->height, camera->pre_night_fps_n, camera->pre_night_fps_d, 0);
    }
  }
}

gboolean
gst_camerabin_photography_get_property (GstCameraBin * camera, guint prop_id,
    GValue * value)
{
  gboolean ret = FALSE;

  GST_DEBUG_OBJECT (camera, "Photointerface property: %d", prop_id);

  switch (prop_id) {
    case ARG_WB_MODE:
    {
      GstWhiteBalanceMode wb_mode;
      GST_DEBUG_OBJECT (camera, "==== GETTING PROP_WB_MODE ====");
      if (gst_camerabin_get_white_balance_mode ((GstPhotography *) camera,
              &wb_mode)) {
        g_value_set_enum (value, wb_mode);
      }
      ret = TRUE;
      break;
    }
    case ARG_COLOUR_TONE:
    {
      GstColourToneMode tone;
      GST_DEBUG_OBJECT (camera, "==== GETTING PROP_COLOUR_TONE ====");
      if (gst_camerabin_get_colour_tone_mode ((GstPhotography *) camera, &tone)) {
        g_value_set_enum (value, tone);
      }
      ret = TRUE;
      break;
    }
    case ARG_SCENE_MODE:
    {
      GstSceneMode scene;
      GST_DEBUG_OBJECT (camera, "==== GETTING PROP_SCENE_MODE ====");
      if (gst_camerabin_get_scene_mode ((GstPhotography *) camera, &scene)) {
        g_value_set_enum (value, scene);
      }
      ret = TRUE;
      break;
    }
    case ARG_FLASH_MODE:
    {
      GstFlashMode flash;
      GST_DEBUG_OBJECT (camera, "==== GETTING PROP_FLASH_MODE ====");
      if (gst_camerabin_get_flash_mode ((GstPhotography *) camera, &flash)) {
        g_value_set_enum (value, flash);
      }
      ret = TRUE;
      break;
    }
    case ARG_CAPABILITIES:
    {
      gulong capabilities;
      GST_DEBUG_OBJECT (camera, "==== GETTING PROP_CAPABILITIES ====");
      capabilities =
          (gulong) gst_camerabin_get_capabilities ((GstPhotography *) camera);
      g_value_set_ulong (value, capabilities);
      ret = TRUE;
      break;
    }
    case ARG_EV_COMP:
    {
      gfloat ev_comp;
      GST_DEBUG_OBJECT (camera, "==== GETTING PROP_EV_COMP ====");
      if (gst_camerabin_get_ev_compensation ((GstPhotography *) camera,
              &ev_comp)) {
        g_value_set_float (value, ev_comp);
      }
      ret = TRUE;
      break;
    }
    case ARG_ISO_SPEED:
    {
      guint iso_speed;
      GST_DEBUG_OBJECT (camera, "==== GETTING PROP_ISO_SPEED ====");
      if (gst_camerabin_get_iso_speed ((GstPhotography *) camera, &iso_speed)) {
        g_value_set_uint (value, iso_speed);
      }
      ret = TRUE;
      break;
    }
    case ARG_APERTURE:
    {
      guint aperture;
      GST_DEBUG_OBJECT (camera, "==== GETTING PROP_APERTURE ====");
      if (gst_camerabin_get_aperture ((GstPhotography *) camera, &aperture)) {
        g_value_set_uint (value, aperture);
      }
      ret = TRUE;
      break;
    }
    case ARG_EXPOSURE:
    {
      guint32 exposure;
      GST_DEBUG_OBJECT (camera, "==== GETTING PROP_EXPOSURE ====");
      if (gst_camerabin_get_exposure ((GstPhotography *) camera, &exposure)) {
        g_value_set_uint (value, exposure);
      }
      ret = TRUE;
      break;
    }
    default:
      break;
  }

  return ret;
}


/*
 *
 */
gboolean
gst_camerabin_photography_set_property (GstCameraBin * camera, guint prop_id,
    const GValue * value)
{
  gboolean ret = FALSE;

  switch (prop_id) {
    case ARG_WB_MODE:
      GST_DEBUG_OBJECT (camera, "==== SETTING PROP_WB_MODE ====");
      gst_camerabin_set_white_balance_mode ((GstPhotography *) camera,
          g_value_get_enum (value));
      ret = TRUE;
      break;
    case ARG_COLOUR_TONE:
      GST_DEBUG_OBJECT (camera, "==== SETTING PROP_COLOUR_TONE ====");
      gst_camerabin_set_colour_tone_mode ((GstPhotography *) camera,
          g_value_get_enum (value));
      ret = TRUE;
      break;
    case ARG_SCENE_MODE:
      GST_DEBUG_OBJECT (camera, "==== SETTING PROP_SCENE_MODE ====");
      gst_camerabin_set_scene_mode ((GstPhotography *) camera,
          g_value_get_enum (value));
      ret = TRUE;
      break;
    case ARG_FLASH_MODE:
      GST_DEBUG_OBJECT (camera, "==== SETTING PROP_FLASH_MODE ====");
      gst_camerabin_set_flash_mode ((GstPhotography *) camera,
          g_value_get_enum (value));
      ret = TRUE;
      break;
    case ARG_EV_COMP:
      GST_DEBUG_OBJECT (camera, "==== SETTING PROP_EV_COMP ====");
      gst_camerabin_set_ev_compensation ((GstPhotography *) camera,
          g_value_get_float (value));
      ret = TRUE;
      break;
    case ARG_ISO_SPEED:
      GST_DEBUG_OBJECT (camera, "==== SETTING PROP_ISO_SPEED ====");
      gst_camerabin_set_iso_speed ((GstPhotography *) camera,
          g_value_get_uint (value));
      ret = TRUE;
      break;
    case ARG_APERTURE:
      GST_DEBUG_OBJECT (camera, "==== SETTING PROP_APERTURE ====");
      gst_camerabin_set_aperture ((GstPhotography *) camera,
          g_value_get_uint (value));
      ret = TRUE;
      break;
    case ARG_EXPOSURE:
      GST_DEBUG_OBJECT (camera, "==== SETTING PROP_EXPOSURE ====");
      gst_camerabin_set_exposure ((GstPhotography *) camera,
          g_value_get_uint (value));
      ret = TRUE;
      break;
    default:
      break;
  }

  return ret;
}


void
gst_camerabin_photography_init (GstPhotographyInterface * iface)
{
  GST_DEBUG_CATEGORY_INIT (camerabinphoto_debug, "camerabinphoto", 0,
      "Camerabin photography interface debugging");

  GST_INFO ("initing");

  iface->set_ev_compensation = gst_camerabin_set_ev_compensation;
  iface->get_ev_compensation = gst_camerabin_get_ev_compensation;

  iface->set_iso_speed = gst_camerabin_set_iso_speed;
  iface->get_iso_speed = gst_camerabin_get_iso_speed;

  iface->set_white_balance_mode = gst_camerabin_set_white_balance_mode;
  iface->get_white_balance_mode = gst_camerabin_get_white_balance_mode;

  iface->set_colour_tone_mode = gst_camerabin_set_colour_tone_mode;
  iface->get_colour_tone_mode = gst_camerabin_get_colour_tone_mode;

  iface->set_scene_mode = gst_camerabin_set_scene_mode;
  iface->get_scene_mode = gst_camerabin_get_scene_mode;

  iface->set_flash_mode = gst_camerabin_set_flash_mode;
  iface->get_flash_mode = gst_camerabin_get_flash_mode;

  iface->get_capabilities = gst_camerabin_get_capabilities;

  iface->set_autofocus = gst_camerabin_set_autofocus;

  iface->set_config = gst_camerabin_set_config;
  iface->get_config = gst_camerabin_get_config;
}