mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 06:46:38 +00:00
camerabin: Sanitize constants used for element factory names.
This commit is contained in:
parent
6675318107
commit
ff2d0621f7
1 changed files with 18 additions and 27 deletions
|
@ -219,20 +219,9 @@ static guint camerabin_signals[LAST_SIGNAL];
|
||||||
#define USE_COLOR_CONVERTER 1
|
#define USE_COLOR_CONVERTER 1
|
||||||
|
|
||||||
/* FIXME: Make sure this can work with autovideosrc and use that. */
|
/* 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";
|
#define DEFAULT_VIEW_SINK "autovideosink"
|
||||||
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";
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* static helper functions declaration
|
* static helper functions declaration
|
||||||
|
@ -551,26 +540,26 @@ camerabin_create_src_elements (GstCameraBin * camera)
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
} else if (!(camera->src_vid_src =
|
} 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;
|
goto done;
|
||||||
#ifdef USE_COLOR_CONVERTER
|
#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;
|
goto done;
|
||||||
#endif
|
#endif
|
||||||
if (!(camera->src_filter =
|
if (!(camera->src_filter =
|
||||||
gst_camerabin_create_and_add_element (cbin, CAPS_FILTER)))
|
gst_camerabin_create_and_add_element (cbin, "capsfilter")))
|
||||||
goto done;
|
goto done;
|
||||||
if (!(camera->src_zoom_crop =
|
if (!(camera->src_zoom_crop =
|
||||||
gst_camerabin_create_and_add_element (cbin, ZOOM_CROP)))
|
gst_camerabin_create_and_add_element (cbin, "videocrop")))
|
||||||
goto done;
|
goto done;
|
||||||
if (!(camera->src_zoom_scale =
|
if (!(camera->src_zoom_scale =
|
||||||
gst_camerabin_create_and_add_element (cbin, ZOOM_SCALE)))
|
gst_camerabin_create_and_add_element (cbin, "videoscale")))
|
||||||
goto done;
|
goto done;
|
||||||
if (!(camera->src_zoom_filter =
|
if (!(camera->src_zoom_filter =
|
||||||
gst_camerabin_create_and_add_element (cbin, CAPS_FILTER)))
|
gst_camerabin_create_and_add_element (cbin, "capsfilter")))
|
||||||
goto done;
|
goto done;
|
||||||
if (!(camera->src_out_sel =
|
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;
|
goto done;
|
||||||
|
|
||||||
camera->srcpad_zoom_filter =
|
camera->srcpad_zoom_filter =
|
||||||
|
@ -636,7 +625,7 @@ camerabin_create_view_elements (GstCameraBin * camera)
|
||||||
|
|
||||||
if (!(camera->view_in_sel =
|
if (!(camera->view_in_sel =
|
||||||
gst_camerabin_create_and_add_element (GST_BIN (camera),
|
gst_camerabin_create_and_add_element (GST_BIN (camera),
|
||||||
VIEW_IN_SEL))) {
|
"input-selector"))) {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -650,11 +639,12 @@ camerabin_create_view_elements (GstCameraBin * camera)
|
||||||
|
|
||||||
if (!(camera->view_scale =
|
if (!(camera->view_scale =
|
||||||
gst_camerabin_create_and_add_element (GST_BIN (camera),
|
gst_camerabin_create_and_add_element (GST_BIN (camera),
|
||||||
VIEW_SCALE))) {
|
"videoscale"))) {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
#ifdef USE_COLOR_CONVERTER
|
#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;
|
goto error;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -664,7 +654,8 @@ camerabin_create_view_elements (GstCameraBin * camera)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
} else if (!(camera->view_sink =
|
} 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;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2007,8 +1998,8 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class, ARG_VF_SINK,
|
g_object_class_install_property (gobject_class, ARG_VF_SINK,
|
||||||
g_param_spec_object ("vfsink", "View finder sink",
|
g_param_spec_object ("vfsink", "View finder sink",
|
||||||
"View finder sink GStreamer element (default is autovideosink)",
|
"View finder sink GStreamer element (default is " DEFAULT_VIEW_SINK
|
||||||
GST_TYPE_ELEMENT, G_PARAM_READWRITE));
|
")", GST_TYPE_ELEMENT, G_PARAM_READWRITE));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GstCameraBin:videosrc:
|
* GstCameraBin:videosrc:
|
||||||
|
@ -2021,7 +2012,7 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class, ARG_VIDEO_SRC,
|
g_object_class_install_property (gobject_class, ARG_VIDEO_SRC,
|
||||||
g_param_spec_object ("videosrc", "Video source element",
|
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));
|
GST_TYPE_ELEMENT, G_PARAM_READWRITE));
|
||||||
/**
|
/**
|
||||||
* GstCameraBin:audiosrc:
|
* GstCameraBin:audiosrc:
|
||||||
|
|
Loading…
Reference in a new issue