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 |
- Methods
- audioChannelGetFallbackMask
- audioChannelPositionsFromMask
- audioChannelPositionsToMask
- audioChannelPositionsToString
- audioChannelPositionsToValidOrder
- audioCheckValidChannelPositions
- audioClippingMetaApiGetType
- audioDownmixMetaApiGetType
- audioFormatInfoGetType
- audioFormatsRaw
- audioGetChannelReorderMap
- audioIec61937FrameSize
- audioIec61937Payload
- audioLevelMetaApiGetType
- audioMakeRawCaps
- audioMetaApiGetType
- audioReorderChannels
- bufferAddAudioClippingMeta
- bufferAddAudioDownmixMeta
- bufferAddAudioLevelMeta
- bufferAddAudioMeta
- bufferGetAudioDownmixMetaForChannels
- bufferGetAudioLevelMeta
Synopsis
- 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
- audioFormatsRaw :: (HasCallStack, MonadIO m) => m [AudioFormat]
- audioGetChannelReorderMap :: (HasCallStack, MonadIO m) => [AudioChannelPosition] -> [AudioChannelPosition] -> [Int32] -> m Bool
- audioIec61937FrameSize :: (HasCallStack, MonadIO m) => AudioRingBufferSpec -> m Word32
- audioIec61937Payload :: (HasCallStack, MonadIO m) => ByteString -> ByteString -> AudioRingBufferSpec -> Int32 -> m Bool
- audioLevelMetaApiGetType :: (HasCallStack, MonadIO m) => m GType
- audioMakeRawCaps :: (HasCallStack, MonadIO m) => Maybe [AudioFormat] -> AudioLayout -> m Caps
- audioMetaApiGetType :: (HasCallStack, MonadIO m) => m GType
- audioReorderChannels :: (HasCallStack, MonadIO m) => ByteString -> AudioFormat -> [AudioChannelPosition] -> [AudioChannelPosition] -> m Bool
- bufferAddAudioClippingMeta :: (HasCallStack, MonadIO m) => Buffer -> Format -> Word64 -> Word64 -> m AudioClippingMeta
- bufferAddAudioDownmixMeta :: (HasCallStack, MonadIO m) => Buffer -> [AudioChannelPosition] -> [AudioChannelPosition] -> Float -> m AudioDownmixMeta
- bufferAddAudioLevelMeta :: (HasCallStack, MonadIO m) => Buffer -> Word8 -> Bool -> m (Maybe AudioLevelMeta)
- bufferAddAudioMeta :: (HasCallStack, MonadIO m) => Buffer -> AudioInfo -> Word64 -> Word64 -> m AudioMeta
- bufferGetAudioDownmixMetaForChannels :: (HasCallStack, MonadIO m) => Buffer -> [AudioChannelPosition] -> m AudioDownmixMeta
- bufferGetAudioLevelMeta :: (HasCallStack, MonadIO m) => Buffer -> m (Maybe AudioLevelMeta)
Methods
audioChannelGetFallbackMask
audioChannelGetFallbackMask Source #
:: (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 #
:: (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 #
:: (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 #
:: (HasCallStack, MonadIO m) | |
=> [AudioChannelPosition] |
|
-> m Text | Returns: a newly allocated string representing
|
Converts position
to a human-readable string representation for
debugging purposes.
Since: 1.10
audioChannelPositionsToValidOrder
audioChannelPositionsToValidOrder Source #
:: (HasCallStack, MonadIO m) | |
=> [AudioChannelPosition] |
|
-> m Bool | Returns: |
Reorders the channel positions in position
from any order to
the GStreamer channel order.
audioCheckValidChannelPositions
audioCheckValidChannelPositions Source #
:: (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.
audioFormatsRaw
:: (HasCallStack, MonadIO m) | |
=> m [AudioFormat] | Returns: an array of |
Return all the raw audio formats supported by GStreamer.
Since: 1.18
audioGetChannelReorderMap
audioGetChannelReorderMap Source #
:: (HasCallStack, MonadIO m) | |
=> [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 #
:: (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
:: (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.
audioLevelMetaApiGetType
audioLevelMetaApiGetType Source #
:: (HasCallStack, MonadIO m) | |
=> m GType | Returns: a |
Return the GType
associated with AudioLevelMeta
.
Since: 1.20
audioMakeRawCaps
:: (HasCallStack, MonadIO m) | |
=> Maybe [AudioFormat] |
|
-> AudioLayout |
|
-> m Caps | Returns: an audio |
Return a generic raw audio caps for formats defined in formats
.
If formats
is Nothing
returns a caps for all the supported raw audio formats,
see audioFormatsRaw
.
Since: 1.18
audioMetaApiGetType
audioMetaApiGetType :: (HasCallStack, MonadIO m) => m GType Source #
No description available in the introspection data.
audioReorderChannels
:: (HasCallStack, MonadIO m) | |
=> ByteString |
|
-> AudioFormat |
|
-> [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.
Note: this function assumes the audio data is in interleaved layout
bufferAddAudioClippingMeta
bufferAddAudioClippingMeta Source #
:: (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 #
:: (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.
bufferAddAudioLevelMeta
bufferAddAudioLevelMeta Source #
:: (HasCallStack, MonadIO m) | |
=> Buffer |
|
-> Word8 |
|
-> Bool |
|
-> m (Maybe AudioLevelMeta) | Returns: the |
Attaches audio level information to buffer
. (RFC 6464)
Since: 1.20
bufferAddAudioMeta
:: (HasCallStack, MonadIO m) | |
=> Buffer |
|
-> AudioInfo |
|
-> Word64 |
|
-> Word64 |
|
-> m AudioMeta | Returns: the |
Allocates and attaches a AudioMeta
on buffer
, which must be writable
for that purpose. The fields of the AudioMeta
are directly populated
from the arguments of this function.
When info
->layout is AudioLayoutNonInterleaved
and offsets
is
Nothing
, the offsets are calculated with a formula that assumes the planes are
tightly packed and in sequence:
offsets[channel] = channel * samples
* sample_stride
It is not allowed for channels to overlap in memory,
i.e. for each i in [0, channels), the range
[offsets
[i], offsets
[i] + samples
* sample_stride) must not overlap
with any other such range. This function will assert if the parameters
specified cause this restriction to be violated.
It is, obviously, also not allowed to specify parameters that would cause
out-of-bounds memory access on buffer
. This is also checked, which means
that you must add enough memory on the buffer
before adding this meta.
Since: 1.16
bufferGetAudioDownmixMetaForChannels
bufferGetAudioDownmixMetaForChannels Source #
:: (HasCallStack, MonadIO m) | |
=> Buffer |
|
-> [AudioChannelPosition] |
|
-> m AudioDownmixMeta | Returns: the |
Find the AudioDownmixMeta
on buffer
for the given destination
channel positions.
bufferGetAudioLevelMeta
bufferGetAudioLevelMeta Source #
:: (HasCallStack, MonadIO m) | |
=> Buffer |
|
-> m (Maybe AudioLevelMeta) | Returns: the |
Find the AudioLevelMeta
on buffer
.
Since: 1.20