typefind: add GST_TYPE_FIND_NONE and use it
authorJosep Torra <n770galaxy@gmail.com>
Thu, 25 Aug 2011 21:49:38 +0000 (23:49 +0200)
committerJosep Torra <n770galaxy@gmail.com>
Fri, 26 Aug 2011 12:11:15 +0000 (14:11 +0200)
Fixes warning #188: enumerated type mixed with another type reported by ICC.

gst/gsttypefind.h
libs/gst/base/gsttypefindhelper.c

index 6e1f049..67ee0be 100644 (file)
@@ -44,6 +44,7 @@ typedef void (* GstTypeFindFunction) (GstTypeFind *find, gpointer data);
 
 /**
  * GstTypeFindProbability:
+ * @GST_TYPE_FIND_NONE: type undetected
  * @GST_TYPE_FIND_MINIMUM: unlikely typefind
  * @GST_TYPE_FIND_POSSIBLE: possible type detected
  * @GST_TYPE_FIND_LIKELY: likely a type was detected
@@ -54,6 +55,7 @@ typedef void (* GstTypeFindFunction) (GstTypeFind *find, gpointer data);
  * in doing a reliable typefind.
  */
 typedef enum {
+  GST_TYPE_FIND_NONE = 0,
   GST_TYPE_FIND_MINIMUM = 1,
   GST_TYPE_FIND_POSSIBLE = 50,
   GST_TYPE_FIND_LIKELY = 80,
index 8695b92..05f4bd5 100644 (file)
@@ -51,7 +51,7 @@ typedef struct
   guint64 size;
   guint64 last_offset;
   GstTypeFindHelperGetRangeFunction func;
-  guint best_probability;
+  GstTypeFindProbability best_probability;
   GstCaps *caps;
   GstTypeFindFactory *factory;  /* for logging */
   GstObject *obj;               /* for logging */
@@ -185,7 +185,8 @@ error:
  * If given @probability is higher, replace previously store caps.
  */
 static void
-helper_find_suggest (gpointer data, guint probability, const GstCaps * caps)
+helper_find_suggest (gpointer data, GstTypeFindProbability probability,
+    const GstCaps * caps)
 {
   GstTypeFindHelper *helper = (GstTypeFindHelper *) data;
 
@@ -263,7 +264,7 @@ gst_type_find_helper_get_range_ext (GstObject * obj,
   helper.size = size;
   helper.last_offset = 0;
   helper.func = func;
-  helper.best_probability = 0;
+  helper.best_probability = GST_TYPE_FIND_NONE;
   helper.caps = NULL;
   helper.obj = obj;
 
@@ -408,7 +409,7 @@ typedef struct
 {
   guint8 *data;                 /* buffer data */
   guint size;
-  guint best_probability;
+  GstTypeFindProbability best_probability;
   GstCaps *caps;
   GstTypeFindFactory *factory;  /* for logging */
   GstObject *obj;               /* for logging */
@@ -458,7 +459,8 @@ buf_helper_find_peek (gpointer data, gint64 off, guint size)
  * If given @probability is higher, replace previously store caps.
  */
 static void
-buf_helper_find_suggest (gpointer data, guint probability, const GstCaps * caps)
+buf_helper_find_suggest (gpointer data, GstTypeFindProbability probability,
+    const GstCaps * caps)
 {
   GstTypeFindBufHelper *helper = (GstTypeFindBufHelper *) data;
 
@@ -516,7 +518,7 @@ gst_type_find_helper_for_buffer (GstObject * obj, GstBuffer * buf,
 
   helper.data = GST_BUFFER_DATA (buf);
   helper.size = GST_BUFFER_SIZE (buf);
-  helper.best_probability = 0;
+  helper.best_probability = GST_TYPE_FIND_NONE;
   helper.caps = NULL;
   helper.obj = obj;