| Copyright | Will Thompson and Iñaki García Etxebarria |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
GI.Gst.Structs.TypeFind
Description
The following functions allow you to detect the media type of an unknown stream.
Synopsis
- newtype TypeFind = TypeFind (ManagedPtr TypeFind)
- newZeroTypeFind :: MonadIO m => m TypeFind
- typeFindGetLength :: (HasCallStack, MonadIO m) => TypeFind -> m Word64
- typeFindPeek :: (HasCallStack, MonadIO m) => TypeFind -> Int64 -> Word32 -> m Word8
- typeFindRegister :: (HasCallStack, MonadIO m, IsPlugin a) => Maybe a -> Text -> Word32 -> TypeFindFunction -> Maybe Text -> Maybe Caps -> m Bool
- typeFindSuggest :: (HasCallStack, MonadIO m) => TypeFind -> Word32 -> Caps -> m ()
- typeFindSuggestEmptySimple :: (HasCallStack, MonadIO m) => TypeFind -> Word32 -> Text -> m ()
- clearTypeFindData :: MonadIO m => TypeFind -> m ()
- getTypeFindData :: MonadIO m => TypeFind -> m (Ptr ())
- setTypeFindData :: MonadIO m => TypeFind -> Ptr () -> m ()
- clearTypeFindGetLength :: MonadIO m => TypeFind -> m ()
- getTypeFindGetLength :: MonadIO m => TypeFind -> m (Maybe TypeFindGetLengthFieldCallback_WithClosures)
- setTypeFindGetLength :: MonadIO m => TypeFind -> FunPtr C_TypeFindGetLengthFieldCallback -> m ()
- clearTypeFindPeek :: MonadIO m => TypeFind -> m ()
- getTypeFindPeek :: MonadIO m => TypeFind -> m (Maybe TypeFindPeekFieldCallback)
- setTypeFindPeek :: MonadIO m => TypeFind -> FunPtr C_TypeFindPeekFieldCallback -> m ()
- clearTypeFindSuggest :: MonadIO m => TypeFind -> m ()
- getTypeFindSuggest :: MonadIO m => TypeFind -> m (Maybe TypeFindSuggestFieldCallback)
- setTypeFindSuggest :: MonadIO m => TypeFind -> FunPtr C_TypeFindSuggestFieldCallback -> m ()
Exported types
Memory-managed wrapper type.
Instances
| Eq TypeFind Source # | |
| BoxedPtr TypeFind Source # | |
Defined in GI.Gst.Structs.TypeFind | |
| CallocPtr TypeFind Source # | |
Defined in GI.Gst.Structs.TypeFind Methods boxedPtrCalloc :: IO (Ptr TypeFind) | |
| ManagedPtrNewtype TypeFind Source # | |
Defined in GI.Gst.Structs.TypeFind Methods toManagedPtr :: TypeFind -> ManagedPtr TypeFind | |
| tag ~ 'AttrSet => Constructible TypeFind tag Source # | |
Methods
Click to display all available methods, including inherited ones
getLength
Arguments
| :: (HasCallStack, MonadIO m) | |
| => TypeFind |
|
| -> m Word64 | Returns: The length of the data stream, or 0 if it is not available. |
Get the length of the data stream.
peek
Arguments
| :: (HasCallStack, MonadIO m) | |
| => TypeFind |
|
| -> Int64 |
|
| -> Word32 |
|
| -> m Word8 | Returns: the
requested data, or |
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.
register
Arguments
| :: (HasCallStack, MonadIO m, IsPlugin a) | |
| => Maybe a | |
| -> Text |
|
| -> Word32 |
|
| -> TypeFindFunction |
|
| -> Maybe Text |
|
| -> Maybe Caps |
|
| -> m Bool |
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.
suggest
Arguments
| :: (HasCallStack, MonadIO m) | |
| => TypeFind |
|
| -> Word32 |
|
| -> Caps |
|
| -> m () |
If a TypeFindFunction calls this function it suggests the caps with the
given probability. A TypeFindFunction may supply different suggestions
in one call.
It is up to the caller of the TypeFindFunction to interpret these values.
suggestEmptySimple
typeFindSuggestEmptySimple Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => TypeFind |
|
| -> Word32 |
|
| -> Text |
|
| -> m () |
If a TypeFindFunction calls this function it suggests caps of the
given mediaType with the given probability.
This function is similar to gst_type_find_suggest_simple(), but uses
a Caps with no fields.
Since: 1.20
Properties
data
The data used by the caller of the typefinding function.
clearTypeFindData :: MonadIO m => TypeFind -> m () Source #
Set the value of the “data” field to Nothing.
When overloading is enabled, this is equivalent to
clear #data
getTypeFindData :: MonadIO m => TypeFind -> m (Ptr ()) Source #
Get the value of the “data” field.
When overloading is enabled, this is equivalent to
get typeFind #data
setTypeFindData :: MonadIO m => TypeFind -> Ptr () -> m () Source #
Set the value of the “data” field.
When overloading is enabled, this is equivalent to
settypeFind [ #data:=value ]
getLength
Returns the length of current data.
clearTypeFindGetLength :: MonadIO m => TypeFind -> m () Source #
Set the value of the “get_length” field to Nothing.
When overloading is enabled, this is equivalent to
clear #getLength
getTypeFindGetLength :: MonadIO m => TypeFind -> m (Maybe TypeFindGetLengthFieldCallback_WithClosures) Source #
Get the value of the “get_length” field.
When overloading is enabled, this is equivalent to
get typeFind #getLength
setTypeFindGetLength :: MonadIO m => TypeFind -> FunPtr C_TypeFindGetLengthFieldCallback -> m () Source #
Set the value of the “get_length” field.
When overloading is enabled, this is equivalent to
settypeFind [ #getLength:=value ]
peek
Method to peek data.
clearTypeFindPeek :: MonadIO m => TypeFind -> m () Source #
Set the value of the “peek” field to Nothing.
When overloading is enabled, this is equivalent to
clear #peek
getTypeFindPeek :: MonadIO m => TypeFind -> m (Maybe TypeFindPeekFieldCallback) Source #
Get the value of the “peek” field.
When overloading is enabled, this is equivalent to
get typeFind #peek
setTypeFindPeek :: MonadIO m => TypeFind -> FunPtr C_TypeFindPeekFieldCallback -> m () Source #
Set the value of the “peek” field.
When overloading is enabled, this is equivalent to
settypeFind [ #peek:=value ]
suggest
Method to suggest Caps with a given probability.
clearTypeFindSuggest :: MonadIO m => TypeFind -> m () Source #
Set the value of the “suggest” field to Nothing.
When overloading is enabled, this is equivalent to
clear #suggest
getTypeFindSuggest :: MonadIO m => TypeFind -> m (Maybe TypeFindSuggestFieldCallback) Source #
Get the value of the “suggest” field.
When overloading is enabled, this is equivalent to
get typeFind #suggest
setTypeFindSuggest :: MonadIO m => TypeFind -> FunPtr C_TypeFindSuggestFieldCallback -> m () Source #
Set the value of the “suggest” field.
When overloading is enabled, this is equivalent to
settypeFind [ #suggest:=value ]