[cameracontrol] add new cameracontrol interface - record command, set/get auto exposu... 39/42439/2 accepted/tizen/mobile/20150702.045105 accepted/tizen/tv/20150702.035943 accepted/tizen/wearable/20150702.040007 submit/tizen/20150701.131745
authorJeongmo Yang <jm80.yang@samsung.com>
Mon, 29 Jun 2015 07:49:11 +0000 (16:49 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Mon, 29 Jun 2015 07:54:33 +0000 (16:54 +0900)
Change-Id: I1c20801eae648563d980d67d15fca32bbc1d0a2e
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
gst-libs/gst/video/cameracontrol.c
gst-libs/gst/video/cameracontrol.h
packaging/gst-plugins-base.spec

index e150a8f..211dd2d 100644 (file)
@@ -132,15 +132,20 @@ static void gst_camera_control_class_init(GstCameraControlClass *klass)
        klass->get_part_color = NULL;
        klass->get_exif_info = NULL;
        klass->set_capture_command = NULL;
+       klass->set_record_command = NULL;
        klass->start_face_zoom = NULL;
        klass->stop_face_zoom = NULL;
+       klass->set_ae_lock = NULL;
+       klass->get_ae_lock = NULL;
+       klass->set_awb_lock = NULL;
+       klass->get_awb_lock = NULL;
 }
 
 const GList* gst_camera_control_list_channels(GstCameraControl *control)
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->list_channels) {
+       if (klass && klass->list_channels) {
                return klass->list_channels(control);
        }
 
@@ -152,7 +157,7 @@ gboolean gst_camera_control_set_value(GstCameraControl *control, GstCameraContro
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->set_value) {
+       if (klass && klass->set_value) {
                return klass->set_value(control, control_channel, value);
        }
 
@@ -163,7 +168,7 @@ gboolean gst_camera_control_get_value(GstCameraControl *control, GstCameraContro
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->get_value) {
+       if (klass && klass->get_value) {
                return klass->get_value(control, control_channel, value);
        }
 
@@ -176,7 +181,7 @@ gboolean gst_camera_control_set_exposure(GstCameraControl *control, gint type, g
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->set_exposure) {
+       if (klass && klass->set_exposure) {
                return klass->set_exposure(control, type, value1, value2);
        }
 
@@ -187,7 +192,7 @@ gboolean gst_camera_control_get_exposure(GstCameraControl *control, gint type, g
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->get_exposure) {
+       if (klass && klass->get_exposure) {
                return klass->get_exposure(control, type, value1, value2);
        }
 
@@ -198,7 +203,7 @@ gboolean gst_camera_control_set_capture_mode(GstCameraControl *control, gint typ
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->set_capture_mode) {
+       if (klass && klass->set_capture_mode) {
                return klass->set_capture_mode(control, type, value);
        }
 
@@ -209,7 +214,7 @@ gboolean gst_camera_control_get_capture_mode(GstCameraControl *control, gint typ
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->get_capture_mode) {
+       if (klass && klass->get_capture_mode) {
                return klass->get_capture_mode(control, type, value);
        }
 
@@ -220,7 +225,7 @@ gboolean gst_camera_control_set_strobe(GstCameraControl *control, gint type, gin
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->set_strobe) {
+       if (klass && klass->set_strobe) {
                return klass->set_strobe(control, type, value);
        }
 
@@ -231,7 +236,7 @@ gboolean gst_camera_control_get_strobe(GstCameraControl *control, gint type, gin
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->get_strobe) {
+       if (klass && klass->get_strobe) {
                return klass->get_strobe(control, type, value);
        }
 
@@ -242,7 +247,7 @@ gboolean gst_camera_control_set_detect(GstCameraControl *control, gint type, gin
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->set_detect) {
+       if (klass && klass->set_detect) {
                return klass->set_detect(control, type, value);
        }
 
@@ -253,7 +258,7 @@ gboolean gst_camera_control_get_detect(GstCameraControl *control, gint type, gin
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->get_detect) {
+       if (klass && klass->get_detect) {
                return klass->get_detect(control, type, value);
        }
 
@@ -264,7 +269,7 @@ gboolean gst_camera_control_set_zoom(GstCameraControl *control, gint type, gint
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->set_zoom) {
+       if (klass && klass->set_zoom) {
                return klass->set_zoom(control, type, value);
        }
 
@@ -275,7 +280,7 @@ gboolean gst_camera_control_get_zoom(GstCameraControl *control, gint type, gint
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->get_zoom) {
+       if (klass && klass->get_zoom) {
                return klass->get_zoom(control, type, value);
        }
 
@@ -286,7 +291,7 @@ gboolean gst_camera_control_set_focus(GstCameraControl *control, gint mode, gint
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->set_focus) {
+       if (klass && klass->set_focus) {
                return klass->set_focus(control, mode, range);
        }
 
@@ -297,7 +302,7 @@ gboolean gst_camera_control_get_focus(GstCameraControl *control, gint *mode, gin
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->get_focus) {
+       if (klass && klass->get_focus) {
                return klass->get_focus(control, mode, range);
        }
 
@@ -308,7 +313,7 @@ gboolean gst_camera_control_start_auto_focus(GstCameraControl *control)
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->start_auto_focus) {
+       if (klass && klass->start_auto_focus) {
                return klass->start_auto_focus(control);
        }
 
@@ -319,7 +324,7 @@ gboolean gst_camera_control_stop_auto_focus(GstCameraControl *control)
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->stop_auto_focus) {
+       if (klass && klass->stop_auto_focus) {
                return klass->stop_auto_focus(control);
        }
 
@@ -330,7 +335,7 @@ gboolean gst_camera_control_set_focus_level(GstCameraControl *control, gint manu
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->set_focus_level) {
+       if (klass && klass->set_focus_level) {
                return klass->set_focus_level(control, manual_level);
        }
 
@@ -341,7 +346,7 @@ gboolean gst_camera_control_get_focus_level(GstCameraControl *control, gint *man
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->get_focus_level) {
+       if (klass && klass->get_focus_level) {
                return klass->get_focus_level(control, manual_level);
        }
 
@@ -352,7 +357,7 @@ gboolean gst_camera_control_set_auto_focus_area(GstCameraControl *control, GstCa
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->set_auto_focus_area) {
+       if (klass && klass->set_auto_focus_area) {
                return klass->set_auto_focus_area(control, rect);
        }
 
@@ -363,7 +368,7 @@ gboolean gst_camera_control_get_auto_focus_area(GstCameraControl *control, GstCa
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->get_auto_focus_area) {
+       if (klass && klass->get_auto_focus_area) {
                return klass->get_auto_focus_area(control, rect);
        }
 
@@ -374,7 +379,7 @@ gboolean gst_camera_control_set_wdr(GstCameraControl *control, gint value)
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->set_wdr) {
+       if (klass && klass->set_wdr) {
                return klass->set_wdr(control, value);
        }
 
@@ -385,7 +390,7 @@ gboolean gst_camera_control_get_wdr(GstCameraControl *control, gint *value)
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->get_wdr) {
+       if (klass && klass->get_wdr) {
                return klass->get_wdr(control, value);
        }
 
@@ -396,7 +401,7 @@ gboolean gst_camera_control_set_ahs(GstCameraControl *control, gint value)
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->set_ahs) {
+       if (klass && klass->set_ahs) {
                return klass->set_ahs(control, value);
        }
 
@@ -407,7 +412,7 @@ gboolean gst_camera_control_get_ahs(GstCameraControl *control, gint *value)
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->get_ahs) {
+       if (klass && klass->get_ahs) {
                return klass->get_ahs(control, value);
        }
 
@@ -418,7 +423,7 @@ gboolean gst_camera_control_set_part_color(GstCameraControl *control, gint type,
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->set_part_color) {
+       if (klass && klass->set_part_color) {
                return klass->set_part_color(control, type, value);
        }
 
@@ -429,7 +434,7 @@ gboolean gst_camera_control_get_part_color(GstCameraControl *control, gint type,
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->get_part_color) {
+       if (klass && klass->get_part_color) {
                return klass->get_part_color(control, type, value);
        }
 
@@ -441,7 +446,7 @@ gst_camera_control_get_exif_info(GstCameraControl *control, GstCameraControlExif
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->get_exif_info) {
+       if (klass && klass->get_exif_info) {
                return klass->get_exif_info(control, info);
        }
 
@@ -453,7 +458,7 @@ gboolean gst_camera_control_get_basic_dev_info(GstCameraControl *control, gint d
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->get_basic_dev_info) {
+       if (klass && klass->get_basic_dev_info) {
                return klass->get_basic_dev_info(control, dev_id, info);
        }
 
@@ -464,8 +469,7 @@ gboolean gst_camera_control_get_misc_dev_info(GstCameraControl *control, gint de
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS( control );
 
-       if( klass->get_misc_dev_info )
-       {
+       if (klass && klass->get_misc_dev_info) {
                return klass->get_misc_dev_info( control, dev_id, info );
        }
 
@@ -476,7 +480,7 @@ gboolean gst_camera_control_get_extra_dev_info(GstCameraControl *control, gint d
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->get_extra_dev_info) {
+       if (klass && klass->get_extra_dev_info) {
                return klass->get_extra_dev_info(control, dev_id, info);
        }
 
@@ -487,18 +491,29 @@ void gst_camera_control_set_capture_command(GstCameraControl *control, GstCamera
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->set_capture_command) {
+       if (klass && klass->set_capture_command) {
                klass->set_capture_command(control, cmd);
        }
 
        return;
 }
 
+void gst_camera_control_set_record_command(GstCameraControl *control, GstCameraControlRecordCommand cmd)
+{
+       GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+       if (klass && klass->set_record_command) {
+               klass->set_record_command(control, cmd);
+       }
+
+       return;
+}
+
 gboolean gst_camera_control_start_face_zoom(GstCameraControl *control, gint x, gint y, gint zoom_level)
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->start_face_zoom) {
+       if (klass && klass->start_face_zoom) {
                return klass->start_face_zoom(control, x, y, zoom_level);
        }
 
@@ -509,13 +524,57 @@ gboolean gst_camera_control_stop_face_zoom(GstCameraControl *control)
 {
        GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
 
-       if (klass->stop_face_zoom) {
+       if (klass && klass->stop_face_zoom) {
                return klass->stop_face_zoom(control);
        }
 
        return FALSE;
 }
 
+gboolean gst_camera_control_set_ae_lock(GstCameraControl *control, gboolean lock)
+{
+       GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+       if (klass && klass->set_ae_lock) {
+               return klass->set_ae_lock(control, lock);
+       }
+
+       return FALSE;
+}
+
+gboolean gst_camera_control_get_ae_lock(GstCameraControl *control, gboolean *lock)
+{
+       GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+       if (klass && klass->get_ae_lock) {
+               return klass->get_ae_lock(control, lock);
+       }
+
+       return FALSE;
+}
+
+gboolean gst_camera_control_set_awb_lock(GstCameraControl *control, gboolean lock)
+{
+       GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+       if (klass && klass->set_awb_lock) {
+               return klass->set_awb_lock(control, lock);
+       }
+
+       return FALSE;
+}
+
+gboolean gst_camera_control_get_awb_lock(GstCameraControl *control, gboolean *lock)
+{
+       GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+       if (klass && klass->get_awb_lock) {
+               return klass->get_awb_lock(control, lock);
+       }
+
+       return FALSE;
+}
+
 void gst_camera_control_value_changed(GstCameraControl *control, GstCameraControlChannel *control_channel, gint value)
 {
        g_signal_emit(G_OBJECT(control), gst_camera_control_signals[CONTROL_VALUE_CHANGED], 0, control_channel, value);
index cbccc93..26b7541 100644 (file)
@@ -54,11 +54,11 @@ G_BEGIN_DECLS
     (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_CAMERA_CONTROL))
 #define GST_IS_CAMERA_CONTROL_CLASS(klass) \
        (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_CAMERA_CONTROL))
-#define GST_CAMERA_CONTROL_TYPE(klass) (klass->camera_control_type)    
+#define GST_CAMERA_CONTROL_TYPE(klass) (klass->camera_control_type)
 
 
 typedef struct _GstCameraControl GstCameraControl;
-  
+
 typedef enum
 {
        // TODO : V4L2 Extend
@@ -140,7 +140,7 @@ typedef enum
 {
        GST_CAMERA_CONTROL_PART_COLOR_SRC,
        GST_CAMERA_CONTROL_PART_COLOR_DST,
-       GST_CAMERA_CONTROL_PART_COLOR_MODE,     
+       GST_CAMERA_CONTROL_PART_COLOR_MODE,
 } GstCameraControlPartColorType;
 
 /**
@@ -154,7 +154,15 @@ typedef enum
        GST_CAMERA_CONTROL_CAPTURE_COMMAND_STOP_MULTISHOT,
 } GstCameraControlCaptureCommand;
 
-
+/**
+ * Enumerations for Camera record command.
+ */
+typedef enum
+{
+       GST_CAMERA_CONTROL_RECORD_COMMAND_NONE,
+       GST_CAMERA_CONTROL_RECORD_COMMAND_START,
+       GST_CAMERA_CONTROL_RECORD_COMMAND_STOP,
+} GstCameraControlRecordCommand;
 
 /////////////////////////////////
 //  For Query functionalities  //
@@ -407,8 +415,13 @@ typedef struct _GstCameraControlClass {
        gboolean        (*get_misc_dev_info)           (GstCameraControl *control, gint dev_id, GstCameraControlCtrlListInfoType *info);
        gboolean        (*get_extra_dev_info)          (GstCameraControl *control, gint dev_id, GstCameraControlExtraInfoType *info);
        void            (*set_capture_command)         (GstCameraControl *control, GstCameraControlCaptureCommand cmd);
+       void            (*set_record_command)          (GstCameraControl *control, GstCameraControlRecordCommand cmd);
        gboolean        (*start_face_zoom)             (GstCameraControl *control, gint x, gint y, gint zoom_level);
        gboolean        (*stop_face_zoom)              (GstCameraControl *control);
+       gboolean        (*set_ae_lock)                 (GstCameraControl *control, gboolean lock);
+       gboolean        (*get_ae_lock)                 (GstCameraControl *control, gboolean *lock);
+       gboolean        (*set_awb_lock)                (GstCameraControl *control, gboolean lock);
+       gboolean        (*get_awb_lock)                (GstCameraControl *control, gboolean *lock);
 
        /* signals */
        void (* value_changed)                          (GstCameraControl *control, GstCameraControlChannel *channel, gint value);
@@ -450,8 +463,13 @@ gboolean   gst_camera_control_get_basic_dev_info   (GstCameraControl *control, gin
 gboolean       gst_camera_control_get_misc_dev_info    (GstCameraControl *control, gint dev_id, GstCameraControlCtrlListInfoType *info);
 gboolean       gst_camera_control_get_extra_dev_info   (GstCameraControl *control, gint dev_id, GstCameraControlExtraInfoType *info);
 void           gst_camera_control_set_capture_command  (GstCameraControl *control, GstCameraControlCaptureCommand cmd);
+void           gst_camera_control_set_record_command   (GstCameraControl *control, GstCameraControlRecordCommand cmd);
 gboolean       gst_camera_control_start_face_zoom      (GstCameraControl *control, gint x, gint y, gint zoom_level);
 gboolean       gst_camera_control_stop_face_zoom       (GstCameraControl *control);
+gboolean       gst_camera_control_set_ae_lock          (GstCameraControl *control, gboolean lock);
+gboolean       gst_camera_control_get_ae_lock          (GstCameraControl *control, gboolean *lock);
+gboolean       gst_camera_control_set_awb_lock         (GstCameraControl *control, gboolean lock);
+gboolean       gst_camera_control_get_awb_lock         (GstCameraControl *control, gboolean *lock);
 
 
 /* trigger signal */
index e052f13..10d0d08 100644 (file)
@@ -4,7 +4,7 @@
 
 Name:           gst-plugins-base
 Version:        1.4.1
-Release:        5
+Release:        6
 License:        LGPL-2.1+ and GPL-2.0+
 Summary:        GStreamer Streaming-Media Framework Plug-Ins
 Url:            http://gstreamer.freedesktop.org/