MythTV  master
audiooutput.cpp
Go to the documentation of this file.
1 #include <cstdio>
2 #include <cstdlib>
3 
4 // Qt utils: to parse audio list
5 #include <QtGlobal>
6 #include <QFile>
7 #include <QDateTime>
8 #include <QDir>
9 
10 #include "libmythbase/compat.h"
12 
13 #include "audiooutput.h"
14 #include "audiooutputnull.h"
15 #ifdef _WIN32
16 #include "audiooutputdx.h"
17 #include "audiooutputwin.h"
18 #endif
19 #ifdef USING_OSS
20 #include "audiooutputoss.h"
21 #endif
22 #ifdef USING_ALSA
23 #include "audiooutputalsa.h"
24 #endif
25 #ifdef Q_OS_DARWIN
26 #include "audiooutputca.h"
27 #endif
28 #ifdef USING_JACK
29 #include "audiooutputjack.h"
30 #endif
31 #ifdef USING_PULSEOUTPUT
32 #include "audiooutputpulse.h"
33 #endif
34 #ifdef USING_PULSE
35 #include "audiopulsehandler.h"
36 #endif
37 #ifdef Q_OS_ANDROID
38 #include "audiooutputopensles.h"
39 #include "audiooutputaudiotrack.h"
40 #endif
41 
42 extern "C" {
43 #include "libavcodec/avcodec.h" // to get codec id
44 }
45 #include "audioconvert.h"
46 
47 #define LOC QString("AO: ")
48 
50 {
51 #ifdef USING_PULSE
53 #endif
54 }
55 
57  const QString &main_device, const QString &passthru_device,
58  AudioFormat format, int channels, AVCodecID codec, int samplerate,
59  AudioOutputSource source, bool set_initial_vol, bool passthru,
60  int upmixer_startup, AudioOutputSettings *custom)
61 {
62  AudioSettings settings(
63  main_device, passthru_device, format, channels, codec, samplerate,
64  source, set_initial_vol, passthru, upmixer_startup, custom);
65 
66  return OpenAudio(settings);
67 }
68 
70  const QString &main_device, const QString &passthru_device,
71  bool willsuspendpa)
72 {
73  AudioSettings settings(main_device, passthru_device);
74 
75  return OpenAudio(settings, willsuspendpa);
76 }
77 
79  [[maybe_unused]] bool willsuspendpa)
80 {
81  QString &main_device = settings.m_mainDevice;
82  AudioOutput *ret = nullptr;
83 
84  // Don't suspend Pulse if unnecessary. This can save 100mS
85  if (settings.m_format == FORMAT_NONE || settings.m_channels <= 0)
86  willsuspendpa = false;
87 
88 #ifdef USING_PULSE
89  bool pulsestatus = false;
90 #else
91  {
92  static bool warned = false;
93  if (!warned && IsPulseAudioRunning())
94  {
95  warned = true;
96  LOG(VB_GENERAL, LOG_WARNING,
97  "WARNING: ***Pulse Audio is running***");
98  }
99  }
100 #endif // USING_PULSE
101 
102  settings.FixPassThrough();
103 
104  if (main_device.startsWith("PulseAudio:"))
105  {
106 #ifdef USING_PULSEOUTPUT
107  return new AudioOutputPulseAudio(settings);
108 #else
109  LOG(VB_GENERAL, LOG_ERR, "Audio output device is set to PulseAudio "
110  "but PulseAudio support is not compiled in!");
111  return nullptr;
112 #endif // USING_PULSEOUTPUT
113  }
114  if (main_device.startsWith("NULL"))
115  {
116  return new AudioOutputNULL(settings);
117  }
118 
119 #ifdef USING_PULSE
120  if (willsuspendpa)
121  {
122  bool ispulse = false;
123 #ifdef USING_ALSA
124  // Check if using ALSA, that the device doesn't contain the word
125  // "pulse" in its hint
126  if (main_device.startsWith("ALSA:"))
127  {
128  QString device_name = main_device;
129 
130  device_name.remove(0, 5);
131  QMap<QString, QString> *alsadevs =
133  if (!alsadevs->empty() && alsadevs->contains(device_name))
134  {
135  if (alsadevs->value(device_name).contains("pulse",
136  Qt::CaseInsensitive))
137  {
138  ispulse = true;
139  }
140  }
141  delete alsadevs;
142  }
143 #endif // USING_ALSA
144  if (main_device.contains("pulse", Qt::CaseInsensitive))
145  {
146  ispulse = true;
147  }
148  if (!ispulse)
149  {
151  }
152  }
153 #endif // USING_PULSE
154 
155  if (main_device.startsWith("ALSA:"))
156  {
157 #ifdef USING_ALSA
158  settings.TrimDeviceType();
159  ret = new AudioOutputALSA(settings);
160 #else
161  LOG(VB_GENERAL, LOG_ERR, "Audio output device is set to an ALSA device "
162  "but ALSA support is not compiled in!");
163 #endif
164  }
165  else if (main_device.startsWith("JACK:"))
166  {
167 #ifdef USING_JACK
168  settings.TrimDeviceType();
169  ret = new AudioOutputJACK(settings);
170 #else
171  LOG(VB_GENERAL, LOG_ERR, "Audio output device is set to a JACK device "
172  "but JACK support is not compiled in!");
173 #endif
174  }
175  else if (main_device.startsWith("DirectX:"))
176  {
177 #ifdef _WIN32
178  ret = new AudioOutputDX(settings);
179 #else
180  LOG(VB_GENERAL, LOG_ERR, "Audio output device is set to DirectX device "
181  "but DirectX support is not compiled in!");
182 #endif
183  }
184  else if (main_device.startsWith("Windows:"))
185  {
186 #ifdef _WIN32
187  ret = new AudioOutputWin(settings);
188 #else
189  LOG(VB_GENERAL, LOG_ERR, "Audio output device is set to a Windows "
190  "device but Windows support is not compiled "
191  "in!");
192 #endif
193  }
194  else if (main_device.startsWith("OpenSLES:"))
195  {
196 #ifdef Q_OS_ANDROID
197  ret = new AudioOutputOpenSLES(settings);
198 #else
199  LOG(VB_GENERAL, LOG_ERR, "Audio output device is set to a OpenSLES "
200  "device but Android support is not compiled "
201  "in!");
202 #endif
203  }
204  else if (main_device.startsWith("AudioTrack:"))
205  {
206 #ifdef Q_OS_ANDROID
207  ret = new AudioOutputAudioTrack(settings);
208 #else
209  LOG(VB_GENERAL, LOG_ERR, "Audio output device is set to AudioTrack "
210  "device but Android support is not compiled "
211  "in!");
212 #endif
213  }
214 #if defined(USING_OSS)
215  else
216  ret = new AudioOutputOSS(settings);
217 #elif defined(Q_OS_DARWIN)
218  else
219  ret = new AudioOutputCA(settings);
220 #endif
221 
222  if (!ret)
223  {
224  LOG(VB_GENERAL, LOG_CRIT, "No useable audio output driver found.");
225  LOG(VB_GENERAL, LOG_ERR, "Don't disable OSS support unless you're "
226  "not running on Linux.");
227 #ifdef USING_PULSE
228  if (pulsestatus)
230 #endif
231  return nullptr;
232  }
233 #ifdef USING_PULSE
234  ret->m_pulseWasSuspended = pulsestatus;
235 #endif
236  return ret;
237 }
238 
240 {
241 #ifdef USING_PULSE
244 #endif
245  av_frame_free(&m_frame);
246 }
247 
248 void AudioOutput::SetStretchFactor(float /*factor*/)
249 {
250 }
251 
253 {
254  return new AudioOutputSettings;
255 }
256 
258 {
259  return new AudioOutputSettings;
260 }
261 
262 bool AudioOutput::CanPassthrough(int /*samplerate*/,
263  int /*channels*/,
264  AVCodecID /*codec*/,
265  int /*profile*/) const
266 {
267  return false;
268 }
269 
270 // TODO: get rid of this if possible... need to see what uses GetError() and
271 // GetWarning() and why. These would give more useful logs as macros
272 void AudioOutput::Error(const QString &msg)
273 {
274  m_lastError = msg;
275  LOG(VB_GENERAL, LOG_ERR, "AudioOutput Error: " + m_lastError);
276 }
277 
278 void AudioOutput::SilentError(const QString &msg)
279 {
280  m_lastError = msg;
281 }
282 
283 void AudioOutput::Warn(const QString &msg)
284 {
285  m_lastWarn = msg;
286  LOG(VB_GENERAL, LOG_WARNING, "AudioOutput Warning: " + m_lastWarn);
287 }
288 
290 {
291  m_lastError.clear();
292 }
293 
295 {
296  m_lastWarn.clear();
297 }
298 
300  QString &name, const QString &desc, bool willsuspendpa)
301 {
302  AudioOutputSettings aosettings(true);
303 
304  AudioOutput *ao = OpenAudio(name, QString(), willsuspendpa);
305  if (ao)
306  {
307  aosettings = *(ao->GetOutputSettingsCleaned());
308  delete ao;
309  }
310  if (aosettings.IsInvalid())
311  {
312  if (!willsuspendpa)
313  return nullptr;
314  QString msg = tr("Invalid or unuseable audio device");
315  return new AudioOutput::AudioDeviceConfig(name, msg);
316  }
317 
318  QString capabilities = desc;
319  int max_channels = aosettings.BestSupportedChannelsELD();
320  if (aosettings.hasELD())
321  {
322  if (aosettings.getELD().isValid())
323  {
324  capabilities += tr(" (%1 connected to %2)")
325  .arg(aosettings.getELD().product_name().simplified(),
326  aosettings.getELD().connection_name());
327  }
328  else
329  {
330  capabilities += tr(" (No connection detected)");
331  }
332  }
333 
334  QString speakers;
335  switch (max_channels)
336  {
337  case 6:
338  speakers = "5.1";
339  break;
340  case 8:
341  speakers = "7.1";
342  break;
343  default:
344  speakers = "2.0";
345  break;
346  }
347 
348  capabilities += tr("\nDevice supports up to %1")
349  .arg(speakers);
350  if (aosettings.canPassthrough() >= 0)
351  {
352  if (aosettings.hasELD() && aosettings.getELD().isValid())
353  {
354  // We have an ELD, show actual reported capabilities
355  capabilities += " (" + aosettings.getELD().codecs_desc() + ")";
356  }
357  else
358  {
359  // build capabilities string, in a similar fashion as reported
360  // by ELD
361  int mask = 0;
362  mask |=
363  (static_cast<int>(aosettings.canLPCM()) << 0) |
364  (static_cast<int>(aosettings.canAC3()) << 1) |
365  (static_cast<int>(aosettings.canDTS()) << 2);
366  static const std::array<const std::string,3> s_typeNames { "LPCM", "AC3", "DTS" };
367 
368  if (mask != 0)
369  {
370  capabilities += QObject::tr(" (guessing: ");
371  bool found_one = false;
372  for (unsigned int i = 0; i < 3; i++)
373  {
374  if ((mask & (1 << i)) != 0)
375  {
376  if (found_one)
377  capabilities += ", ";
378  capabilities += QString::fromStdString(s_typeNames[i]);
379  found_one = true;
380  }
381  }
382  capabilities += QString(")");
383  }
384  }
385  }
386  LOG(VB_AUDIO, LOG_INFO, QString("Found %1 (%2)") .arg(name, capabilities));
387  auto *adc = new AudioOutput::AudioDeviceConfig(name, capabilities);
388  adc->m_settings = aosettings;
389  return adc;
390 }
391 
392 #ifdef USING_OSS
393 static void fillSelectionsFromDir(const QDir &dir,
394  AudioOutput::ADCVect *list)
395 {
396  QFileInfoList entries = dir.entryInfoList();
397  for (const auto& fi : qAsConst(entries))
398  {
399  QString name = fi.absoluteFilePath();
400  QString desc = AudioOutput::tr("OSS device");
403  if (!adc)
404  continue;
405  list->append(*adc);
406  delete adc;
407  }
408 }
409 #endif
410 
412 {
413  auto *list = new ADCVect;
414 
415 #ifdef USING_PULSE
417 #endif
418 
419 #ifdef USING_ALSA
420  QMap<QString, QString> *alsadevs = AudioOutputALSA::GetDevices("pcm");
421 
422  if (!alsadevs->empty())
423  {
424  for (auto i = alsadevs->cbegin(); i != alsadevs->cend(); ++i)
425  {
426  const QString& key = i.key();
427  const QString& desc = i.value();
428  QString devname = QString("ALSA:%1").arg(key);
429 
430  auto *adc = GetAudioDeviceConfig(devname, desc);
431  if (!adc)
432  continue;
433  list->append(*adc);
434  delete adc;
435  }
436  }
437  delete alsadevs;
438 #endif
439 #ifdef USING_OSS
440  {
441  QDir dev("/dev", "dsp*", QDir::Name, QDir::System);
442  fillSelectionsFromDir(dev, list);
443  dev.setNameFilters(QStringList("adsp*"));
444  fillSelectionsFromDir(dev, list);
445 
446  dev.setPath("/dev/sound");
447  if (dev.exists())
448  {
449  dev.setNameFilters(QStringList("dsp*"));
450  fillSelectionsFromDir(dev, list);
451  dev.setNameFilters(QStringList("adsp*"));
452  fillSelectionsFromDir(dev, list);
453  }
454  }
455 #endif
456 #ifdef USING_JACK
457  {
458  QString name = "JACK:";
459  QString desc = tr("Use JACK default sound server.");
460  auto *adc = GetAudioDeviceConfig(name, desc);
461  if (adc)
462  {
463  list->append(*adc);
464  delete adc;
465  }
466  }
467 #endif
468 #ifdef Q_OS_DARWIN
469 
470  {
471  QMap<QString, QString> *devs = AudioOutputCA::GetDevices(nullptr);
472  if (!devs->empty())
473  {
474  for (QMap<QString, QString>::const_iterator i = devs->begin();
475  i != devs->end(); ++i)
476  {
477  QString key = i.key();
478  QString desc = i.value();
479  QString devname = QString("CoreAudio:%1").arg(key);
480 
481  auto adc = GetAudioDeviceConfig(devname, desc);
482  if (!adc)
483  continue;
484  list->append(*adc);
485  delete adc;
486  }
487  }
488  delete devs;
489  QString name = "CoreAudio:Default Output Device";
490  QString desc = tr("CoreAudio default output");
491  auto adc = GetAudioDeviceConfig(name, desc);
492  if (adc)
493  {
494  list->append(*adc);
495  delete adc;
496  }
497  }
498 #endif
499 #ifdef _WIN32
500  {
501  QString name = "Windows:";
502  QString desc = "Windows default output";
503  auto adc = GetAudioDeviceConfig(name, desc);
504  if (adc)
505  {
506  list->append(*adc);
507  delete adc;
508  }
509 
510  QMap<int, QString> *dxdevs = AudioOutputDX::GetDXDevices();
511 
512  if (!dxdevs->empty())
513  {
514  for (QMap<int, QString>::const_iterator i = dxdevs->begin();
515  i != dxdevs->end(); ++i)
516  {
517  QString devdesc = i.value();
518  QString devname = QString("DirectX:%1").arg(devdesc);
519 
520  adc = GetAudioDeviceConfig(devname, devdesc);
521  if (!adc)
522  continue;
523  list->append(*adc);
524  delete adc;
525  }
526  }
527  delete dxdevs;
528  }
529 #endif
530 
531 #ifdef USING_PULSE
532  if (pasuspended)
534 #endif
535 
536 #ifdef USING_PULSEOUTPUT
537  {
538  QString name = "PulseAudio:default";
539  QString desc = tr("PulseAudio default sound server.");
540  auto *adc = GetAudioDeviceConfig(name, desc);
541  if (adc)
542  {
543  list->append(*adc);
544  delete adc;
545  }
546  }
547 #endif
548 
549 #ifdef Q_OS_ANDROID
550  {
551  QString name = "OpenSLES:";
552  QString desc = tr("OpenSLES default output. Stereo support only.");
553  auto adc = GetAudioDeviceConfig(name, desc);
554  if (adc)
555  {
556  list->append(*adc);
557  delete adc;
558  }
559  }
560  {
561  QString name = "AudioTrack:";
562  QString desc = tr("Android AudioTrack output. Supports surround sound.");
563  auto adc = GetAudioDeviceConfig(name, desc);
564  if (adc)
565  {
566  list->append(*adc);
567  delete adc;
568  }
569  }
570 #endif
571 
572  QString name = "NULL";
573  QString desc = "NULL device";
574  auto *adc = GetAudioDeviceConfig(name, desc);
575  if (adc)
576  {
577  list->append(*adc);
578  delete adc;
579  }
580  return list;
581 }
582 
590 int AudioOutput::DecodeAudio(AVCodecContext *ctx,
591  uint8_t *buffer, int &data_size,
592  const AVPacket *pkt)
593 {
594  bool got_frame = false;
595 
596  data_size = 0;
597  if (!m_frame)
598  {
599  if (!(m_frame = av_frame_alloc()))
600  {
601  return AVERROR(ENOMEM);
602  }
603  }
604  else
605  {
606  av_frame_unref(m_frame);
607  }
608 
609 // SUGGESTION
610 // Now that avcodec_decode_audio4 is deprecated and replaced
611 // by 2 calls (receive frame and send packet), this could be optimized
612 // into separate routines or separate threads.
613 // Also now that it always consumes a whole buffer some code
614 // in the caller may be able to be optimized.
615  int ret = avcodec_receive_frame(ctx,m_frame);
616  if (ret == 0)
617  got_frame = true;
618  if (ret == AVERROR(EAGAIN))
619  ret = 0;
620  if (ret == 0)
621  ret = avcodec_send_packet(ctx, pkt);
622  if (ret == AVERROR(EAGAIN))
623  ret = 0;
624  else if (ret < 0)
625  {
626  std::string error;
627  LOG(VB_AUDIO, LOG_ERR, LOC +
628  QString("audio decode error: %1 (%2)")
629  .arg(av_make_error_stdstring(error, ret))
630  .arg(got_frame));
631  return ret;
632  }
633  else
634  ret = pkt->size;
635 
636  if (!got_frame)
637  {
638  LOG(VB_AUDIO, LOG_DEBUG, LOC +
639  QString("audio decode, no frame decoded (%1)").arg(ret));
640  return ret;
641  }
642 
643  auto format = (AVSampleFormat)m_frame->format;
644  AudioFormat fmt =
645  AudioOutputSettings::AVSampleFormatToFormat(format, ctx->bits_per_raw_sample);
646 
647  data_size = m_frame->nb_samples * m_frame->ch_layout.nb_channels * av_get_bytes_per_sample(format);
648 
649  // May need to convert audio to S16
650  AudioConvert converter(fmt, CanProcess(fmt) ? fmt : FORMAT_S16);
651  uint8_t* src = nullptr;
652 
653  if (av_sample_fmt_is_planar(format))
654  {
655  src = buffer;
656  converter.InterleaveSamples(m_frame->ch_layout.nb_channels,
657  src,
658  (const uint8_t **)m_frame->extended_data,
659  data_size);
660  }
661  else
662  {
663  // data is already compacted...
664  src = m_frame->extended_data[0];
665  }
666 
667  uint8_t* transit = buffer;
668 
669  if (!CanProcess(fmt) &&
670  av_get_bytes_per_sample(ctx->sample_fmt) < AudioOutputSettings::SampleSize(converter.Out()))
671  {
672  // this conversion can't be done in place
673  transit = (uint8_t*)av_malloc(data_size * av_get_bytes_per_sample(ctx->sample_fmt)
674  / AudioOutputSettings::SampleSize(converter.Out()));
675  if (!transit)
676  {
677  LOG(VB_AUDIO, LOG_ERR, LOC +
678  QString("audio decode, out of memory"));
679  data_size = 0;
680  return ret;
681  }
682  }
683  if (!CanProcess(fmt) || src != transit)
684  {
685  data_size = converter.Process(transit, src, data_size, true);
686  }
687  if (transit != buffer)
688  {
689  av_free(transit);
690  }
691  return ret;
692 }
FORMAT_NONE
@ FORMAT_NONE
Definition: audiooutputsettings.h:25
audiooutputwin.h
AudioOutputSettings::AVSampleFormatToFormat
static AudioFormat AVSampleFormatToFormat(AVSampleFormat format, int bits=0)
Return AVSampleFormat closest equivalent to AudioFormat.
Definition: audiooutputsettings.cpp:198
AudioOutputDX
Definition: audiooutputdx.h:12
FORMAT_S16
@ FORMAT_S16
Definition: audiooutputsettings.h:27
audiooutputoss.h
AudioOutputALSA
Definition: audiooutputalsa.h:12
PulseHandler::Suspend
static bool Suspend(enum PulseAction action)
Definition: audiopulsehandler.cpp:42
AudioOutput::Error
void Error(const QString &msg)
Definition: audiooutput.cpp:272
eld::connection_name
QString connection_name() const
Definition: eldutils.cpp:441
AudioOutputJACK
Definition: audiooutputjack.h:19
AudioOutput::Warn
void Warn(const QString &msg)
Definition: audiooutput.cpp:283
AudioOutputSettings::SampleSize
static int SampleSize(AudioFormat format)
Definition: audiooutputsettings.cpp:180
AudioOutputWin
Definition: audiooutputwin.h:9
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
AudioOutputALSA::GetDevices
static QMap< QString, QString > * GetDevices(const char *type)
Definition: audiooutputalsa.cpp:986
audiooutputalsa.h
AudioConvert::Out
AudioFormat Out(void)
Definition: audioconvert.h:49
AudioOutputPulseAudio
Definition: audiooutputpulse.h:27
OutputListeners::error
void error(const QString &e)
Definition: output.cpp:29
audiooutputaudiotrack.h
LOC
#define LOC
Definition: audiooutput.cpp:47
audiooutputjack.h
AudioOutput::OpenAudio
static AudioOutput * OpenAudio(const QString &main_device, const QString &passthru_device, AudioFormat format, int channels, AVCodecID codec, int samplerate, AudioOutputSource source, bool set_initial_vol, bool passthru, int upmixer_startup=0, AudioOutputSettings *custom=nullptr)
Definition: audiooutput.cpp:56
AudioOutputCA
Implements Core Audio (Mac OS X Hardware Abstraction Layer) output.
Definition: audiooutputca.h:13
AudioSettings::FixPassThrough
void FixPassThrough(void)
Definition: audiosettings.cpp:93
AudioOutputCA::GetDevices
static QMap< QString, QString > * GetDevices(const char *type=nullptr)
Definition: audiooutputca.cpp:1758
IsPulseAudioRunning
bool IsPulseAudioRunning(void)
Is A/V Sync destruction daemon is running on this host?
Definition: mythmiscutil.cpp:638
AudioOutputDX::GetDXDevices
static QMap< int, QString > * GetDXDevices(void)
Definition: audiooutputdx.cpp:624
AudioSettings
Definition: audiosettings.h:28
audiooutputopensles.h
AudioConvert
Definition: audioconvert.h:32
AudioOutput::CanPassthrough
virtual bool CanPassthrough(int samplerate, int channels, AVCodecID codec, int profile) const
Definition: audiooutput.cpp:262
AudioOutput
Definition: audiooutput.h:26
audiooutputnull.h
AudioOutputSettings::BestSupportedChannelsELD
int BestSupportedChannelsELD()
Reports best supported channel number, restricted to ELD range.
Definition: audiooutputsettings.cpp:549
AudioOutputSettings::canPassthrough
int canPassthrough() const
Definition: audiooutputsettings.h:77
compat.h
AudioOutputOpenSLES
Definition: audiooutputopensles.h:17
AudioOutput::GetOutputSettingsCleaned
virtual AudioOutputSettings * GetOutputSettingsCleaned(bool digital=true)
Definition: audiooutput.cpp:252
audiopulsehandler.h
PulseHandler::kPulseResume
@ kPulseResume
Definition: audiopulsehandler.h:14
AudioSettings::m_mainDevice
QString m_mainDevice
Definition: audiosettings.h:70
AudioOutput::GetAudioDeviceConfig
static AudioDeviceConfig * GetAudioDeviceConfig(QString &name, const QString &desc, bool willsuspendpa=false)
Definition: audiooutput.cpp:299
AudioOutputSettings::hasELD
bool hasELD() const
get the ELD flag
Definition: audiooutputsettings.cpp:537
PulseHandler::kPulseSuspend
@ kPulseSuspend
Definition: audiopulsehandler.h:13
AudioOutputSettings::canDTS
bool canDTS() const
return true if device can or may support DTS (deprecated, see canFeature())
Definition: audiooutputsettings.h:102
AudioOutput::DecodeAudio
virtual int DecodeAudio(AVCodecContext *ctx, uint8_t *buffer, int &data_size, const AVPacket *pkt)
Utility routine.
Definition: audiooutput.cpp:590
eld::product_name
QString product_name() const
Definition: eldutils.cpp:436
AudioOutputSettings::IsInvalid
bool IsInvalid() const
return true if class instance is marked invalid.
Definition: audiooutputsettings.h:113
AudioOutputAudioTrack
Definition: audiooutputaudiotrack.h:16
AudioOutputOSS
Definition: audiooutputoss.h:14
AudioOutput::AudioDeviceConfig
Definition: audiooutput.h:31
AudioOutputNULL
Definition: audiooutputnull.h:21
audiooutputpulse.h
mythmiscutil.h
fillSelectionsFromDir
static void fillSelectionsFromDir(const QDir &dir, AudioOutput::ADCVect *list)
Definition: audiooutput.cpp:393
AudioOutput::SilentError
void SilentError(const QString &msg)
Definition: audiooutput.cpp:278
AudioSettings::m_format
AudioFormat m_format
Definition: audiosettings.h:72
AudioOutput::SetStretchFactor
virtual void SetStretchFactor(float factor)
Definition: audiooutput.cpp:248
AudioConvert::Process
int Process(void *out, const void *in, int bytes, bool noclip=false)
Process Parameters: out : destination buffer where converted samples will be copied in : source buffe...
Definition: audioconvert.cpp:654
AudioOutputSettings
Definition: audiooutputsettings.h:48
audiooutput.h
audiooutputdx.h
AudioOutput::CanProcess
virtual uint32_t CanProcess(void)
Definition: audiooutput.h:175
AudioOutput::ClearError
void ClearError(void)
Definition: audiooutput.cpp:289
AudioOutputSource
AudioOutputSource
Definition: audiosettings.h:21
audiooutputca.h
AudioOutputSettings::canLPCM
bool canLPCM() const
return true if device supports multichannels PCM (deprecated, see canFeature())
Definition: audiooutputsettings.h:107
AudioOutput::ClearWarning
void ClearWarning(void)
Definition: audiooutput.cpp:294
AudioConvert::InterleaveSamples
void InterleaveSamples(int channels, uint8_t *output, const uint8_t *const *input, int data_size)
Definition: audioconvert.cpp:883
PulseHandler::kPulseCleanup
@ kPulseCleanup
Definition: audiopulsehandler.h:15
AudioOutput::m_lastWarn
QString m_lastWarn
Definition: audiooutput.h:207
AudioOutput::~AudioOutput
~AudioOutput() override
Definition: audiooutput.cpp:239
AudioSettings::TrimDeviceType
void TrimDeviceType(void)
Definition: audiosettings.cpp:99
AudioFormat
AudioFormat
Definition: audiooutputsettings.h:24
AudioOutput::Cleanup
static void Cleanup(void)
Definition: audiooutput.cpp:49
eld::codecs_desc
QString codecs_desc() const
Definition: eldutils.cpp:473
AudioOutput::ADCVect
QVector< AudioDeviceConfig > ADCVect
Definition: audiooutput.h:49
AudioOutput::GetOutputSettingsUsers
virtual AudioOutputSettings * GetOutputSettingsUsers(bool digital=true)
Definition: audiooutput.cpp:257
AudioOutputSettings::getELD
eld & getELD(void)
retrieve ELD data
Definition: audiooutputsettings.h:175
eld::isValid
bool isValid() const
Definition: eldutils.cpp:407
AudioOutput::m_pulseWasSuspended
bool m_pulseWasSuspended
Definition: audiooutput.h:208
AudioOutput::m_frame
AVFrame * m_frame
Definition: audiooutput.h:209
av_make_error_stdstring
char * av_make_error_stdstring(std::string &errbuf, int errnum)
Definition: mythaverror.cpp:41
AudioOutput::GetOutputList
static ADCVect * GetOutputList(void)
Definition: audiooutput.cpp:411
AudioOutput::m_lastError
QString m_lastError
Definition: audiooutput.h:206
AudioSettings::m_channels
int m_channels
Definition: audiosettings.h:73
AudioOutputSettings::canAC3
bool canAC3() const
return true if device can or may support AC3 (deprecated, see canFeature())
Definition: audiooutputsettings.h:97
audioconvert.h