Commit 306e317a authored by Josep Torra's avatar Josep Torra

typefind: add GST_TYPE_FIND_NONE and use it

Fixes warning #188: enumerated type mixed with another type reported by ICC.
parent 81794a42
......@@ -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,
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment