mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 23:42:51 +02:00
Merge remote-tracking branch 'check/cst-next'
needs build- and functional fixes
Conflicts:
configure.ac
data/icons/shutdown.jpg
data/icons/start.jpg
data/locale/deutsch.locale
data/locale/english.locale
lib/libmd5sum/md5.c
src/driver/scanepg.cpp
src/driver/streamts.cpp
src/driver/vfd.cpp
src/driver/vfd.h
src/driver/volume.cpp
src/eitd/dmx.cpp
src/eitd/xmlutil.cpp
src/gui/Makefile.am
src/gui/audiomute.cpp
src/gui/channellist.cpp
src/gui/dboxinfo.cpp
src/gui/epgview.cpp
src/gui/eventlist.cpp
src/gui/filebrowser.cpp
src/gui/hdd_menu.cpp
src/gui/infoviewer.cpp
src/gui/infoviewer_bb.cpp
src/gui/infoviewer_bb.h
src/gui/keybind_setup.cpp
src/gui/luainstance.cpp
src/gui/luainstance.h
src/gui/miscsettings_menu.cpp
src/gui/moviebrowser.cpp
src/gui/movieplayer.cpp
src/gui/osd_progressbar_setup.cpp
src/gui/osd_progressbar_setup.h
src/gui/osd_setup.cpp
src/gui/osdlang_setup.cpp
src/gui/personalize.cpp
src/gui/plugins.cpp
src/gui/plugins.h
src/gui/scan.cpp
src/gui/scan_setup.cpp
src/gui/update_settings.cpp
src/gui/user_menue.cpp
src/gui/user_menue_setup.cpp
src/gui/videosettings.cpp
src/gui/widget/buttons.cpp
src/gui/widget/menue.cpp
src/gui/widget/menue.h
src/gui/widget/progresswindow.cpp
src/neutrino.cpp
src/neutrino_menue.cpp
src/nhttpd/yhttpd.cpp
src/system/helpers.cpp
src/system/locals.h
src/system/locals_intern.h
src/system/setting_helpers.cpp
src/zapit/lib/zapitclient.cpp
src/zapit/src/fastscan.cpp
src/zapit/src/frontend.cpp
src/zapit/src/getservices.cpp
src/zapit/src/scan.cpp
src/zapit/src/scannit.cpp
src/zapit/src/scanpmt.cpp
src/zapit/src/transponder.cpp
src/zapit/src/zapit.cpp
Origin commit data
------------------
Branch: ni/coolstream
Commit: 69c4dbbdba
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2014-12-25 (Thu, 25 Dec 2014)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -51,6 +51,14 @@
|
||||
#include <system/helpers.h>
|
||||
|
||||
#include <zapit/client/zapittools.h>
|
||||
#include "widget/shellwindow.h"
|
||||
#include "widget/messagebox.h"
|
||||
#include <poll.h>
|
||||
#include <fcntl.h>
|
||||
#include <vector>
|
||||
|
||||
#include <video.h>
|
||||
extern cVideo * videoDecoder;
|
||||
|
||||
#include "plugins.h"
|
||||
|
||||
@@ -61,6 +69,7 @@ extern CPlugins * g_PluginList; /* neutrino.cpp */
|
||||
extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */
|
||||
|
||||
#define PLUGINDIR_VAR "/var/tuxbox/plugins"
|
||||
#define PLUGINDIR_USB "/mnt/usb/tuxbox/plugins"
|
||||
|
||||
CPlugins::CPlugins()
|
||||
{
|
||||
@@ -68,11 +77,6 @@ CPlugins::CPlugins()
|
||||
number_of_plugins = 0;
|
||||
}
|
||||
|
||||
CPlugins::~CPlugins()
|
||||
{
|
||||
plugin_list.clear();
|
||||
}
|
||||
|
||||
bool CPlugins::plugin_exists(const std::string & filename)
|
||||
{
|
||||
return (find_plugin(filename) >= 0);
|
||||
@@ -112,6 +116,7 @@ void CPlugins::scanDir(const char *dir)
|
||||
fname += '/';
|
||||
new_plugin.cfgfile = fname.append(new_plugin.filename);
|
||||
new_plugin.cfgfile.append(".cfg");
|
||||
new_plugin.plugindir = dir;
|
||||
bool plugin_ok = parseCfg(&new_plugin);
|
||||
if (plugin_ok)
|
||||
{
|
||||
@@ -147,12 +152,33 @@ void CPlugins::loadPlugins()
|
||||
plugin_list.clear();
|
||||
sindex = 100;
|
||||
scanDir(g_settings.plugin_hdd_dir.c_str());
|
||||
scanDir(PLUGINDIR_USB);
|
||||
scanDir(PLUGINDIR_VAR);
|
||||
scanDir(PLUGINDIR);
|
||||
|
||||
sort (plugin_list.begin(), plugin_list.end());
|
||||
}
|
||||
|
||||
CPlugins::~CPlugins()
|
||||
{
|
||||
plugin_list.clear();
|
||||
}
|
||||
|
||||
bool CPlugins::overrideType(plugin *plugin_data, std::string &setting, p_type type)
|
||||
{
|
||||
if (!setting.empty()) {
|
||||
char s[setting.length() + 1];
|
||||
cstrncpy(s, setting, setting.length() + 1);
|
||||
char *t, *p = s;
|
||||
while ((t = strsep(&p, ",")))
|
||||
if (!strcmp(t, plugin_data->filename.c_str())) {
|
||||
plugin_data->type = type;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CPlugins::parseCfg(plugin *plugin_data)
|
||||
{
|
||||
std::ifstream inFile;
|
||||
@@ -173,8 +199,15 @@ bool CPlugins::parseCfg(plugin *plugin_data)
|
||||
plugin_data->vtxtpid = false;
|
||||
plugin_data->showpig = false;
|
||||
plugin_data->needoffset = false;
|
||||
plugin_data->shellwindow = false;
|
||||
plugin_data->hide = false;
|
||||
plugin_data->type = CPlugins::P_TYPE_DISABLED;
|
||||
plugin_data->integration = CPlugins::I_TYPE_DISABLED;
|
||||
plugin_data->hinticon = NEUTRINO_ICON_HINT_PLUGIN;
|
||||
|
||||
std::string _hintIcon = plugin_data->plugindir + "/" + plugin_data->filename + "_hint.png";
|
||||
if (access(_hintIcon.c_str(), F_OK) == 0)
|
||||
plugin_data->hinticon = _hintIcon;
|
||||
|
||||
for (int i = 0; i < linecount; i++)
|
||||
{
|
||||
@@ -187,11 +220,11 @@ bool CPlugins::parseCfg(plugin *plugin_data)
|
||||
|
||||
if (cmd == "index")
|
||||
{
|
||||
plugin_data->index = atoi(parm.c_str());
|
||||
plugin_data->index = atoi(parm);
|
||||
}
|
||||
else if (cmd == "pluginversion")
|
||||
{
|
||||
plugin_data->key = atoi(parm.c_str());
|
||||
plugin_data->key = atoi(parm);
|
||||
}
|
||||
else if (cmd == "name")
|
||||
{
|
||||
@@ -205,49 +238,73 @@ bool CPlugins::parseCfg(plugin *plugin_data)
|
||||
{
|
||||
plugin_data->depend = parm;
|
||||
}
|
||||
else if (cmd == "hinticon")
|
||||
{
|
||||
plugin_data->hinticon = parm;
|
||||
}
|
||||
else if (cmd == "type")
|
||||
{
|
||||
plugin_data->type = getPluginType(atoi(parm.c_str()));
|
||||
plugin_data->type = getPluginType(atoi(parm));
|
||||
}
|
||||
else if (cmd == "integration")
|
||||
{
|
||||
plugin_data->integration = getPluginIntegration(atoi(parm));
|
||||
}
|
||||
else if (cmd == "needfb")
|
||||
{
|
||||
plugin_data->fb = ((parm == "1")?true:false);
|
||||
plugin_data->fb = atoi(parm);
|
||||
}
|
||||
else if (cmd == "needrc")
|
||||
{
|
||||
plugin_data->rc = ((parm == "1")?true:false);
|
||||
plugin_data->rc = atoi(parm);
|
||||
}
|
||||
else if (cmd == "needlcd")
|
||||
{
|
||||
plugin_data->lcd = ((parm == "1")?true:false);
|
||||
plugin_data->lcd = atoi(parm);
|
||||
}
|
||||
else if (cmd == "needvtxtpid")
|
||||
{
|
||||
plugin_data->vtxtpid = ((parm == "1")?true:false);
|
||||
plugin_data->vtxtpid = atoi(parm);
|
||||
}
|
||||
else if (cmd == "pigon")
|
||||
{
|
||||
plugin_data->showpig = ((parm == "1")?true:false);
|
||||
plugin_data->showpig = atoi(parm);
|
||||
}
|
||||
else if (cmd == "needoffsets")
|
||||
{
|
||||
plugin_data->needoffset = ((parm == "1")?true:false);
|
||||
plugin_data->needoffset = atoi(parm);
|
||||
}
|
||||
else if (cmd == "shellwindow")
|
||||
{
|
||||
plugin_data->shellwindow = atoi(parm);
|
||||
}
|
||||
else if (cmd == "hide")
|
||||
{
|
||||
plugin_data->hide = ((parm == "1")?true:false);
|
||||
plugin_data->hide = atoi(parm);
|
||||
}
|
||||
else if (cmd == "needenigma")
|
||||
{
|
||||
reject = ((parm == "1")?true:false);
|
||||
reject = atoi(parm);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inFile.close();
|
||||
|
||||
_hintIcon = plugin_data->plugindir + "/" + plugin_data->hinticon + ".png";
|
||||
if (access(_hintIcon.c_str(), F_OK) == 0)
|
||||
plugin_data->hinticon = _hintIcon;
|
||||
|
||||
overrideType(plugin_data, g_settings.plugins_disabled, P_TYPE_DISABLED) ||
|
||||
overrideType(plugin_data, g_settings.plugins_game, P_TYPE_GAME) ||
|
||||
overrideType(plugin_data, g_settings.plugins_tool, P_TYPE_TOOL) ||
|
||||
overrideType(plugin_data, g_settings.plugins_script, P_TYPE_SCRIPT) ||
|
||||
overrideType(plugin_data, g_settings.plugins_lua, P_TYPE_LUA);
|
||||
|
||||
return !reject;
|
||||
}
|
||||
|
||||
#if 0
|
||||
PluginParam * CPlugins::makeParam(const char * const id, const char * const value, PluginParam * const next)
|
||||
{
|
||||
PluginParam * startparam = new PluginParam;
|
||||
@@ -267,12 +324,13 @@ PluginParam * CPlugins::makeParam(const char * const id, const int value, Plugin
|
||||
|
||||
return makeParam(id, aval, next);
|
||||
}
|
||||
#endif
|
||||
|
||||
void CPlugins::startPlugin_by_name(const std::string & name)
|
||||
void CPlugins::startPlugin_by_name(const std::string & filename)
|
||||
{
|
||||
for (int i = 0; i < (int) plugin_list.size(); i++)
|
||||
{
|
||||
if (name.compare(g_PluginList->getName(i))==0)
|
||||
if (!filename.compare(g_PluginList->getFileName(i)))
|
||||
{
|
||||
startPlugin(i);
|
||||
return;
|
||||
@@ -290,6 +348,27 @@ void CPlugins::startPlugin(const char * const name)
|
||||
|
||||
}
|
||||
|
||||
void CPlugins::popenScriptPlugin(const char * script)
|
||||
{
|
||||
pid_t pid = 0;
|
||||
FILE *f = my_popen(pid, script, "r");
|
||||
if (f != NULL)
|
||||
{
|
||||
char *output=NULL;
|
||||
size_t len = 0;
|
||||
while ((getline(&output, &len, f)) != -1)
|
||||
scriptOutput += output;
|
||||
pclose(f);
|
||||
int s;
|
||||
while (waitpid(pid, &s, WNOHANG)>0);
|
||||
kill(pid, SIGTERM);
|
||||
if (output)
|
||||
free(output);
|
||||
}
|
||||
else
|
||||
printf("[CPlugins] can't execute %s\n",script);
|
||||
}
|
||||
|
||||
void CPlugins::startScriptPlugin(int number)
|
||||
{
|
||||
const char *script = plugin_list[number].pluginfile.c_str();
|
||||
@@ -300,28 +379,17 @@ void CPlugins::startScriptPlugin(int number)
|
||||
script, plugin_list[number].cfgfile.c_str());
|
||||
return;
|
||||
}
|
||||
pid_t pid = 0;
|
||||
FILE *f = my_popen(pid,script,"r");
|
||||
if (f != NULL)
|
||||
{
|
||||
char *output=NULL;
|
||||
size_t len = 0;
|
||||
while (( getline(&output, &len, f)) != -1)
|
||||
|
||||
{
|
||||
scriptOutput += output;
|
||||
}
|
||||
pclose(f);
|
||||
int s;
|
||||
while (waitpid(pid,&s,WNOHANG)>0);
|
||||
kill(pid,SIGTERM);
|
||||
if(output)
|
||||
free(output);
|
||||
// workaround for manually messed up permissions
|
||||
if (access(script, X_OK))
|
||||
chmod(script, 0755);
|
||||
if (plugin_list[number].shellwindow)
|
||||
{
|
||||
CShellWindow(script, CShellWindow::VERBOSE | CShellWindow::ACKNOWLEDGE);
|
||||
scriptOutput = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("[CPlugins] can't execute %s\n",script);
|
||||
}
|
||||
popenScriptPlugin(script);
|
||||
}
|
||||
|
||||
void CPlugins::startLuaPlugin(int number)
|
||||
@@ -337,6 +405,11 @@ void CPlugins::startLuaPlugin(int number)
|
||||
CLuaInstance *lua = new CLuaInstance();
|
||||
lua->runScript(script);
|
||||
delete lua;
|
||||
#if HAVE_SPARK_HARDWARE
|
||||
frameBuffer->ClearFB();
|
||||
#endif
|
||||
videoDecoder->Pig(-1, -1, -1, -1);
|
||||
frameBuffer->paintBackground();
|
||||
}
|
||||
|
||||
void CPlugins::startPlugin(int number)
|
||||
@@ -345,13 +418,29 @@ void CPlugins::startPlugin(int number)
|
||||
delScriptOutput();
|
||||
/* export neutrino settings to the environment */
|
||||
char tmp[32];
|
||||
#if HAVE_SPARK_HARDWARE
|
||||
sprintf(tmp, "%d", g_settings.screen_StartX_int);
|
||||
#else
|
||||
sprintf(tmp, "%d", g_settings.screen_StartX);
|
||||
#endif
|
||||
setenv("SCREEN_OFF_X", tmp, 1);
|
||||
#if HAVE_SPARK_HARDWARE
|
||||
sprintf(tmp, "%d", g_settings.screen_StartY_int);
|
||||
#else
|
||||
sprintf(tmp, "%d", g_settings.screen_StartY);
|
||||
#endif
|
||||
setenv("SCREEN_OFF_Y", tmp, 1);
|
||||
#if HAVE_SPARK_HARDWARE
|
||||
sprintf(tmp, "%d", g_settings.screen_EndX_int);
|
||||
#else
|
||||
sprintf(tmp, "%d", g_settings.screen_EndX);
|
||||
#endif
|
||||
setenv("SCREEN_END_X", tmp, 1);
|
||||
#if HAVE_SPARK_HARDWARE
|
||||
sprintf(tmp, "%d", g_settings.screen_EndY_int);
|
||||
#else
|
||||
sprintf(tmp, "%d", g_settings.screen_EndY);
|
||||
#endif
|
||||
setenv("SCREEN_END_Y", tmp, 1);
|
||||
|
||||
bool ispip = strstr(plugin_list[number].pluginfile.c_str(), "pip") != 0;
|
||||
@@ -377,10 +466,22 @@ void CPlugins::startPlugin(int number)
|
||||
|
||||
g_RCInput->clearRCMsg();
|
||||
g_RCInput->stopInput();
|
||||
|
||||
/* stop automatic updates etc. */
|
||||
frameBuffer->Lock();
|
||||
//frameBuffer->setMode(720, 576, 8 * sizeof(fb_pixel_t));
|
||||
printf("Starting %s\n", plugin_list[number].pluginfile.c_str());
|
||||
my_system(2, plugin_list[number].pluginfile.c_str(), NULL);
|
||||
|
||||
// workaround for manually messed up permissions
|
||||
if (access(plugin_list[number].pluginfile, X_OK))
|
||||
chmod(plugin_list[number].pluginfile.c_str(), 0755);
|
||||
|
||||
my_system(2, plugin_list[number].pluginfile.c_str(), NULL);
|
||||
//frameBuffer->setMode(720, 576, 8 * sizeof(fb_pixel_t));
|
||||
frameBuffer->Unlock();
|
||||
#if HAVE_SPARK_HARDWARE
|
||||
frameBuffer->ClearFB();
|
||||
#endif
|
||||
videoDecoder->Pig(-1, -1, -1, -1);
|
||||
frameBuffer->paintBackground();
|
||||
g_RCInput->restartInput();
|
||||
g_RCInput->clearRCMsg();
|
||||
@@ -429,3 +530,32 @@ CPlugins::p_type_t CPlugins::getPluginType(int type)
|
||||
return P_TYPE_DISABLED;
|
||||
}
|
||||
}
|
||||
|
||||
CPlugins::i_type_t CPlugins::getPluginIntegration(int integration)
|
||||
{
|
||||
switch (integration)
|
||||
{
|
||||
case INTEGRATION_TYPE_DISABLED:
|
||||
return I_TYPE_DISABLED;
|
||||
break;
|
||||
/*
|
||||
case INTEGRATION_TYPE_MAIN:
|
||||
return I_TYPE_MAIN;
|
||||
break;
|
||||
*/
|
||||
case INTEGRATION_TYPE_MULTIMEDIA:
|
||||
return I_TYPE_MULTIMEDIA;
|
||||
break;
|
||||
case INTEGRATION_TYPE_SETTING:
|
||||
return I_TYPE_SETTING;
|
||||
break;
|
||||
case INTEGRATION_TYPE_SERVICE:
|
||||
return I_TYPE_SERVICE;
|
||||
break;
|
||||
case INTEGRATION_TYPE_INFORMATION:
|
||||
return I_TYPE_INFORMATION;
|
||||
break;
|
||||
default:
|
||||
return I_TYPE_DISABLED;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user