MythTV  master
Classes | Macros | Typedefs | Functions | Variables
audiooutputca.cpp File Reference
#include <array>
#include <vector>
#include <CoreServices/CoreServices.h>
#include <CoreAudio/CoreAudio.h>
#include <AudioUnit/AudioUnit.h>
#include <AudioToolbox/AudioFormat.h>
#include "mythcorecontext.h"
#include "audiooutputca.h"
#include "config.h"
#include "SoundTouch.h"
Include dependency graph for audiooutputca.cpp:

Go to the source code of this file.


class  CoreAudioData
 This holds Core Audio member variables and low-level audio IO methods The name is now a misnomer, it should be CoreAudioPrivate, or CoreAudioMgr. More...


#define LOC   QString("CoreAudio: ")
#define CHANNELS_MIN   1
#define CHANNELS_MAX   8
#define OSS_STATUS(x)   UInt32ToFourCC((UInt32*)&(x))


using AudioStreamIDVec = std::vector< AudioStreamID >
using AudioStreamRangedVec = std::vector< AudioStreamRangedDescription >
using AudioValueRangeVec = std::vector< AudioValueRange >
using RatesVec = std::vector< int >
using ChannelsArr = std::array< bool, CHANNELS_MAX >


char * UInt32ToFourCC (const UInt32 *pVal)
QString StreamDescriptionToString (AudioStreamBasicDescription desc)
static OSStatus RenderCallbackAnalog (void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData)
static OSStatus RenderCallbackSPDIF (AudioDeviceID inDevice, const AudioTimeStamp *inNow, const void *inInputData, const AudioTimeStamp *inInputTime, AudioBufferList *outOutputData, const AudioTimeStamp *inOutputTime, void *inRefCon)
template<class AudioDataType >
static void _ReorderSmpteToCA (AudioDataType *buf, uint frames)
static void ReorderSmpteToCA (void *buf, uint frames, AudioFormat format)
static bool IsRateCommon (Float64 inRate)


static UInt32 sNumberCommonSampleRates = 15
static Float64 sCommonSampleRates []

Macro Definition Documentation


#define LOC   QString("CoreAudio: ")

Definition at line 28 of file audiooutputca.cpp.


#define CHANNELS_MIN   1

Definition at line 30 of file audiooutputca.cpp.


#define CHANNELS_MAX   8

Definition at line 31 of file audiooutputca.cpp.


#define OSS_STATUS (   x)    UInt32ToFourCC((UInt32*)&(x))

Definition at line 39 of file audiooutputca.cpp.

Typedef Documentation

◆ AudioStreamIDVec

using AudioStreamIDVec = std::vector<AudioStreamID>

Definition at line 33 of file audiooutputca.cpp.

◆ AudioStreamRangedVec

using AudioStreamRangedVec = std::vector<AudioStreamRangedDescription>

Definition at line 34 of file audiooutputca.cpp.

◆ AudioValueRangeVec

using AudioValueRangeVec = std::vector<AudioValueRange>

Definition at line 35 of file audiooutputca.cpp.

◆ RatesVec

using RatesVec = std::vector<int>

Definition at line 36 of file audiooutputca.cpp.

◆ ChannelsArr

using ChannelsArr = std::array<bool,CHANNELS_MAX>

Definition at line 37 of file audiooutputca.cpp.

Function Documentation

◆ UInt32ToFourCC()

char* UInt32ToFourCC ( const UInt32 *  pVal)

Definition at line 40 of file audiooutputca.cpp.

Referenced by StreamDescriptionToString().

◆ StreamDescriptionToString()

QString StreamDescriptionToString ( AudioStreamBasicDescription  desc)

◆ RenderCallbackAnalog()

OSStatus RenderCallbackAnalog ( void *  inRefCon,
AudioUnitRenderActionFlags *  ioActionFlags,
const AudioTimeStamp *  inTimeStamp,
UInt32  inBusNumber,
UInt32  inNumberFrames,
AudioBufferList *  ioData 

Definition at line 419 of file audiooutputca.cpp.

Referenced by CoreAudioData::OpenAnalog().

◆ RenderCallbackSPDIF()

static OSStatus RenderCallbackSPDIF ( AudioDeviceID  inDevice,
const AudioTimeStamp *  inNow,
const void *  inInputData,
const AudioTimeStamp *  inInputTime,
AudioBufferList *  outOutputData,
const AudioTimeStamp *  inOutputTime,
void *  inRefCon 

Definition at line 465 of file audiooutputca.cpp.

Referenced by CoreAudioData::OpenSPDIF().

◆ _ReorderSmpteToCA()

template<class AudioDataType >
static void _ReorderSmpteToCA ( AudioDataType *  buf,
uint  frames 

Definition at line 317 of file audiooutputca.cpp.

Referenced by ReorderSmpteToCA().

◆ ReorderSmpteToCA()

static void ReorderSmpteToCA ( void *  buf,
uint  frames,
AudioFormat  format 

Definition at line 339 of file audiooutputca.cpp.

Referenced by AudioOutputCA::RenderAudio().

◆ IsRateCommon()

static bool IsRateCommon ( Float64  inRate)

Definition at line 959 of file audiooutputca.cpp.

Referenced by CoreAudioData::RatesList().

Variable Documentation

◆ sNumberCommonSampleRates

UInt32 sNumberCommonSampleRates = 15

Definition at line 951 of file audiooutputca.cpp.

Referenced by IsRateCommon(), and CoreAudioData::RatesList().

◆ sCommonSampleRates

Float64 sCommonSampleRates[]
Initial value:
= {
8000.0, 11025.0, 12000.0,
16000.0, 22050.0, 24000.0,
32000.0, 44100.0, 48000.0,
64000.0, 88200.0, 96000.0,
128000.0, 176400.0, 192000.0 }

Definition at line 952 of file audiooutputca.cpp.

Referenced by IsRateCommon(), and CoreAudioData::RatesList().