![]() |
![]() |
![]() |
GStreamer 0.10 Core Reference Manual | ![]() |
---|---|---|---|---|
#include <gst/gst.h> GstTypeFind; void (*GstTypeFindFunction) (GstTypeFind *find, gpointer data); enum GstTypeFindProbability; guint8* gst_type_find_peek (GstTypeFind *find, gint64 offset, guint size); void gst_type_find_suggest (GstTypeFind *find, guint probability, const GstCaps *caps); guint64 gst_type_find_get_length (GstTypeFind *find); gboolean gst_type_find_register (GstPlugin *plugin, const gchar *name, guint rank, GstTypeFindFunction func, gchar **extensions, const GstCaps *possible_caps, gpointer data, GDestroyNotify data_notify);
The following functions allow you to detect the media type of an unknown stream.
Last reviewed on 2005-11-09 (0.9.4)
typedef struct { /* private to the caller of the typefind function */ guint8 * (* peek) (gpointer data, gint64 offset, guint size); void (* suggest) (gpointer data, guint probability, const GstCaps * caps); gpointer data; /* optional */ guint64 (* get_length) (gpointer data); } GstTypeFind;
Object that stores typefind callbacks. To use with GstTypeFindFactory.
peek
()peek
Method to peek data.
Method to peek data.
suggest
()suggest
Method to suggest GstCaps with a given probability.
Method to suggest GstCaps with a given probability.
GstCapsGstCapsgpointer data
;gpointerdata
The data used by the caller of the typefinding function.
The data used by the caller of the typefinding function.
get_length
()get_length
Returns the length of current data.
Returns the length of current data.
peek () |
Method to peek data. |
suggest () |
Method to suggest GstCaps with a given probability. |
gpointer data ; |
The data used by the caller of the typefinding function. |
get_length () |
Returns the length of current data. |
void (*GstTypeFindFunction) (GstTypeFind *find, gpointer data);
A function that will be called by typefinding.
find
:find
A GstTypeFind structure
A GstTypeFind structure
GstTypeFindGstTypeFinddata
:data
optionnal data to pass to the function
optionnal data to pass to the function
find : |
A GstTypeFind structure |
data : |
optionnal data to pass to the function |
typedef enum { GST_TYPE_FIND_MINIMUM = 1, GST_TYPE_FIND_POSSIBLE = 50, GST_TYPE_FIND_LIKELY = 80, GST_TYPE_FIND_NEARLY_CERTAIN = 99, GST_TYPE_FIND_MAXIMUM = 100 } GstTypeFindProbability;
The probability of the typefind function. Higher values have more certainty in doing a reliable typefind.
GST_TYPE_FIND_MINIMUM
GST_TYPE_FIND_MINIMUM
unlikely typefind
unlikely typefind
GST_TYPE_FIND_POSSIBLE
GST_TYPE_FIND_POSSIBLE
possible type detected
possible type detected
GST_TYPE_FIND_LIKELY
GST_TYPE_FIND_LIKELY
likely a type was detected
likely a type was detected
GST_TYPE_FIND_NEARLY_CERTAIN
GST_TYPE_FIND_NEARLY_CERTAIN
nearly certain that a type was detected
nearly certain that a type was detected
GST_TYPE_FIND_MAXIMUM
GST_TYPE_FIND_MAXIMUM
very certain a type was detected.
very certain a type was detected.
guint8* gst_type_find_peek (GstTypeFind *find, gint64 offset, guint size);
Returns the size
bytes of the stream to identify beginning at offset. If
offset is a positive number, the offset is relative to the beginning of the
stream, if offset is a negative number the offset is relative to the end of
the stream. The returned memory is valid until the typefinding function
returns and must not be freed.
find
:find
The GstTypeFind object the function was called with
The GstTypeFind object the function was called with
GstTypeFindGstTypeFindoffset
:offset
The offset
The offset
size
:size
The number of bytes to return
The number of bytes to return
Returns :Returns the requested data, or NULL if that data is not available.
the requested data, or NULL if that data is not available.
find : |
The GstTypeFind object the function was called with |
offset : |
The offset |
size : |
The number of bytes to return |
Returns : | the requested data, or NULL if that data is not available. |
void gst_type_find_suggest (GstTypeFind *find, guint probability, const GstCaps *caps);
If a GstTypeFindFunction calls this function it suggests the caps with the given probability. A GstTypeFindFunction may supply different suggestions in one call. It is up to the caller of the GstTypeFindFunction to interpret these values.
find
:find
The GstTypeFind object the function was called with
The GstTypeFind object the function was called with
GstTypeFindGstTypeFindprobability
:probability
The probability in percent that the suggestion is right
The probability in percent that the suggestion is right
caps
:caps
The fixed GstCaps to suggest
The fixed GstCaps to suggest
GstCapsGstCaps
find : |
The GstTypeFind object the function was called with |
probability : |
The probability in percent that the suggestion is right |
caps : |
The fixed GstCaps to suggest |
guint64 gst_type_find_get_length (GstTypeFind *find);
Get the length of the data stream.
find
:find
The GstTypeFind the function was called with
The GstTypeFind the function was called with
GstTypeFindGstTypeFindReturns :Returns The length of the data stream, or 0 if it is not available.
The length of the data stream, or 0 if it is not available.
find : |
The GstTypeFind the function was called with |
Returns : | The length of the data stream, or 0 if it is not available. |
gboolean gst_type_find_register (GstPlugin *plugin, const gchar *name, guint rank, GstTypeFindFunction func, gchar **extensions, const GstCaps *possible_caps, gpointer data, GDestroyNotify data_notify);
Registers a new typefind function to be used for typefinding. After registering this function will be available for typefinding. This function is typically called during an element's plugin initialization.
plugin
:plugin
A GstPlugin.
A GstPlugin.
GstPluginGstPluginname
:name
The name for registering
The name for registering
rank
:rank
The rank (or importance) of this typefind function
The rank (or importance) of this typefind function
func
:func
The GstTypeFindFunction to use
The GstTypeFindFunction to use
GstTypeFindFunctionGstTypeFindFunctionextensions
:extensions
Optional extensions that could belong to this type
Optional extensions that could belong to this type
possible_caps
:possible_caps
Optionally the caps that could be returned when typefinding
succeeds
Optionally the caps that could be returned when typefinding
succeeds
data
:data
Optional user data. This user data must be available until the plugin
is unloaded.
Optional user data. This user data must be available until the plugin
is unloaded.
data_notify
:data_notify
a GDestroyNotify that will be called on data
when the plugin
is unloaded.
a GDestroyNotify that will be called on data
when the plugin
is unloaded.
GDestroyNotifyGDestroyNotifydata
Returns :Returns TRUE on success, FALSE otherwise
TRUE on success, FALSE otherwise
plugin : |
A GstPlugin. |
name : |
The name for registering |
rank : |
The rank (or importance) of this typefind function |
func : |
The GstTypeFindFunction to use |
extensions : |
Optional extensions that could belong to this type |
possible_caps : |
Optionally the caps that could be returned when typefinding succeeds |
data : |
Optional user data. This user data must be available until the plugin is unloaded. |
data_notify : |
a GDestroyNotify that will be called on data when the plugin
is unloaded.
|
Returns : | TRUE on success, FALSE otherwise |