camerabin2: Put enums inside their classes .c
authorThiago Santos <thiago.sousa.santos@collabora.co.uk>
Sun, 12 Dec 2010 23:46:16 +0000 (20:46 -0300)
committerThiago Santos <thiago.sousa.santos@collabora.co.uk>
Thu, 23 Dec 2010 16:18:57 +0000 (13:18 -0300)
Remove global list of properties' enums and put them
inside their classes .c

gst/camerabin2/gstbasecamerasrc.c
gst/camerabin2/gstcamerabin-enum.h
gst/camerabin2/gstv4l2camerasrc.c

index f0d4e00..a5e7053 100644 (file)
 
 enum
 {
+  PROP_0,
+  PROP_MODE,
+  PROP_ZOOM,
+  PROP_READY_FOR_CAPTURE
+};
+
+enum
+{
   /* action signals */
   START_CAPTURE_SIGNAL,
   STOP_CAPTURE_SIGNAL,
@@ -346,11 +354,11 @@ gst_base_camera_src_set_property (GObject * object,
   GstBaseCameraSrc *self = GST_BASE_CAMERA_SRC (object);
 
   switch (prop_id) {
-    case ARG_MODE:
+    case PROP_MODE:
       gst_base_camera_src_set_mode (GST_BASE_CAMERA_SRC (self),
           g_value_get_enum (value));
       break;
-    case ARG_ZOOM:{
+    case PROP_ZOOM:{
       g_atomic_int_set (&self->zoom, g_value_get_int (value));
       /* does not set it if in NULL, the src is not created yet */
       if (GST_STATE (self) != GST_STATE_NULL)
@@ -370,13 +378,13 @@ gst_base_camera_src_get_property (GObject * object,
   GstBaseCameraSrc *self = GST_BASE_CAMERA_SRC (object);
 
   switch (prop_id) {
-    case ARG_MODE:
+    case PROP_MODE:
       g_value_set_enum (value, self->mode);
       break;
-    case ARG_READY_FOR_CAPTURE:
+    case PROP_READY_FOR_CAPTURE:
       g_value_set_boolean (value, !self->capturing);
       break;
-    case ARG_ZOOM:
+    case PROP_ZOOM:
       g_value_set_int (value, g_atomic_int_get (&self->zoom));
       break;
     default:
@@ -475,7 +483,7 @@ gst_base_camera_src_class_init (GstBaseCameraSrcClass * klass)
   gobject_class->get_property = gst_base_camera_src_get_property;
 
   // g_object_class_install_property ....
-  g_object_class_install_property (gobject_class, ARG_MODE,
+  g_object_class_install_property (gobject_class, PROP_MODE,
       g_param_spec_enum ("mode", "Mode",
           "The capture mode (still image capture or video recording)",
           GST_TYPE_CAMERABIN_MODE, MODE_IMAGE,
@@ -492,7 +500,7 @@ gst_base_camera_src_class_init (GstBaseCameraSrcClass * klass)
    * function, please schedule a new thread to do it. If you're using glib's
    * mainloop you can use g_idle_add() for example.
    */
-  g_object_class_install_property (gobject_class, ARG_READY_FOR_CAPTURE,
+  g_object_class_install_property (gobject_class, PROP_READY_FOR_CAPTURE,
       g_param_spec_boolean ("ready-for-capture", "Ready for capture",
           "Informs this element is ready for starting another capture",
           TRUE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
index 299e05c..590cb68 100644 (file)
 
 G_BEGIN_DECLS
 
-/* XXX find better place for property related enum/defaults */
-enum
-{
-  ARG_0,
-  ARG_FILENAME,
-  ARG_MODE,
-  ARG_READY_FOR_CAPTURE,
-  ARG_FLAGS,
-  ARG_MUTE,
-  ARG_ZOOM,
-  ARG_IMAGE_POST,
-  ARG_IMAGE_ENC,
-  ARG_VIDEO_POST,
-  ARG_VIDEO_ENC,
-  ARG_AUDIO_ENC,
-  ARG_VIDEO_MUX,
-  ARG_VF_SINK,
-  ARG_VIDEO_SRC,
-  ARG_AUDIO_SRC,
-  ARG_INPUT_CAPS,
-  ARG_FILTER_CAPS,
-  ARG_PREVIEW_CAPS,
-  ARG_WB_MODE,
-  ARG_COLOUR_TONE,
-  ARG_SCENE_MODE,
-  ARG_FLASH_MODE,
-  ARG_FOCUS_STATUS,
-  ARG_CAPABILITIES,
-  ARG_SHAKE_RISK,
-  ARG_EV_COMP,
-  ARG_ISO_SPEED,
-  ARG_APERTURE,
-  ARG_EXPOSURE,
-  ARG_VIDEO_SOURCE_FILTER,
-  ARG_IMAGE_CAPTURE_SUPPORTED_CAPS,
-  ARG_VIEWFINDER_FILTER,
-  ARG_FLICKER_MODE,
-  ARG_FOCUS_MODE,
-  ARG_BLOCK_VIEWFINDER,
-  ARG_IMAGE_CAPTURE_WIDTH,
-  ARG_IMAGE_CAPTURE_HEIGHT,
-  ARG_VIDEO_CAPTURE_WIDTH,
-  ARG_VIDEO_CAPTURE_HEIGHT,
-  ARG_VIDEO_CAPTURE_FRAMERATE
-};
-
 #define DEFAULT_WIDTH 640
 #define DEFAULT_HEIGHT 480
 #define DEFAULT_CAPTURE_WIDTH 800
index c8cd2b2..451b98f 100644 (file)
 #include "camerabingeneral.h"
 #include "gstcamerabin-enum.h"
 
+enum
+{
+  PROP_0,
+  PROP_FILTER_CAPS,
+  PROP_VIDEO_SRC,
+  PROP_VIDEO_SOURCE_FILTER
+};
+
 #define CAMERABIN_DEFAULT_VF_CAPS "video/x-raw-yuv,format=(fourcc)I420"
 
 /* Using "bilinear" as default zoom method */
@@ -68,14 +76,14 @@ gst_v4l2_camera_src_set_property (GObject * object,
   GstV4l2CameraSrc *self = GST_V4L2_CAMERA_SRC (object);
 
   switch (prop_id) {
-    case ARG_FILTER_CAPS:
+    case PROP_FILTER_CAPS:
       GST_OBJECT_LOCK (self);
       gst_caps_replace (&self->view_finder_caps,
           (GstCaps *) gst_value_get_caps (value));
       GST_OBJECT_UNLOCK (self);
       configure_format (self, self->view_finder_caps);
       break;
-    case ARG_VIDEO_SOURCE_FILTER:
+    case PROP_VIDEO_SOURCE_FILTER:
       if (GST_STATE (self) != GST_STATE_NULL) {
         GST_ELEMENT_ERROR (self, CORE, FAILED,
             ("camerasrc must be in NULL state when setting the video filter element"),
@@ -86,7 +94,7 @@ gst_v4l2_camera_src_set_property (GObject * object,
         self->app_video_filter = g_value_dup_object (value);
       }
       break;
-    case ARG_VIDEO_SRC:
+    case PROP_VIDEO_SRC:
       if (GST_STATE (self) != GST_STATE_NULL) {
         GST_ELEMENT_ERROR (self, CORE, FAILED,
             ("camerasrc must be in NULL state when setting the video source element"),
@@ -111,13 +119,13 @@ gst_v4l2_camera_src_get_property (GObject * object,
   GstV4l2CameraSrc *self = GST_V4L2_CAMERA_SRC (object);
 
   switch (prop_id) {
-    case ARG_FILTER_CAPS:
+    case PROP_FILTER_CAPS:
       gst_value_set_caps (value, self->view_finder_caps);
       break;
-    case ARG_VIDEO_SOURCE_FILTER:
+    case PROP_VIDEO_SOURCE_FILTER:
       g_value_set_object (value, self->app_video_filter);
       break;
-    case ARG_VIDEO_SRC:
+    case PROP_VIDEO_SRC:
       if (self->src_vid_src)
         g_value_set_object (value, self->src_vid_src);
       else