v4l2: mark v4l2sink as experimental and build only if --enable-experimental is passed

It's not really of 'good' quality yet, but there's a lot of
code shared with v4l2src, so not so easy to move it elswhere.

https://bugzilla.gnome.org/show_bug.cgi?id=612244
This commit is contained in:
Tim-Philipp Müller 2011-01-02 11:37:14 +00:00
parent 0be6bd355a
commit b0eb10cc53
4 changed files with 19 additions and 1 deletions

View file

@ -13,13 +13,16 @@ libgstvideo4linux2_la_SOURCES = gstv4l2.c \
gstv4l2object.c \
gstv4l2bufferpool.c \
gstv4l2src.c \
gstv4l2sink.c \
gstv4l2tuner.c \
gstv4l2vidorient.c \
v4l2_calls.c \
v4l2src_calls.c \
$(xv_source)
if BUILD_EXPERIMENTAL
libgstvideo4linux2_la_SOURCES += gstv4l2sink.c
endif
libgstvideo4linux2_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
$(GST_CONTROLLER_CFLAGS) \

View file

@ -32,7 +32,9 @@
#include "gstv4l2object.h"
#include "gstv4l2src.h"
#ifdef HAVE_EXPERIMENTAL
#include "gstv4l2sink.h"
#endif
/* #include "gstv4l2jpegsrc.h" */
/* #include "gstv4l2mjpegsrc.h" */
/* #include "gstv4l2mjpegsink.h" */
@ -52,8 +54,10 @@ plugin_init (GstPlugin * plugin)
if (!gst_element_register (plugin, "v4l2src", GST_RANK_PRIMARY,
GST_TYPE_V4L2SRC) ||
#ifdef HAVE_EXPERIMENTAL
!gst_element_register (plugin, "v4l2sink", GST_RANK_NONE,
GST_TYPE_V4L2SINK) ||
#endif
/* !gst_element_register (plugin, "v4l2jpegsrc", */
/* GST_RANK_NONE, GST_TYPE_V4L2JPEGSRC) || */
/* !gst_element_register (plugin, "v4l2mjpegsrc", */

View file

@ -34,7 +34,9 @@
#include <gstv4l2bufferpool.h>
#include "gstv4l2src.h"
#ifdef HAVE_EXPERIMENTAL
#include "gstv4l2sink.h"
#endif
#include "v4l2_calls.h"
#include "gst/gst-i18n-plugin.h"
@ -290,8 +292,10 @@ get_v4l2_object (GstElement * v4l2elem)
GstV4l2Object *v4l2object = NULL;
if (GST_IS_V4L2SRC (v4l2elem)) {
v4l2object = (GST_V4L2SRC (v4l2elem))->v4l2object;
#ifdef HAVE_EXPERIMENTAL
} else if (GST_IS_V4L2SINK (v4l2elem)) {
v4l2object = (GST_V4L2SINK (v4l2elem))->v4l2object;
#endif
} else {
GST_ERROR_OBJECT (v4l2elem, "unknown v4l2 element");
}

View file

@ -46,7 +46,10 @@
#include "gstv4l2colorbalance.h"
#include "gstv4l2src.h"
#ifdef HAVE_EXPERIMENTAL
#include "gstv4l2sink.h"
#endif
#include "gst/gst-i18n-plugin.h"
@ -462,9 +465,11 @@ gst_v4l2_open (GstV4l2Object * v4l2object)
!(v4l2object->vcap.capabilities & V4L2_CAP_VIDEO_CAPTURE))
goto not_capture;
#ifdef HAVE_EXPERIMENTAL
if (GST_IS_V4L2SINK (v4l2object->element) &&
!(v4l2object->vcap.capabilities & V4L2_CAP_VIDEO_OUTPUT))
goto not_output;
#endif
/* create enumerations, posts errors. */
if (!gst_v4l2_fill_lists (v4l2object))
@ -510,6 +515,7 @@ not_capture:
("Capabilities: 0x%x", v4l2object->vcap.capabilities));
goto error;
}
#ifdef HAVE_EXPERIMENTAL
not_output:
{
GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, NOT_FOUND,
@ -518,6 +524,7 @@ not_output:
("Capabilities: 0x%x", v4l2object->vcap.capabilities));
goto error;
}
#endif
error:
{
if (GST_V4L2_IS_OPEN (v4l2object)) {