GST_IMPLEMENT_V4L2_PROBE_METHODS (GstV4l2SrcClass, gst_v4l2src);
GST_IMPLEMENT_V4L2_COLOR_BALANCE_METHODS (GstV4l2Src, gst_v4l2src);
GST_IMPLEMENT_V4L2_TUNER_METHODS (GstV4l2Src, gst_v4l2src);
-#ifdef HAVE_XVIDEO
+#if 0 /* overlay is still not implemented #ifdef HAVE_XVIDEO */
GST_IMPLEMENT_V4L2_XOVERLAY_METHODS (GstV4l2Src, gst_v4l2src);
#endif
GST_IMPLEMENT_V4L2_VIDORIENT_METHODS (GstV4l2Src, gst_v4l2src);
{
GstV4l2Object *v4l2object = GST_V4L2SRC (iface)->v4l2object;
-#ifdef HAVE_XVIDEO
+#if 0 /* overlay is still not implemented #ifdef HAVE_XVIDEO */
g_assert (iface_type == GST_TYPE_TUNER ||
iface_type == GST_TYPE_X_OVERLAY ||
iface_type == GST_TYPE_COLOR_BALANCE ||
if (v4l2object->video_fd == -1)
return FALSE;
-#ifdef HAVE_XVIDEO
+#if 0 /* overlay is still not implemented #ifdef HAVE_XVIDEO */
if (iface_type == GST_TYPE_X_OVERLAY && !GST_V4L2_IS_OVERLAY (v4l2object))
return FALSE;
#endif
NULL,
NULL,
};
-#ifdef HAVE_XVIDEO
+#if 0 /* overlay is still not implemented #ifdef HAVE_XVIDEO */
static const GInterfaceInfo v4l2_xoverlay_info = {
(GInterfaceInitFunc) gst_v4l2src_xoverlay_interface_init,
NULL,
g_type_add_interface_static (type,
GST_TYPE_IMPLEMENTS_INTERFACE, &v4l2iface_info);
g_type_add_interface_static (type, GST_TYPE_TUNER, &v4l2_tuner_info);
-#ifdef HAVE_XVIDEO
+#if 0 /* overlay is still not implemented #ifdef HAVE_XVIDEO */
g_type_add_interface_static (type, GST_TYPE_X_OVERLAY, &v4l2_xoverlay_info);
#endif
g_type_add_interface_static (type,
gst_v4l2src_set_caps (GstBaseSrc * src, GstCaps * caps)
{
GstV4l2Src *v4l2src;
- gint w, h;
+ gint w = 0, h = 0;
GstStructure *structure;
struct v4l2_fmtdesc *format;
const GValue *framerate;
read_error:
{
GST_ELEMENT_ERROR (v4l2src, RESOURCE, SYNC,
- (_("Error read()ing %d bytes on device %s."),
+ (_("Error read()ing %d bytes on device '%s'."),
buffersize, v4l2src->v4l2object->videodev), GST_ERROR_SYSTEM);
gst_buffer_unref (*buf);
return GST_FLOW_ERROR;
}
short_read:
{
- GST_ELEMENT_ERROR (v4l2src, RESOURCE, SYNC, (NULL),
+ GST_ELEMENT_ERROR (v4l2src, RESOURCE, SYNC,
+ (_("Error reading from device '%s'"),
+ v4l2src->v4l2object->videodev),
("Error read()ing a buffer on device %s: got only %d bytes instead of expected %d.",
v4l2src->v4l2object->videodev, amount, buffersize));
gst_buffer_unref (*buf);
break; /* end of enumeration */
else {
GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, SETTINGS,
- (_("Failed to get %d in channel enumeration for %s."),
- n, v4l2object->videodev), GST_ERROR_SYSTEM);
+ (_("Failed to query attributes of input %d in device %s"),
+ n, v4l2object->videodev),
+ ("Failed to get %d in input enumeration for %s. (%d - %s)",
+ n, v4l2object->videodev, errno, strerror (errno)));
return FALSE;
}
}
vtun.index = input.tuner;
if (ioctl (v4l2object->video_fd, VIDIOC_G_TUNER, &vtun) < 0) {
GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, SETTINGS,
- (_("Failed to get tuner %d settings on %s."),
+ (_("Failed to get setting of tuner &d on device '%s'."),
input.tuner, v4l2object->videodev), GST_ERROR_SYSTEM);
g_object_unref (G_OBJECT (channel));
return FALSE;
break; /* end of enumeration */
else {
GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, SETTINGS,
- (_("Failed to get %d in norm enumeration for %s."),
- n, v4l2object->videodev), GST_ERROR_SYSTEM);
+ (_("Failed to query norm on device '%s'."),
+ v4l2object->videodev),
+ ("Failed to get attributes for norm %d on devide '%s'. (%d - %s)",
+ n, v4l2object->videodev, errno, strerror (errno)));
return FALSE;
}
}
break;
} else {
GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, SETTINGS,
- (_("Failed to get %d in control enumeration for %s."),
- n, v4l2object->videodev), GST_ERROR_SYSTEM);
+ (_("Failed getting controls attributes on device '%s."),
+ v4l2object->videodev),
+ ("Failed querying control %d on device '%s'. (%d - %s)",
+ n, v4l2object->videodev, errno, strerror (errno)));
return FALSE;
}
}
break; /* end of enumeration */
else {
GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, SETTINGS,
- (_("Failed to get %d in menu enumeration for %s"),
- n, v4l2object->videodev), GST_ERROR_SYSTEM);
+ (_("Failed getting controls attributes on device '%s."),
+ v4l2object->videodev),
+ ("Failed to get %d in menu enumeration for %s. (%d - %s)",
+ n, v4l2object->videodev, errno, strerror (errno)));
return FALSE;
}
}
not_open:
{
GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, OPEN_READ_WRITE,
- (_("Could not open device \"%s\" for reading and writing."),
+ (_("Could not open device '%s' for reading and writing."),
v4l2object->videodev), GST_ERROR_SYSTEM);
goto error;
}
not_capture:
{
GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, NOT_FOUND,
- (_("Device \"%s\" is not a capture device."),
+ (_("Device '%s' is not a capture device."),
v4l2object->videodev),
("Capabilities: 0x%x", v4l2object->vcap.capabilities));
goto error;
std_failed:
{
GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS,
- (_("Failed to set norm 0x%llx for device %s: %s."),
- norm, v4l2object->videodev), GST_ERROR_SYSTEM);
+ (_("Failed to set norm for device '%s'."),
+ v4l2object->videodev), GST_ERROR_SYSTEM);
return FALSE;
}
}
freq_failed:
{
GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS,
- (_("Failed to get current tuner frequency for device %s."),
+ (_("Failed to get current tuner frequency for device '%s'."),
v4l2object->videodev), GST_ERROR_SYSTEM);
return FALSE;
}
freq_failed:
{
GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS,
- (_("Failed to set current tuner frequency for device %s to %lu."),
+ (_("Failed to set current tuner frequency for device '%s' to %lu Hz."),
v4l2object->videodev, frequency), GST_ERROR_SYSTEM);
return FALSE;
}
tuner_failed:
{
GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS,
- (_("Failed to get signal strength for device %s."),
+ (_("Failed to get signal strength for device '%s'."),
v4l2object->videodev), GST_ERROR_SYSTEM);
return FALSE;
}
ctrl_failed:
{
GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS,
- (_("Failed to get value for control %d on device %s."),
+ (_("Failed to get value for control %d on device '%s'."),
attribute_num, v4l2object->videodev), GST_ERROR_SYSTEM);
return FALSE;
}
ctrl_failed:
{
GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS,
- (_("Failed to set value %d for control %d on device %s."),
+ (_("Failed to set value %d for control %d on device '%s'."),
value, attribute_num, v4l2object->videodev), GST_ERROR_SYSTEM);
return FALSE;
}
input_failed:
{
GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS,
- (_("Failed to get current input on device %s."),
+ (_("Failed to get current input on device '%s'."),
v4l2object->videodev), GST_ERROR_SYSTEM);
return FALSE;
}
failed:
{
GST_ELEMENT_ERROR (v4l2src, RESOURCE, SETTINGS,
- (_("Failed to get number %d in pixelformat enumeration for %s."),
- n, v4l2src->v4l2object->videodev), GST_ERROR_SYSTEM);
+ (_("Failed to enumerate possible video formats device '%s' can work with"), v4l2src->v4l2object->videodev), ("Failed to get number %d in pixelformat enumeration for %s. (%d - %s)", n, v4l2src->v4l2object->videodev, errno, strerror (errno)));
g_free (format);
return FALSE;
}
failed:
{
GST_ELEMENT_ERROR (v4l2src, RESOURCE, WRITE,
- (_("Could not write to device '%s'."),
+ (_("Could not exchange data with device '%s'."),
v4l2src->v4l2object->videodev),
("Error queueing buffer %u on device %s. system error: %s", i,
v4l2src->v4l2object->videodev, g_strerror (errno)));
v4l2src->v4l2object->videodev);
break;
default:
- GST_ELEMENT_WARNING (v4l2src, RESOURCE, FAILED,
+ GST_WARNING_OBJECT (v4l2src,
(_("Grabbing frame got interrupted on %s. No expected reason."),
- v4l2src->v4l2object->videodev), GST_ERROR_SYSTEM);
+ v4l2src->v4l2object->videodev));
break;
}
einval:
{
GST_ELEMENT_ERROR (v4l2src, RESOURCE, FAILED,
- (_("Failed trying to get frames from device %s."),
+ (_("Failed trying to get video frames from device '%s'."),
v4l2src->v4l2object->videodev),
(_("The buffer type is not supported, or the index is out of bounds,"
" or no buffers have been allocated yet, or the userptr"
nomem:
{
GST_ELEMENT_ERROR (v4l2src, RESOURCE, FAILED,
- (_("Failed trying to get frames from device %s. Not enough memory."),
- v4l2src->v4l2object->videodev),
- (_("insufficient memory to enqueue a user pointer buffer. device %s."),
- v4l2src->v4l2object->videodev));
+ (_("Failed trying to get video frames from device '%s'. Not enough memory."), v4l2src->v4l2object->videodev), (_("insufficient memory to enqueue a user pointer buffer. device %s."), v4l2src->v4l2object->videodev));
return -1;
}
too_many_trials:
{
GST_ELEMENT_ERROR (v4l2src, RESOURCE, FAILED,
- (_("Failed trying to get frames from device %s."),
+ (_("Failed trying to get video frames from device '%s'."),
v4l2src->v4l2object->videodev),
(_("Failed after 100 tries. device %s."),
v4l2src->v4l2object->videodev));
fmt_failed:
{
GST_ELEMENT_ERROR (v4l2src, RESOURCE, SETTINGS,
- (_("Failed to get pixelformat for device %s."),
- v4l2src->v4l2object->videodev), GST_ERROR_SYSTEM);
+ (_("Failed querying in which video format device '%s' is working with"),
+ v4l2src->v4l2object->videodev),
+ ("Failed VIDIOC_G_FMT for %s. (%d - %s)",
+ v4l2src->v4l2object->videodev, errno, strerror (errno)));
return FALSE;
}
}
if (*width != v4l2src->format.fmt.pix.width ||
*height != v4l2src->format.fmt.pix.height) {
- DEBUG ("Updating size from %dx%d to %dx%d, format %s",
- *width, *height, v4l2src->format.fmt.pix.width,
- v4l2src->format.fmt.pix.height, fmt->description);
+ GST_ELEMENT_WARNING (v4l2src, STREAM, WRONG_TYPE,
+ (_("The closest size from %dx%d is %dx%d, for video format %s on device '%s'"), *width, *height, v4l2src->format.fmt.pix.width, v4l2src->format.fmt.pix.height, fmt->description, v4l2src->v4l2object->videodev), ("Updating size from %dx%d to %dx%d, format %s", *width, *height, v4l2src->format.fmt.pix.width, v4l2src->format.fmt.pix.height, fmt->description));
}
/* update internal info, posted error */
if (*fps_n) {
if (gst_v4l2src_set_fps (v4l2src, &new_fps_n, &new_fps_d)) {
if (new_fps_n != *fps_n || new_fps_d != *fps_d) {
- DEBUG ("Updating framerate from %u/%u to %u%u",
- *fps_n, *fps_d, new_fps_n, new_fps_d);
+ GST_ELEMENT_WARNING (v4l2src, STREAM, WRONG_TYPE,
+ (_("The closest framerate from %u/%u is %u/%u, on device '%s'"),
+ *fps_n, *fps_d, new_fps_n, new_fps_d,
+ v4l2src->v4l2object->videodev),
+ ("Updating framerate from %u/%u to %u%u", *fps_n, *fps_d, new_fps_n,
+ new_fps_d));
+
*fps_n = new_fps_n;
*fps_d = new_fps_d;
}
fmt_failed:
{
GST_ELEMENT_ERROR (v4l2src, RESOURCE, SETTINGS,
- (_("Failed to set pixelformat to %s @ %dx%d for device %s: %s."),
- fmt->description, *width, *height, v4l2src->v4l2object->videodev),
- GST_ERROR_SYSTEM);
+ (_("Failed setting the video format for device '%s'"),
+ v4l2src->v4l2object->videodev),
+ ("Failed to set pixelformat to %s @ %dx%d for device %s. (%d - %s)",
+ fmt->description, *width, *height,
+ v4l2src->v4l2object->videodev, errno, strerror (errno)));
return FALSE;
}
pixfmt_failed:
{
GST_ELEMENT_ERROR (v4l2src, RESOURCE, SETTINGS,
- (_("Failed to set pixelformat to %s @ %dx%d for device %s: %s."),
- fmt->description, *width, *height, v4l2src->v4l2object->videodev),
- GST_ERROR_SYSTEM);
+ (_("Failed setting the video format for device '%s'"),
+ v4l2src->v4l2object->videodev),
+ ("Failed to set pixelformat to %s @ %dx%d for device %s. (%d - %s)",
+ fmt->description, *width, *height,
+ v4l2src->v4l2object->videodev, errno, strerror (errno)));
return FALSE;
}
fail:
GST_ELEMENT_ERROR (v4l2src, RESOURCE, READ,
(_("Could not get buffers from device '%s'."),
v4l2src->v4l2object->videodev),
- ("error requesting %d buffers. system error: %s",
- v4l2src->breq.count, g_strerror (errno)));
+ ("error requesting %d buffers. (%d - %s)",
+ v4l2src->breq.count, errno, g_strerror (errno)));
return FALSE;
}
broken_driver:
GST_ELEMENT_ERROR (v4l2src, RESOURCE, READ,
(_("The driver of device '%s' is broken."),
v4l2src->v4l2object->videodev),
- ("no supported read capability from %s",
- v4l2src->v4l2object->videodev));
+ ("no supported read capability from %s. (%d - %s)",
+ v4l2src->v4l2object->videodev, errno, strerror (errno)));
return FALSE;
}
no_buffers:
GST_ELEMENT_ERROR (v4l2src, RESOURCE, READ,
(_("Could not get enough buffers from device '%s'."),
v4l2src->v4l2object->videodev),
- ("we received %d, we want at least %d",
- v4l2src->breq.count, GST_V4L2_MIN_BUFFERS));
+ ("we received %d from device '%s', we want at least %d. (%d - %s))",
+ v4l2src->breq.count, v4l2src->v4l2object->videodev,
+ GST_V4L2_MIN_BUFFERS, errno, strerror (errno)));
v4l2src->breq.count = buffers;
return FALSE;
}
querybuf_failed:
{
GST_ELEMENT_ERROR (v4l2src, RESOURCE, READ,
- (_("Could not get buffer properties of buffer %d."), n),
- GST_ERROR_SYSTEM);
+ (_("Could not get properties of data comming from device '%s'"),
+ v4l2src->v4l2object->videodev),
+ ("Failed querying buffer properties. (%d - %s)",
+ errno, strerror (errno)));
gst_v4l2src_capture_deinit (v4l2src);
return FALSE;
}
mmap_failed:
{
GST_ELEMENT_ERROR (v4l2src, RESOURCE, READ,
- (_("Could not mmap video buffer %d."), n), GST_ERROR_SYSTEM);
+ (_("Could not map memory in device '%s'."),
+ v4l2src->v4l2object->videodev),
+ ("mmap failed. (%d - %s)", errno, strerror (errno)));
gst_v4l2src_capture_deinit (v4l2src);
buffer->start = 0;
return FALSE;
streamon_failed:
{
GST_ELEMENT_ERROR (v4l2src, RESOURCE, OPEN_READ,
- (_("Error starting streaming capture from device %s."),
+ (_("Error starting streaming capture from device '%s'."),
v4l2src->v4l2object->videodev), GST_ERROR_SYSTEM);
return FALSE;
}
streamoff_failed:
{
GST_ELEMENT_ERROR (v4l2src, RESOURCE, CLOSE,
- (_("Error stopping streaming capture from device %s."),
+ (_("Error stopping streaming capture from device '%s'."),
v4l2src->v4l2object->videodev), GST_ERROR_SYSTEM);
return FALSE;
}