| Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.GstAudio.Functions
Contents
- Methods
- audioBufferClip
- audioBufferReorderChannels
- audioChannelGetFallbackMask
- audioChannelPositionsFromMask
- audioChannelPositionsToMask
- audioChannelPositionsToString
- audioChannelPositionsToValidOrder
- audioCheckValidChannelPositions
- audioClippingMetaApiGetType
- audioDownmixMetaApiGetType
- audioFormatInfoGetType
- audioGetChannelReorderMap
- audioIec61937FrameSize
- audioIec61937Payload
- audioReorderChannels
- bufferAddAudioClippingMeta
- bufferAddAudioDownmixMeta
- bufferGetAudioDownmixMetaForChannels
Description
Synopsis
- audioBufferClip :: (HasCallStack, MonadIO m) => Buffer -> Segment -> Int32 -> Int32 -> m Buffer
- audioBufferReorderChannels :: (HasCallStack, MonadIO m) => Buffer -> AudioFormat -> Int32 -> [AudioChannelPosition] -> [AudioChannelPosition] -> m Bool
- audioChannelGetFallbackMask :: (HasCallStack, MonadIO m) => Int32 -> m Word64
- audioChannelPositionsFromMask :: (HasCallStack, MonadIO m) => Word64 -> [AudioChannelPosition] -> m Bool
- audioChannelPositionsToMask :: (HasCallStack, MonadIO m) => [AudioChannelPosition] -> Bool -> m (Bool, Word64)
- audioChannelPositionsToString :: (HasCallStack, MonadIO m) => [AudioChannelPosition] -> m Text
- audioChannelPositionsToValidOrder :: (HasCallStack, MonadIO m) => [AudioChannelPosition] -> m Bool
- audioCheckValidChannelPositions :: (HasCallStack, MonadIO m) => [AudioChannelPosition] -> Bool -> m Bool
- audioClippingMetaApiGetType :: (HasCallStack, MonadIO m) => m GType
- audioDownmixMetaApiGetType :: (HasCallStack, MonadIO m) => m GType
- audioFormatInfoGetType :: (HasCallStack, MonadIO m) => m GType
- audioGetChannelReorderMap :: (HasCallStack, MonadIO m) => Int32 -> [AudioChannelPosition] -> [AudioChannelPosition] -> [Int32] -> m Bool
- audioIec61937FrameSize :: (HasCallStack, MonadIO m) => AudioRingBufferSpec -> m Word32
- audioIec61937Payload :: (HasCallStack, MonadIO m) => ByteString -> ByteString -> AudioRingBufferSpec -> Int32 -> m Bool
- audioReorderChannels :: (HasCallStack, MonadIO m) => ByteString -> AudioFormat -> Int32 -> [AudioChannelPosition] -> [AudioChannelPosition] -> m Bool
- bufferAddAudioClippingMeta :: (HasCallStack, MonadIO m) => Buffer -> Format -> Word64 -> Word64 -> m AudioClippingMeta
- bufferAddAudioDownmixMeta :: (HasCallStack, MonadIO m) => Buffer -> [AudioChannelPosition] -> [AudioChannelPosition] -> Float -> m AudioDownmixMeta
- bufferGetAudioDownmixMetaForChannels :: (HasCallStack, MonadIO m) => Buffer -> [AudioChannelPosition] -> m AudioDownmixMeta
Methods
audioBufferClip
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Buffer |
|
| -> Segment |
|
| -> Int32 |
|
| -> Int32 |
|
| -> m Buffer | Returns: If the buffer has no timestamp, it is assumed to be inside the segment and is not clipped |
Clip the buffer to the given GstSegment.
After calling this function the caller does not own a reference to
buffer anymore.
audioBufferReorderChannels
audioBufferReorderChannels Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Buffer |
|
| -> AudioFormat |
|
| -> Int32 |
|
| -> [AudioChannelPosition] |
|
| -> [AudioChannelPosition] |
|
| -> m Bool | Returns: |
Reorders buffer from the channel positions from to the channel
positions to. from and to must contain the same number of
positions and the same positions, only in a different order.
buffer must be writable.
audioChannelGetFallbackMask
audioChannelGetFallbackMask Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Int32 |
|
| -> m Word64 | Returns: a fallback channel-mask for |
Get the fallback channel-mask for the given number of channels.
This function returns a reasonable fallback channel-mask and should be called as a last resort when the specific channel map is unknown.
Since: 1.8
audioChannelPositionsFromMask
audioChannelPositionsFromMask Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Word64 |
|
| -> [AudioChannelPosition] |
|
| -> m Bool | Returns: |
Convert the channels present in channelMask to a position array
(which should have at least channels entries ensured by caller).
If channelMask is set to 0, it is considered as 'not present' for purpose
of conversion.
A partially valid channelMask with less bits set than the number
of channels is considered valid.
audioChannelPositionsToMask
audioChannelPositionsToMask Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => [AudioChannelPosition] |
|
| -> Bool |
|
| -> m (Bool, Word64) | Returns: |
Convert the position array of channels channels to a bitmask.
If forceOrder is True it additionally checks if the channels are
in the order required by GStreamer.
audioChannelPositionsToString
audioChannelPositionsToString Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => [AudioChannelPosition] |
|
| -> m Text | Returns: a newly allocated string representing
Since 1.10 |
Converts position to a human-readable string representation for
debugging purposes.
audioChannelPositionsToValidOrder
audioChannelPositionsToValidOrder Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => [AudioChannelPosition] |
|
| -> m Bool | Returns: |
Reorders the channel positions in position from any order to
the GStreamer channel order.
audioCheckValidChannelPositions
audioCheckValidChannelPositions Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => [AudioChannelPosition] |
|
| -> Bool |
|
| -> m Bool | Returns: |
Checks if position contains valid channel positions for
channels channels. If forceOrder is True it additionally
checks if the channels are in the order required by GStreamer.
audioClippingMetaApiGetType
audioClippingMetaApiGetType :: (HasCallStack, MonadIO m) => m GType Source #
No description available in the introspection data.
audioDownmixMetaApiGetType
audioDownmixMetaApiGetType :: (HasCallStack, MonadIO m) => m GType Source #
No description available in the introspection data.
audioFormatInfoGetType
audioFormatInfoGetType :: (HasCallStack, MonadIO m) => m GType Source #
No description available in the introspection data.
audioGetChannelReorderMap
audioGetChannelReorderMap Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Int32 |
|
| -> [AudioChannelPosition] |
|
| -> [AudioChannelPosition] |
|
| -> [Int32] |
|
| -> m Bool | Returns: |
Returns a reorder map for from to to that can be used in
custom channel reordering code, e.g. to convert from or to the
GStreamer channel order. from and to must contain the same
number of positions and the same positions, only in a
different order.
The resulting reorderMap can be used for reordering by assigning
channel i of the input to channel reorder_map[i] of the output.
audioIec61937FrameSize
audioIec61937FrameSize Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => AudioRingBufferSpec |
|
| -> m Word32 | Returns: the size or 0 if the given |
Calculated the size of the buffer expected by audioIec61937Payload for
payloading type from spec.
audioIec61937Payload
Arguments
| :: (HasCallStack, MonadIO m) | |
| => ByteString |
|
| -> ByteString |
|
| -> AudioRingBufferSpec |
|
| -> Int32 |
|
| -> m Bool | Returns: transfer-full: |
Payloads src in the form specified by IEC 61937 for the type from spec and
stores the result in dst. src must contain exactly one frame of data and
the frame is not checked for errors.
audioReorderChannels
Arguments
| :: (HasCallStack, MonadIO m) | |
| => ByteString |
|
| -> AudioFormat |
|
| -> Int32 |
|
| -> [AudioChannelPosition] |
|
| -> [AudioChannelPosition] |
|
| -> m Bool | Returns: |
Reorders data from the channel positions from to the channel
positions to. from and to must contain the same number of
positions and the same positions, only in a different order.
bufferAddAudioClippingMeta
bufferAddAudioClippingMeta Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Buffer |
|
| -> Format |
|
| -> Word64 |
|
| -> Word64 |
|
| -> m AudioClippingMeta | Returns: the |
Attaches AudioClippingMeta metadata to buffer with the given parameters.
Since: 1.8
bufferAddAudioDownmixMeta
bufferAddAudioDownmixMeta Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Buffer |
|
| -> [AudioChannelPosition] |
|
| -> [AudioChannelPosition] |
|
| -> Float |
|
| -> m AudioDownmixMeta | Returns: the |
Attaches AudioDownmixMeta metadata to buffer with the given parameters.
matrix is an two-dimensional array of toChannels times fromChannels
coefficients, i.e. the i-th output channels is constructed by multiplicating
the input channels with the coefficients in matrix[i] and taking the sum
of the results.
bufferGetAudioDownmixMetaForChannels
bufferGetAudioDownmixMetaForChannels Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Buffer |
|
| -> [AudioChannelPosition] |
|
| -> m AudioDownmixMeta | Returns: the |
Find the AudioDownmixMeta on buffer for the given destination
channel positions.