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.

Classes

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...
 

Macros

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

Typedefs

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 >
 

Functions

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)
 

Variables

static UInt32 sNumberCommonSampleRates = 15
 
static Float64 sCommonSampleRates []
 

Macro Definition Documentation

◆ LOC

#define LOC   QString("CoreAudio: ")

Definition at line 28 of file audiooutputca.cpp.

◆ CHANNELS_MIN

#define CHANNELS_MIN   1

Definition at line 30 of file audiooutputca.cpp.

◆ CHANNELS_MAX

#define CHANNELS_MAX   8

Definition at line 31 of file audiooutputca.cpp.

◆ OSS_STATUS

#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 
)
static

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 
)
static

Definition at line 465 of file audiooutputca.cpp.

Referenced by CoreAudioData::OpenSPDIF().

◆ _ReorderSmpteToCA()

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

Definition at line 317 of file audiooutputca.cpp.

Referenced by ReorderSmpteToCA().

◆ ReorderSmpteToCA()

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

Definition at line 339 of file audiooutputca.cpp.

Referenced by AudioOutputCA::RenderAudio().

◆ IsRateCommon()

static bool IsRateCommon ( Float64  inRate)
static

Definition at line 959 of file audiooutputca.cpp.

Referenced by CoreAudioData::RatesList().

Variable Documentation

◆ sNumberCommonSampleRates

UInt32 sNumberCommonSampleRates = 15
static

Definition at line 951 of file audiooutputca.cpp.

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

◆ sCommonSampleRates

Float64 sCommonSampleRates[]
static
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().