MythTV
master
|
This class is to act as a fake audio output device to store the data for reencoding. More...
#include <mythtranscode/audioreencodebuffer.h>
Public Member Functions | |
AudioReencodeBuffer (AudioFormat audio_format, int audio_channels, bool passthru) | |
~AudioReencodeBuffer () override | |
void | Reconfigure (const AudioSettings &settings) override |
reconfigure sound out for new params More... | |
void | SetEffDsp (int dsprate) override |
void | Reset (void) override |
bool | AddFrames (void *buffer, int frames, std::chrono::milliseconds timecode) override |
Add frames to the audiobuffer for playback. More... | |
bool | AddData (void *buffer, int len, std::chrono::milliseconds timecode, int frames) override |
Add data to the audiobuffer for playback. More... | |
AudioBuffer * | GetData (std::chrono::milliseconds time) |
long long | GetSamples (std::chrono::milliseconds time) |
void | SetTimecode (std::chrono::milliseconds timecode) override |
bool | IsPaused (void) const override |
void | Pause (bool paused) override |
void | PauseUntilBuffered (void) override |
void | Drain (void) override |
std::chrono::milliseconds | GetAudiotime (void) override |
int | GetVolumeChannel (int) const override |
void | SetVolumeChannel (int, int) override |
uint | GetCurrentVolume (void) const override |
void | SetCurrentVolume (int) override |
void | AdjustCurrentVolume (int) override |
virtual void | SetMute (bool) |
void | ToggleMute (void) override |
MuteState | GetMuteState (void) const override |
virtual MuteState | IterateMutedChannels (void) |
void | SetSWVolume (int, bool) override |
int | GetSWVolume (void) override |
bool | CanPassthrough (int, int, AVCodecID, int) const override |
void | bufferOutputData (bool) override |
int | readOutputData (unsigned char *, size_t) override |
Public Member Functions inherited from AudioOutput | |
AudioOutput ()=default | |
~AudioOutput () override | |
virtual void | SetStretchFactor (float factor) |
virtual float | GetStretchFactor (void) const |
virtual int | GetChannels (void) const |
virtual AudioFormat | GetFormat (void) const |
virtual int | GetBytesPerFrame (void) const |
virtual AudioOutputSettings * | GetOutputSettingsCleaned (bool digital=true) |
virtual AudioOutputSettings * | GetOutputSettingsUsers (bool digital=true) |
virtual bool | CanDownmix (void) const |
virtual bool | NeedDecodingBeforePassthrough (void) const |
virtual std::chrono::milliseconds | LengthLastData (void) const |
virtual std::chrono::milliseconds | GetAudioBufferedTime (void) |
report amount of audio buffered in milliseconds. More... | |
virtual void | SetSourceBitrate (int) |
QString | GetError (void) const |
QString | GetWarning (void) const |
virtual void | GetBufferStatus (uint &fill, uint &total) |
virtual bool | IsUpmixing (void) |
virtual bool | ToggleUpmix (void) |
virtual bool | CanUpmix (void) |
bool | PulseStatus (void) const |
virtual bool | CanProcess (AudioFormat fmt) |
virtual uint32_t | CanProcess (void) |
virtual int | DecodeAudio (AVCodecContext *ctx, uint8_t *buffer, int &data_size, const AVPacket *pkt) |
Utility routine. More... | |
Public Member Functions inherited from VolumeBase | |
VolumeBase () | |
virtual | ~VolumeBase ()=default |
void | SWVolume (bool set) |
bool | SWVolume (void) const |
virtual MuteState | SetMuteState (MuteState) |
Public Member Functions inherited from OutputListeners | |
OutputListeners ()=default | |
~OutputListeners () override=default | |
bool | hasVisual (void) |
void | addVisual (MythTV::Visual *v) |
void | removeVisual (MythTV::Visual *v) |
QMutex * | mutex () |
void | setBufferSize (unsigned int sz) |
unsigned int | bufferSize () const |
Public Member Functions inherited from MythObservable | |
MythObservable () | |
virtual | ~MythObservable () |
void | addListener (QObject *listener) |
Add a listener to the observable. More... | |
void | removeListener (QObject *listener) |
Remove a listener to the observable. More... | |
void | dispatch (const MythEvent &event) |
Dispatch an event to all listeners. More... | |
bool | hasListeners (void) |
Public Attributes | |
int | m_channels {-1} |
int | m_bytes_per_frame {-1} |
int | m_eff_audiorate {-1} |
std::chrono::milliseconds | m_last_audiotime {0ms} |
bool | m_passthru {false} |
int | m_audioFrameSize {0} |
Private Attributes | |
bool | m_initpassthru {false} |
QMutex | m_bufferMutex |
QList< AudioBuffer * > | m_bufferList |
AudioBuffer * | m_saveBuffer {nullptr} |
Additional Inherited Members | |
Public Types inherited from AudioOutput | |
using | ADCVect = QVector< AudioDeviceConfig > |
Static Public Member Functions inherited from AudioOutput | |
static void | Cleanup (void) |
static ADCVect * | GetOutputList (void) |
static AudioDeviceConfig * | GetAudioDeviceConfig (QString &name, const QString &desc, bool willsuspendpa=false) |
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) |
static AudioOutput * | OpenAudio (AudioSettings &settings, bool willsuspendpa=true) |
static AudioOutput * | OpenAudio (const QString &main_device, const QString &passthru_device=QString(), bool willsuspendpa=true) |
Static Public Member Functions inherited from VolumeBase | |
static MuteState | NextMuteState (MuteState) |
Static Public Attributes inherited from AudioOutput | |
static const int | kMaxSizeBuffer = 384000 |
kMaxSizeBuffer is the maximum size of a buffer to be used with DecodeAudio More... | |
Protected Member Functions inherited from AudioOutput | |
void | Error (const QString &msg) |
void | SilentError (const QString &msg) |
void | Warn (const QString &msg) |
void | ClearError (void) |
void | ClearWarning (void) |
Protected Member Functions inherited from VolumeBase | |
void | UpdateVolume (void) |
void | SyncVolume (void) |
void | SetChannels (int new_channels) |
Protected Member Functions inherited from OutputListeners | |
void | error (const QString &e) |
void | dispatchVisual (uchar *b, unsigned long b_len, std::chrono::milliseconds timecode, int chan, int prec) |
void | prepareVisuals () |
Protected Attributes inherited from AudioOutput | |
QString | m_lastError |
QString | m_lastWarn |
bool | m_pulseWasSuspended {false} |
AVFrame * | m_frame {nullptr} |
Protected Attributes inherited from VolumeBase | |
bool | m_internalVol {false} |
Protected Attributes inherited from MythObservable | |
QMutex * | m_lock {nullptr} |
QSet< QObject * > | m_listeners |
This class is to act as a fake audio output device to store the data for reencoding.
Definition at line 31 of file audioreencodebuffer.h.
AudioReencodeBuffer::AudioReencodeBuffer | ( | AudioFormat | audio_format, |
int | audio_channels, | ||
bool | passthru | ||
) |
Definition at line 64 of file audioreencodebuffer.cpp.
|
override |
Definition at line 73 of file audioreencodebuffer.cpp.
|
overridevirtual |
reconfigure sound out for new params
Implements AudioOutput.
Definition at line 82 of file audioreencodebuffer.cpp.
Referenced by AudioReencodeBuffer().
|
overridevirtual |
dsprate | is in 100 * frames/second |
Implements AudioOutput.
Definition at line 96 of file audioreencodebuffer.cpp.
|
overridevirtual |
Implements AudioOutput.
Definition at line 101 of file audioreencodebuffer.cpp.
Referenced by AudioReencodeBuffer(), and ~AudioReencodeBuffer().
|
overridevirtual |
Add frames to the audiobuffer for playback.
[in] | buffer | pointer to audio data |
[in] | frames | number of frames added. |
[in] | timecode | timecode of the first sample added (in msec) |
Implements AudioOutput.
Definition at line 121 of file audioreencodebuffer.cpp.
|
overridevirtual |
Add data to the audiobuffer for playback.
[in] | buffer | pointer to audio data |
[in] | len | length of audio data added |
[in] | timecode | timecode of the first sample added (in msec) |
[in] | frames | number of frames added. |
Implements AudioOutput.
Definition at line 137 of file audioreencodebuffer.cpp.
Referenced by AddFrames().
AudioBuffer * AudioReencodeBuffer::GetData | ( | std::chrono::milliseconds | time | ) |
Definition at line 202 of file audioreencodebuffer.cpp.
Referenced by Transcode::TranscodeFile().
long long AudioReencodeBuffer::GetSamples | ( | std::chrono::milliseconds | time | ) |
Definition at line 220 of file audioreencodebuffer.cpp.
Referenced by Transcode::TranscodeFile().
|
overridevirtual |
Implements AudioOutput.
Definition at line 238 of file audioreencodebuffer.cpp.
|
inlineoverridevirtual |
Implements AudioOutput.
Definition at line 47 of file audioreencodebuffer.h.
|
inlineoverridevirtual |
Implements AudioOutput.
Definition at line 48 of file audioreencodebuffer.h.
|
inlineoverridevirtual |
Implements AudioOutput.
Definition at line 49 of file audioreencodebuffer.h.
|
inlineoverridevirtual |
Implements AudioOutput.
Definition at line 50 of file audioreencodebuffer.h.
|
inlineoverridevirtual |
Implements AudioOutput.
Definition at line 51 of file audioreencodebuffer.h.
|
inlineoverridevirtual |
Implements VolumeBase.
Definition at line 52 of file audioreencodebuffer.h.
|
inlineoverridevirtual |
Implements VolumeBase.
Definition at line 53 of file audioreencodebuffer.h.
|
inlineoverridevirtual |
Reimplemented from VolumeBase.
Definition at line 54 of file audioreencodebuffer.h.
|
inlineoverridevirtual |
Reimplemented from VolumeBase.
Definition at line 55 of file audioreencodebuffer.h.
|
inlineoverridevirtual |
Reimplemented from VolumeBase.
Definition at line 56 of file audioreencodebuffer.h.
|
inlinevirtual |
Definition at line 57 of file audioreencodebuffer.h.
|
inlineoverridevirtual |
Reimplemented from VolumeBase.
Definition at line 58 of file audioreencodebuffer.h.
|
inlineoverridevirtual |
Reimplemented from VolumeBase.
Definition at line 59 of file audioreencodebuffer.h.
|
inlinevirtual |
Definition at line 60 of file audioreencodebuffer.h.
|
inlineoverridevirtual |
Implements VolumeBase.
Definition at line 61 of file audioreencodebuffer.h.
|
inlineoverridevirtual |
Implements VolumeBase.
Definition at line 62 of file audioreencodebuffer.h.
|
inlineoverridevirtual |
Reimplemented from AudioOutput.
Definition at line 63 of file audioreencodebuffer.h.
|
inlineoverridevirtual |
Implements AudioOutput.
Definition at line 67 of file audioreencodebuffer.h.
|
inlineoverridevirtual |
Implements AudioOutput.
Definition at line 68 of file audioreencodebuffer.h.
int AudioReencodeBuffer::m_channels {-1} |
Definition at line 71 of file audioreencodebuffer.h.
Referenced by Reconfigure(), and Transcode::TranscodeFile().
int AudioReencodeBuffer::m_bytes_per_frame {-1} |
Definition at line 72 of file audioreencodebuffer.h.
Referenced by AddData(), AddFrames(), Reconfigure(), and Transcode::TranscodeFile().
int AudioReencodeBuffer::m_eff_audiorate {-1} |
Definition at line 73 of file audioreencodebuffer.h.
Referenced by AddData(), Reconfigure(), SetEffDsp(), and Transcode::TranscodeFile().
std::chrono::milliseconds AudioReencodeBuffer::m_last_audiotime {0ms} |
Definition at line 74 of file audioreencodebuffer.h.
Referenced by AddData(), GetAudiotime(), and SetTimecode().
Definition at line 75 of file audioreencodebuffer.h.
Referenced by Reconfigure(), and Transcode::TranscodeFile().
int AudioReencodeBuffer::m_audioFrameSize {0} |
Definition at line 76 of file audioreencodebuffer.h.
Referenced by AddData(), and Transcode::TranscodeFile().
Definition at line 79 of file audioreencodebuffer.h.
Referenced by CanPassthrough().
|
private |
Definition at line 80 of file audioreencodebuffer.h.
Referenced by AddData(), GetData(), GetSamples(), and Reset().
|
private |
Definition at line 81 of file audioreencodebuffer.h.
Referenced by AddData(), GetData(), GetSamples(), and Reset().
|
private |
Definition at line 82 of file audioreencodebuffer.h.
Referenced by AddData(), and ~AudioReencodeBuffer().