Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (inaki@blueleaf.cc) |
Safe Haskell | None |
Language | Haskell2010 |
Information describing audio properties. This information can be filled
in from GstCaps with audioInfoFromCaps
.
Use the provided macros to access the info in this structure.
Synopsis
- newtype AudioInfo = AudioInfo (ManagedPtr AudioInfo)
- newZeroAudioInfo :: MonadIO m => m AudioInfo
- noAudioInfo :: Maybe AudioInfo
- audioInfoConvert :: (HasCallStack, MonadIO m) => AudioInfo -> Format -> Int64 -> Format -> m (Bool, Int64)
- audioInfoCopy :: (HasCallStack, MonadIO m) => AudioInfo -> m AudioInfo
- audioInfoFree :: (HasCallStack, MonadIO m) => AudioInfo -> m ()
- audioInfoFromCaps :: (HasCallStack, MonadIO m) => AudioInfo -> Caps -> m Bool
- audioInfoInit :: (HasCallStack, MonadIO m) => AudioInfo -> m ()
- audioInfoIsEqual :: (HasCallStack, MonadIO m) => AudioInfo -> AudioInfo -> m Bool
- audioInfoNew :: (HasCallStack, MonadIO m) => m AudioInfo
- audioInfoSetFormat :: (HasCallStack, MonadIO m) => AudioInfo -> AudioFormat -> Int32 -> Int32 -> Maybe [AudioChannelPosition] -> m ()
- audioInfoToCaps :: (HasCallStack, MonadIO m) => AudioInfo -> m Caps
- getAudioInfoBpf :: MonadIO m => AudioInfo -> m Int32
- setAudioInfoBpf :: MonadIO m => AudioInfo -> Int32 -> m ()
- getAudioInfoChannels :: MonadIO m => AudioInfo -> m Int32
- setAudioInfoChannels :: MonadIO m => AudioInfo -> Int32 -> m ()
- clearAudioInfoFinfo :: MonadIO m => AudioInfo -> m ()
- getAudioInfoFinfo :: MonadIO m => AudioInfo -> m (Maybe AudioFormatInfo)
- setAudioInfoFinfo :: MonadIO m => AudioInfo -> Ptr AudioFormatInfo -> m ()
- getAudioInfoFlags :: MonadIO m => AudioInfo -> m [AudioFlags]
- setAudioInfoFlags :: MonadIO m => AudioInfo -> [AudioFlags] -> m ()
- getAudioInfoLayout :: MonadIO m => AudioInfo -> m AudioLayout
- setAudioInfoLayout :: MonadIO m => AudioInfo -> AudioLayout -> m ()
- getAudioInfoRate :: MonadIO m => AudioInfo -> m Int32
- setAudioInfoRate :: MonadIO m => AudioInfo -> Int32 -> m ()
Exported types
Memory-managed wrapper type.
newZeroAudioInfo :: MonadIO m => m AudioInfo Source #
Construct a AudioInfo
struct initialized to zero.
Methods
convert
:: (HasCallStack, MonadIO m) | |
=> AudioInfo |
|
-> Format |
|
-> Int64 |
|
-> Format |
|
-> m (Bool, Int64) | Returns: TRUE if the conversion was successful. |
Converts among various Format
types. This function handles
GST_FORMAT_BYTES, GST_FORMAT_TIME, and GST_FORMAT_DEFAULT. For
raw audio, GST_FORMAT_DEFAULT corresponds to audio frames. This
function can be used to handle pad queries of the type GST_QUERY_CONVERT.
copy
:: (HasCallStack, MonadIO m) | |
=> AudioInfo |
|
-> m AudioInfo | Returns: a new |
Copy a GstAudioInfo structure.
free
:: (HasCallStack, MonadIO m) | |
=> AudioInfo |
|
-> m () |
Free a GstAudioInfo structure previously allocated with audioInfoNew
or audioInfoCopy
.
fromCaps
:: (HasCallStack, MonadIO m) | |
=> AudioInfo |
|
-> Caps |
|
-> m Bool | Returns: TRUE if |
Parse caps
and update info
.
init
:: (HasCallStack, MonadIO m) | |
=> AudioInfo |
|
-> m () |
Initialize info
with default values.
isEqual
Compares two AudioInfo
and returns whether they are equal or not
Since: 1.2
new
:: (HasCallStack, MonadIO m) | |
=> m AudioInfo | Returns: a new |
Allocate a new AudioInfo
that is also initialized with
audioInfoInit
.
setFormat
:: (HasCallStack, MonadIO m) | |
=> AudioInfo |
|
-> AudioFormat |
|
-> Int32 |
|
-> Int32 |
|
-> Maybe [AudioChannelPosition] |
|
-> m () |
Set the default info for the audio info of format
and rate
and channels
.
Note: This initializes info
first, no values are preserved.
toCaps
:: (HasCallStack, MonadIO m) | |
=> AudioInfo |
|
-> m Caps | Returns: the new |
Convert the values of info
into a Caps
.
Properties
bpf
the number of bytes for one frame, this is the size of one
sample * channels
getAudioInfoBpf :: MonadIO m => AudioInfo -> m Int32 Source #
Get the value of the “bpf
” field.
When overloading is enabled, this is equivalent to
get
audioInfo #bpf
setAudioInfoBpf :: MonadIO m => AudioInfo -> Int32 -> m () Source #
Set the value of the “bpf
” field.
When overloading is enabled, this is equivalent to
set
audioInfo [ #bpf:=
value ]
channels
the number of channels
getAudioInfoChannels :: MonadIO m => AudioInfo -> m Int32 Source #
Get the value of the “channels
” field.
When overloading is enabled, this is equivalent to
get
audioInfo #channels
setAudioInfoChannels :: MonadIO m => AudioInfo -> Int32 -> m () Source #
Set the value of the “channels
” field.
When overloading is enabled, this is equivalent to
set
audioInfo [ #channels:=
value ]
finfo
the format info of the audio
clearAudioInfoFinfo :: MonadIO m => AudioInfo -> m () Source #
Set the value of the “finfo
” field to Nothing
.
When overloading is enabled, this is equivalent to
clear
#finfo
getAudioInfoFinfo :: MonadIO m => AudioInfo -> m (Maybe AudioFormatInfo) Source #
Get the value of the “finfo
” field.
When overloading is enabled, this is equivalent to
get
audioInfo #finfo
setAudioInfoFinfo :: MonadIO m => AudioInfo -> Ptr AudioFormatInfo -> m () Source #
Set the value of the “finfo
” field.
When overloading is enabled, this is equivalent to
set
audioInfo [ #finfo:=
value ]
flags
additional audio flags
getAudioInfoFlags :: MonadIO m => AudioInfo -> m [AudioFlags] Source #
Get the value of the “flags
” field.
When overloading is enabled, this is equivalent to
get
audioInfo #flags
setAudioInfoFlags :: MonadIO m => AudioInfo -> [AudioFlags] -> m () Source #
Set the value of the “flags
” field.
When overloading is enabled, this is equivalent to
set
audioInfo [ #flags:=
value ]
layout
audio layout
getAudioInfoLayout :: MonadIO m => AudioInfo -> m AudioLayout Source #
Get the value of the “layout
” field.
When overloading is enabled, this is equivalent to
get
audioInfo #layout
setAudioInfoLayout :: MonadIO m => AudioInfo -> AudioLayout -> m () Source #
Set the value of the “layout
” field.
When overloading is enabled, this is equivalent to
set
audioInfo [ #layout:=
value ]
rate
the audio sample rate
getAudioInfoRate :: MonadIO m => AudioInfo -> m Int32 Source #
Get the value of the “rate
” field.
When overloading is enabled, this is equivalent to
get
audioInfo #rate
setAudioInfoRate :: MonadIO m => AudioInfo -> Int32 -> m () Source #
Set the value of the “rate
” field.
When overloading is enabled, this is equivalent to
set
audioInfo [ #rate:=
value ]