Commit 51af7c95 authored by Thomas Bluemel's avatar Thomas Bluemel Committed by Nicolas Dufresne

typefind: Add ability to check for EOS.

Adds gst_type_find_is_eos () to allow type finding to hold off
on suggestions until the last moment.
parent 09909d37
Pipeline #47910 failed with stages
in 65 minutes and 17 seconds
......@@ -213,3 +213,22 @@ gst_type_find_get_length (GstTypeFind * find)
return find->get_length (find->data);
}
/**
* gst_type_find_is_eos:
* @find: The #GstTypeFind the function was called with
*
* Returns whether the end of the data stream has been reached
*
* Returns: %TRUE if the end of the data stream has been reached, %FALSE otherwise
*
* Since: 1.18
*/
gboolean
gst_type_find_is_eos (GstTypeFind * find)
{
if (find->is_eos == NULL)
return FALSE;
return find->is_eos (find->data);
}
......@@ -87,8 +87,10 @@ struct _GstTypeFind {
/* optional */
guint64 (* get_length) (gpointer data);
gboolean ( *is_eos) (gpointer data);
/* <private> */
gpointer _gst_reserved[GST_PADDING];
gpointer _gst_reserved[GST_PADDING - 1];
};
/**
......@@ -115,6 +117,9 @@ void gst_type_find_suggest_simple (GstTypeFind * find,
GST_API
guint64 gst_type_find_get_length (GstTypeFind * find);
GST_API
gboolean gst_type_find_is_eos (GstTypeFind * find);
/* registration interface */
GST_API
......
This diff is collapsed.
......@@ -38,6 +38,13 @@ GstCaps * gst_type_find_helper_for_data (GstObject *obj,
gsize size,
GstTypeFindProbability *prob);
GST_BASE_API
GstCaps * gst_type_find_helper_for_data_full (GstObject *obj,
const guint8 *data,
gsize size,
gboolean at_eos,
GstTypeFindProbability *prob);
GST_BASE_API
GstCaps * gst_type_find_helper_for_data_with_extension (GstObject *obj,
const guint8 *data,
......@@ -45,6 +52,14 @@ GstCaps * gst_type_find_helper_for_data_with_extension (GstObject *
const gchar *extension,
GstTypeFindProbability *prob);
GST_BASE_API
GstCaps * gst_type_find_helper_for_data_with_extension_full (GstObject *obj,
const guint8 *data,
gsize size,
gboolean at_eos,
const gchar *extension,
GstTypeFindProbability *prob);
GST_BASE_API
GstCaps * gst_type_find_helper_for_buffer (GstObject *obj,
GstBuffer *buf,
......@@ -56,6 +71,13 @@ GstCaps * gst_type_find_helper_for_buffer_with_extension (GstObject
const gchar *extension,
GstTypeFindProbability *prob);
GST_BASE_API
GstCaps * gst_type_find_helper_for_buffer_with_extension_full (GstObject *obj,
GstBuffer *buf,
gboolean at_eos,
const gchar *extension,
GstTypeFindProbability *prob);
GST_BASE_API
GstCaps * gst_type_find_helper_for_extension (GstObject * obj,
const gchar * extension);
......
......@@ -949,8 +949,9 @@ gst_type_find_element_chain_do_typefinding (GstTypeFindElement * typefind,
ext = gst_type_find_get_extension (typefind, typefind->sink);
/* map all available data */
data = gst_adapter_map (typefind->adapter, avail);
caps = gst_type_find_helper_for_data_with_extension (GST_OBJECT (typefind),
data, avail, ext, &probability);
caps =
gst_type_find_helper_for_data_with_extension_full (GST_OBJECT
(typefind), data, avail, at_eos, ext, &probability);
gst_adapter_unmap (typefind->adapter);
g_free (ext);
......
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