mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
sys/v4l2/v4l2_calls.c: add comments and more debug logging
Original commit message from CVS: * sys/v4l2/v4l2_calls.c: (gst_v4l2_fill_lists): add comments and more debug logging
This commit is contained in:
parent
3b4f4554a6
commit
7c063cc950
1 changed files with 16 additions and 4 deletions
|
@ -85,6 +85,7 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
|
||||||
if (dir != GST_PAD_SINK) {
|
if (dir != GST_PAD_SINK) {
|
||||||
#endif /* #if 0 - output not handled by now */
|
#endif /* #if 0 - output not handled by now */
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (v4l2object->element, " inputs");
|
||||||
/* and now, the inputs */
|
/* and now, the inputs */
|
||||||
for (n = 0;; n++) {
|
for (n = 0;; n++) {
|
||||||
struct v4l2_input input;
|
struct v4l2_input input;
|
||||||
|
@ -180,6 +181,7 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
|
||||||
}
|
}
|
||||||
#endif /* #if 0 - output not handled by now */
|
#endif /* #if 0 - output not handled by now */
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (v4l2object->element, " norms");
|
||||||
/* norms... */
|
/* norms... */
|
||||||
for (n = 0;; n++) {
|
for (n = 0;; n++) {
|
||||||
struct v4l2_standard standard;
|
struct v4l2_standard standard;
|
||||||
|
@ -208,20 +210,24 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
|
||||||
v4l2object->stds = g_list_append (v4l2object->stds, (gpointer) norm);
|
v4l2object->stds = g_list_append (v4l2object->stds, (gpointer) norm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (v4l2object->element, " controls+menus");
|
||||||
/* and lastly, controls+menus (if appropriate) */
|
/* and lastly, controls+menus (if appropriate) */
|
||||||
for (n = V4L2_CID_BASE;; n++) {
|
for (n = V4L2_CID_BASE;; n++) {
|
||||||
struct v4l2_queryctrl control;
|
struct v4l2_queryctrl control;
|
||||||
GstV4l2ColorBalanceChannel *v4l2channel;
|
GstV4l2ColorBalanceChannel *v4l2channel;
|
||||||
GstColorBalanceChannel *channel;
|
GstColorBalanceChannel *channel;
|
||||||
|
|
||||||
/* hacky... */
|
/* when we reached the last official CID, continue with private CIDs */
|
||||||
if (n == V4L2_CID_LASTP1)
|
if (n == V4L2_CID_LASTP1) {
|
||||||
|
GST_DEBUG_OBJECT (v4l2object->element, "chhecking private CIDs");
|
||||||
n = V4L2_CID_PRIVATE_BASE;
|
n = V4L2_CID_PRIVATE_BASE;
|
||||||
|
}
|
||||||
|
|
||||||
control.id = n;
|
control.id = n;
|
||||||
if (ioctl (v4l2object->video_fd, VIDIOC_QUERYCTRL, &control) < 0) {
|
if (ioctl (v4l2object->video_fd, VIDIOC_QUERYCTRL, &control) < 0) {
|
||||||
if (errno == EINVAL) {
|
if (errno == EINVAL) {
|
||||||
if (n < V4L2_CID_PRIVATE_BASE)
|
if (n < V4L2_CID_PRIVATE_BASE)
|
||||||
|
/* continue so that we also check private controls */
|
||||||
continue;
|
continue;
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
|
@ -249,17 +255,19 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
|
||||||
case V4L2_CID_EXPOSURE:
|
case V4L2_CID_EXPOSURE:
|
||||||
case V4L2_CID_AUTOGAIN:
|
case V4L2_CID_AUTOGAIN:
|
||||||
case V4L2_CID_GAIN:
|
case V4L2_CID_GAIN:
|
||||||
/* we only handle these for now */
|
/* we only handle these for now (why?) */
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
GST_DEBUG_OBJECT (v4l2object->element,
|
GST_DEBUG_OBJECT (v4l2object->element,
|
||||||
"ControlID %s (%d) unhandled, FIXME", control.name, n);
|
"ControlID %s (%x) unhandled, FIXME", control.name, n);
|
||||||
control.id++;
|
control.id++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (n != control.id)
|
if (n != control.id)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (v4l2object->element,
|
||||||
|
"Adding ControlID %s (%x)", control.name, n);
|
||||||
v4l2channel = g_object_new (GST_TYPE_V4L2_COLOR_BALANCE_CHANNEL, NULL);
|
v4l2channel = g_object_new (GST_TYPE_V4L2_COLOR_BALANCE_CHANNEL, NULL);
|
||||||
channel = GST_COLOR_BALANCE_CHANNEL (v4l2channel);
|
channel = GST_COLOR_BALANCE_CHANNEL (v4l2channel);
|
||||||
channel->label = g_strdup ((const gchar *) control.name);
|
channel->label = g_strdup ((const gchar *) control.name);
|
||||||
|
@ -301,6 +309,9 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
|
||||||
channel->max_value = TRUE;
|
channel->max_value = TRUE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
GST_DEBUG_OBJECT (v4l2object->element,
|
||||||
|
"No range for ControlID %s (%x), type=%d",
|
||||||
|
control.name, n, control.type);
|
||||||
channel->min_value = channel->max_value = 0;
|
channel->min_value = channel->max_value = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -308,6 +319,7 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
|
||||||
v4l2object->colors = g_list_append (v4l2object->colors, (gpointer) channel);
|
v4l2object->colors = g_list_append (v4l2object->colors, (gpointer) channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (v4l2object->element, "done");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue