From: Nicolas Dufresne Date: Mon, 8 Feb 2021 22:22:37 +0000 (-0500) Subject: v4l2: Fix input/output index sign X-Git-Tag: 1.19.3~509^2~282 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba3eddebc87ea05d1cd1b6593f8f1f37da464a0d;p=platform%2Fupstream%2Fgstreamer.git v4l2: Fix input/output index sign This is an unsigned integer in the kernel API. Part-of: --- diff --git a/sys/v4l2/gstv4l2object.h b/sys/v4l2/gstv4l2object.h index a6604bd..e29783c 100644 --- a/sys/v4l2/gstv4l2object.h +++ b/sys/v4l2/gstv4l2object.h @@ -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); diff --git a/sys/v4l2/gstv4l2radio.c b/sys/v4l2/gstv4l2radio.c index ab7c76d..5cbc18c 100644 --- a/sys/v4l2/gstv4l2radio.c +++ b/sys/v4l2/gstv4l2radio.c @@ -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); diff --git a/sys/v4l2/gstv4l2tuner.c b/sys/v4l2/gstv4l2tuner.c index 66cc2c1..c08b2ca 100644 --- a/sys/v4l2/gstv4l2tuner.c +++ b/sys/v4l2/gstv4l2tuner.c @@ -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 */ diff --git a/sys/v4l2/v4l2_calls.c b/sys/v4l2/v4l2_calls.c index bbe1819..54cdd0b 100644 --- a/sys/v4l2/v4l2_calls.c +++ b/sys/v4l2/v4l2_calls.c @@ -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;