vdr-plugin-drmdevice 2.0.0-46418f1
Audio Module

Audio Interface. More...

Classes

class  cAlsaDevice
 Alsa Interface. More...
 
class  cAudioStream
 Audio Interface. More...
 
class  cAudioProcessor
 Audio Manipulation. More...
 
class  cPidController
 PID Controller. More...
 
class  cRingbuffer
 Ringbuffer (FIFO) Implementation. More...
 

Functions

static void AlsaNoopCallback (__attribute__((unused)) const char *file, __attribute__((unused)) int line, __attribute__((unused)) const char *function, __attribute__((unused)) int err, __attribute__((unused)) const char *fmt,...)
 Empty log callback.
 
static const char * alsaToFFmpegChannel (const char *alsaName)
 FFmpeg does not have channels called "RL" or "RR" So "rename" Alsas RL (rear left) and RR (rear right) to FFmpegs BL (back left) and BR (back right) to make the channelmap filter parser happy.
 
static std::vector< std::string > GetFFmpegChannelLayoutAsArray (const AVChannelLayout &layout)
 Put FFmpeg channel layout in a dynamic array of strings.
 
static bool LayoutsMatch (const std::vector< std::string > &ff, const std::vector< std::string > &alsa)
 Check, if FFmpeg and Alsa channel layout match.
 
static bool LayoutIsValid (const std::vector< std::string > &channelLayout)
 Check, if the channel layout has channels named "NA" (N/A, silent)
 
std::vector< std::string > cAlsaDevice::GetChannelLayoutAsArray (void)
 Put ALSA channel layout in a dynamic array of strings.
 
std::string cAudioStream::BuildChannelMapFilter (const AVChannelLayout &)
 Build the "|"-separated mappings list for the channelmap filter.
 

Detailed Description

Audio Interface.

Handles the audio stream

Function Documentation

◆ AlsaNoopCallback()

static void AlsaNoopCallback ( __attribute__((unused)) const char *  file,
__attribute__((unused)) int  line,
__attribute__((unused)) const char *  function,
__attribute__((unused)) int  err,
__attribute__((unused)) const char *  fmt,
  ... 
)
static

Empty log callback.

Definition at line 30 of file alsadevice.cpp.

Referenced by cAlsaDevice::Init().

◆ alsaToFFmpegChannel()

static const char * alsaToFFmpegChannel ( const char *  alsaName)
static

FFmpeg does not have channels called "RL" or "RR" So "rename" Alsas RL (rear left) and RR (rear right) to FFmpegs BL (back left) and BR (back right) to make the channelmap filter parser happy.

Definition at line 605 of file alsadevice.cpp.

Referenced by cAlsaDevice::GetChannelLayoutAsArray().

◆ BuildChannelMapFilter()

std::string cAudioStream::BuildChannelMapFilter ( const AVChannelLayout &  layout)
private

Build the "|"-separated mappings list for the channelmap filter.

Parameters
layoutcurrent FFmpeg channel layout
Returns
mapping string to feed into the channelmap filter

Definition at line 141 of file audio.cpp.

References cAlsaDevice::GetChannelLayoutAsArray(), GetFFmpegChannelLayoutAsArray(), L_SOUND, LayoutIsValid(), LayoutsMatch(), LOGDEBUG2, LOGWARNING, and cAudioStream::m_alsa.

Referenced by cAudioStream::InitFilter().

◆ GetChannelLayoutAsArray()

std::vector< std::string > cAlsaDevice::GetChannelLayoutAsArray ( void  )

Put ALSA channel layout in a dynamic array of strings.

Parameters
pcmHandlecurrent Alsa PCM handle
Returns
ALSA channel layout as an array of strings

Definition at line 622 of file alsadevice.cpp.

References alsaToFFmpegChannel(), and cAlsaDevice::m_pPCMHandle.

Referenced by cAudioStream::BuildChannelMapFilter(), and cAlsaDevice::Setup().

◆ GetFFmpegChannelLayoutAsArray()

static std::vector< std::string > GetFFmpegChannelLayoutAsArray ( const AVChannelLayout &  layout)
static

Put FFmpeg channel layout in a dynamic array of strings.

Parameters
layoutcurrent FFmpeg channel layout
Returns
ffmpeg layout as an array of strings

Definition at line 80 of file audio.cpp.

Referenced by cAudioStream::BuildChannelMapFilter().

◆ LayoutIsValid()

static bool LayoutIsValid ( const std::vector< std::string > &  channelLayout)
static

Check, if the channel layout has channels named "NA" (N/A, silent)

Parameters
channelLayoutchannel layout
Returns
true if the channel layout doesn't contain "NA" (N/A, silent)

Definition at line 127 of file audio.cpp.

Referenced by cAudioStream::BuildChannelMapFilter().

◆ LayoutsMatch()

static bool LayoutsMatch ( const std::vector< std::string > &  ff,
const std::vector< std::string > &  alsa 
)
static

Check, if FFmpeg and Alsa channel layout match.

Parameters
ffArray of FFmpeg channel layout
alsaArray of Alsa channel layout
Returns
true if the channel layouts match

Definition at line 105 of file audio.cpp.

Referenced by cAudioStream::BuildChannelMapFilter().