Class (GI Struct)

Gst-1.0GstTypeFind

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

Index

Constructors

Properties

data: any
$gtype: GType<TypeFind>

Methods

  • Get the length of the data stream.

    Returns number

    The length of the data stream, or 0 if it is not available.

  • 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.

    Parameters

    • offset: number

      The offset

    • size: number

      The number of bytes to return

    Returns number

    the requested data, or null if that data is not available.

  • If a Gst.TypeFindFunction calls this function it suggests caps of the given media_type with the given probability.

    This function is similar to gst_type_find_suggest_simple(), but uses a Gst.Caps with no fields.

    Parameters

    • probability: number

      The probability in percent that the suggestion is right

    • media_type: string

      the media type of the suggested caps

    Returns void

  • 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.

    Parameters

    • plugin: Gst.Plugin

      A Gst.Plugin, or null for a static typefind function

    • name: string

      The name for registering

    • rank: number

      The rank (or importance) of this typefind function

    • func: TypeFindFunction
    • Optionalextensions: string

      Optional comma-separated list of extensions that could belong to this type

    • Optionalpossible_caps: Gst.Caps

      Optionally the caps that could be returned when typefinding succeeds

    Returns boolean