- remove HAVE_SH4_HARDWARE

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2021-11-03 11:23:58 +01:00
committed by Thilo Graf
parent 3bf1b05399
commit 6b79f74b55
2 changed files with 1 additions and 73 deletions

View File

@@ -47,15 +47,7 @@
#include <cs_api.h> #include <cs_api.h>
#include <hardware/video.h> #include <hardware/video.h>
#if HAVE_SH4_HARDWARE
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <gui/kerneloptions.h>
#else
extern cVideo *videoDecoder; extern cVideo *videoDecoder;
#endif
CCECSetup::CCECSetup() CCECSetup::CCECSetup()
{ {
@@ -83,16 +75,6 @@ int CCECSetup::exec(CMenuTarget* parent, const std::string &/*actionKey*/)
return res; return res;
} }
#if HAVE_SH4_HARDWARE
#define VIDEOMENU_HDMI_CEC_STANDBY_OPTION_COUNT 3
const CMenuOptionChooser::keyval VIDEOMENU_HDMI_CEC_STANDBY_OPTIONS[VIDEOMENU_HDMI_CEC_STANDBY_OPTION_COUNT] =
{
{ 0 , LOCALE_OPTIONS_OFF },
{ 1 , LOCALE_OPTIONS_ON },
{ 2 , LOCALE_VIDEOMENU_HDMI_CEC_STANDBY_NOT_TIMER }
};
#else
#define VIDEOMENU_HDMI_CEC_MODE_OPTION_COUNT 3 #define VIDEOMENU_HDMI_CEC_MODE_OPTION_COUNT 3
const CMenuOptionChooser::keyval VIDEOMENU_HDMI_CEC_MODE_OPTIONS[VIDEOMENU_HDMI_CEC_MODE_OPTION_COUNT] = const CMenuOptionChooser::keyval VIDEOMENU_HDMI_CEC_MODE_OPTIONS[VIDEOMENU_HDMI_CEC_MODE_OPTION_COUNT] =
{ {
@@ -100,6 +82,7 @@ const CMenuOptionChooser::keyval VIDEOMENU_HDMI_CEC_MODE_OPTIONS[VIDEOMENU_HDMI_
{ VIDEO_HDMI_CEC_MODE_TUNER , LOCALE_VIDEOMENU_HDMI_CEC_MODE_TUNER }, { VIDEO_HDMI_CEC_MODE_TUNER , LOCALE_VIDEOMENU_HDMI_CEC_MODE_TUNER },
{ VIDEO_HDMI_CEC_MODE_RECORDER , LOCALE_VIDEOMENU_HDMI_CEC_MODE_RECORDER } { VIDEO_HDMI_CEC_MODE_RECORDER , LOCALE_VIDEOMENU_HDMI_CEC_MODE_RECORDER }
}; };
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE #if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
#define VIDEOMENU_HDMI_CEC_VOL_OPTION_COUNT 3 #define VIDEOMENU_HDMI_CEC_VOL_OPTION_COUNT 3
const CMenuOptionChooser::keyval VIDEOMENU_HDMI_CEC_VOL_OPTIONS[VIDEOMENU_HDMI_CEC_VOL_OPTION_COUNT] = const CMenuOptionChooser::keyval VIDEOMENU_HDMI_CEC_VOL_OPTIONS[VIDEOMENU_HDMI_CEC_VOL_OPTION_COUNT] =
@@ -109,7 +92,6 @@ const CMenuOptionChooser::keyval VIDEOMENU_HDMI_CEC_VOL_OPTIONS[VIDEOMENU_HDMI_C
{ VIDEO_HDMI_CEC_VOL_TV , LOCALE_VIDEOMENU_HDMI_CEC_VOL_TV } { VIDEO_HDMI_CEC_VOL_TV , LOCALE_VIDEOMENU_HDMI_CEC_VOL_TV }
}; };
#endif #endif
#endif
int CCECSetup::showMenu() int CCECSetup::showMenu()
{ {
@@ -118,13 +100,6 @@ int CCECSetup::showMenu()
cec->addIntroItems(LOCALE_VIDEOMENU_HDMI_CEC); cec->addIntroItems(LOCALE_VIDEOMENU_HDMI_CEC);
//cec //cec
#if HAVE_SH4_HARDWARE
CKernelOptions ko;
g_settings.hdmi_cec_mode = ko.isEnabled("cec");
CMenuOptionChooser *cec_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_HDMI_CEC_MODE, &g_settings.hdmi_cec_mode, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this);
cec1 = new CMenuOptionChooser(LOCALE_VIDEOMENU_HDMI_CEC_STANDBY, &g_settings.hdmi_cec_standby, VIDEOMENU_HDMI_CEC_STANDBY_OPTIONS, VIDEOMENU_HDMI_CEC_STANDBY_OPTION_COUNT, g_settings.hdmi_cec_mode != 0, this);
cec2 = new CMenuOptionChooser(LOCALE_VIDEOMENU_HDMI_CEC_BROADCAST, &g_settings.hdmi_cec_broadcast, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.hdmi_cec_mode != VIDEO_HDMI_CEC_MODE_OFF, this);
#else
CMenuOptionChooser *cec_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_HDMI_CEC_MODE, &g_settings.hdmi_cec_mode, VIDEOMENU_HDMI_CEC_MODE_OPTIONS, VIDEOMENU_HDMI_CEC_MODE_OPTION_COUNT, true, this); CMenuOptionChooser *cec_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_HDMI_CEC_MODE, &g_settings.hdmi_cec_mode, VIDEOMENU_HDMI_CEC_MODE_OPTIONS, VIDEOMENU_HDMI_CEC_MODE_OPTION_COUNT, true, this);
cec_ch->setHint("", LOCALE_MENU_HINT_CEC_MODE); cec_ch->setHint("", LOCALE_MENU_HINT_CEC_MODE);
cec1 = new CMenuOptionChooser(LOCALE_VIDEOMENU_HDMI_CEC_VIEW_ON, &g_settings.hdmi_cec_view_on, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.hdmi_cec_mode != VIDEO_HDMI_CEC_MODE_OFF, this); cec1 = new CMenuOptionChooser(LOCALE_VIDEOMENU_HDMI_CEC_VIEW_ON, &g_settings.hdmi_cec_view_on, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.hdmi_cec_mode != VIDEO_HDMI_CEC_MODE_OFF, this);
@@ -134,13 +109,10 @@ int CCECSetup::showMenu()
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE #if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
cec3 = new CMenuOptionChooser(LOCALE_VIDEOMENU_HDMI_CEC_VOLUME, &g_settings.hdmi_cec_volume, VIDEOMENU_HDMI_CEC_VOL_OPTIONS, VIDEOMENU_HDMI_CEC_VOL_OPTION_COUNT, g_settings.hdmi_cec_mode != VIDEO_HDMI_CEC_MODE_OFF, this); cec3 = new CMenuOptionChooser(LOCALE_VIDEOMENU_HDMI_CEC_VOLUME, &g_settings.hdmi_cec_volume, VIDEOMENU_HDMI_CEC_VOL_OPTIONS, VIDEOMENU_HDMI_CEC_VOL_OPTION_COUNT, g_settings.hdmi_cec_mode != VIDEO_HDMI_CEC_MODE_OFF, this);
cec3->setHint("", LOCALE_MENU_HINT_CEC_VOLUME); cec3->setHint("", LOCALE_MENU_HINT_CEC_VOLUME);
#endif
#endif #endif
cec->addItem(cec_ch); cec->addItem(cec_ch);
#if !HAVE_SH4_HARDWARE
cec->addItem(GenericMenuSeparatorLine); cec->addItem(GenericMenuSeparatorLine);
#endif
//------------------------------------------------------- //-------------------------------------------------------
cec->addItem(cec1); cec->addItem(cec1);
cec->addItem(cec2); cec->addItem(cec2);
@@ -154,32 +126,6 @@ int CCECSetup::showMenu()
return res; return res;
} }
#if HAVE_SH4_HARDWARE
void CCECSetup::setCECSettings(bool b)
{
printf("[neutrino CEC Settings] %s init CEC settings...\n", __FUNCTION__);
if (b) {
// wakeup
if (g_settings.hdmi_cec_mode &&
((g_settings.hdmi_cec_standby == 1) ||
(g_settings.hdmi_cec_standby == 2 && !CNeutrinoApp::getInstance()->timer_wakeup))) {
int otp = ::open("/proc/stb/cec/onetouchplay", O_WRONLY);
if (otp > -1) {
write(otp, g_settings.hdmi_cec_broadcast ? "f\n" : "0\n", 2);
close(otp);
}
}
} else {
if (g_settings.hdmi_cec_mode && g_settings.hdmi_cec_standby) {
int otp = ::open("/proc/stb/cec/systemstandby", O_WRONLY);
if (otp > -1) {
write(otp, g_settings.hdmi_cec_broadcast ? "f\n" : "0\n", 2);
close(otp);
}
}
}
}
#else
void CCECSetup::setCECSettings() void CCECSetup::setCECSettings()
{ {
printf("[neutrino CEC Settings] %s init CEC settings...\n", __FUNCTION__); printf("[neutrino CEC Settings] %s init CEC settings...\n", __FUNCTION__);
@@ -190,22 +136,9 @@ void CCECSetup::setCECSettings()
#endif #endif
videoDecoder->SetCECMode((VIDEO_HDMI_CEC_MODE)g_settings.hdmi_cec_mode); videoDecoder->SetCECMode((VIDEO_HDMI_CEC_MODE)g_settings.hdmi_cec_mode);
} }
#endif
bool CCECSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data*/) bool CCECSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data*/)
{ {
#if HAVE_SH4_HARDWARE
if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_HDMI_CEC_MODE))
{
printf("[neutrino CEC Settings] %s set CEC settings...\n", __FUNCTION__);
cec1->setActive(g_settings.hdmi_cec_mode != 0);
cec2->setActive(g_settings.hdmi_cec_mode != 0);
CKernelOptions ko;
ko.Enable("cec", g_settings.hdmi_cec_mode != 0);
g_settings.hdmi_cec_mode = ko.isEnabled("cec");
}
#else
if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_HDMI_CEC_MODE)) if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_HDMI_CEC_MODE))
{ {
printf("[neutrino CEC Settings] %s set CEC settings...\n", __FUNCTION__); printf("[neutrino CEC Settings] %s set CEC settings...\n", __FUNCTION__);
@@ -233,7 +166,6 @@ bool CCECSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data*/
} }
#endif #endif
} }
#endif
return false; return false;
} }

View File

@@ -46,11 +46,7 @@ class CCECSetup : public CMenuTarget, CChangeObserver
public: public:
CCECSetup(); CCECSetup();
~CCECSetup(); ~CCECSetup();
#if HAVE_SH4_HARDWARE
void setCECSettings(bool);
#else
void setCECSettings(); void setCECSettings();
#endif
int exec(CMenuTarget* parent, const std::string & actionKey); int exec(CMenuTarget* parent, const std::string & actionKey);
virtual bool changeNotify(const neutrino_locale_t OptionName, void * data); virtual bool changeNotify(const neutrino_locale_t OptionName, void * data);
}; };