Improved comments in ELEMENT_ERROR/WARNING and added "#if 0" to xoverlay code that is still not implemented.

Original commit message from CVS:
Improved comments in ELEMENT_ERROR/WARNING and added "#if 0" to xoverlay code that is still not implemented.
This commit is contained in:
Edgard Lima 2006-11-01 19:48:26 +00:00
parent 93c5c6fcba
commit 24088fed0a
6 changed files with 105 additions and 72 deletions

View file

@ -1,3 +1,14 @@
2006-11-01 Edgard Lima <edgard.lima@indt.org.br>
* sys/v4l2/Makefile.am:
* sys/v4l2/gstv4l2object.c:
* sys/v4l2/gstv4l2src.c:
* sys/v4l2/gstv4l2xoverlay.c:
* sys/v4l2/v4l2_calls.c:
* sys/v4l2/v4l2src_calls.c:
Improved comments in ELEMENT_ERROR/WARNING and added "#if 0" to
xoverlay code that is still not implemented.
2006-11-01 Tim-Philipp Müller <tim at centricular dot net> 2006-11-01 Tim-Philipp Müller <tim at centricular dot net>
* gst/id3demux/id3v2frames.c: (parse_picture_frame): * gst/id3demux/id3v2frames.c: (parse_picture_frame):

View file

@ -1,12 +1,13 @@
plugin_LTLIBRARIES = libgstvideo4linux2.la plugin_LTLIBRARIES = libgstvideo4linux2.la
if USE_XVIDEO # overlay is still not supported in current implementation
xv_source = gstv4l2xoverlay.c # if USE_XVIDEO
xv_libs = $(X_LIBS) $(XVIDEO_LIBS) #xv_source = gstv4l2xoverlay.c
else #xv_libs = $(X_LIBS) $(XVIDEO_LIBS)
xv_source = #else
xv_libs = #xv_source =
endif #xv_libs =
#endif
libgstvideo4linux2_la_SOURCES = gstv4l2.c \ libgstvideo4linux2_la_SOURCES = gstv4l2.c \
gstv4l2colorbalance.c \ gstv4l2colorbalance.c \

View file

@ -30,7 +30,7 @@
#include "v4l2_calls.h" #include "v4l2_calls.h"
#include "gstv4l2tuner.h" #include "gstv4l2tuner.h"
#ifdef HAVE_XVIDEO #if 0 /* overlay is still not implemented #ifdef HAVE_XVIDEO */
#include "gstv4l2xoverlay.h" #include "gstv4l2xoverlay.h"
#endif #endif
#include "gstv4l2colorbalance.h" #include "gstv4l2colorbalance.h"
@ -488,7 +488,7 @@ gst_v4l2_object_start (GstV4l2Object * v4l2object)
else else
return FALSE; return FALSE;
#ifdef HAVE_XVIDEO #if 0 /* overlay is still not implemented #ifdef HAVE_XVIDEO */
gst_v4l2_xoverlay_start (v4l2object); gst_v4l2_xoverlay_start (v4l2object);
#endif #endif
@ -498,7 +498,7 @@ gst_v4l2_object_start (GstV4l2Object * v4l2object)
gboolean gboolean
gst_v4l2_object_stop (GstV4l2Object * v4l2object) gst_v4l2_object_stop (GstV4l2Object * v4l2object)
{ {
#ifdef HAVE_XVIDEO #if 0 /* overlay is still not implemented #ifdef HAVE_XVIDEO */
gst_v4l2_xoverlay_stop (v4l2object); gst_v4l2_xoverlay_stop (v4l2object);
#endif #endif

View file

@ -128,7 +128,7 @@ static const guint32 gst_v4l2_formats[] = {
GST_IMPLEMENT_V4L2_PROBE_METHODS (GstV4l2SrcClass, gst_v4l2src); GST_IMPLEMENT_V4L2_PROBE_METHODS (GstV4l2SrcClass, gst_v4l2src);
GST_IMPLEMENT_V4L2_COLOR_BALANCE_METHODS (GstV4l2Src, gst_v4l2src); GST_IMPLEMENT_V4L2_COLOR_BALANCE_METHODS (GstV4l2Src, gst_v4l2src);
GST_IMPLEMENT_V4L2_TUNER_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); GST_IMPLEMENT_V4L2_XOVERLAY_METHODS (GstV4l2Src, gst_v4l2src);
#endif #endif
GST_IMPLEMENT_V4L2_VIDORIENT_METHODS (GstV4l2Src, gst_v4l2src); GST_IMPLEMENT_V4L2_VIDORIENT_METHODS (GstV4l2Src, gst_v4l2src);
@ -138,7 +138,7 @@ gst_v4l2src_iface_supported (GstImplementsInterface * iface, GType iface_type)
{ {
GstV4l2Object *v4l2object = GST_V4L2SRC (iface)->v4l2object; 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 || g_assert (iface_type == GST_TYPE_TUNER ||
iface_type == GST_TYPE_X_OVERLAY || iface_type == GST_TYPE_X_OVERLAY ||
iface_type == GST_TYPE_COLOR_BALANCE || iface_type == GST_TYPE_COLOR_BALANCE ||
@ -152,7 +152,7 @@ gst_v4l2src_iface_supported (GstImplementsInterface * iface, GType iface_type)
if (v4l2object->video_fd == -1) if (v4l2object->video_fd == -1)
return FALSE; 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)) if (iface_type == GST_TYPE_X_OVERLAY && !GST_V4L2_IS_OVERLAY (v4l2object))
return FALSE; return FALSE;
#endif #endif
@ -182,7 +182,7 @@ gst_v4l2src_init_interfaces (GType type)
NULL, NULL,
NULL, NULL,
}; };
#ifdef HAVE_XVIDEO #if 0 /* overlay is still not implemented #ifdef HAVE_XVIDEO */
static const GInterfaceInfo v4l2_xoverlay_info = { static const GInterfaceInfo v4l2_xoverlay_info = {
(GInterfaceInitFunc) gst_v4l2src_xoverlay_interface_init, (GInterfaceInitFunc) gst_v4l2src_xoverlay_interface_init,
NULL, NULL,
@ -208,7 +208,7 @@ gst_v4l2src_init_interfaces (GType type)
g_type_add_interface_static (type, g_type_add_interface_static (type,
GST_TYPE_IMPLEMENTS_INTERFACE, &v4l2iface_info); GST_TYPE_IMPLEMENTS_INTERFACE, &v4l2iface_info);
g_type_add_interface_static (type, GST_TYPE_TUNER, &v4l2_tuner_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); g_type_add_interface_static (type, GST_TYPE_X_OVERLAY, &v4l2_xoverlay_info);
#endif #endif
g_type_add_interface_static (type, g_type_add_interface_static (type,
@ -762,7 +762,7 @@ static gboolean
gst_v4l2src_set_caps (GstBaseSrc * src, GstCaps * caps) gst_v4l2src_set_caps (GstBaseSrc * src, GstCaps * caps)
{ {
GstV4l2Src *v4l2src; GstV4l2Src *v4l2src;
gint w, h; gint w = 0, h = 0;
GstStructure *structure; GstStructure *structure;
struct v4l2_fmtdesc *format; struct v4l2_fmtdesc *format;
const GValue *framerate; const GValue *framerate;
@ -908,14 +908,16 @@ gst_v4l2src_get_read (GstV4l2Src * v4l2src, GstBuffer ** buf)
read_error: read_error:
{ {
GST_ELEMENT_ERROR (v4l2src, RESOURCE, SYNC, 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); buffersize, v4l2src->v4l2object->videodev), GST_ERROR_SYSTEM);
gst_buffer_unref (*buf); gst_buffer_unref (*buf);
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
short_read: 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.", ("Error read()ing a buffer on device %s: got only %d bytes instead of expected %d.",
v4l2src->v4l2object->videodev, amount, buffersize)); v4l2src->v4l2object->videodev, amount, buffersize));
gst_buffer_unref (*buf); gst_buffer_unref (*buf);

View file

@ -99,8 +99,10 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
break; /* end of enumeration */ break; /* end of enumeration */
else { else {
GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, SETTINGS, GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, SETTINGS,
(_("Failed to get %d in channel enumeration for %s."), (_("Failed to query attributes of input %d in device %s"),
n, v4l2object->videodev), GST_ERROR_SYSTEM); n, v4l2object->videodev),
("Failed to get %d in input enumeration for %s. (%d - %s)",
n, v4l2object->videodev, errno, strerror (errno)));
return FALSE; return FALSE;
} }
} }
@ -121,7 +123,7 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
vtun.index = input.tuner; vtun.index = input.tuner;
if (ioctl (v4l2object->video_fd, VIDIOC_G_TUNER, &vtun) < 0) { if (ioctl (v4l2object->video_fd, VIDIOC_G_TUNER, &vtun) < 0) {
GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, SETTINGS, 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); input.tuner, v4l2object->videodev), GST_ERROR_SYSTEM);
g_object_unref (G_OBJECT (channel)); g_object_unref (G_OBJECT (channel));
return FALSE; return FALSE;
@ -161,8 +163,10 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
break; /* end of enumeration */ break; /* end of enumeration */
else { else {
GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, SETTINGS, GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, SETTINGS,
(_("Failed to get %d in norm enumeration for %s."), (_("Failed to query norm on device '%s'."),
n, v4l2object->videodev), GST_ERROR_SYSTEM); v4l2object->videodev),
("Failed to get attributes for norm %d on devide '%s'. (%d - %s)",
n, v4l2object->videodev, errno, strerror (errno)));
return FALSE; return FALSE;
} }
} }
@ -207,8 +211,10 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
break; break;
} else { } else {
GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, SETTINGS, GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, SETTINGS,
(_("Failed to get %d in control enumeration for %s."), (_("Failed getting controls attributes on device '%s."),
n, v4l2object->videodev), GST_ERROR_SYSTEM); v4l2object->videodev),
("Failed querying control %d on device '%s'. (%d - %s)",
n, v4l2object->videodev, errno, strerror (errno)));
return FALSE; return FALSE;
} }
} }
@ -276,8 +282,10 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
break; /* end of enumeration */ break; /* end of enumeration */
else { else {
GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, SETTINGS, GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, SETTINGS,
(_("Failed to get %d in menu enumeration for %s"), (_("Failed getting controls attributes on device '%s."),
n, v4l2object->videodev), GST_ERROR_SYSTEM); v4l2object->videodev),
("Failed to get %d in menu enumeration for %s. (%d - %s)",
n, v4l2object->videodev, errno, strerror (errno)));
return FALSE; return FALSE;
} }
} }
@ -406,14 +414,14 @@ no_device:
not_open: not_open:
{ {
GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, OPEN_READ_WRITE, 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); v4l2object->videodev), GST_ERROR_SYSTEM);
goto error; goto error;
} }
not_capture: not_capture:
{ {
GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, NOT_FOUND, GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, NOT_FOUND,
(_("Device \"%s\" is not a capture device."), (_("Device '%s' is not a capture device."),
v4l2object->videodev), v4l2object->videodev),
("Capabilities: 0x%x", v4l2object->vcap.capabilities)); ("Capabilities: 0x%x", v4l2object->vcap.capabilities));
goto error; goto error;
@ -508,8 +516,8 @@ gst_v4l2_set_norm (GstV4l2Object * v4l2object, v4l2_std_id norm)
std_failed: std_failed:
{ {
GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS, GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS,
(_("Failed to set norm 0x%llx for device %s: %s."), (_("Failed to set norm for device '%s'."),
norm, v4l2object->videodev), GST_ERROR_SYSTEM); v4l2object->videodev), GST_ERROR_SYSTEM);
return FALSE; return FALSE;
} }
} }
@ -545,7 +553,7 @@ gst_v4l2_get_frequency (GstV4l2Object * v4l2object,
freq_failed: freq_failed:
{ {
GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS, 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); v4l2object->videodev), GST_ERROR_SYSTEM);
return FALSE; return FALSE;
} }
@ -586,7 +594,7 @@ gst_v4l2_set_frequency (GstV4l2Object * v4l2object,
freq_failed: freq_failed:
{ {
GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS, 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); v4l2object->videodev, frequency), GST_ERROR_SYSTEM);
return FALSE; return FALSE;
} }
@ -620,7 +628,7 @@ gst_v4l2_signal_strength (GstV4l2Object * v4l2object,
tuner_failed: tuner_failed:
{ {
GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS, 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); v4l2object->videodev), GST_ERROR_SYSTEM);
return FALSE; return FALSE;
} }
@ -656,7 +664,7 @@ gst_v4l2_get_attribute (GstV4l2Object * v4l2object,
ctrl_failed: ctrl_failed:
{ {
GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS, 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); attribute_num, v4l2object->videodev), GST_ERROR_SYSTEM);
return FALSE; return FALSE;
} }
@ -691,7 +699,7 @@ gst_v4l2_set_attribute (GstV4l2Object * v4l2object,
ctrl_failed: ctrl_failed:
{ {
GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS, 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); value, attribute_num, v4l2object->videodev), GST_ERROR_SYSTEM);
return FALSE; return FALSE;
} }
@ -718,7 +726,7 @@ gst_v4l2_get_input (GstV4l2Object * v4l2object, gint * input)
input_failed: input_failed:
{ {
GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS, 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); v4l2object->videodev), GST_ERROR_SYSTEM);
return FALSE; return FALSE;
} }

View file

@ -92,8 +92,7 @@ gst_v4l2src_fill_format_list (GstV4l2Src * v4l2src)
failed: failed:
{ {
GST_ELEMENT_ERROR (v4l2src, RESOURCE, SETTINGS, GST_ELEMENT_ERROR (v4l2src, RESOURCE, SETTINGS,
(_("Failed to get number %d in pixelformat enumeration for %s."), (_("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)));
n, v4l2src->v4l2object->videodev), GST_ERROR_SYSTEM);
g_free (format); g_free (format);
return FALSE; return FALSE;
} }
@ -135,7 +134,7 @@ gst_v4l2src_queue_frame (GstV4l2Src * v4l2src, guint i)
failed: failed:
{ {
GST_ELEMENT_ERROR (v4l2src, RESOURCE, WRITE, GST_ELEMENT_ERROR (v4l2src, RESOURCE, WRITE,
(_("Could not write to device '%s'."), (_("Could not exchange data with device '%s'."),
v4l2src->v4l2object->videodev), v4l2src->v4l2object->videodev),
("Error queueing buffer %u on device %s. system error: %s", i, ("Error queueing buffer %u on device %s. system error: %s", i,
v4l2src->v4l2object->videodev, g_strerror (errno))); v4l2src->v4l2object->videodev, g_strerror (errno)));
@ -184,9 +183,9 @@ gst_v4l2src_grab_frame (GstV4l2Src * v4l2src)
v4l2src->v4l2object->videodev); v4l2src->v4l2object->videodev);
break; break;
default: default:
GST_ELEMENT_WARNING (v4l2src, RESOURCE, FAILED, GST_WARNING_OBJECT (v4l2src,
(_("Grabbing frame got interrupted on %s. No expected reason."), (_("Grabbing frame got interrupted on %s. No expected reason."),
v4l2src->v4l2object->videodev), GST_ERROR_SYSTEM); v4l2src->v4l2object->videodev));
break; break;
} }
@ -208,7 +207,7 @@ gst_v4l2src_grab_frame (GstV4l2Src * v4l2src)
einval: einval:
{ {
GST_ELEMENT_ERROR (v4l2src, RESOURCE, FAILED, 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), v4l2src->v4l2object->videodev),
(_("The buffer type is not supported, or the index is out of bounds," (_("The buffer type is not supported, or the index is out of bounds,"
" or no buffers have been allocated yet, or the userptr" " or no buffers have been allocated yet, or the userptr"
@ -219,16 +218,13 @@ einval:
nomem: nomem:
{ {
GST_ELEMENT_ERROR (v4l2src, RESOURCE, FAILED, GST_ELEMENT_ERROR (v4l2src, RESOURCE, FAILED,
(_("Failed trying to get frames from device %s. Not enough memory."), (_("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));
v4l2src->v4l2object->videodev),
(_("insufficient memory to enqueue a user pointer buffer. device %s."),
v4l2src->v4l2object->videodev));
return -1; return -1;
} }
too_many_trials: too_many_trials:
{ {
GST_ELEMENT_ERROR (v4l2src, RESOURCE, FAILED, 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), v4l2src->v4l2object->videodev),
(_("Failed after 100 tries. device %s."), (_("Failed after 100 tries. device %s."),
v4l2src->v4l2object->videodev)); v4l2src->v4l2object->videodev));
@ -261,8 +257,10 @@ gst_v4l2src_get_capture (GstV4l2Src * v4l2src)
fmt_failed: fmt_failed:
{ {
GST_ELEMENT_ERROR (v4l2src, RESOURCE, SETTINGS, GST_ELEMENT_ERROR (v4l2src, RESOURCE, SETTINGS,
(_("Failed to get pixelformat for device %s."), (_("Failed querying in which video format device '%s' is working with"),
v4l2src->v4l2object->videodev), GST_ERROR_SYSTEM); v4l2src->v4l2object->videodev),
("Failed VIDIOC_G_FMT for %s. (%d - %s)",
v4l2src->v4l2object->videodev, errno, strerror (errno)));
return FALSE; return FALSE;
} }
} }
@ -302,9 +300,8 @@ gst_v4l2src_set_capture (GstV4l2Src * v4l2src,
if (*width != v4l2src->format.fmt.pix.width || if (*width != v4l2src->format.fmt.pix.width ||
*height != v4l2src->format.fmt.pix.height) { *height != v4l2src->format.fmt.pix.height) {
DEBUG ("Updating size from %dx%d to %dx%d, format %s", GST_ELEMENT_WARNING (v4l2src, STREAM, WRONG_TYPE,
*width, *height, v4l2src->format.fmt.pix.width, (_("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));
v4l2src->format.fmt.pix.height, fmt->description);
} }
/* update internal info, posted error */ /* update internal info, posted error */
@ -317,8 +314,13 @@ gst_v4l2src_set_capture (GstV4l2Src * v4l2src,
if (*fps_n) { if (*fps_n) {
if (gst_v4l2src_set_fps (v4l2src, &new_fps_n, &new_fps_d)) { if (gst_v4l2src_set_fps (v4l2src, &new_fps_n, &new_fps_d)) {
if (new_fps_n != *fps_n || new_fps_d != *fps_d) { if (new_fps_n != *fps_n || new_fps_d != *fps_d) {
DEBUG ("Updating framerate from %u/%u to %u%u", GST_ELEMENT_WARNING (v4l2src, STREAM, WRONG_TYPE,
*fps_n, *fps_d, new_fps_n, new_fps_d); (_("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_n = new_fps_n;
*fps_d = new_fps_d; *fps_d = new_fps_d;
} }
@ -340,17 +342,21 @@ gst_v4l2src_set_capture (GstV4l2Src * v4l2src,
fmt_failed: fmt_failed:
{ {
GST_ELEMENT_ERROR (v4l2src, RESOURCE, SETTINGS, GST_ELEMENT_ERROR (v4l2src, RESOURCE, SETTINGS,
(_("Failed to set pixelformat to %s @ %dx%d for device %s: %s."), (_("Failed setting the video format for device '%s'"),
fmt->description, *width, *height, v4l2src->v4l2object->videodev), v4l2src->v4l2object->videodev),
GST_ERROR_SYSTEM); ("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; return FALSE;
} }
pixfmt_failed: pixfmt_failed:
{ {
GST_ELEMENT_ERROR (v4l2src, RESOURCE, SETTINGS, GST_ELEMENT_ERROR (v4l2src, RESOURCE, SETTINGS,
(_("Failed to set pixelformat to %s @ %dx%d for device %s: %s."), (_("Failed setting the video format for device '%s'"),
fmt->description, *width, *height, v4l2src->v4l2object->videodev), v4l2src->v4l2object->videodev),
GST_ERROR_SYSTEM); ("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; return FALSE;
} }
fail: fail:
@ -468,8 +474,8 @@ reqbufs_failed:
GST_ELEMENT_ERROR (v4l2src, RESOURCE, READ, GST_ELEMENT_ERROR (v4l2src, RESOURCE, READ,
(_("Could not get buffers from device '%s'."), (_("Could not get buffers from device '%s'."),
v4l2src->v4l2object->videodev), v4l2src->v4l2object->videodev),
("error requesting %d buffers. system error: %s", ("error requesting %d buffers. (%d - %s)",
v4l2src->breq.count, g_strerror (errno))); v4l2src->breq.count, errno, g_strerror (errno)));
return FALSE; return FALSE;
} }
broken_driver: broken_driver:
@ -477,8 +483,8 @@ broken_driver:
GST_ELEMENT_ERROR (v4l2src, RESOURCE, READ, GST_ELEMENT_ERROR (v4l2src, RESOURCE, READ,
(_("The driver of device '%s' is broken."), (_("The driver of device '%s' is broken."),
v4l2src->v4l2object->videodev), v4l2src->v4l2object->videodev),
("no supported read capability from %s", ("no supported read capability from %s. (%d - %s)",
v4l2src->v4l2object->videodev)); v4l2src->v4l2object->videodev, errno, strerror (errno)));
return FALSE; return FALSE;
} }
no_buffers: no_buffers:
@ -486,23 +492,28 @@ no_buffers:
GST_ELEMENT_ERROR (v4l2src, RESOURCE, READ, GST_ELEMENT_ERROR (v4l2src, RESOURCE, READ,
(_("Could not get enough buffers from device '%s'."), (_("Could not get enough buffers from device '%s'."),
v4l2src->v4l2object->videodev), v4l2src->v4l2object->videodev),
("we received %d, we want at least %d", ("we received %d from device '%s', we want at least %d. (%d - %s))",
v4l2src->breq.count, GST_V4L2_MIN_BUFFERS)); v4l2src->breq.count, v4l2src->v4l2object->videodev,
GST_V4L2_MIN_BUFFERS, errno, strerror (errno)));
v4l2src->breq.count = buffers; v4l2src->breq.count = buffers;
return FALSE; return FALSE;
} }
querybuf_failed: querybuf_failed:
{ {
GST_ELEMENT_ERROR (v4l2src, RESOURCE, READ, GST_ELEMENT_ERROR (v4l2src, RESOURCE, READ,
(_("Could not get buffer properties of buffer %d."), n), (_("Could not get properties of data comming from device '%s'"),
GST_ERROR_SYSTEM); v4l2src->v4l2object->videodev),
("Failed querying buffer properties. (%d - %s)",
errno, strerror (errno)));
gst_v4l2src_capture_deinit (v4l2src); gst_v4l2src_capture_deinit (v4l2src);
return FALSE; return FALSE;
} }
mmap_failed: mmap_failed:
{ {
GST_ELEMENT_ERROR (v4l2src, RESOURCE, READ, 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); gst_v4l2src_capture_deinit (v4l2src);
buffer->start = 0; buffer->start = 0;
return FALSE; return FALSE;
@ -545,7 +556,7 @@ gst_v4l2src_capture_start (GstV4l2Src * v4l2src)
streamon_failed: streamon_failed:
{ {
GST_ELEMENT_ERROR (v4l2src, RESOURCE, OPEN_READ, 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); v4l2src->v4l2object->videodev), GST_ERROR_SYSTEM);
return FALSE; return FALSE;
} }
@ -583,7 +594,7 @@ gst_v4l2src_capture_stop (GstV4l2Src * v4l2src)
streamoff_failed: streamoff_failed:
{ {
GST_ELEMENT_ERROR (v4l2src, RESOURCE, CLOSE, 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); v4l2src->v4l2object->videodev), GST_ERROR_SYSTEM);
return FALSE; return FALSE;
} }