MythTV
master
|
#include <libmyth/audio/audiooutputsettings.h>
Public Member Functions | |
AudioOutputSettings (bool invalid=false) | |
AudioOutputSettings (const AudioOutputSettings &)=default | |
~AudioOutputSettings () | |
AudioOutputSettings & | operator= (const AudioOutputSettings &) |
AudioOutputSettings * | GetCleaned (bool newcopy=false) |
Returns capabilities supported by the audio device amended to take into account the digital audio options (AC3 and DTS) Warning: do not call it twice in a row, will lead to invalid settings. More... | |
AudioOutputSettings * | GetUsers (bool newcopy=false) |
Returns capabilities supported by the audio device amended to take into account the digital audio options (AC3 and DTS) as well as the user settings If newcopy = false, assume GetCleaned was called before hand. More... | |
int | GetNextRate () |
void | AddSupportedRate (int rate) |
bool | IsSupportedRate (int rate) |
int | NearestSupportedRate (int rate) |
int | BestSupportedRate () |
AudioFormat | GetNextFormat () |
void | AddSupportedFormat (AudioFormat format) |
bool | IsSupportedFormat (AudioFormat format) |
AudioFormat | BestSupportedFormat () |
void | AddSupportedChannels (int channels) |
bool | IsSupportedChannels (int channels) |
int | BestSupportedChannels () |
void | setPassthrough (int val) |
int | canPassthrough () const |
bool | canFeature (DigitalFeature arg) const |
return DigitalFeature mask. More... | |
bool | canFeature (unsigned int arg) const |
bool | canAC3 () const |
return true if device can or may support AC3 (deprecated, see canFeature()) More... | |
bool | canDTS () const |
return true if device can or may support DTS (deprecated, see canFeature()) More... | |
bool | canLPCM () const |
return true if device supports multichannels PCM (deprecated, see canFeature()) More... | |
bool | IsInvalid () const |
return true if class instance is marked invalid. More... | |
void | setFeature (DigitalFeature arg) |
set the provided digital feature possible values are: More... | |
void | setFeature (unsigned int arg) |
void | setFeature (bool val, DigitalFeature arg) |
clear or set digital feature internal mask More... | |
void | setFeature (bool val, int arg) |
void | SetBestSupportedChannels (int channels) |
Force set the greatest number of channels supported by the audio device. More... | |
int | GetMaxHDRate () const |
return the highest iec958 rate supported. More... | |
QString | FeaturesToString (void) const |
bool | hasELD () const |
get the ELD flag More... | |
bool | hasValidELD () |
void | setELD (QByteArray *ba) |
set ELD data More... | |
eld & | getELD (void) |
retrieve ELD data More... | |
int | BestSupportedChannelsELD () |
Reports best supported channel number, restricted to ELD range. More... | |
int | BestSupportedPCMChannelsELD () |
Reports best supported PCM channel number, restricted to ELD. More... | |
Static Public Member Functions | |
static int | FormatToBits (AudioFormat format) |
static const char * | FormatToString (AudioFormat format) |
static int | SampleSize (AudioFormat format) |
static AudioFormat | AVSampleFormatToFormat (AVSampleFormat format, int bits=0) |
Return AVSampleFormat closest equivalent to AudioFormat. More... | |
static AVSampleFormat | FormatToAVSampleFormat (AudioFormat format) |
Return AudioFormat closest equivalent to AVSampleFormat Note that FORMAT_S24LSB and FORMAT_S24 have no direct equivalent use S32 instead. More... | |
static QString | FeaturesToString (DigitalFeature arg) |
Display in human readable form the digital features supported by the output device. More... | |
static QString | GetPassthroughParams (int codec, int codec_profile, int &samplerate, int &channels, bool canDTSHDMA) |
Setup samplerate and number of channels for passthrough. More... | |
Private Member Functions | |
void | SortSupportedChannels () |
Private Attributes | |
int | m_passthrough {-1} |
passthrough status -1 : no 0: unknown 1: yes More... | |
unsigned int | m_features {FEATURE_NONE} |
bool | m_invalid {false} |
bool | m_hasEld {false} |
will be set to true if we were able to retrieve the device ELD (EDID like Data). More... | |
eld | m_eld |
std::vector< int > | m_rates |
std::vector< int > | m_channels |
std::vector< AudioFormat > | m_formats |
rate_array::iterator | m_srIt { } |
format_array::iterator | m_sfIt { } |
Static Private Attributes | |
static const rate_array | kStdRates |
static const format_array | kStdFormats |
Definition at line 48 of file audiooutputsettings.h.
Definition at line 35 of file audiooutputsettings.cpp.
Referenced by GetCleaned().
|
default |
AudioOutputSettings::~AudioOutputSettings | ( | ) |
Definition at line 42 of file audiooutputsettings.cpp.
AudioOutputSettings & AudioOutputSettings::operator= | ( | const AudioOutputSettings & | rhs | ) |
Definition at line 49 of file audiooutputsettings.cpp.
AudioOutputSettings * AudioOutputSettings::GetCleaned | ( | bool | newcopy = false | ) |
Returns capabilities supported by the audio device amended to take into account the digital audio options (AC3 and DTS) Warning: do not call it twice in a row, will lead to invalid settings.
Definition at line 304 of file audiooutputsettings.cpp.
Referenced by AudioOutputBase::GetOutputSettingsCleaned(), and GetUsers().
AudioOutputSettings * AudioOutputSettings::GetUsers | ( | bool | newcopy = false | ) |
Returns capabilities supported by the audio device amended to take into account the digital audio options (AC3 and DTS) as well as the user settings If newcopy = false, assume GetCleaned was called before hand.
Definition at line 361 of file audiooutputsettings.cpp.
int AudioOutputSettings::GetNextRate | ( | ) |
Definition at line 67 of file audiooutputsettings.cpp.
Referenced by AudioOutputWin::GetOutputSettings(), AudioOutputDX::GetOutputSettings(), and AudioOutputAudioTrack::GetOutputSettings().
void AudioOutputSettings::AddSupportedRate | ( | int | rate | ) |
Definition at line 78 of file audiooutputsettings.cpp.
Referenced by AudioOutputWin::GetOutputSettings(), AudioOutputDX::GetOutputSettings(), AudioOutputOpenSLES::GetOutputSettings(), and AudioOutputAudioTrack::GetOutputSettings().
bool AudioOutputSettings::IsSupportedRate | ( | int | rate | ) |
Definition at line 85 of file audiooutputsettings.cpp.
Referenced by AudioOutputBase::CanPassthrough(), GetCleaned(), and AudioOutputBase::Reconfigure().
int AudioOutputSettings::NearestSupportedRate | ( | int | rate | ) |
Definition at line 101 of file audiooutputsettings.cpp.
Referenced by AudioOutputBase::Reconfigure().
int AudioOutputSettings::BestSupportedRate | ( | ) |
Definition at line 94 of file audiooutputsettings.cpp.
AudioFormat AudioOutputSettings::GetNextFormat | ( | ) |
Definition at line 116 of file audiooutputsettings.cpp.
Referenced by AudioOutputPulseAudio::GetOutputSettings().
void AudioOutputSettings::AddSupportedFormat | ( | AudioFormat | format | ) |
Definition at line 127 of file audiooutputsettings.cpp.
Referenced by AudioOutputWin::GetOutputSettings(), AudioOutputDX::GetOutputSettings(), AudioOutputOpenSLES::GetOutputSettings(), AudioOutputAudioTrack::GetOutputSettings(), and AudioOutputPulseAudio::GetOutputSettings().
bool AudioOutputSettings::IsSupportedFormat | ( | AudioFormat | format | ) |
Definition at line 134 of file audiooutputsettings.cpp.
Referenced by AudioOutputBase::CanPassthrough(), and GetCleaned().
AudioFormat AudioOutputSettings::BestSupportedFormat | ( | ) |
Definition at line 143 of file audiooutputsettings.cpp.
Referenced by AudioOutputBase::Reconfigure().
|
static |
Definition at line 150 of file audiooutputsettings.cpp.
Referenced by AudioOutputBase::AddData(), AudioConvert::DeinterleaveSamples(), fromFloat32(), AudioConvert::InterleaveSamples(), CoreAudioData::OpenAnalog(), AudioOutputWin::OpenDevice(), AudioOutputDX::OpenDevice(), AudioOutputOSS::OpenDevice(), ReorderSmpteToAlsa(), ReorderSmpteToCA(), AudioOutputBase::Status(), toFloat32(), and AudioInfo::toString().
|
static |
Definition at line 165 of file audiooutputsettings.cpp.
Referenced by AddSupportedFormat(), and AudioOutputBase::Reconfigure().
|
static |
Definition at line 180 of file audiooutputsettings.cpp.
Referenced by AudioOutputBase::AddData(), AudioOutputBase::CopyWithUpmix(), AudioOutput::DecodeAudio(), AudioOutputDigitalEncoder::Encode(), AudioOutputBase::GetAudioData(), AudioConvert::Process(), AvFormatDecoder::ProcessAudioPacket(), AudioReencodeBuffer::Reconfigure(), AudioOutputBase::Reconfigure(), AudioOutputBase::SetStretchFactorLocked(), and MythAVFormatWriter::WriteAudioFrame().
|
static |
Return AVSampleFormat closest equivalent to AudioFormat.
Definition at line 198 of file audiooutputsettings.cpp.
Referenced by AudioOutputUtil::DecodeAudio(), AudioOutput::DecodeAudio(), avfDecoder::initialize(), AvFormatDecoder::ProcessAudioPacket(), AvFormatDecoder::SetupAudioStream(), and MythAVFormatWriter::WriteAudioFrame().
|
static |
Return AudioFormat closest equivalent to AVSampleFormat Note that FORMAT_S24LSB and FORMAT_S24 have no direct equivalent use S32 instead.
Definition at line 223 of file audiooutputsettings.cpp.
Referenced by AudioConvert::Process().
void AudioOutputSettings::AddSupportedChannels | ( | int | channels | ) |
Definition at line 237 of file audiooutputsettings.cpp.
Referenced by GetCleaned(), AudioOutputWin::GetOutputSettings(), AudioOutputDX::GetOutputSettings(), AudioOutputOpenSLES::GetOutputSettings(), and AudioOutputAudioTrack::GetOutputSettings().
bool AudioOutputSettings::IsSupportedChannels | ( | int | channels | ) |
Definition at line 244 of file audiooutputsettings.cpp.
Referenced by GetCleaned(), AudioOutputBase::Reconfigure(), AudioConfigSettings::UpdateCapabilities(), and AudioSetupWizard::UpdateCapabilities().
int AudioOutputSettings::BestSupportedChannels | ( | ) |
Definition at line 254 of file audiooutputsettings.cpp.
Referenced by BestSupportedChannelsELD(), BestSupportedPCMChannelsELD(), GetCleaned(), AudioPlayer::GetMaxChannels(), GetUsers(), AudioOutputBase::InitSettings(), AudioConfigSettings::UpdateCapabilities(), and AudioSetupWizard::UpdateCapabilities().
|
inline |
Definition at line 76 of file audiooutputsettings.h.
Referenced by GetCleaned(), AudioOutputWin::GetOutputSettings(), AudioOutputDX::GetOutputSettings(), AudioOutputOpenSLES::GetOutputSettings(), and AudioOutputAudioTrack::GetOutputSettings().
|
inline |
Definition at line 77 of file audiooutputsettings.h.
Referenced by AudioOutput::GetAudioDeviceConfig(), and AudioConfigSettings::UpdateCapabilities().
|
inline |
return DigitalFeature mask.
possible values are:
Definition at line 88 of file audiooutputsettings.h.
Referenced by AudioOutputBase::CanPassthrough(), GetMaxHDRate(), GetUsers(), AudioOutputBase::Reconfigure(), AudioOutputBase::SetupPassthrough(), TestDigitalFeature(), AudioConfigSettings::UpdateCapabilities(), and AudioSetupWizard::UpdateCapabilities().
|
inline |
Definition at line 90 of file audiooutputsettings.h.
|
inline |
return true if device can or may support AC3 (deprecated, see canFeature())
Definition at line 97 of file audiooutputsettings.h.
Referenced by AudioOutput::GetAudioDeviceConfig().
|
inline |
return true if device can or may support DTS (deprecated, see canFeature())
Definition at line 102 of file audiooutputsettings.h.
Referenced by AudioOutput::GetAudioDeviceConfig().
|
inline |
return true if device supports multichannels PCM (deprecated, see canFeature())
Definition at line 107 of file audiooutputsettings.h.
Referenced by AudioOutput::GetAudioDeviceConfig().
|
inline |
return true if class instance is marked invalid.
if true, you can not assume any of the other method returned values are valid
Definition at line 113 of file audiooutputsettings.h.
Referenced by AudioConfigSettings::CheckConfiguration(), AudioConfigSettings::CheckPassthrough(), AudioOutput::GetAudioDeviceConfig(), and AudioSetupWizard::Init().
|
inline |
set the provided digital feature possible values are:
Definition at line 125 of file audiooutputsettings.h.
Referenced by GetCleaned(), GetUsers(), setFeature(), AudioConfigSettings::UpdateCapabilities(), and AudioSetupWizard::UpdateCapabilities().
|
inline |
Definition at line 126 of file audiooutputsettings.h.
void AudioOutputSettings::setFeature | ( | bool | val, |
DigitalFeature | arg | ||
) |
clear or set digital feature internal mask
Definition at line 293 of file audiooutputsettings.cpp.
void AudioOutputSettings::setFeature | ( | bool | val, |
int | arg | ||
) |
Definition at line 285 of file audiooutputsettings.cpp.
void AudioOutputSettings::SetBestSupportedChannels | ( | int | channels | ) |
Force set the greatest number of channels supported by the audio device.
Definition at line 269 of file audiooutputsettings.cpp.
Referenced by GetUsers(), AudioConfigSettings::UpdateCapabilities(), and AudioSetupWizard::UpdateCapabilities().
int AudioOutputSettings::GetMaxHDRate | ( | ) | const |
return the highest iec958 rate supported.
return 0 if no HD rate are supported
Definition at line 415 of file audiooutputsettings.cpp.
Referenced by AudioPlayer::GetMaxHDRate(), and AudioOutputBase::SetupPassthrough().
|
static |
Display in human readable form the digital features supported by the output device.
Definition at line 444 of file audiooutputsettings.cpp.
Referenced by AudioOutputBase::Reconfigure().
|
inline |
Definition at line 151 of file audiooutputsettings.h.
|
static |
Setup samplerate and number of channels for passthrough.
Definition at line 456 of file audiooutputsettings.cpp.
Referenced by AudioOutputBase::SetupPassthrough().
bool AudioOutputSettings::hasELD | ( | ) | const |
get the ELD flag
Definition at line 536 of file audiooutputsettings.cpp.
Referenced by AudioOutput::GetAudioDeviceConfig().
bool AudioOutputSettings::hasValidELD | ( | ) |
Definition at line 531 of file audiooutputsettings.cpp.
Referenced by BestSupportedChannelsELD(), and BestSupportedPCMChannelsELD().
void AudioOutputSettings::setELD | ( | QByteArray * | ba | ) |
set ELD data
Definition at line 541 of file audiooutputsettings.cpp.
|
inline |
retrieve ELD data
Definition at line 175 of file audiooutputsettings.h.
Referenced by AudioOutput::GetAudioDeviceConfig().
int AudioOutputSettings::BestSupportedChannelsELD | ( | ) |
Reports best supported channel number, restricted to ELD range.
Definition at line 548 of file audiooutputsettings.cpp.
Referenced by AudioOutput::GetAudioDeviceConfig().
int AudioOutputSettings::BestSupportedPCMChannelsELD | ( | ) |
Reports best supported PCM channel number, restricted to ELD.
Definition at line 557 of file audiooutputsettings.cpp.
Referenced by GetCleaned().
|
private |
Definition at line 262 of file audiooutputsettings.cpp.
Referenced by BestSupportedChannels().
|
private |
passthrough status -1 : no 0: unknown 1: yes
Definition at line 193 of file audiooutputsettings.h.
Referenced by GetCleaned(), and operator=().
|
private |
Definition at line 195 of file audiooutputsettings.h.
Referenced by operator=(), and setFeature().
Definition at line 197 of file audiooutputsettings.h.
Referenced by GetCleaned(), GetUsers(), and operator=().
will be set to true if we were able to retrieve the device ELD (EDID like Data).
ELD contains information about the audio processing capabilities of the device connected to the audio card ELD is usually retrieved from EDID CEA-861-E extension.
Definition at line 204 of file audiooutputsettings.h.
Referenced by hasELD(), hasValidELD(), operator=(), and setELD().
|
private |
Definition at line 205 of file audiooutputsettings.h.
Referenced by BestSupportedChannelsELD(), BestSupportedPCMChannelsELD(), hasValidELD(), operator=(), and setELD().
|
private |
Definition at line 207 of file audiooutputsettings.h.
Referenced by AddSupportedRate(), BestSupportedRate(), IsSupportedRate(), NearestSupportedRate(), operator=(), and ~AudioOutputSettings().
|
private |
Definition at line 208 of file audiooutputsettings.h.
Referenced by AddSupportedChannels(), BestSupportedChannels(), IsSupportedChannels(), operator=(), SetBestSupportedChannels(), SortSupportedChannels(), and ~AudioOutputSettings().
|
private |
Definition at line 209 of file audiooutputsettings.h.
Referenced by AddSupportedFormat(), BestSupportedFormat(), IsSupportedFormat(), operator=(), and ~AudioOutputSettings().
|
private |
Definition at line 210 of file audiooutputsettings.h.
Referenced by GetNextRate(), and operator=().
|
private |
Definition at line 211 of file audiooutputsettings.h.
Referenced by GetNextFormat(), and operator=().
|
staticprivate |
Definition at line 213 of file audiooutputsettings.h.
Referenced by GetNextRate(), and operator=().
|
staticprivate |
Definition at line 214 of file audiooutputsettings.h.
Referenced by GetNextFormat(), and operator=().