v4l2: Fix input/output index sign

This is an unsigned integer in the kernel API.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/870>
This commit is contained in:
Nicolas Dufresne 2021-02-08 17:22:37 -05:00
parent 1094e2548e
commit ba3eddebc8
4 changed files with 24 additions and 24 deletions

View file

@ -68,8 +68,8 @@ typedef enum {
GST_V4L2_IO_DMABUF_IMPORT = 5
} GstV4l2IOMode;
typedef gboolean (*GstV4l2GetInOutFunction) (GstV4l2Object * v4l2object, gint * input);
typedef gboolean (*GstV4l2SetInOutFunction) (GstV4l2Object * v4l2object, gint input);
typedef gboolean (*GstV4l2GetInOutFunction) (GstV4l2Object * v4l2object, guint32 * input);
typedef gboolean (*GstV4l2SetInOutFunction) (GstV4l2Object * v4l2object, guint32 input);
typedef gboolean (*GstV4l2UpdateFpsFunction) (GstV4l2Object * v4l2object);
/* On Android NDK r18b the ioctl() signature uses 'unsigned' instead of
@ -325,10 +325,10 @@ gboolean gst_v4l2_close (GstV4l2Object * v4l2object);
/* norm/input/output */
gboolean gst_v4l2_get_norm (GstV4l2Object * v4l2object, v4l2_std_id * norm);
gboolean gst_v4l2_set_norm (GstV4l2Object * v4l2object, v4l2_std_id norm);
gboolean gst_v4l2_get_input (GstV4l2Object * v4l2object, gint * input);
gboolean gst_v4l2_set_input (GstV4l2Object * v4l2object, gint input);
gboolean gst_v4l2_get_output (GstV4l2Object * v4l2object, gint * output);
gboolean gst_v4l2_set_output (GstV4l2Object * v4l2object, gint output);
gboolean gst_v4l2_get_input (GstV4l2Object * v4l2object, guint32 * input);
gboolean gst_v4l2_set_input (GstV4l2Object * v4l2object, guint32 input);
gboolean gst_v4l2_get_output (GstV4l2Object * v4l2object, guint32 * output);
gboolean gst_v4l2_set_output (GstV4l2Object * v4l2object, guint32 output);
/* frequency control */
gboolean gst_v4l2_get_frequency (GstV4l2Object * v4l2object, gint tunernum, gulong * frequency);

View file

@ -161,7 +161,7 @@ not_a_tuner:
}
static gboolean
gst_v4l2radio_get_input (GstV4l2Object * v4l2object, gint * input)
gst_v4l2radio_get_input (GstV4l2Object * v4l2object, guint32 * input)
{
GST_DEBUG_OBJECT (v4l2object->element, "trying to get radio input");
@ -188,7 +188,7 @@ input_failed:
}
static gboolean
gst_v4l2radio_set_input (GstV4l2Object * v4l2object, gint input)
gst_v4l2radio_set_input (GstV4l2Object * v4l2object, guint32 input)
{
GST_DEBUG_OBJECT (v4l2object->element, "trying to set input to %d", input);

View file

@ -105,7 +105,7 @@ GstTunerChannel *
gst_v4l2_tuner_get_channel (GstV4l2Object * v4l2object)
{
GList *item;
gint channel;
guint32 channel;
/* assert that we're opened and that we're using a known item */
g_return_val_if_fail (GST_V4L2_IS_OPEN (v4l2object), NULL);
@ -229,7 +229,7 @@ gst_v4l2_tuner_set_frequency (GstV4l2Object * v4l2object,
GstTunerChannel * channel, gulong frequency)
{
GstV4l2TunerChannel *v4l2channel = GST_V4L2_TUNER_CHANNEL (channel);
gint chan;
guint32 chan;
/* assert that we're opened and that we're using a known item */
g_return_val_if_fail (GST_V4L2_IS_OPEN (v4l2object), FALSE);
@ -257,7 +257,7 @@ gst_v4l2_tuner_get_frequency (GstV4l2Object * v4l2object,
GstTunerChannel * channel)
{
GstV4l2TunerChannel *v4l2channel = GST_V4L2_TUNER_CHANNEL (channel);
gint chan;
guint32 chan;
gulong frequency = 0;
/* assert that we're opened and that we're using a known item */
@ -282,7 +282,7 @@ gst_v4l2_tuner_signal_strength (GstV4l2Object * v4l2object,
GstTunerChannel * channel)
{
GstV4l2TunerChannel *v4l2channel = GST_V4L2_TUNER_CHANNEL (channel);
gint chan;
guint32 chan;
gulong signal = 0;
/* assert that we're opened and that we're using a known item */

View file

@ -1083,9 +1083,9 @@ gst_v4l2_set_controls (GstV4l2Object * v4l2object, GstStructure * controls)
}
gboolean
gst_v4l2_get_input (GstV4l2Object * v4l2object, gint * input)
gst_v4l2_get_input (GstV4l2Object * v4l2object, guint32 * input)
{
gint n;
guint32 n;
GST_DEBUG_OBJECT (v4l2object->dbg_obj, "trying to get input");
@ -1097,7 +1097,7 @@ gst_v4l2_get_input (GstV4l2Object * v4l2object, gint * input)
*input = n;
GST_DEBUG_OBJECT (v4l2object->dbg_obj, "input: %d", n);
GST_DEBUG_OBJECT (v4l2object->dbg_obj, "input: %u", n);
return TRUE;
@ -1114,9 +1114,9 @@ input_failed:
}
gboolean
gst_v4l2_set_input (GstV4l2Object * v4l2object, gint input)
gst_v4l2_set_input (GstV4l2Object * v4l2object, guint32 input)
{
GST_DEBUG_OBJECT (v4l2object->dbg_obj, "trying to set input to %d", input);
GST_DEBUG_OBJECT (v4l2object->dbg_obj, "trying to set input to %u", input);
if (!GST_V4L2_IS_OPEN (v4l2object))
return FALSE;
@ -1133,16 +1133,16 @@ input_failed:
* support
*/
GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS,
(_("Failed to set input %d on device %s."),
(_("Failed to set input %u on device %s."),
input, v4l2object->videodev), GST_ERROR_SYSTEM);
}
return FALSE;
}
gboolean
gst_v4l2_get_output (GstV4l2Object * v4l2object, gint * output)
gst_v4l2_get_output (GstV4l2Object * v4l2object, guint32 * output)
{
gint n;
guint32 n;
GST_DEBUG_OBJECT (v4l2object->dbg_obj, "trying to get output");
@ -1154,7 +1154,7 @@ gst_v4l2_get_output (GstV4l2Object * v4l2object, gint * output)
*output = n;
GST_DEBUG_OBJECT (v4l2object->dbg_obj, "output: %d", n);
GST_DEBUG_OBJECT (v4l2object->dbg_obj, "output: %u", n);
return TRUE;
@ -1171,9 +1171,9 @@ output_failed:
}
gboolean
gst_v4l2_set_output (GstV4l2Object * v4l2object, gint output)
gst_v4l2_set_output (GstV4l2Object * v4l2object, guint32 output)
{
GST_DEBUG_OBJECT (v4l2object->dbg_obj, "trying to set output to %d", output);
GST_DEBUG_OBJECT (v4l2object->dbg_obj, "trying to set output to %u", output);
if (!GST_V4L2_IS_OPEN (v4l2object))
return FALSE;
@ -1190,7 +1190,7 @@ output_failed:
* support
*/
GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS,
(_("Failed to set output %d on device %s."),
(_("Failed to set output %u on device %s."),
output, v4l2object->videodev), GST_ERROR_SYSTEM);
}
return FALSE;