Skip to content
Snippets Groups Projects
Commit 293abe06 authored by Nicolas Dufresne's avatar Nicolas Dufresne
Browse files

v4l2: Add helper to query input status

This is a wrapper around ENUM_INPUT renamed for readability.

Part-of: <!870>
parent ba3eddeb
No related branches found
No related tags found
1 merge request!870v4l2src: Add source-change / resolution-change support
......@@ -327,6 +327,7 @@ gboolean gst_v4l2_get_norm (GstV4l2Object * v4l2object, v4l2_std_id *
gboolean gst_v4l2_set_norm (GstV4l2Object * v4l2object, v4l2_std_id norm);
gboolean gst_v4l2_get_input (GstV4l2Object * v4l2object, guint32 * input);
gboolean gst_v4l2_set_input (GstV4l2Object * v4l2object, guint32 input);
gboolean gst_v4l2_query_input (GstV4l2Object * v4l2object, struct v4l2_input * input);
gboolean gst_v4l2_get_output (GstV4l2Object * v4l2object, guint32 * output);
gboolean gst_v4l2_set_output (GstV4l2Object * v4l2object, guint32 output);
......@@ -341,7 +342,6 @@ gboolean gst_v4l2_set_attribute (GstV4l2Object * v4l2object, int attribute
gboolean gst_v4l2_set_string_attribute (GstV4l2Object * v4l2object, int attribute_num, const char *value);
gboolean gst_v4l2_set_controls (GstV4l2Object * v4l2object, GstStructure * controls);
/* events */
gboolean gst_v4l2_subscribe_event (GstV4l2Object * v4l2object, guint32 event);
gboolean gst_v4l2_dequeue_event (GstV4l2Object * v4l2object, struct v4l2_event *event);
......
......@@ -1139,6 +1139,21 @@ input_failed:
return FALSE;
}
gboolean
gst_v4l2_query_input (GstV4l2Object * obj, struct v4l2_input * input)
{
gint ret;
ret = obj->ioctl (obj->video_fd, VIDIOC_ENUMINPUT, input);
if (ret < 0) {
GST_WARNING_OBJECT (obj->dbg_obj, "Failed to read input state: %s (%i)",
g_strerror (errno), errno);
return FALSE;
}
return TRUE;
}
gboolean
gst_v4l2_get_output (GstV4l2Object * v4l2object, guint32 * output)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment