MythTV  master
audiooutputaudiotrack.h
Go to the documentation of this file.
1 #ifndef _AUDIOOUTPUTAUDIOTRACK_H_
2 #define _AUDIOOUTPUTAUDIOTRACK_H_
3 
4 #include "audiooutputbase.h"
5 
6 class QAndroidJniObject;
7 /*
8 
9  Audio output for android based on android.media.AudioTrack.
10 
11  This uses the java class org.mythtv.audio.AudioOutputAudioTrack
12  to invoke android media playback methods.
13 
14 */
15 
17 {
18  public:
19  explicit AudioOutputAudioTrack(const AudioSettings &settings);
20  ~AudioOutputAudioTrack() override;
21 
22  bool AddData(void *buffer, int len, int64_t timecode, int frames) override; // AudioOutput
23 
24  // Volume control
25  int GetVolumeChannel(int /* channel */) const override // VolumeBase
26  { return 100; }
27  void SetVolumeChannel(int /* channel */, int /* volume */) override // VolumeBase
28  {}
29  void Pause(bool paused) override; // AudioOutput
30 
31  protected:
32  bool OpenDevice(void) override; // AudioOutputBase
33  void CloseDevice(void) override; // AudioOutputBase
34  void WriteAudio(unsigned char *aubuf, int size) override; // AudioOutputBase
35  int GetBufferedOnSoundcard(void) const override; // AudioOutputBase
36  AudioOutputSettings* GetOutputSettings(bool digital) override; // AudioOutputBase
37  void SetSourceBitrate(int rate) override; // AudioOutputBase
38  bool StartOutputThread(void) override; // AudioOutputBase
39  void StopOutputThread(void) override; // AudioOutputBase
40  QAndroidJniObject *m_audioTrack {nullptr};
42 };
43 
44 #endif //_AUDIOOUTPUTAUDIOTRACK_H_
AudioOutputAudioTrack::m_bitsPer10Frames
int m_bitsPer10Frames
Definition: audiooutputaudiotrack.h:41
AudioOutputAudioTrack::SetVolumeChannel
void SetVolumeChannel(int, int) override
Definition: audiooutputaudiotrack.h:27
AudioOutputAudioTrack::m_audioTrack
QAndroidJniObject * m_audioTrack
Definition: audiooutputaudiotrack.h:40
AudioOutputAudioTrack::AddData
bool AddData(void *buffer, int len, int64_t timecode, int frames) override
Add data to the audiobuffer for playback.
Definition: audiooutputaudiotrack.cpp:266
AudioOutputAudioTrack::StartOutputThread
bool StartOutputThread(void) override
Definition: audiooutputaudiotrack.cpp:298
AudioOutputAudioTrack::GetBufferedOnSoundcard
int GetBufferedOnSoundcard(void) const override
Return the size in bytes of frames currently in the audio buffer adjusted with the audio playback lat...
Definition: audiooutputaudiotrack.cpp:241
AudioSettings
Definition: audiosettings.h:29
AudioOutputAudioTrack::SetSourceBitrate
void SetSourceBitrate(int rate) override
Definition: audiooutputaudiotrack.cpp:285
AudioOutputBase
Definition: audiooutputbase.h:50
AudioOutputAudioTrack::WriteAudio
void WriteAudio(unsigned char *aubuf, int size) override
Definition: audiooutputaudiotrack.cpp:206
AudioOutputAudioTrack::OpenDevice
bool OpenDevice(void) override
Definition: audiooutputaudiotrack.cpp:57
AudioOutputAudioTrack
Definition: audiooutputaudiotrack.h:17
AudioOutputAudioTrack::GetVolumeChannel
int GetVolumeChannel(int) const override
Definition: audiooutputaudiotrack.h:25
AudioOutputAudioTrack::AudioOutputAudioTrack
AudioOutputAudioTrack(const AudioSettings &settings)
Definition: audiooutputaudiotrack.cpp:44
audiooutputbase.h
AudioOutputAudioTrack::StopOutputThread
void StopOutputThread(void) override
Definition: audiooutputaudiotrack.cpp:310
AudioOutputAudioTrack::~AudioOutputAudioTrack
~AudioOutputAudioTrack() override
Definition: audiooutputaudiotrack.cpp:52
AudioOutputSettings
Definition: audiooutputsettings.h:50
AudioOutputAudioTrack::Pause
void Pause(bool paused) override
Definition: audiooutputaudiotrack.cpp:275
AudioOutputAudioTrack::GetOutputSettings
AudioOutputSettings * GetOutputSettings(bool digital) override
Definition: audiooutputaudiotrack.cpp:155
AudioOutputAudioTrack::CloseDevice
void CloseDevice(void) override
Definition: audiooutputaudiotrack.cpp:143