Next: , Previous: GstTypeFindFactory, Up: Top


40 GstTypeFind

Stream type detection

40.1 Overview

The following functions allow you to detect the media type of an unknown stream.

Last reviewed on 2005-11-09 (0.9.4)

40.2 Usage

— Function: gst-type-find-peek (self <gst-type-find*>) (offset int64) (size unsigned-int)   (ret <guint8*>)

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
The <gst-type-find> object the function was called with
offset
The offset
size
The number of bytes to return
ret
the requested data, or NULL if that data is not available.
— Function: gst-type-find-suggest (self <gst-type-find*>) (probability unsigned-int) (caps <gst-caps>)

If a <gst-type-find-function> calls this function it suggests the caps with the given probability. A <gst-type-find-function> may supply different suggestions in one call. It is up to the caller of the <gst-type-find-function> to interpret these values.

find
The <gst-type-find> object the function was called with
probability
The probability in percent that the suggestion is right
caps
The fixed <gst-caps> to suggest
— Function: gst-type-find-get-length (self <gst-type-find*>)   (ret unsigned-int64)

Get the length of the data stream.

find
The <gst-type-find> the function was called with
ret
The length of the data stream, or 0 if it is not available.
— Function: gst-type-find-register (plugin <gst-plugin>) (name mchars) (rank unsigned-int) (func <gst-type-find-function>) (possible_caps <gst-caps>) (data <gpointer>) (data_notify <g-destroy-notify>)   (ret bool) (extensions mchars)

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
A <gst-plugin>.
name
The name for registering
rank
The rank (or importance) of this typefind function
func
The <gst-type-find-function> 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 <g-destroy-notify> that will be called on data when the plugin is unloaded.
ret
TRUE on success, FALSE otherwise