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.GstAudio.Functions
Contents
- Methods
- audioChannelGetFallbackMask
- audioChannelPositionsFromMask
- audioChannelPositionsToMask
- audioChannelPositionsToString
- audioChannelPositionsToValidOrder
- audioCheckValidChannelPositions
- audioClippingMetaApiGetType
- audioDownmixMetaApiGetType
- audioFormatInfoGetType
- audioFormatsRaw
- audioGetChannelReorderMap
- audioIec61937FrameSize
- audioIec61937Payload
- audioLevelMetaApiGetType
- audioMakeRawCaps
- audioMetaApiGetType
- audioReorderChannels
- bufferAddAudioClippingMeta
- bufferAddAudioDownmixMeta
- bufferAddAudioLevelMeta
- bufferAddAudioMeta
- bufferAddDsdPlaneOffsetMeta
- bufferGetAudioDownmixMetaForChannels
- bufferGetAudioLevelMeta
- dsdConvert
- dsdPlaneOffsetMetaApiGetType
Description
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 -> CSize -> CSize -> m AudioMeta
- bufferAddDsdPlaneOffsetMeta :: (HasCallStack, MonadIO m) => Buffer -> Int32 -> CSize -> CSize -> m DsdPlaneOffsetMeta
- bufferGetAudioDownmixMetaForChannels :: (HasCallStack, MonadIO m) => Buffer -> [AudioChannelPosition] -> m AudioDownmixMeta
- bufferGetAudioLevelMeta :: (HasCallStack, MonadIO m) => Buffer -> m (Maybe AudioLevelMeta)
- dsdConvert :: (HasCallStack, MonadIO m) => Word8 -> Word8 -> DsdFormat -> DsdFormat -> AudioLayout -> AudioLayout -> CSize -> CSize -> CSize -> Int32 -> Bool -> m ()
- dsdPlaneOffsetMetaApiGetType :: (HasCallStack, MonadIO m) => m GType
Methods
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
|
Converts position
to a human-readable string representation for
debugging purposes.
Since: 1.10
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.
audioFormatsRaw
Arguments
:: (HasCallStack, MonadIO m) | |
=> m [AudioFormat] | Returns: an array of |
Return all the raw audio formats supported by GStreamer.
Since: 1.18
audioGetChannelReorderMap
audioGetChannelReorderMap Source #
Arguments
:: (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 #
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.
audioLevelMetaApiGetType
audioLevelMetaApiGetType Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> m GType | Returns: a |
Return the GType
associated with AudioLevelMeta
.
Since: 1.20
audioMakeRawCaps
Arguments
:: (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
Arguments
:: (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 #
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.
bufferAddAudioLevelMeta
bufferAddAudioLevelMeta Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> Buffer |
|
-> Word8 |
|
-> Bool |
|
-> m (Maybe AudioLevelMeta) | Returns: the |
Attaches audio level information to buffer
. (RFC 6464)
Since: 1.20
bufferAddAudioMeta
Arguments
:: (HasCallStack, MonadIO m) | |
=> Buffer |
|
-> AudioInfo |
|
-> CSize |
|
-> CSize |
|
-> 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
bufferAddDsdPlaneOffsetMeta
bufferAddDsdPlaneOffsetMeta Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> Buffer |
|
-> Int32 |
|
-> CSize |
|
-> CSize |
|
-> m DsdPlaneOffsetMeta | Returns: the |
Allocates and attaches a DsdPlaneOffsetMeta
on buffer
, which must be
writable for that purpose. The fields of the DsdPlaneOffsetMeta
are
directly populated from the arguments of this function.
If offsets
is NULL, then the meta's offsets field is left uninitialized.
This is useful if for example offset values are to be calculated in the
meta's offsets field in-place. Similarly, numBytesPerChannel
can be
set to 0, but only if offsets
is NULL. This is useful if the number of
bytes per channel is known only later.
It is not allowed for channels to overlap in memory,
i.e. for each i in [0, channels), the range
[offsets
[i], offsets
[i] + numBytesPerChannel
) 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.
This meta is only needed for non-interleaved (= planar) DSD data.
Since: 1.24
bufferGetAudioDownmixMetaForChannels
bufferGetAudioDownmixMetaForChannels Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> Buffer |
|
-> [AudioChannelPosition] |
|
-> m AudioDownmixMeta | Returns: the |
Find the AudioDownmixMeta
on buffer
for the given destination
channel positions.
bufferGetAudioLevelMeta
bufferGetAudioLevelMeta Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> Buffer |
|
-> m (Maybe AudioLevelMeta) | Returns: the |
Find the AudioLevelMeta
on buffer
.
Since: 1.20
dsdConvert
Arguments
:: (HasCallStack, MonadIO m) | |
=> Word8 |
|
-> Word8 |
|
-> DsdFormat |
|
-> DsdFormat |
|
-> AudioLayout |
|
-> AudioLayout |
|
-> CSize |
|
-> CSize |
|
-> CSize |
|
-> Int32 |
|
-> Bool |
|
-> m () |
Converts DSD data from one layout and grouping format to another.
numBytes
must be an integer multiple of the width of both input
and output format. For example, if the input format is GST_DSD_FORMAT_U32LE,
and the output format is GST_DSD_FORMAT_U16BE, then numBytes
must
be an integer multiple of both 4 (U32LE width) and 2 (U16BE width).
reverseByteBits
is necessary if the bit order within the DSD bytes
needs to be reversed. This is rarely necessary, and is not to be
confused with the endianness of formats (which determines the ordering
of *bytes*).
inputPlaneOffsets
must not be NULL if inputLayout
is set to
GST_AUDIO_LAYOUT_NON_INTERLEAVED
. The same applies to outputPlaneOffsets
.
These plane offsets define the starting offset of the planes (there is
exactly one plane per channel) within inputData
and outputData
respectively. If GST_AUDIO_LAYOUT_INTERLEAVED is used, the plane offsets
are ignored.
Since: 1.24
dsdPlaneOffsetMetaApiGetType
dsdPlaneOffsetMetaApiGetType :: (HasCallStack, MonadIO m) => m GType Source #
No description available in the introspection data.