Merge remote-tracking branch 'tuxbox/master'

Origin commit data
------------------
Branch: ni/coolstream
Commit: d1f5ea76a0
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2017-08-26 (Sat, 26 Aug 2017)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2017-08-26 12:58:44 +02:00
178 changed files with 5770 additions and 3336 deletions

View File

@@ -76,10 +76,12 @@
#include "gui/eventlist.h"
#include "gui/favorites.h"
#include "gui/filebrowser.h"
#include "gui/followscreenings.h"
#include "gui/hdd_menu.h"
#include "gui/infoviewer.h"
#include "gui/mediaplayer.h"
#include "gui/movieplayer.h"
#include "gui/osd_helpers.h"
#include "gui/osd_setup.h"
#include "gui/osdlang_setup.h"
#include "gui/pictureviewer.h"
@@ -234,6 +236,8 @@ CNeutrinoApp::CNeutrinoApp()
init_td_api();
// shutdown_td_api();
#endif
osd_resolution_tmp = -1;
frameBufferInitialized = false;
frameBuffer = CFrameBuffer::getInstance();
frameBuffer->setIconBasePath(ICONSDIR);
@@ -314,22 +318,6 @@ static SNeutrinoSettings::usermenu_t usermenu_default[] = {
/**************************************************************************************
* CNeutrinoApp - loadSetup, load the application-settings *
**************************************************************************************/
#if HAVE_TRIPLEDRAGON || HAVE_SPARK_HARDWARE || HAVE_GENERIC_HARDWARE
#define DEFAULT_X_START_SD 32
#define DEFAULT_Y_START_SD 26
#define DEFAULT_X_END_SD 694
#define DEFAULT_Y_END_SD 570
#else
#define DEFAULT_X_START_SD 60
#define DEFAULT_Y_START_SD 20
#define DEFAULT_X_END_SD 1220
#define DEFAULT_Y_END_SD 560
#endif
#define DEFAULT_X_START_HD 40 //5
#define DEFAULT_Y_START_HD 25 //5
#define DEFAULT_X_END_HD 1235 //1275
#define DEFAULT_Y_END_HD 690 //715
std::string ttx_font_file = "";
@@ -339,22 +327,27 @@ int CNeutrinoApp::loadSetup(const char * fname)
int erg = 0;
configfile.clear();
//settings laden - und dabei Defaults setzen!
if(!configfile.loadConfig(fname)) {
//file existiert nicht
// load settings; setup defaults
if (!configfile.loadConfig(fname))
{
// file doesn't exist
erg = 1;
} else {
}
else
{
#if 0
/* try to detect bad / broken config file */
if (!configfile.getInt32("screen_EndX_crt", 0) ||
!configfile.getInt32("screen_EndY_crt", 0) ||
!configfile.getInt32("screen_EndX_lcd", 0) ||
!configfile.getInt32("screen_EndY_lcd", 0)) {
if (!configfile.getInt32("screen_EndX_crt_0", 0) ||
!configfile.getInt32("screen_EndY_crt_0", 0) ||
!configfile.getInt32("screen_EndX_lcd_0", 0) ||
!configfile.getInt32("screen_EndY_lcd_0", 0)) {
printf("[neutrino] config file %s is broken, using defaults\n", fname);
configfile.clear();
} else {
} else
#endif
migrateConfig(fname);
}
}
parentallocked = !access(NEUTRINO_PARENTALLOCKED_FILE, R_OK);
//theme/color options
@@ -515,7 +508,7 @@ int CNeutrinoApp::loadSetup(const char * fname)
g_settings.timer_remotebox_ip.push_back(timer_rb);
}
}
g_settings.timer_followscreenings = configfile.getInt32( "timer_followscreenings", 1 );
g_settings.timer_followscreenings = configfile.getInt32( "timer_followscreenings", CFollowScreenings::FOLLOWSCREENINGS_ON );
g_settings.infobar_sat_display = configfile.getBool("infobar_sat_display" , true );
g_settings.infobar_show_channeldesc = configfile.getBool("infobar_show_channeldesc" , false );
@@ -594,6 +587,7 @@ int CNeutrinoApp::loadSetup(const char * fname)
g_settings.epg_scan = CEpgScan::SCAN_CURRENT;
g_settings.epg_scan_mode = CEpgScan::MODE_OFF;
}
g_settings.epg_scan_rescan = configfile.getInt32("epg_scan_rescan", 24);
g_settings.epg_save_mode = configfile.getInt32("epg_save_mode", 0);
//widget settings
g_settings.widget_fade = false;
@@ -750,34 +744,37 @@ int CNeutrinoApp::loadSetup(const char * fname)
g_settings.channellist_show_numbers = configfile.getInt32("channellist_show_numbers", 1);
//screen configuration
g_settings.screen_StartX_crt = configfile.getInt32( "screen_StartX_crt", DEFAULT_X_START_SD);
g_settings.screen_StartY_crt = configfile.getInt32( "screen_StartY_crt", DEFAULT_Y_START_SD );
g_settings.screen_EndX_crt = configfile.getInt32( "screen_EndX_crt", DEFAULT_X_END_SD);
g_settings.screen_EndY_crt = configfile.getInt32( "screen_EndY_crt", DEFAULT_Y_END_SD);
g_settings.screen_StartX_lcd = configfile.getInt32( "screen_StartX_lcd", DEFAULT_X_START_HD);
g_settings.screen_StartY_lcd = configfile.getInt32( "screen_StartY_lcd", DEFAULT_Y_START_HD );
g_settings.screen_EndX_lcd = configfile.getInt32( "screen_EndX_lcd", DEFAULT_X_END_HD);
g_settings.screen_EndY_lcd = configfile.getInt32( "screen_EndY_lcd", DEFAULT_Y_END_HD);
g_settings.screen_preset = configfile.getInt32( "screen_preset", 1);
g_settings.osd_resolution = (osd_resolution_tmp == -1) ? configfile.getInt32("osd_resolution", 0) : osd_resolution_tmp;
COsdHelpers::getInstance()->g_settings_osd_resolution_save = g_settings.osd_resolution;
g_settings.screen_StartX_crt_0 = configfile.getInt32("screen_StartX_crt_0", 80);
g_settings.screen_StartY_crt_0 = configfile.getInt32("screen_StartY_crt_0", 45);
g_settings.screen_EndX_crt_0 = configfile.getInt32("screen_EndX_crt_0" , 1280 - g_settings.screen_StartX_crt_0 - 1);
g_settings.screen_EndY_crt_0 = configfile.getInt32("screen_EndY_crt_0" , 580 - g_settings.screen_StartY_crt_0 - 1);
g_settings.screen_StartX_lcd_0 = configfile.getInt32("screen_StartX_lcd_0", 40);
g_settings.screen_StartY_lcd_0 = configfile.getInt32("screen_StartY_lcd_0", 25);
g_settings.screen_EndX_lcd_0 = configfile.getInt32("screen_EndX_lcd_0" , 1280 - g_settings.screen_StartX_lcd_0 - 1);
g_settings.screen_EndY_lcd_0 = configfile.getInt32("screen_EndY_lcd_0" , 720 - g_settings.screen_StartY_lcd_0 - 1);
g_settings.screen_StartX_crt_1 = configfile.getInt32("screen_StartX_crt_1", 80);
g_settings.screen_StartY_crt_1 = configfile.getInt32("screen_StartY_crt_1", 45);
g_settings.screen_EndX_crt_1 = configfile.getInt32("screen_EndX_crt_1" , 1920 - g_settings.screen_StartX_crt_1 - 1);
g_settings.screen_EndY_crt_1 = configfile.getInt32("screen_EndY_crt_1" , 870 - g_settings.screen_StartY_crt_1 - 1);
g_settings.screen_StartX_lcd_1 = configfile.getInt32("screen_StartX_lcd_1", 40);
g_settings.screen_StartY_lcd_1 = configfile.getInt32("screen_StartY_lcd_1", 25);
g_settings.screen_EndX_lcd_1 = configfile.getInt32("screen_EndX_lcd_1" , 1920 - g_settings.screen_StartX_lcd_1 - 1);
g_settings.screen_EndY_lcd_1 = configfile.getInt32("screen_EndY_lcd_1" , 1080 - g_settings.screen_StartY_lcd_1 - 1);
g_settings.screen_preset = configfile.getInt32("screen_preset", COsdSetup::PRESET_LCD);
#if HAVE_TRIPLEDRAGON
g_settings.screen_preset = 0; /* does not make sense to have two configurations for that... */
#elif ! HAVE_COOLSTREAM
g_settings.screen_preset = 1; /* spark is now always using 1280x720 framebuffer */
#endif
g_settings.screen_StartX = g_settings.screen_preset ? g_settings.screen_StartX_lcd : g_settings.screen_StartX_crt;
g_settings.screen_StartY = g_settings.screen_preset ? g_settings.screen_StartY_lcd : g_settings.screen_StartY_crt;
g_settings.screen_EndX = g_settings.screen_preset ? g_settings.screen_EndX_lcd : g_settings.screen_EndX_crt;
g_settings.screen_EndY = g_settings.screen_preset ? g_settings.screen_EndY_lcd : g_settings.screen_EndY_crt;
g_settings.screen_width = frameBuffer->getScreenWidth(true);
g_settings.screen_height = frameBuffer->getScreenHeight(true);
setScreenSettings();
// avoid configuration mismatch
if (g_settings.screen_EndX > g_settings.screen_width)
g_settings.screen_EndX = g_settings.screen_width;
if (g_settings.screen_EndY > g_settings.screen_height)
g_settings.screen_EndY = g_settings.screen_height;
if (g_settings.screen_EndX >= g_settings.screen_width)
g_settings.screen_EndX = g_settings.screen_width - 1;
if (g_settings.screen_EndY >= g_settings.screen_height)
g_settings.screen_EndY = g_settings.screen_height - 1;
g_settings.bigFonts = configfile.getInt32("bigFonts", 1);
g_settings.window_size = configfile.getInt32("window_size", 100);
@@ -880,7 +877,7 @@ int CNeutrinoApp::loadSetup(const char * fname)
//Filebrowser
g_settings.filebrowser_showrights = configfile.getInt32("filebrowser_showrights", 1);
g_settings.filebrowser_sortmethod = configfile.getInt32("filebrowser_sortmethod", 0);
g_settings.filebrowser_sortmethod = configfile.getInt32("filebrowser_sortmethod", 1);
if ((g_settings.filebrowser_sortmethod < 0) || (g_settings.filebrowser_sortmethod >= FILEBROWSER_NUMBER_OF_SORT_VARIANTS))
g_settings.filebrowser_sortmethod = 0;
g_settings.filebrowser_denydirectoryleave = configfile.getBool("filebrowser_denydirectoryleave", false);
@@ -989,6 +986,56 @@ int CNeutrinoApp::loadSetup(const char * fname)
return erg;
}
void CNeutrinoApp::setScreenSettings()
{
g_settings.screen_width = frameBuffer->getScreenWidth(true);
g_settings.screen_height = frameBuffer->getScreenHeight(true);
switch (g_settings.osd_resolution) {
#ifdef ENABLE_CHANGE_OSD_RESOLUTION
case 1:
{
switch (g_settings.screen_preset) {
case COsdSetup::PRESET_CRT:
g_settings.screen_StartX = g_settings.screen_StartX_crt_1;
g_settings.screen_StartY = g_settings.screen_StartY_crt_1;
g_settings.screen_EndX = g_settings.screen_EndX_crt_1;
g_settings.screen_EndY = g_settings.screen_EndY_crt_1;
break;
case COsdSetup::PRESET_LCD:
default:
g_settings.screen_StartX = g_settings.screen_StartX_lcd_1;
g_settings.screen_StartY = g_settings.screen_StartY_lcd_1;
g_settings.screen_EndX = g_settings.screen_EndX_lcd_1;
g_settings.screen_EndY = g_settings.screen_EndY_lcd_1;
break;
}
}
break;
#endif
case 0:
default:
{
switch (g_settings.screen_preset) {
case COsdSetup::PRESET_CRT:
g_settings.screen_StartX = g_settings.screen_StartX_crt_0;
g_settings.screen_StartY = g_settings.screen_StartY_crt_0;
g_settings.screen_EndX = g_settings.screen_EndX_crt_0;
g_settings.screen_EndY = g_settings.screen_EndY_crt_0;
break;
case COsdSetup::PRESET_LCD:
default:
g_settings.screen_StartX = g_settings.screen_StartX_lcd_0;
g_settings.screen_StartY = g_settings.screen_StartY_lcd_0;
g_settings.screen_EndX = g_settings.screen_EndX_lcd_0;
g_settings.screen_EndY = g_settings.screen_EndY_lcd_0;
break;
}
}
break;
}
}
void CNeutrinoApp::upgradeSetup(const char * fname)
{
dprintf(DEBUG_NORMAL, "upgrade/cleanup %s\n", fname);
@@ -1218,6 +1265,7 @@ void CNeutrinoApp::saveSetup(const char * fname)
configfile.setInt32("epg_read_frequently", g_settings.epg_read_frequently);
configfile.setInt32("epg_scan", g_settings.epg_scan);
configfile.setInt32("epg_scan_mode", g_settings.epg_scan_mode);
configfile.setInt32("epg_scan_rescan", g_settings.epg_scan_rescan);
configfile.setInt32("epg_save_mode", g_settings.epg_save_mode);
configfile.setInt32("epg_cache_time" ,g_settings.epg_cache );
configfile.setInt32("epg_extendedcache_time" ,g_settings.epg_extendedcache);
@@ -1352,15 +1400,24 @@ void CNeutrinoApp::saveSetup(const char * fname)
configfile.setInt32("channellist_show_numbers", g_settings.channellist_show_numbers);
//screen configuration
configfile.setInt32( "screen_StartX_lcd", g_settings.screen_StartX_lcd );
configfile.setInt32( "screen_StartY_lcd", g_settings.screen_StartY_lcd );
configfile.setInt32( "screen_EndX_lcd", g_settings.screen_EndX_lcd );
configfile.setInt32( "screen_EndY_lcd", g_settings.screen_EndY_lcd );
configfile.setInt32( "screen_StartX_crt", g_settings.screen_StartX_crt );
configfile.setInt32( "screen_StartY_crt", g_settings.screen_StartY_crt );
configfile.setInt32( "screen_EndX_crt", g_settings.screen_EndX_crt );
configfile.setInt32( "screen_EndY_crt", g_settings.screen_EndY_crt );
configfile.setInt32( "screen_preset", g_settings.screen_preset );
configfile.setInt32("osd_resolution" , COsdHelpers::getInstance()->g_settings_osd_resolution_save);
configfile.setInt32("screen_StartX_lcd_0", g_settings.screen_StartX_lcd_0);
configfile.setInt32("screen_StartY_lcd_0", g_settings.screen_StartY_lcd_0);
configfile.setInt32("screen_EndX_lcd_0" , g_settings.screen_EndX_lcd_0);
configfile.setInt32("screen_EndY_lcd_0" , g_settings.screen_EndY_lcd_0);
configfile.setInt32("screen_StartX_crt_0", g_settings.screen_StartX_crt_0);
configfile.setInt32("screen_StartY_crt_0", g_settings.screen_StartY_crt_0);
configfile.setInt32("screen_EndX_crt_0" , g_settings.screen_EndX_crt_0);
configfile.setInt32("screen_EndY_crt_0" , g_settings.screen_EndY_crt_0);
configfile.setInt32("screen_StartX_lcd_1", g_settings.screen_StartX_lcd_1);
configfile.setInt32("screen_StartY_lcd_1", g_settings.screen_StartY_lcd_1);
configfile.setInt32("screen_EndX_lcd_1" , g_settings.screen_EndX_lcd_1);
configfile.setInt32("screen_EndY_lcd_1" , g_settings.screen_EndY_lcd_1);
configfile.setInt32("screen_StartX_crt_1", g_settings.screen_StartX_crt_1);
configfile.setInt32("screen_StartY_crt_1", g_settings.screen_StartY_crt_1);
configfile.setInt32("screen_EndX_crt_1" , g_settings.screen_EndX_crt_1);
configfile.setInt32("screen_EndY_crt_1" , g_settings.screen_EndY_crt_1);
configfile.setInt32("screen_preset" , g_settings.screen_preset);
//Software-update
configfile.setInt32 ("softupdate_mode" , g_settings.softupdate_mode );
@@ -1854,14 +1911,50 @@ void CNeutrinoApp::CmdParser(int argc, char **argv)
/**************************************************************************************
* CNeutrinoApp - setup the framebuffer *
**************************************************************************************/
void CNeutrinoApp::SetupFrameBuffer()
{
frameBuffer->init();
if(frameBuffer->setMode(720, 576, 8 * sizeof(fb_pixel_t))) {
int setFbMode = 0;
osd_resolution_tmp = -1;
#ifdef ENABLE_CHANGE_OSD_RESOLUTION
frameBuffer->setOsdResolutions();
if (frameBuffer->osd_resolutions.empty()) {
dprintf(DEBUG_NORMAL, "Error while setting framebuffer mode\n");
exit(-1);
}
uint32_t ort;
configfile.loadConfig(NEUTRINO_SETTINGS_FILE);
ort = configfile.getInt32("osd_resolution", 0);
size_t resCount = frameBuffer->osd_resolutions.size();
if (ort > (resCount - 1))
osd_resolution_tmp = ort = 0;
if (resCount == 1)
ort = 0;
setFbMode = frameBuffer->setMode(frameBuffer->osd_resolutions[ort].xRes,
frameBuffer->osd_resolutions[ort].yRes,
frameBuffer->osd_resolutions[ort].bpp);
/*
setFbMode = 0;
COsdHelpers::getInstance()->changeOsdResolution(0, true);
*/
#else
/* all other hardware ignores setMode parameters */
setFbMode = frameBuffer->setMode(0, 0, 0);
#endif
if (setFbMode == -1) {
dprintf(DEBUG_NORMAL, "Error while setting framebuffer mode\n");
exit(-1);
}
frameBuffer->Clear();
frameBufferInitialized = true;
}
/**************************************************************************************
@@ -2083,11 +2176,18 @@ void wake_up(bool &wakeup)
int CNeutrinoApp::run(int argc, char **argv)
{
puts("[neutrino] executing " NEUTRINO_APP_START_SCRIPT ".");
if (my_system(NEUTRINO_APP_START_SCRIPT) != 0)
perror(NEUTRINO_APP_START_SCRIPT " failed");
CmdParser(argc, argv);
TIMER_START();
cs_api_init();
cs_register_messenger(CSSendMessage);
#if defined(HAVE_COOL_HARDWARE) && defined(ENABLE_CHANGE_OSD_RESOLUTION)
cs_new_auto_videosystem();
#endif
g_info.hw_caps = get_hwcaps();
can_deepstandby = g_info.hw_caps->can_shutdown;
@@ -2149,6 +2249,8 @@ TIMER_START();
ZapStart_arg.volume = g_settings.current_volume;
ZapStart_arg.webtv_xml = &g_settings.webtv_xml;
ZapStart_arg.osd_resolution = g_settings.osd_resolution;
CCamManager::getInstance()->SetCITuner(g_settings.ci_tuner);
/* create decoders, read channels */
bool zapit_init = CZapit::getInstance()->Start(&ZapStart_arg);
@@ -2177,6 +2279,20 @@ TIMER_START();
CheckFastScan();
// dirty part of hw_caps - specify some details after zapit start
if (strcmp(g_info.hw_caps->boxname, "HD1") == 0)
{
// only SAT-HD1 has fan
if (!CFEManager::getInstance()->getFE(0)->hasSat())
g_info.hw_caps->has_fan = 0;
}
if (strcmp(g_info.hw_caps->boxname, "Neo") == 0)
{
// detecting Neo Twin by counting frontends
if (CFEManager::getInstance()->getFrontendCount() > 1)
strcpy(g_info.hw_caps->boxname, "Neo Twin");
}
//timer start
long timerd_signal = 0;
timer_wakeup = false;//init
@@ -2948,6 +3064,18 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
CMoviePlayerGui::getInstance(true).showSubtitle(data);
return messages_return::handled;
}
if (msg == NeutrinoMessages::EVT_AUTO_SET_VIDEOSYSTEM) {
printf(">>>>>[CNeutrinoApp::%s:%d] Receive EVT_AUTO_SET_VIDEOSYSTEM message\n", __func__, __LINE__);
COsdHelpers *coh = COsdHelpers::getInstance();
int videoSystem = (int)data;
if ((videoSystem != -1) /* -1 => not enabled for automode */ &&
(coh->getVideoSystem() != videoSystem)) {
coh->setVideoSystem(videoSystem, false);
if (frameBufferInitialized)
coh->changeOsdResolution(0, true, false);
}
return messages_return::handled;
}
if(msg == NeutrinoMessages::EVT_ZAP_COMPLETE) {
CZapit::getInstance()->GetAudioMode(g_settings.audio_AnalogMode);
if(g_settings.audio_AnalogMode < 0 || g_settings.audio_AnalogMode > 2)
@@ -3430,6 +3558,8 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
skipShutdownTimer = (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_SHUTDOWNTIMER_ANNOUNCE, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 450, 5) == CMsgBox::mbrYes);
}
else if( msg == NeutrinoMessages::SHUTDOWN ) {
if(CStreamManager::getInstance()->StreamStatus())
skipShutdownTimer = true;
if(!skipShutdownTimer) {
ExitRun(g_info.hw_caps->can_shutdown);
}
@@ -4121,7 +4251,7 @@ void CNeutrinoApp::radioMode( bool rezap)
CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO);
videoDecoder->Standby(false);
}
mode = mode_radio;
#ifdef ENABLE_PIP
pipDecoder->Pig(g_settings.pip_radio_x, g_settings.pip_radio_y,
g_settings.pip_radio_width, g_settings.pip_radio_height,
@@ -4129,6 +4259,12 @@ void CNeutrinoApp::radioMode( bool rezap)
#endif
CRecordManager::getInstance()->StopAutoRecord();
if (mode != mode_webtv) {
frameBuffer->useBackground(false);
frameBuffer->paintBackground();
}
mode = mode_radio;
g_RemoteControl->radioMode();
SetChannelMode(g_settings.channel_mode_radio);
@@ -4995,11 +5131,7 @@ bool CNeutrinoApp::adjustToChannelID(const t_channel_id channel_id)
}
/*
* commit 523b273a changed the names of config file entries:
* casystem_display => infobar_casystem_display
* casystem_dotmatrix => infobar_casystem_dotmatrix
* casystem_frame => infobar_casystem_frame
* convert these, so that users do not need to set up their system again
* convert config keys, so that users do not need to set up their system again
*/
struct __key_rename {
const char *from;
@@ -5010,6 +5142,14 @@ static struct __key_rename key_rename[] = {
{ "casystem_display", "infobar_casystem_display" },
{ "casystem_dotmatrix", "infobar_casystem_dotmatrix"},
{ "casystem_frame", "infobar_casystem_frame" },
{ "screen_StartX_crt", "screen_StartX_crt_0" },
{ "screen_StartY_crt", "screen_StartY_crt_0" },
{ "screen_EndX_crt", "screen_EndX_crt_0" },
{ "screen_EndY_crt", "screen_EndY_crt_0" },
{ "screen_StartX_lcd", "screen_StartX_lcd_0" },
{ "screen_StartY_lcd", "screen_StartY_lcd_0" },
{ "screen_EndX_lcd", "screen_EndX_lcd_0" },
{ "screen_EndY_lcd", "screen_EndY_lcd_0" },
{ NULL, NULL }
};
@@ -5032,9 +5172,8 @@ void CNeutrinoApp::migrateConfig(const char *fname)
/* only set new key to old value if the new key does not yet exist */
if (configfile.getInt32(to, magic) == magic)
configfile.setInt32(to, tmp);
/* always remove old key*/
/* always remove old key */
configfile.deleteKey(from);
}
/* more complex migration, including converting values etc. could be done here */
}