diff --git a/gst/gsttypefind.h b/gst/gsttypefind.h index 6e1f049786..67ee0bedaa 100644 --- a/gst/gsttypefind.h +++ b/gst/gsttypefind.h @@ -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, diff --git a/libs/gst/base/gsttypefindhelper.c b/libs/gst/base/gsttypefindhelper.c index 8695b92917..05f4bd5e70 100644 --- a/libs/gst/base/gsttypefindhelper.c +++ b/libs/gst/base/gsttypefindhelper.c @@ -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;