From 6c7d7946f53aed028d66cf48e81edd39b2a433e6 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Mon, 29 Nov 2010 11:31:26 -0300 Subject: [PATCH] camerabin2: Keep mode definition at -enum file Use 'mode' enum definition from gstcamerabin-enum file to avoid conflicts between v4l2camerasrc and gstcamerabin2 modes. For now there is a MODE_PREVIEW there that is only used on the camerasrc, not sure if we are keeping it at the future, but for now this works. --- gst/camerabin2/gstcamerabin-enum.c | 2 +- gst/camerabin2/gstcamerabin2.c | 35 +----------------------------- 2 files changed, 2 insertions(+), 35 deletions(-) diff --git a/gst/camerabin2/gstcamerabin-enum.c b/gst/camerabin2/gstcamerabin-enum.c index 8d1d0c92d3..ac80d0b0a3 100644 --- a/gst/camerabin2/gstcamerabin-enum.c +++ b/gst/camerabin2/gstcamerabin-enum.c @@ -72,7 +72,7 @@ gst_camerabin_mode_get_type (void) {0, NULL, NULL} }; - gtype = g_enum_register_static ("GstCameraBinMode", values); + gtype = g_enum_register_static ("GstCameraBin2Mode", values); } return gtype; } diff --git a/gst/camerabin2/gstcamerabin2.c b/gst/camerabin2/gstcamerabin2.c index 9ea7bfb1d4..b6705d803d 100644 --- a/gst/camerabin2/gstcamerabin2.c +++ b/gst/camerabin2/gstcamerabin2.c @@ -27,6 +27,7 @@ #endif #include "gstcamerabin2.h" +#include "gstcamerabin-enum.h" GST_DEBUG_CATEGORY_STATIC (gst_camera_bin_debug); #define GST_CAT_DEFAULT gst_camera_bin_debug @@ -56,40 +57,6 @@ static guint camerabin_signals[LAST_SIGNAL]; * and GObject types * ********************************/ -#define GST_TYPE_CAMERABIN_MODE (gst_camerabin_mode_get_type ()) -/** - * GstCameraBinMode: - * @MODE_PREVIEW: preview only (no capture) mode - * @MODE_IMAGE: image capture - * @MODE_VIDEO: video capture - * - * Capture mode to use. - */ -typedef enum -{ - MODE_PREVIEW = 0, /* TODO do we have an use for this? */ - MODE_IMAGE = 1, - MODE_VIDEO = 2, -} GstCameraBinMode; - -static GType -gst_camerabin_mode_get_type (void) -{ - static GType gtype = 0; - - if (gtype == 0) { - static const GEnumValue values[] = { - {MODE_IMAGE, "Still image capture (default)", "mode-image"}, - {MODE_VIDEO, "Video recording", "mode-video"}, - {0, NULL, NULL} - }; - - gtype = g_enum_register_static ("GstCameraBin2Mode", values); - } - return gtype; -} - - static GstPipelineClass *parent_class; static void gst_camera_bin_class_init (GstCameraBinClass * klass); static void gst_camera_bin_base_init (gpointer klass);