Merge branch 'ni/mp' into ni/cst-next

Conflicts:
	data/icons/shutdown.jpg
	data/icons/start.jpg
	data/locale/Makefile.am
	data/locale/deutsch.locale
	data/locale/english.locale
	lib/libdvbsub/dvbsub.cpp
	lib/libdvbsub/dvbsubtitle.cpp
	lib/libtuxtxt/tuxtxt.cpp
	lib/libtuxtxt/tuxtxt.h
	src/gui/dboxinfo.cpp
	src/gui/movieplayer.cpp
	src/gui/streaminfo2.cpp
	src/gui/themes.cpp
	src/neutrino.cpp
	src/neutrino_menue.cpp
	src/nhttpd/Makefile.am
	src/system/flashtool.cpp


Origin commit data
------------------
Commit: 161347db29
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-08-26 (Fri, 26 Aug 2016)
This commit is contained in:
vanhofen
2016-08-26 19:13:47 +02:00
220 changed files with 7577 additions and 1615 deletions

View File

@@ -1,6 +1,9 @@
/*
Neutrino-GUI - DBoxII-Project
(C) 2004-2009 tuxbox project contributors
(C) 2011-2012,2015 Stefan Seyfried
License: GPL
@@ -33,6 +36,7 @@
#include <global.h>
#include <neutrino.h>
#include <driver/abstime.h>
#include <driver/display.h>
#include <driver/fontrenderer.h>
#include <driver/rcinput.h>
@@ -135,15 +139,17 @@ int CStreamInfo2::doSignalStrengthLoop ()
neutrino_msg_t msg;
uint64_t maxb, minb, lastb, tmp_rate;
unsigned int current_pmt_version= pmt_version;
unsigned int current_pmt_version = (unsigned int)-1;
int cnt = 0;
char tmp_str[150];
int delay_counter = 0;
const int delay = 15;
int offset = g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_BITRATE));
int sw = g_Font[font_info]->getRenderWidth ("99999.999");
int dheight = g_Font[font_info]->getHeight (); //NI
maxb = minb = lastb = tmp_rate = 0;
string br_str = string(g_Locale->getText(LOCALE_STREAMINFO_BITRATE)) + ":";
string avg_str = "(" + string(g_Locale->getText(LOCALE_STREAMINFO_AVERAGE_BITRATE)) + ")";
int offset = g_Font[font_info]->getRenderWidth(avg_str);
int dheight = g_Font[font_info]->getHeight ();
int dx1 = x + 10;
ts_setup ();
while (1) {
neutrino_msg_data_t data;
@@ -182,26 +188,25 @@ int CStreamInfo2::doSignalStrengthLoop ()
rate.min_short_average = minb = bit_s;
char currate[150];
snprintf(tmp_str,sizeof(tmp_str), "%s:",g_Locale->getText(LOCALE_STREAMINFO_BITRATE));
g_Font[font_info]->RenderString(dx1 , average_bitrate_pos, offset+10, tmp_str, COL_MENUCONTENT_TEXT);
sprintf(currate, "%5llu.%02llu", rate.short_average / 1000ULL, rate.short_average % 1000ULL);
sprintf(currate, "%u", rate.short_average / 1000);
g_Font[font_info]->RenderString(dx1, average_bitrate_pos, width/2, br_str, COL_MENUCONTENT_TEXT);
g_Font[font_info]->RenderString(dx1+average_bitrate_offset+sw+10 , average_bitrate_pos, offset, avg_str, COL_MENUCONTENT_TEXT);
frameBuffer->paintBoxRel (dx1 + average_bitrate_offset , average_bitrate_pos -dheight, sw, dheight, COL_MENUCONTENT_PLUS_0);
g_Font[font_info]->RenderString (dx1 + average_bitrate_offset , average_bitrate_pos, sw - 10, currate, COL_MENUCONTENT_TEXT);
snprintf(tmp_str,sizeof(tmp_str), "(%s)",g_Locale->getText(LOCALE_STREAMINFO_AVERAGE_BITRATE));
g_Font[font_info]->RenderString (dx1 + average_bitrate_offset + sw , average_bitrate_pos, sw *2, tmp_str, COL_MENUCONTENT_TEXT);
g_Font[font_info]->RenderString(dx1+average_bitrate_offset, average_bitrate_pos, sw, currate, COL_MENUCONTENT_TEXT);
}
if (!mp) {
showSNR ();
if(pmt_version != current_pmt_version && delay_counter > delay){
current_pmt_version = pmt_version;
paint_techinfo (x + 10, y+ hheight +5);
if (++delay_counter > delay) {
CZapitChannel * channel = CZapit::getInstance()->GetCurrentChannel();
if (channel)
pmt_version = channel->getPmtVersion();
delay_counter = 0;
if (pmt_version != current_pmt_version && delay_counter > delay){
current_pmt_version = pmt_version;
paint_techinfo(dx1, y + hheight + 5);
}
}
}
delay_counter++;
}
rate.short_average = abit_s;
if (signal.max_ber < signal.ber)
@@ -228,6 +233,10 @@ int CStreamInfo2::doSignalStrengthLoop ()
signal.old_snr = signal.snr;
signal.old_ber = signal.ber;
neutrino_msg_data_t data;
/* rate limiting is done in update_rate */
g_RCInput->getMsg_us(&msg, &data, 0);
// switch paint mode
if (msg == CRCInput::RC_red || msg == CRCInput::RC_blue || msg == CRCInput::RC_green || msg == CRCInput::RC_yellow) {
hide ();
@@ -468,7 +477,7 @@ void CStreamInfo2::paint (int /*mode*/)
pip->paint(CC_SAVE_SCREEN_NO);
paint_techinfo (xpos, ypos);
paint_signal_fe_box (width - width/3 - 10, (y + 10 + height/3 + hheight), width/3, height/3 + hheight);
paint_signal_fe_box (width - width/3 - 10, y + 10 + height/3, width/3, height/3 + hheight);
} else {
// -- small PIG, small signal graph
// -- paint backround, title pig, etc.
@@ -840,7 +849,6 @@ void CStreamInfo2::paintCASystem(int xpos, int ypos)
}
spaceoffset+=4;
ypos += iheight*2;
bool cryptsysteme = true;
for(int ca_id = 0; ca_id < NUM_CAIDS; ca_id++){
if(caids[ca_id] == true){
@@ -949,8 +957,7 @@ int CStreamInfo2::update_rate ()
int ret = 0;
int timeout = 100;
int b_len;
int b_len = 0;
if(!dmx && !mp)
return 0;
@@ -958,7 +965,15 @@ int CStreamInfo2::update_rate ()
usleep(timeout * 1000);
b_len = mp->GetReadCount();
} else {
b_len = dmx->Read(dmxbuf, TS_BUF_SIZE, timeout);
time_t start = time_monotonic_ms();
/* always sample for ~100ms */
while (time_monotonic_ms() - start < timeout)
{
ret = dmx->Read(dmxbuf, TS_BUF_SIZE, 10);
if (ret >= 0)
b_len += ret;
}
//printf("ts: read %d time %d\n", b_len, time_monotonic_ms() - start);
}
//printf("ts: read %d\n", b_len);
@@ -988,8 +1003,8 @@ int CStreamInfo2::update_rate ()
last_tv.tv_sec = tv.tv_sec;
last_tv.tv_usec = tv.tv_usec;
ret = 1;
return ret;
return 1;
}
int CStreamInfo2::ts_close ()
@@ -1005,9 +1020,15 @@ int CStreamInfo2::ts_close ()
void CStreamInfo2::showSNR ()
{
/* sig_text_y + sheight + 4 + 5 is upper limit of ber/snr/sig numbers
* sheight*3 is 3x sig numbers + 1/2 sheight */
int snr_y = sig_text_y + 4+5 + sheight*9 / 2;
int snr_h = 50;
if (snr_y + snr_h > max_height - 10)
return;
if (signalbox == NULL)
{
signalbox = new CSignalBox(x + 10, yypos, 240, 50, frontend);
signalbox = new CSignalBox(sigBox_x, snr_y, 240, snr_h, frontend);
signalbox->setColorBody(COL_MENUCONTENT_PLUS_0);
signalbox->setTextColor(COL_MENUCONTENT_TEXT);
signalbox->doPaintBg(true);