diff options
author | Thomas Reufer <thomas@reufer.ch> | 2014-04-22 21:46:07 +0200 |
---|---|---|
committer | Thomas Reufer <thomas@reufer.ch> | 2014-04-22 21:46:07 +0200 |
commit | 6c9ac4a738357a3ded8f528df8bdbe5085dbc591 (patch) | |
tree | 22c22bf9e1b8bb23cb5cfffa4fd9144428b684a6 | |
parent | f0b7ff1f6b875034de8e6e03f12e0a905a5ed62a (diff) | |
download | vdr-plugin-rpihddevice-6c9ac4a738357a3ded8f528df8bdbe5085dbc591.tar.gz vdr-plugin-rpihddevice-6c9ac4a738357a3ded8f528df8bdbe5085dbc591.tar.bz2 |
add setup option to ignore HDMI audio EDID
-rw-r--r-- | po/de_DE.po | 17 | ||||
-rw-r--r-- | setup.c | 83 | ||||
-rw-r--r-- | setup.h | 7 |
3 files changed, 87 insertions, 20 deletions
diff --git a/po/de_DE.po b/po/de_DE.po index 658e571..76b4b03 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-rpihddevice 0.0.4\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2014-01-11 15:12+0100\n" +"POT-Creation-Date: 2014-04-22 21:38+0200\n" "PO-Revision-Date: 2013-10-14 13:36+0200\n" "Last-Translator: <thomas@reufer.ch>\n" "Language-Team: German <translation-team-de@lists.sourceforge.net>\n" @@ -23,14 +23,17 @@ msgstr "Videoformat nicht unterstützt!" msgid "HD output device for Raspberry Pi" msgstr "HD Ausgabegerät für Raspberry Pi" -msgid "analog" -msgstr "analog" - -msgid "HDMI" -msgstr "HDMI" - msgid "Audio Port" msgstr "Audioanschluss" msgid "Digital Audio Pass-Through" msgstr "Digitalton durchreichen" + +msgid "Ignore Audio EDID" +msgstr "Audio EDID ignorieren" + +msgid "analog" +msgstr "analog" + +msgid "HDMI" +msgstr "HDMI" @@ -36,20 +36,33 @@ class cRpiSetupPage : public cMenuSetupPage public: - cRpiSetupPage(int *audioPort, int *passthrough, bool *audioSetupChanged) : + cRpiSetupPage(int *audioPort, int *passthrough, int *ignoreAudioEDID, + bool *audioSetupChanged) : m_audioPort(audioPort), m_passthrough(passthrough), + m_ignoreAudioEDID(ignoreAudioEDID), m_audioSetupChanged(audioSetupChanged) { - static const char *const audioport[] = { tr("analog"), tr("HDMI") }; - m_newAudioPort = *m_audioPort; m_newPassthrough = *m_passthrough; + m_newIgnoreAudioEDID = *m_ignoreAudioEDID; - Add(new cMenuEditStraItem( - tr("Audio Port"), &m_newAudioPort, 2, audioport)); - Add(new cMenuEditBoolItem( - tr("Digital Audio Pass-Through"), &m_newPassthrough)); + Setup(); + } + + eOSState ProcessKey(eKeys Key) + { + int newAudioPort = m_newAudioPort; + bool newPassthrough = m_newPassthrough; + + eOSState state = cMenuSetupPage::ProcessKey(Key); + + if (Key != kNone) + if ((newAudioPort != m_newAudioPort) || + (newPassthrough != m_newPassthrough)) + Setup(); + + return state; } protected: @@ -58,26 +71,60 @@ protected: { *m_audioSetupChanged = (*m_audioPort != m_newAudioPort) || - (*m_passthrough != m_newPassthrough); + (*m_passthrough != m_newPassthrough) || + (*m_ignoreAudioEDID != m_newIgnoreAudioEDID); SetupStore("AudioPort", *m_audioPort = m_newAudioPort); SetupStore("PassThrough", *m_passthrough = m_newPassthrough); + SetupStore("IgnoreAudioEDID", *m_ignoreAudioEDID = m_newIgnoreAudioEDID); } private: + void Setup(void) + { + int current = Current(); + Clear(); + + Add(new cMenuEditStraItem( + tr("Audio Port"), &m_newAudioPort, 2, s_audioport)); + + if (m_newAudioPort == 1) + { + Add(new cMenuEditBoolItem( + tr("Digital Audio Pass-Through"), &m_newPassthrough)); + + if (m_newPassthrough) + Add(new cMenuEditBoolItem( + tr("Ignore Audio EDID"), &m_newIgnoreAudioEDID)); + } + + SetCurrent(Get(current)); + Display(); + } + int m_newAudioPort; int m_newPassthrough; + int m_newIgnoreAudioEDID; int *m_audioPort; int *m_passthrough; + int *m_ignoreAudioEDID; bool *m_audioSetupChanged; + static const char *const s_audioport[2]; }; +const char *const cRpiSetupPage::s_audioport[] = + { tr("analog"), tr("HDMI") }; + bool cRpiSetup::HwInit(void) { + cRpiSetup* instance = GetInstance(); + if (!instance) + return false; + bcm_host_init(); if (!vc_gencmd_send("codec_enabled MPG2")) @@ -115,9 +162,9 @@ bool cRpiSetup::HwInit(void) ILOG("using %s video output at %dx%d%s", cVideoPort::Str(port), width, height, progressive ? "p" : "i"); - GetInstance()->m_isProgressive = progressive; - GetInstance()->m_displayHeight = height; - GetInstance()->m_displayWidth = width; + instance->m_isProgressive = progressive; + instance->m_displayHeight = height; + instance->m_displayWidth = width; } else { @@ -131,11 +178,19 @@ bool cRpiSetup::HwInit(void) bool cRpiSetup::IsAudioFormatSupported(cAudioCodec::eCodec codec, int channels, int samplingRate) { + // MPEG-1 layer 2 audio pass-through not supported by audio render + // and AAC audio pass-through not yet working + if (codec == cAudioCodec::eMPG || codec == cAudioCodec::eAAC) + return false; + + if (IgnoreAudioEDID()) + return true; + if (vc_tv_hdmi_audio_supported( codec == cAudioCodec::eMPG ? EDID_AudioFormat_eMPEG1 : codec == cAudioCodec::eAC3 ? EDID_AudioFormat_eAC3 : codec == cAudioCodec::eEAC3 ? EDID_AudioFormat_eEAC3 : - codec == cAudioCodec::eAAC ? EDID_AudioFormat_eAAC : + codec == cAudioCodec::eAAC ? EDID_AudioFormat_eAAC : EDID_AudioFormat_ePCM, channels, samplingRate == 32000 ? EDID_AudioSampleRate_e32KHz : samplingRate == 44100 ? EDID_AudioSampleRate_e44KHz : @@ -174,13 +229,15 @@ bool cRpiSetup::HasAudioSetupChanged(void) cMenuSetupPage* cRpiSetup::GetSetupPage(void) { return new cRpiSetupPage( - &m_audioPort, &m_passthrough, &m_audioSetupChanged); + &m_audioPort, &m_passthrough, &m_ignoreAudioEDID, + &m_audioSetupChanged); } bool cRpiSetup::Parse(const char *name, const char *value) { if (!strcasecmp(name, "AudioPort")) m_audioPort = atoi(value); else if (!strcasecmp(name, "PassThrough")) m_passthrough = atoi(value); + else if (!strcasecmp(name, "IgnoreAudioEDID")) m_ignoreAudioEDID = atoi(value); else return false; return true; @@ -23,6 +23,9 @@ public: static bool IsAudioPassthrough(void) { return GetInstance()->m_passthrough; } + static bool IgnoreAudioEDID(void) { + return GetInstance()->m_ignoreAudioEDID; } + static bool HasAudioSetupChanged(void); static bool IsAudioFormatSupported(cAudioCodec::eCodec codec, @@ -47,6 +50,9 @@ public: private: cRpiSetup() : + m_audioPort(0), + m_passthrough(0), + m_ignoreAudioEDID(0), m_audioSetupChanged(false), m_mpeg2Enabled(false), m_isProgressive(false), @@ -59,6 +65,7 @@ private: int m_audioPort; int m_passthrough; + int m_ignoreAudioEDID; bool m_audioSetupChanged; |