|
MythTV master
|
#include <libmythtv/audioplayer.h>
Signals | |
| void | AudioPlayerStateChanged (MythAudioPlayerState State) |
Public Member Functions | |
| AudioPlayer (MythPlayer *parent, bool muted) | |
| ~AudioPlayer () override | |
| void | addVisual (MythTV::Visual *vis) |
| void | removeVisual (MythTV::Visual *vis) |
| void | Reset (void) |
| void | DeleteOutput (void) |
| QString | ReinitAudio (void) |
| void | SetAudioOutput (AudioOutput *ao) |
| void | SetAudioInfo (const QString &main_device, const QString &passthru_device, uint samplerate, int codec_profile=-1) |
| Set audio output device parameters. More... | |
| void | SetAudioParams (AudioFormat format, int orig_channels, int channels, AVCodecID codec, int samplerate, bool passthru, int codec_profile=-1) |
| Set audio output parameters. More... | |
| void | SetEffDsp (int dsprate) |
| void | CheckFormat (void) |
| void | SetNoAudio (void) |
| bool | HasAudioIn (void) const |
| bool | HasAudioOut (void) const |
| bool | ControlsVolume (void) const |
| bool | Pause (bool pause) |
| bool | IsPaused (void) |
| void | PauseAudioUntilBuffered (void) |
| AVCodecID | GetCodec (void) const |
| int | GetOrigChannels (void) const |
| int | GetSampleRate (void) const |
| uint | GetVolume (void) |
| uint | AdjustVolume (int change) |
| uint | SetVolume (int newvolume) |
| float | GetStretchFactor (void) const |
| void | SetStretchFactor (float factor) |
| bool | IsUpmixing (void) |
| bool | EnableUpmix (bool enable, bool toggle=false) |
| bool | CanUpmix (void) |
| bool | CanPassthrough (int samplerate, int channels, AVCodecID codec, int profile) |
| bool | CanDownmix (void) |
| bool | CanAC3 (void) |
| bool | CanDTS (void) |
| bool | CanEAC3 (void) |
| bool | CanTrueHD (void) |
| bool | CanDTSHD (void) |
| uint | GetMaxChannels (void) |
| int | GetMaxHDRate (void) |
| std::chrono::milliseconds | GetAudioTime (void) |
| AudioFormat | GetFormat (void) const |
| bool | CanProcess (AudioFormat fmt) |
| uint32_t | CanProcess (void) |
| int | DecodeAudio (AVCodecContext *ctx, uint8_t *buffer, int &data_size, const AVPacket *pkt) |
| DecodeAudio Utility routine. More... | |
| bool | IsMuted (void) |
| bool | SetMuted (bool mute) |
| MuteState | GetMuteState (void) |
| MuteState | SetMuteState (MuteState mstate) |
| MuteState | IncrMuteState (void) |
| void | AddAudioData (char *buffer, int len, std::chrono::milliseconds timecode, int frames) |
| bool | NeedDecodingBeforePassthrough (void) |
| std::chrono::milliseconds | LengthLastData (void) |
| bool | GetBufferStatus (uint &fill, uint &total) |
| bool | IsBufferAlmostFull (void) |
| std::chrono::milliseconds | GetAudioBufferedTime (void) |
| AudioOutput * | GetAudioOutput (void) const |
| Return internal AudioOutput object. More... | |
Private Member Functions | |
| void | AddVisuals (void) |
| void | RemoveVisuals (void) |
| void | ResetVisuals (void) |
Private Attributes | |
| MythPlayer * | m_parent {nullptr} |
| AudioOutput * | m_audioOutput {nullptr} |
| MythAudioPlayerState | m_state { } |
| float | m_stretchFactor {1.0F} |
| QRecursiveMutex | m_lock |
| bool | m_mutedOnCreation {false} |
| QString | m_mainDevice |
| QString | m_passthruDevice |
| bool | m_noAudioIn {false} |
| bool | m_noAudioOut {true} |
| bool | m_controlsVolume {true} |
| std::vector< MythTV::Visual * > | m_visuals |
Definition at line 22 of file audioplayer.h.
| AudioPlayer::AudioPlayer | ( | MythPlayer * | parent, |
| bool | muted | ||
| ) |
Definition at line 15 of file audioplayer.cpp.
|
override |
Definition at line 22 of file audioplayer.cpp.
| void AudioPlayer::AddAudioData | ( | char * | buffer, |
| int | len, | ||
| std::chrono::milliseconds | timecode, | ||
| int | frames | ||
| ) |
Definition at line 452 of file audioplayer.cpp.
Referenced by AvFormatDecoder::ProcessAudioPacket().
| void AudioPlayer::addVisual | ( | MythTV::Visual * | vis | ) |
Definition at line 28 of file audioplayer.cpp.
Referenced by MythPlayerAudioUI::SetupAudioGraph(), and VideoVisual::VideoVisual().
|
private |
Definition at line 56 of file audioplayer.cpp.
Referenced by ReinitAudio(), and SetAudioOutput().
| uint AudioPlayer::AdjustVolume | ( | int | change | ) |
Definition at line 320 of file audioplayer.cpp.
Referenced by MythPlayerAudioUI::ChangeVolume().
|
signal |
| bool AudioPlayer::CanAC3 | ( | void | ) |
Definition at line 394 of file audioplayer.cpp.
| bool AudioPlayer::CanDownmix | ( | void | ) |
Definition at line 441 of file audioplayer.cpp.
Referenced by AvFormatDecoder::DecoderWillDownmix().
| bool AudioPlayer::CanDTS | ( | void | ) |
Definition at line 399 of file audioplayer.cpp.
| bool AudioPlayer::CanDTSHD | ( | void | ) |
Definition at line 414 of file audioplayer.cpp.
Referenced by AvFormatDecoder::DoPassThrough(), and AvFormatDecoder::selectBestAudioTrack().
| bool AudioPlayer::CanEAC3 | ( | void | ) |
Definition at line 404 of file audioplayer.cpp.
| bool AudioPlayer::CanPassthrough | ( | int | samplerate, |
| int | channels, | ||
| AVCodecID | codec, | ||
| int | profile | ||
| ) |
Definition at line 433 of file audioplayer.cpp.
Referenced by AvFormatDecoder::DoPassThrough().
| bool AudioPlayer::CanProcess | ( | AudioFormat | fmt | ) |
Definition at line 516 of file audioplayer.cpp.
| uint32_t AudioPlayer::CanProcess | ( | void | ) |
Definition at line 523 of file audioplayer.cpp.
Referenced by SetAudioParams().
| bool AudioPlayer::CanTrueHD | ( | void | ) |
Definition at line 409 of file audioplayer.cpp.
| bool AudioPlayer::CanUpmix | ( | void | ) |
Definition at line 364 of file audioplayer.cpp.
| void AudioPlayer::CheckFormat | ( | void | ) |
Definition at line 175 of file audioplayer.cpp.
Referenced by MythPlayer::OpenFile().
|
inline |
Definition at line 53 of file audioplayer.h.
Referenced by MythPlayerAudioUI::ChangeMuteState().
| int AudioPlayer::DecodeAudio | ( | AVCodecContext * | ctx, |
| uint8_t * | buffer, | ||
| int & | data_size, | ||
| const AVPacket * | pkt | ||
| ) |
DecodeAudio Utility routine.
Decode an audio packet, and compact it if data is planar Return negative error code if an error occurred during decoding or the number of bytes consumed from the input AVPacket data_size contains the size of decoded data copied into buffer data decoded will be S16 samples if class instance can't handle HD audio or S16 and above otherwise. No U8 PCM format can be returned
Definition at line 540 of file audioplayer.cpp.
Referenced by AvFormatDecoder::ProcessAudioPacket().
| void AudioPlayer::DeleteOutput | ( | void | ) |
Definition at line 95 of file audioplayer.cpp.
Referenced by MythPlayer::AudioEnd(), SetAudioOutput(), MythPlayerUI::StartPlaying(), and ~AudioPlayer().
Definition at line 354 of file audioplayer.cpp.
Referenced by MythPlayerAudioUI::EnableUpmix().
| std::chrono::milliseconds AudioPlayer::GetAudioBufferedTime | ( | void | ) |
Definition at line 510 of file audioplayer.cpp.
Referenced by IsBufferAlmostFull().
|
inline |
Return internal AudioOutput object.
Definition at line 102 of file audioplayer.h.
Referenced by MythPlayerUI::EventLoop(), and AvFormatDecoder::SetupAudioStream().
| std::chrono::milliseconds AudioPlayer::GetAudioTime | ( | void | ) |
Definition at line 338 of file audioplayer.cpp.
Referenced by MythPlayerAVSync::AVSync(), and VideoVisual::GetNode().
Definition at line 487 of file audioplayer.cpp.
Referenced by IsBufferAlmostFull().
|
inline |
Definition at line 58 of file audioplayer.h.
Referenced by MythPlayerUI::GetCodecDescription(), and Transcode::TranscodeFile().
|
inline |
Definition at line 79 of file audioplayer.h.
Referenced by AvFormatDecoder::ProcessAudioPacket().
| uint AudioPlayer::GetMaxChannels | ( | void | ) |
Definition at line 419 of file audioplayer.cpp.
Referenced by AvFormatDecoder::ProcessAudioPacket(), and AvFormatDecoder::SetupAudioStream().
| int AudioPlayer::GetMaxHDRate | ( | void | ) |
Definition at line 426 of file audioplayer.cpp.
| MuteState AudioPlayer::GetMuteState | ( | void | ) |
Definition at line 312 of file audioplayer.cpp.
Referenced by MythPlayerAudioUI::ChangeMuteState(), and IncrMuteState().
|
inline |
Definition at line 59 of file audioplayer.h.
Referenced by MythPlayerUI::GetCodecDescription().
|
inline |
Definition at line 60 of file audioplayer.h.
Referenced by MythPlayerUI::GetPlaybackData(), and MythPlayerAudioUI::SetupAudioGraph().
|
inline |
Definition at line 64 of file audioplayer.h.
Referenced by MythPlayerUI::EventLoop(), MythPlayer::IsNearEnd(), MythPlayer::SetFrameRate(), MythPlayer::SetVideoParams(), MythPlayerUI::StartPlaying(), MythPlayer::syncWithAudioStretch(), and MythPlayer::UpdateFFRewSkip().
| uint AudioPlayer::GetVolume | ( | void | ) |
Definition at line 217 of file audioplayer.cpp.
Referenced by AdjustVolume(), MythPlayerAudioUI::ChangeVolume(), and SetVolume().
|
inline |
Definition at line 51 of file audioplayer.h.
Referenced by MythPlayerVisualiserUI::AutoVisualise(), MythPlayerAVSync::AVSync(), AvFormatDecoder::GetFrame(), AvFormatDecoder::ProcessAudioPacket(), AvFormatDecoder::RemoveAudioStreams(), and AvFormatDecoder::ScanStreams().
|
inline |
Definition at line 52 of file audioplayer.h.
Referenced by MythPlayerAudioUI::ChangeMuteState(), MythPlayer::ChangeSpeed(), MythPlayer::DecoderLoop(), MythPlayerAudioUI::EnableUpmix(), MythPlayer::ForceSetupAudioStream(), AvFormatDecoder::ProcessAudioPacket(), MythPlayer::SetDisablePassThrough(), and MythPlayer::syncWithAudioStretch().
| MuteState AudioPlayer::IncrMuteState | ( | void | ) |
Definition at line 305 of file audioplayer.cpp.
Referenced by MythPlayerAudioUI::ChangeMuteState().
| bool AudioPlayer::IsBufferAlmostFull | ( | void | ) |
Definition at line 496 of file audioplayer.cpp.
Referenced by MythPlayer::DecoderGetFrame(), AvFormatDecoder::GetFrame(), MythPlayer::PrebufferEnoughFrames(), and AvFormatDecoder::ProcessAudioPacket().
|
inline |
Definition at line 86 of file audioplayer.h.
Referenced by MythPlayerAudioUI::ChangeMuteState(), and SetMuted().
| bool AudioPlayer::IsPaused | ( | void | ) |
Definition at line 191 of file audioplayer.cpp.
Referenced by MythPlayerUI::EventLoop(), and MythPlayer::PrebufferEnoughFrames().
| bool AudioPlayer::IsUpmixing | ( | void | ) |
Definition at line 346 of file audioplayer.cpp.
Referenced by EnableUpmix(), and MythPlayerAudioUI::EnableUpmix().
| std::chrono::milliseconds AudioPlayer::LengthLastData | ( | void | ) |
Definition at line 480 of file audioplayer.cpp.
Referenced by AvFormatDecoder::ProcessAudioPacket().
| bool AudioPlayer::NeedDecodingBeforePassthrough | ( | void | ) |
Definition at line 473 of file audioplayer.cpp.
Referenced by AvFormatDecoder::ProcessAudioPacket().
Definition at line 181 of file audioplayer.cpp.
Referenced by MythPlayerAVSync::AVSync(), MythPlayer::Pause(), MythPlayer::Play(), MythPlayer::PrebufferEnoughFrames(), MythPlayerAVSync::ResetAVSyncForLiveTV(), and MythPlayerAVSync::SetAVSyncMusicChoice().
| void AudioPlayer::PauseAudioUntilBuffered | ( | void | ) |
Definition at line 199 of file audioplayer.cpp.
Referenced by MythPlayerAudioUI::PauseAudioUntilBuffered().
| QString AudioPlayer::ReinitAudio | ( | void | ) |
Definition at line 107 of file audioplayer.cpp.
Referenced by MythPlayerAudioUI::ReinitAudio(), AvFormatDecoder::ScanStreams(), and AvFormatDecoder::SetupAudioStream().
| void AudioPlayer::removeVisual | ( | MythTV::Visual * | vis | ) |
Definition at line 42 of file audioplayer.cpp.
Referenced by MythPlayerAudioUI::ClearAudioGraph(), and VideoVisual::~VideoVisual().
|
private |
Definition at line 66 of file audioplayer.cpp.
Referenced by DeleteOutput().
| void AudioPlayer::Reset | ( | void | ) |
Definition at line 86 of file audioplayer.cpp.
Referenced by MythPlayerAVSync::AVSync(), MythPlayer::ClearAfterSeek(), MythPlayer::PrebufferEnoughFrames(), MythDVDDecoder::ReadPacket(), and MythPlayerAudioUI::ResetAudio().
|
private |
Definition at line 76 of file audioplayer.cpp.
Referenced by ReinitAudio(), and SetAudioParams().
| void AudioPlayer::SetAudioInfo | ( | const QString & | main_device, |
| const QString & | passthru_device, | ||
| uint | samplerate, | ||
| int | codec_profile = -1 |
||
| ) |
Set audio output device parameters.
codec_profile is currently only used for DTS
Definition at line 229 of file audioplayer.cpp.
Referenced by MythPlayerAudioUI::SetupAudioOutput().
| void AudioPlayer::SetAudioOutput | ( | AudioOutput * | ao | ) |
Definition at line 207 of file audioplayer.cpp.
| void AudioPlayer::SetAudioParams | ( | AudioFormat | format, |
| int | orig_channels, | ||
| int | channels, | ||
| AVCodecID | codec, | ||
| int | samplerate, | ||
| bool | passthru, | ||
| int | codec_profile = -1 |
||
| ) |
Set audio output parameters.
codec_profile is currently only used for DTS
Definition at line 249 of file audioplayer.cpp.
Referenced by AvFormatDecoder::ScanStreams(), and AvFormatDecoder::SetupAudioStream().
| void AudioPlayer::SetEffDsp | ( | int | dsprate | ) |
Definition at line 265 of file audioplayer.cpp.
Definition at line 273 of file audioplayer.cpp.
Referenced by MythPlayerAudioUI::ChangeMuteState().
Definition at line 297 of file audioplayer.cpp.
Referenced by IncrMuteState(), ReinitAudio(), and SetMuted().
|
inline |
Definition at line 50 of file audioplayer.h.
| void AudioPlayer::SetStretchFactor | ( | float | factor | ) |
Definition at line 372 of file audioplayer.cpp.
Referenced by MythPlayer::ChangeSpeed(), ReinitAudio(), and MythPlayerAudioUI::SetupAudioOutput().
| uint AudioPlayer::SetVolume | ( | int | newvolume | ) |
Definition at line 329 of file audioplayer.cpp.
Referenced by MythPlayerAudioUI::ChangeVolume().
|
private |
Definition at line 111 of file audioplayer.h.
Referenced by AddAudioData(), addVisual(), AddVisuals(), AdjustVolume(), CanAC3(), CanDownmix(), CanDTS(), CanDTSHD(), CanEAC3(), CanPassthrough(), CanProcess(), CanTrueHD(), CanUpmix(), DecodeAudio(), DeleteOutput(), EnableUpmix(), GetAudioBufferedTime(), GetAudioTime(), GetBufferStatus(), GetMaxChannels(), GetMaxHDRate(), GetMuteState(), GetVolume(), IncrMuteState(), IsPaused(), IsUpmixing(), LengthLastData(), NeedDecodingBeforePassthrough(), Pause(), PauseAudioUntilBuffered(), ReinitAudio(), removeVisual(), RemoveVisuals(), Reset(), ResetVisuals(), SetAudioOutput(), SetEffDsp(), SetMuted(), SetMuteState(), SetStretchFactor(), and SetVolume().
Definition at line 120 of file audioplayer.h.
Referenced by AudioPlayer(), and ReinitAudio().
|
private |
Definition at line 114 of file audioplayer.h.
Referenced by addVisual(), AddVisuals(), AdjustVolume(), CanUpmix(), DeleteOutput(), EnableUpmix(), GetAudioTime(), GetMuteState(), GetVolume(), IsPaused(), IsUpmixing(), Pause(), PauseAudioUntilBuffered(), ReinitAudio(), removeVisual(), RemoveVisuals(), Reset(), ResetVisuals(), SetAudioOutput(), SetEffDsp(), SetMuted(), SetMuteState(), SetStretchFactor(), and SetVolume().
|
private |
Definition at line 116 of file audioplayer.h.
Referenced by ReinitAudio(), and SetAudioInfo().
Definition at line 115 of file audioplayer.h.
Referenced by ReinitAudio().
Definition at line 118 of file audioplayer.h.
Referenced by CheckFormat(), and ReinitAudio().
Definition at line 119 of file audioplayer.h.
Referenced by AddAudioData(), AdjustVolume(), CheckFormat(), DeleteOutput(), GetAudioTime(), GetBufferStatus(), GetMuteState(), GetVolume(), IncrMuteState(), IsPaused(), Pause(), PauseAudioUntilBuffered(), ReinitAudio(), SetEffDsp(), SetMuted(), SetMuteState(), and SetVolume().
|
private |
Definition at line 110 of file audioplayer.h.
Referenced by AddAudioData(), and ReinitAudio().
|
private |
Definition at line 117 of file audioplayer.h.
Referenced by ReinitAudio(), and SetAudioInfo().
|
private |
Definition at line 112 of file audioplayer.h.
Referenced by CheckFormat(), ReinitAudio(), SetAudioInfo(), and SetAudioParams().
|
private |
Definition at line 113 of file audioplayer.h.
Referenced by ReinitAudio(), and SetStretchFactor().
|
private |
Definition at line 121 of file audioplayer.h.
Referenced by addVisual(), AddVisuals(), removeVisual(), RemoveVisuals(), ResetVisuals(), and ~AudioPlayer().