summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorRené Stadler <mail@renestadler.de>2009-02-11 01:54:03 +0200
committerRené Stadler <mail@renestadler.de>2009-02-11 01:59:39 +0200
commitff2d0621f7d654511b6ddb06b5323799c343fe05 (patch)
treed951258f4fff80f1a48c844eeed3b2ac5bd51213 /gst
parent6675318107e4cb465dcad37aafec704d46e12a9f (diff)
downloadgst-plugins-bad-ff2d0621f7d654511b6ddb06b5323799c343fe05.tar.gz
gst-plugins-bad-ff2d0621f7d654511b6ddb06b5323799c343fe05.tar.bz2
gst-plugins-bad-ff2d0621f7d654511b6ddb06b5323799c343fe05.zip
camerabin: Sanitize constants used for element factory names.
Diffstat (limited to 'gst')
-rw-r--r--gst/camerabin/gstcamerabin.c45
1 files changed, 18 insertions, 27 deletions
diff --git a/gst/camerabin/gstcamerabin.c b/gst/camerabin/gstcamerabin.c
index 1ad01899..6a7bbb06 100644
--- a/gst/camerabin/gstcamerabin.c
+++ b/gst/camerabin/gstcamerabin.c
@@ -219,20 +219,9 @@ static guint camerabin_signals[LAST_SIGNAL];
#define USE_COLOR_CONVERTER 1
/* FIXME: Make sure this can work with autovideosrc and use that. */
-static const char SRC_VID_SRC[] = "v4l2src";
+#define DEFAULT_SRC_VID_SRC "v4l2src"
-static const char ZOOM_CROP[] = "videocrop";
-static const char ZOOM_SCALE[] = "videoscale";
-
-static const char CAPS_FILTER[] = "capsfilter";
-
-static const char COLOR_CONVERTER[] = "ffmpegcolorspace";
-
-static const char SRC_OUT_SEL[] = "output-selector";
-
-static const char VIEW_IN_SEL[] = "input-selector";
-static const char VIEW_SCALE[] = "videoscale";
-static const char VIEW_SINK[] = "autovideosink";
+#define DEFAULT_VIEW_SINK "autovideosink"
/*
* static helper functions declaration
@@ -551,26 +540,26 @@ camerabin_create_src_elements (GstCameraBin * camera)
goto done;
}
} else if (!(camera->src_vid_src =
- gst_camerabin_create_and_add_element (cbin, SRC_VID_SRC)))
+ gst_camerabin_create_and_add_element (cbin, DEFAULT_SRC_VID_SRC)))
goto done;
#ifdef USE_COLOR_CONVERTER
- if (!gst_camerabin_create_and_add_element (cbin, COLOR_CONVERTER))
+ if (!gst_camerabin_create_and_add_element (cbin, "ffmpegcolorspace"))
goto done;
#endif
if (!(camera->src_filter =
- gst_camerabin_create_and_add_element (cbin, CAPS_FILTER)))
+ gst_camerabin_create_and_add_element (cbin, "capsfilter")))
goto done;
if (!(camera->src_zoom_crop =
- gst_camerabin_create_and_add_element (cbin, ZOOM_CROP)))
+ gst_camerabin_create_and_add_element (cbin, "videocrop")))
goto done;
if (!(camera->src_zoom_scale =
- gst_camerabin_create_and_add_element (cbin, ZOOM_SCALE)))
+ gst_camerabin_create_and_add_element (cbin, "videoscale")))
goto done;
if (!(camera->src_zoom_filter =
- gst_camerabin_create_and_add_element (cbin, CAPS_FILTER)))
+ gst_camerabin_create_and_add_element (cbin, "capsfilter")))
goto done;
if (!(camera->src_out_sel =
- gst_camerabin_create_and_add_element (cbin, SRC_OUT_SEL)))
+ gst_camerabin_create_and_add_element (cbin, "output-selector")))
goto done;
camera->srcpad_zoom_filter =
@@ -636,7 +625,7 @@ camerabin_create_view_elements (GstCameraBin * camera)
if (!(camera->view_in_sel =
gst_camerabin_create_and_add_element (GST_BIN (camera),
- VIEW_IN_SEL))) {
+ "input-selector"))) {
goto error;
}
@@ -650,11 +639,12 @@ camerabin_create_view_elements (GstCameraBin * camera)
if (!(camera->view_scale =
gst_camerabin_create_and_add_element (GST_BIN (camera),
- VIEW_SCALE))) {
+ "videoscale"))) {
goto error;
}
#ifdef USE_COLOR_CONVERTER
- if (!gst_camerabin_create_and_add_element (GST_BIN (camera), COLOR_CONVERTER)) {
+ if (!gst_camerabin_create_and_add_element (GST_BIN (camera),
+ "ffmpegcolorspace")) {
goto error;
}
#endif
@@ -664,7 +654,8 @@ camerabin_create_view_elements (GstCameraBin * camera)
goto error;
}
} else if (!(camera->view_sink =
- gst_camerabin_create_and_add_element (GST_BIN (camera), VIEW_SINK))) {
+ gst_camerabin_create_and_add_element (GST_BIN (camera),
+ DEFAULT_VIEW_SINK))) {
goto error;
}
@@ -2007,8 +1998,8 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
g_object_class_install_property (gobject_class, ARG_VF_SINK,
g_param_spec_object ("vfsink", "View finder sink",
- "View finder sink GStreamer element (default is autovideosink)",
- GST_TYPE_ELEMENT, G_PARAM_READWRITE));
+ "View finder sink GStreamer element (default is " DEFAULT_VIEW_SINK
+ ")", GST_TYPE_ELEMENT, G_PARAM_READWRITE));
/**
* GstCameraBin:videosrc:
@@ -2021,7 +2012,7 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
g_object_class_install_property (gobject_class, ARG_VIDEO_SRC,
g_param_spec_object ("videosrc", "Video source element",
- "Video source GStreamer element (default is v4l2src)",
+ "Video source GStreamer element (default is " DEFAULT_SRC_VID_SRC ")",
GST_TYPE_ELEMENT, G_PARAM_READWRITE));
/**
* GstCameraBin:audiosrc: