It supports seperated device nodes for multiple camera device
[Version] 1.12.2-1
[Profile] Common
[Issue Type] Update
[Dependency module] libmm-camcorder, mmfw-sysconf
[Test] [M(T) - Boot=(OK), sdb=(OK), Home=(OK), Touch=(OK), Version=tizen-unified_20180320.2]
Change-Id: I41675a0568c8d117de4efb16ecd7aefa4578a8df
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
Name: gst-plugins-good
Version: 1.12.2
Name: gst-plugins-good
Version: 1.12.2
License: LGPL-2.1+
Summary: GStreamer Streaming-Media Framework Plug-Ins
Url: http://gstreamer.freedesktop.org/
License: LGPL-2.1+
Summary: GStreamer Streaming-Media Framework Plug-Ins
Url: http://gstreamer.freedesktop.org/
# warning: failed to load external entity "xml/plugin-video4linux2.xml"
export V=1
NOCONFIGURE=1 ./autogen.sh
# warning: failed to load external entity "xml/plugin-video4linux2.xml"
export V=1
NOCONFIGURE=1 ./autogen.sh
-export CFLAGS+=" -DTIZEN_FEATURE_V4L2SRC_MODIFICATION\
+export CFLAGS+=" -DTIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE\
+ -DTIZEN_FEATURE_V4L2SRC_SUPPORT_CAMERA_ID\
-DTIZEN_FEATURE_WAVPARSE_MODIFICATION\
-DTIZEN_FEATURE_MP3PARSE_MODIFICATION\
-DTIZEN_FEATURE_AACPARSE_MODIFICATION\
-DTIZEN_FEATURE_WAVPARSE_MODIFICATION\
-DTIZEN_FEATURE_MP3PARSE_MODIFICATION\
-DTIZEN_FEATURE_AACPARSE_MODIFICATION\
{
PROP_0,
V4L2_STD_OBJECT_PROPS,
{
PROP_0,
V4L2_STD_OBJECT_PROPS,
+#ifdef TIZEN_FEATURE_V4L2SRC_SUPPORT_CAMERA_ID
+ PROP_CAMERA_ID,
+#endif /* TIZEN_FEATURE_V4L2SRC_SUPPORT_CAMERA_ID */
gst_v4l2_object_install_properties_helper (gobject_class,
DEFAULT_PROP_DEVICE);
gst_v4l2_object_install_properties_helper (gobject_class,
DEFAULT_PROP_DEVICE);
+#ifdef TIZEN_FEATURE_V4L2SRC_SUPPORT_CAMERA_ID
+ /**
+ * GstV4l2Src:camera-id:
+ *
+ * The value which is set by application will be used as a number of device node.
+ * ex) 1 -> /dev/video1
+ */
+ g_object_class_install_property (gobject_class, PROP_CAMERA_ID,
+ g_param_spec_uint ("camera-id", "Camera ID",
+ "Camera ID for device node", 0, G_MAXUINT, 0,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+#endif /* TIZEN_FEATURE_V4L2SRC_SUPPORT_CAMERA_ID */
+
/**
* GstV4l2Src::prepare-format:
* @v4l2src: the v4l2src instance
/**
* GstV4l2Src::prepare-format:
* @v4l2src: the v4l2src instance
if (!gst_v4l2_object_set_property_helper (v4l2src->v4l2object,
prop_id, value, pspec)) {
switch (prop_id) {
if (!gst_v4l2_object_set_property_helper (v4l2src->v4l2object,
prop_id, value, pspec)) {
switch (prop_id) {
+#ifdef TIZEN_FEATURE_V4L2SRC_SUPPORT_CAMERA_ID
+ case PROP_CAMERA_ID:
+ g_free (v4l2src->v4l2object->videodev);
+
+ v4l2src->camera_id = g_value_get_uint (value);
+ v4l2src->v4l2object->videodev = g_strdup_printf ("/dev/video%u", v4l2src->camera_id);
+
+ GST_INFO_OBJECT(v4l2src, "videodev [%s]", v4l2src->v4l2object->videodev);
+ break;
+#endif /* TIZEN_FEATURE_V4L2SRC_SUPPORT_CAMERA_ID */
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
if (!gst_v4l2_object_get_property_helper (v4l2src->v4l2object,
prop_id, value, pspec)) {
switch (prop_id) {
if (!gst_v4l2_object_get_property_helper (v4l2src->v4l2object,
prop_id, value, pspec)) {
switch (prop_id) {
+#ifdef TIZEN_FEATURE_V4L2SRC_SUPPORT_CAMERA_ID
+ case PROP_CAMERA_ID:
+ g_value_set_uint (value, v4l2src->camera_id);
+ break;
+#endif /* TIZEN_FEATURE_V4L2SRC_SUPPORT_CAMERA_ID */
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
/* Timestamp sanity check */
GstClockTime last_timestamp;
gboolean has_bad_timestamp;
/* Timestamp sanity check */
GstClockTime last_timestamp;
gboolean has_bad_timestamp;
+
+#ifdef TIZEN_FEATURE_V4L2SRC_SUPPORT_CAMERA_ID
+ /* Properties */
+ guint camera_id;
+#endif /* TIZEN_FEATURE_V4L2SRC_SUPPORT_CAMERA_ID */
};
struct _GstV4l2SrcClass
};
struct _GstV4l2SrcClass
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
-#ifdef TIZEN_FEATURE_V4L2SRC_MODIFICATION
+#ifdef TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE
-#endif /* TIZEN_FEATURE_V4L2SRC_MODIFICATION */
+#endif /* TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE */
#ifdef __sun
/* Needed on older Solaris Nevada builds (72 at least) */
#include <stropts.h>
#ifdef __sun
/* Needed on older Solaris Nevada builds (72 at least) */
#include <stropts.h>
#include "gst/gst-i18n-plugin.h"
#include "gst/gst-i18n-plugin.h"
-#ifdef TIZEN_FEATURE_V4L2SRC_MODIFICATION
+#ifdef TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE
enum {
V4L2_OPEN_ERROR = 0,
V4L2_OPEN_ERROR_STAT_FAILED,
enum {
V4L2_OPEN_ERROR = 0,
V4L2_OPEN_ERROR_STAT_FAILED,
V4L2_OPEN_ERROR_NOT_CAPTURE,
V4L2_OPEN_ERROR_NOT_OUTPUT
};
V4L2_OPEN_ERROR_NOT_CAPTURE,
V4L2_OPEN_ERROR_NOT_OUTPUT
};
-#endif /* TIZEN_FEATURE_V4L2SRC_MODIFICATION */
+#endif /* TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE */
GST_DEBUG_CATEGORY_EXTERN (v4l2_debug);
#define GST_CAT_DEFAULT v4l2_debug
GST_DEBUG_CATEGORY_EXTERN (v4l2_debug);
#define GST_CAT_DEFAULT v4l2_debug
{
struct stat st;
int libv4l2_fd;
{
struct stat st;
int libv4l2_fd;
-#ifdef TIZEN_FEATURE_V4L2SRC_MODIFICATION
+#ifdef TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE
int error_type = V4L2_OPEN_ERROR_STAT_FAILED;
int device_index = 0;
glob_t glob_buf;
int error_type = V4L2_OPEN_ERROR_STAT_FAILED;
int device_index = 0;
glob_t glob_buf;
GST_ERROR("v4l2object is NULL");
return FALSE;
}
GST_ERROR("v4l2object is NULL");
return FALSE;
}
-#endif /* TIZEN_FEATURE_V4L2SRC_MODIFICATION */
+#endif /* TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE */
GST_DEBUG_OBJECT (v4l2object->element, "Trying to open device %s",
v4l2object->videodev);
GST_DEBUG_OBJECT (v4l2object->element, "Trying to open device %s",
v4l2object->videodev);
if (!v4l2object->videodev)
v4l2object->videodev = g_strdup ("/dev/video");
if (!v4l2object->videodev)
v4l2object->videodev = g_strdup ("/dev/video");
-#ifdef TIZEN_FEATURE_V4L2SRC_MODIFICATION
+#ifdef TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE
if (!v4l2object->videodev) {
GST_ERROR_OBJECT(v4l2object->element, "videodev is NULL");
return FALSE;
}
CHECK_AGAIN:
if (!v4l2object->videodev) {
GST_ERROR_OBJECT(v4l2object->element, "videodev is NULL");
return FALSE;
}
CHECK_AGAIN:
-#endif /* TIZEN_FEATURE_V4L2SRC_MODIFICATION */
+#endif /* TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE */
/* check if it is a device */
/* check if it is a device */
-#ifdef TIZEN_FEATURE_V4L2SRC_MODIFICATION
+#ifdef TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE
if (stat (v4l2object->videodev, &st) == -1) {
error_type = V4L2_OPEN_ERROR_STAT_FAILED;
goto pre_error_check;
}
if (stat (v4l2object->videodev, &st) == -1) {
error_type = V4L2_OPEN_ERROR_STAT_FAILED;
goto pre_error_check;
}
-#else /* TIZEN_FEATURE_V4L2SRC_MODIFICATION */
+#else /* TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE */
if (stat (v4l2object->videodev, &st) == -1)
goto stat_failed;
if (stat (v4l2object->videodev, &st) == -1)
goto stat_failed;
-#endif /* TIZEN_FEATURE_V4L2SRC_MODIFICATION */
+#endif /* TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE */
-#ifdef TIZEN_FEATURE_V4L2SRC_MODIFICATION
+#ifdef TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE
if (!S_ISCHR (st.st_mode)) {
error_type = V4L2_OPEN_ERROR_NO_DEVICE;
goto pre_error_check;
}
if (!S_ISCHR (st.st_mode)) {
error_type = V4L2_OPEN_ERROR_NO_DEVICE;
goto pre_error_check;
}
-#else /* TIZEN_FEATURE_V4L2SRC_MODIFICATION */
+#else /* TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE */
if (!S_ISCHR (st.st_mode))
goto no_device;
if (!S_ISCHR (st.st_mode))
goto no_device;
-#endif /* TIZEN_FEATURE_V4L2SRC_MODIFICATION */
+#endif /* TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE */
/* open the device */
v4l2object->video_fd =
open (v4l2object->videodev, O_RDWR /* | O_NONBLOCK */ );
/* open the device */
v4l2object->video_fd =
open (v4l2object->videodev, O_RDWR /* | O_NONBLOCK */ );
-#ifdef TIZEN_FEATURE_V4L2SRC_MODIFICATION
+#ifdef TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE
if (!GST_V4L2_IS_OPEN (v4l2object)) {
error_type = V4L2_OPEN_ERROR_NOT_OPEN;
goto pre_error_check;
}
if (!GST_V4L2_IS_OPEN (v4l2object)) {
error_type = V4L2_OPEN_ERROR_NOT_OPEN;
goto pre_error_check;
}
-#else /* TIZEN_FEATURE_V4L2SRC_MODIFICATION */
+#else /* TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE */
if (!GST_V4L2_IS_OPEN (v4l2object))
goto not_open;
if (!GST_V4L2_IS_OPEN (v4l2object))
goto not_open;
-#endif /* TIZEN_FEATURE_V4L2SRC_MODIFICATION */
+#endif /* TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE */
libv4l2_fd = v4l2_fd_open (v4l2object->video_fd,
V4L2_ENABLE_ENUM_FMT_EMULATION);
libv4l2_fd = v4l2_fd_open (v4l2object->video_fd,
V4L2_ENABLE_ENUM_FMT_EMULATION);
v4l2object->video_fd = libv4l2_fd;
/* get capabilities, error will be posted */
v4l2object->video_fd = libv4l2_fd;
/* get capabilities, error will be posted */
-#ifdef TIZEN_FEATURE_V4L2SRC_MODIFICATION
+#ifdef TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE
if (!gst_v4l2_get_capabilities (v4l2object)) {
error_type = V4L2_OPEN_ERROR;
goto pre_error_check;
}
if (!gst_v4l2_get_capabilities (v4l2object)) {
error_type = V4L2_OPEN_ERROR;
goto pre_error_check;
}
-#else /* TIZEN_FEATURE_V4L2SRC_MODIFICATION */
+#else /* TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE */
if (!gst_v4l2_get_capabilities (v4l2object))
goto error;
if (!gst_v4l2_get_capabilities (v4l2object))
goto error;
-#endif /* TIZEN_FEATURE_V4L2SRC_MODIFICATION */
+#endif /* TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE */
/* do we need to be a capture device? */
/* do we need to be a capture device? */
-#ifdef TIZEN_FEATURE_V4L2SRC_MODIFICATION
+#ifdef TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE
GST_INFO_OBJECT(v4l2object->element, "device_caps 0x%x", v4l2object->device_caps);
if (GST_IS_V4L2SRC (v4l2object->element) &&
(!(v4l2object->device_caps & (V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_CAPTURE_MPLANE)) ||
GST_INFO_OBJECT(v4l2object->element, "device_caps 0x%x", v4l2object->device_caps);
if (GST_IS_V4L2SRC (v4l2object->element) &&
(!(v4l2object->device_caps & (V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_CAPTURE_MPLANE)) ||
error_type = V4L2_OPEN_ERROR_NOT_CAPTURE;
goto pre_error_check;
}
error_type = V4L2_OPEN_ERROR_NOT_CAPTURE;
goto pre_error_check;
}
-#else /* TIZEN_FEATURE_V4L2SRC_MODIFICATION */
+#else /* TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE */
if (GST_IS_V4L2SRC (v4l2object->element) &&
!(v4l2object->device_caps & (V4L2_CAP_VIDEO_CAPTURE |
V4L2_CAP_VIDEO_CAPTURE_MPLANE)))
goto not_capture;
if (GST_IS_V4L2SRC (v4l2object->element) &&
!(v4l2object->device_caps & (V4L2_CAP_VIDEO_CAPTURE |
V4L2_CAP_VIDEO_CAPTURE_MPLANE)))
goto not_capture;
-#endif /* TIZEN_FEATURE_V4L2SRC_MODIFICATION */
+#endif /* TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE */
-#ifdef TIZEN_FEATURE_V4L2SRC_MODIFICATION
+#ifdef TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE
if (GST_IS_V4L2SINK (v4l2object->element) &&
!(v4l2object->device_caps & (V4L2_CAP_VIDEO_OUTPUT |
V4L2_CAP_VIDEO_OUTPUT_MPLANE))) {
error_type = V4L2_OPEN_ERROR_NOT_OUTPUT;
goto pre_error_check;
}
if (GST_IS_V4L2SINK (v4l2object->element) &&
!(v4l2object->device_caps & (V4L2_CAP_VIDEO_OUTPUT |
V4L2_CAP_VIDEO_OUTPUT_MPLANE))) {
error_type = V4L2_OPEN_ERROR_NOT_OUTPUT;
goto pre_error_check;
}
-#else /* TIZEN_FEATURE_V4L2SRC_MODIFICATION */
+#else /* TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE */
if (GST_IS_V4L2SINK (v4l2object->element) &&
!(v4l2object->device_caps & (V4L2_CAP_VIDEO_OUTPUT |
V4L2_CAP_VIDEO_OUTPUT_MPLANE)))
goto not_output;
if (GST_IS_V4L2SINK (v4l2object->element) &&
!(v4l2object->device_caps & (V4L2_CAP_VIDEO_OUTPUT |
V4L2_CAP_VIDEO_OUTPUT_MPLANE)))
goto not_output;
-#endif /* TIZEN_FEATURE_V4L2SRC_MODIFICATION */
+#endif /* TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE */
if (GST_IS_V4L2_VIDEO_DEC (v4l2object->element) &&
/* Today's M2M device only expose M2M */
if (GST_IS_V4L2_VIDEO_DEC (v4l2object->element) &&
/* Today's M2M device only expose M2M */
gst_v4l2_adjust_buf_type (v4l2object);
/* create enumerations, posts errors. */
gst_v4l2_adjust_buf_type (v4l2object);
/* create enumerations, posts errors. */
-#ifdef TIZEN_FEATURE_V4L2SRC_MODIFICATION
+#ifdef TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE
if (!gst_v4l2_fill_lists (v4l2object)) {
error_type = V4L2_OPEN_ERROR;
goto pre_error_check;
}
if (!gst_v4l2_fill_lists (v4l2object)) {
error_type = V4L2_OPEN_ERROR;
goto pre_error_check;
}
-#else /* TIZEN_FEATURE_V4L2SRC_MODIFICATION */
+#else /* TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE */
if (!gst_v4l2_fill_lists (v4l2object))
goto error;
if (!gst_v4l2_fill_lists (v4l2object))
goto error;
-#endif /* TIZEN_FEATURE_V4L2SRC_MODIFICATION */
+#endif /* TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE */
GST_INFO_OBJECT (v4l2object->element,
"Opened device '%s' (%s) successfully",
GST_INFO_OBJECT (v4l2object->element,
"Opened device '%s' (%s) successfully",
if (v4l2object->extra_controls)
gst_v4l2_set_controls (v4l2object, v4l2object->extra_controls);
if (v4l2object->extra_controls)
gst_v4l2_set_controls (v4l2object, v4l2object->extra_controls);
-#ifdef TIZEN_FEATURE_V4L2SRC_MODIFICATION
+#ifdef TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE
-#endif /* TIZEN_FEATURE_V4L2SRC_MODIFICATION */
+#endif /* TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE */
/* UVC devices are never interlaced, and doing VIDIOC_TRY_FMT on them
* causes expensive and slow USB IO, so don't probe them for interlaced
/* UVC devices are never interlaced, and doing VIDIOC_TRY_FMT on them
* causes expensive and slow USB IO, so don't probe them for interlaced
-#ifdef TIZEN_FEATURE_V4L2SRC_MODIFICATION
+#ifdef TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE
pre_error_check:
{
if (GST_IS_V4L2SRC(v4l2object->element) && glob_buf.gl_pathc == 0) {
pre_error_check:
{
if (GST_IS_V4L2SRC(v4l2object->element) && glob_buf.gl_pathc == 0) {
-#endif /* TIZEN_FEATURE_V4L2SRC_MODIFICATION */
+#endif /* TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE */
/* ERRORS */
stat_failed:
/* ERRORS */
stat_failed:
/* empty lists */
gst_v4l2_empty_lists (v4l2object);
/* empty lists */
gst_v4l2_empty_lists (v4l2object);
-#ifdef TIZEN_FEATURE_V4L2SRC_MODIFICATION
+#ifdef TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE
-#endif /* TIZEN_FEATURE_V4L2SRC_MODIFICATION */
+#endif /* TIZEN_FEATURE_V4L2SRC_SCAN_DEVICE_NODE */