Skip to content

Commit

Permalink
Merge OpenViX
Browse files Browse the repository at this point in the history
  • Loading branch information
Ev0-BH committed Feb 8, 2021
2 parents 53daa54 + 7bd204b commit 7a0062d
Show file tree
Hide file tree
Showing 64 changed files with 4,149 additions and 3,716 deletions.
3 changes: 3 additions & 0 deletions data/keymap.xml
Expand Up @@ -805,6 +805,8 @@
<key id="KEY_MENU" mapto="contextMenu" flags="m" />
<key id="KEY_SPACE" mapto="contextMenu" flags="m" />
<key id="KEY_INFO" mapto="showEventInfo" flags="m" />
<key id="KEY_0" mapto="toggleMark" flags="b" />
<key id="KEY_0" mapto="clearMarks" flags="l" />
</map>

<map context="InfobarMovieListActions">
Expand Down Expand Up @@ -923,6 +925,7 @@
<key id="KEY_I" mapto="log" flags="m" />
<key id="KEY_CHANNELUP" mapto="moveTop" flags="m" />
<key id="KEY_CHANNELDOWN" mapto="moveEnd" flags="m" />
<key id="KEY_MENU" mapto="menu" flags="m" />
</map>

<map context="EPGSelectActions">
Expand Down
2 changes: 2 additions & 0 deletions data/setup.xml
Expand Up @@ -44,6 +44,7 @@
<setup key="userinterface" title="GUI settings">
<item level="0" text="1st Infobar timeout" description="Set the time delay before hiding the infobar.">config.usage.infobar_timeout</item>
<item level="0" text="Show second infobar" description="Configure whether (and for how long) a second infobar will be shown when OK is pressed twice. The second infobar contains additional information about the current channel.">config.usage.show_second_infobar</item>
<item level="2" text="Second infobar style*" description="Choose the style of the second infobar. The 'Standard' view normally includes technical data. The 'Simple' view shows minimal technical data." requires="SecondInfoBarSimple">config.usage.second_infobar_simple</item>
<item level="0" text="Always use second infobar" description="Always show second infobar instead of standard infobar.">config.usage.fix_second_infobar</item>
<item level="0" text="Enable infobar fade-out" description="Fade the infobar when hiding">config.usage.show_infobar_do_dimming</item>
<item level="0" text="Infobar fade-out speed" description="Configure the infobar fading speed">config.usage.show_infobar_dimming_speed</item>
Expand Down Expand Up @@ -82,6 +83,7 @@
<item level="1" text="Behavior of 0 key in PiP-mode" description="Choose what you want the '0' button to do when PIP is active.">config.usage.pip_zero_button</item>
<item level="1" text="History buttons mode" description="Configure the function of the &lt; &gt; buttons.">config.usage.historymode</item>
<item level="2" text="Show True/False as graphical switch" description="Enable to display all true/false, yes/no, on/off and enable/disable set up options as a graphical switch.">config.usage.boolean_graphic</item>
<item level="2" text="Allow fast skin reload" requires="DeveloperImage" description="When changing skins this allows the skin to load without requiring an enigma restart.">config.usage.fast_skin_reload</item>
</setup>
<setup key="channelselection" title="Channel selection">
<item level="1" text="Alternative numbering mode" description="When enabled, channel numbering will start at '1' for every bouquet.">config.usage.alternative_number_mode</item>
Expand Down
28 changes: 14 additions & 14 deletions data/startwizard.xml
Expand Up @@ -352,7 +352,7 @@ config.ParentalControl.setuppin.save()
<displaytext value="After the start wizard is completed, you need to protect single services. Refer to your %s %s's manual on how to do that." />
</step>
-->
<step id="plugins" nextstep="skins">
<step id="plugins" nextstep="timeoptions">
<condition>
self.condition = config.misc.installwizard.hasnetwork.value and config.misc.installwizard.ipkgloaded.value
</condition>
Expand All @@ -364,18 +364,6 @@ self.selectKey("OK")
</code>
</step>

<step id="skins" nextstep="timeoptions">
<condition>
self.condition = config.misc.installwizard.hasnetwork.value and config.misc.installwizard.ipkgloaded.value
</condition>
<text value="Skin install" />
<config screen="InstallWizard" module="InstallWizard" args="3" type="ConfigList" />
<code>
self.clearSelectedKeys()
self.selectKey("OK")
</code>
</step>

<step id="timeoptions" nextstep="wizardoptions">
<text value="Please set your time options.\n\nPress YELLOW to set the time zone via geolocation." />
<displaytext value="Please set your time options" />
Expand All @@ -388,7 +376,7 @@ self.selectKey("YELLOW")
</code>
</step>

<step id="wizardoptions">
<step id="wizardoptions" nextstep="skins">
<text value="Please set up the following common options"/>
<config screen="Setup" module="Setup" args="wizardoptions" type="ConfigList" />
<code>
Expand All @@ -397,6 +385,18 @@ self.selectKey("OK")
</code>
</step>

<step id="skins">
<condition>
self.condition = config.misc.installwizard.hasnetwork.value and config.misc.installwizard.ipkgloaded.value
</condition>
<text value="Skin install" />
<config screen="InstallWizard" module="InstallWizard" args="3" type="ConfigList" />
<code>
self.clearSelectedKeys()
self.selectKey("OK")
</code>
</step>

<step id="end" laststep="true">
<condition>
self.condition = self.isLastWizard
Expand Down
2 changes: 1 addition & 1 deletion lib/base/ebase.cpp
Expand Up @@ -277,7 +277,7 @@ int eMainloop::processOneEvent(long user_timeout, PyObject **res, ePyObject addi
m_inActivate = 0;
}
if (pfd[i].revents & (POLLERR|POLLHUP|POLLNVAL))
eLog(5, "[eMainloop::processOneEvent] unhandled POLLERR/HUP/NVAL for fd %d(%d)", pfd[i].fd, pfd[i].revents);
eTrace("[eMainloop::processOneEvent] unhandled POLLERR/HUP/NVAL for fd %d(%d)", pfd[i].fd, pfd[i].revents);
}
}
for (; i < fdcount; ++i)
Expand Down
5 changes: 3 additions & 2 deletions lib/base/eerror.h
Expand Up @@ -117,15 +117,15 @@ void DumpUnfreed();
extern int debugLvl;

void CHECKFORMAT eDebugImpl(int flags, const char*, ...);
enum { lvlDebug=4, lvlInfo=3, lvlWarning=2, lvlError=1, lvlFatal=0 };
enum { lvlTrace=5, lvlDebug=4, lvlInfo=3, lvlWarning=2, lvlError=1, lvlFatal=0 };

#define DEFAULT_DEBUG_LVL 4

#ifndef DEBUG
# define MAX_DEBUG_LEVEL 0
#else
# ifndef MAX_DEBUG_LEVEL
# define MAX_DEBUG_LEVEL 4
# define MAX_DEBUG_LEVEL 5
# endif
#endif

Expand All @@ -149,6 +149,7 @@ enum { lvlDebug=4, lvlInfo=3, lvlWarning=2, lvlError=1, lvlFatal=0 };
#define eDebug(...) eDebugLow(lvlDebug, 0, __VA_ARGS__)
#define eDebugNoNewLineStart(...) eDebugLow(lvlDebug, _DBGFLG_NONEWLINE, __VA_ARGS__)
#define eDebugNoNewLine(...) eDebugLow(lvlDebug, _DBGFLG_NOTIME | _DBGFLG_NONEWLINE, __VA_ARGS__)
#define eTrace(...) eDebugLow(lvlTrace, 0, ##__VA_ARGS__)
#define ASSERT(x) { if (!(x)) eFatal("%s:%d ASSERTION %s FAILED!", __FILE__, __LINE__, #x); }

#endif // SWIG
Expand Down
15 changes: 8 additions & 7 deletions lib/base/estring.cpp
Expand Up @@ -511,13 +511,13 @@ std::string convertDVBUTF8(const unsigned char *data, int len, int table, int ts
if (table != 11)
table = data[i] + 4;
++i;
eLog(6, "[convertDVBUTF8] (1..11)text encoded in ISO-8859-%d", table);
eTrace("[convertDVBUTF8] (1..11)text encoded in ISO-8859-%d", table);
break;
case ISO8859_xx:
{
int n = data[++i] << 8;
n |= (data[++i]);
eLog(6, "[convertDVBUTF8] (0x10)text encoded in ISO-8859-%d", n);
eTrace("[convertDVBUTF8] (0x10)text encoded in ISO-8859-%d", n);
++i;
switch(n)
{
Expand Down Expand Up @@ -591,7 +591,7 @@ std::string convertDVBUTF8(const unsigned char *data, int len, int table, int ts
bool useTwoCharMapping = !table || (tsidonid && encodingHandler.getTransponderUseTwoCharMapping(tsidonid));

if (useTwoCharMapping && table == 5) { // i hope this dont break other transponders which realy use ISO8859-5 and two char byte mapping...
eLog(6, "[convertDVBUTF8] Cyfra / Cyfrowy Polsat HACK... override given ISO8859-5 with ISO6937");
eTrace("[convertDVBUTF8] Cyfra / Cyfrowy Polsat HACK... override given ISO8859-5 with ISO6937");
table = 0;
}
else if ( table == -1 )
Expand Down Expand Up @@ -690,14 +690,15 @@ std::string convertDVBUTF8(const unsigned char *data, int len, int table, int ts
*pconvertedLen = convertedLen;

if (convertedLen < len)
eLog(6, "[convertDVBUTF8] %d chars converted, and %d chars left..", convertedLen, len-convertedLen);
eLog(6, "[convertDVBUTF8] table=0x%02X twochar=%d output:%s\n", table, useTwoCharMapping, output.c_str());
eTrace("[convertDVBUTF8] %d chars converted, and %d chars left..", convertedLen, len-convertedLen);
eTrace("[convertDVBUTF8] table=0x%02X twochar=%d output:%s\n", table, useTwoCharMapping, output.c_str());

eLog(6, "[convertDVBUTF8] table=0x%02X tsid:onid=0x%X:0x%X data[0..14]=%s output:%s\n",
eTrace("[convertDVBUTF8] table=0x%02X tsid:onid=0x%X:0x%X data[0..14]=%s output:%s\n",
table, (unsigned int)tsidonid >> 16, tsidonid & 0xFFFFU,
string_to_hex(std::string((char*)data, len < 15 ? len : 15)).c_str(),
output.c_str());

// replace EIT CR/LF with standard newline:
output = replace_all(replace_all(output, "\xC2\x8A", "\n"), "\xEE\x82\x8A", "\n");
return output;
}

Expand Down
4 changes: 4 additions & 0 deletions lib/dvb/Makefile.inc
Expand Up @@ -11,6 +11,8 @@ dvb_libenigma_dvb_a_SOURCES = \
dvb/dvbtime.cpp \
dvb/eit.cpp \
dvb/epgcache.cpp \
dvb/epgchanneldata.cpp \
dvb/epgtransponderdatareader.cpp \
dvb/esection.cpp \
dvb/fastscan.cpp \
dvb/fbc.cpp \
Expand Down Expand Up @@ -48,6 +50,8 @@ dvbinclude_HEADERS = \
dvb/dvbtime.h \
dvb/eit.h \
dvb/epgcache.h \
dvb/epgchanneldata.h \
dvb/epgtransponderdatareader.h \
dvb/esection.h \
dvb/fastscan.h \
dvb/fbc.h \
Expand Down
72 changes: 43 additions & 29 deletions lib/dvb/encoder.cpp
Expand Up @@ -196,16 +196,15 @@ int eEncoder::allocateEncoder(const std::string &serviceref, int &buffersize,
snprintf(filename, sizeof(filename), "/proc/stb/encoder/%d/apply", encoder_index);
CFile::writeInt(filename, 1);

if(encoder[encoder_index].navigation_instance->playService(serviceref) < 0)
{
eWarning("[eEncoder] navigation->playservice failed");
return(-1);
}

if(!source_file.empty() && ((encoder[encoder_index].file_fd = open(source_file.c_str(), O_RDONLY, 0)) < 0))
if(source_file.empty())
encoder[encoder_index].file_fd = -1;
else
{
eWarning("[eEncoder] open source file failed");
return(-1);
if((encoder[encoder_index].file_fd = open(source_file.c_str(), O_RDONLY, 0)) < 0)
{
eWarning("[eEncoder] open source file failed");
return(-1);
}
}

snprintf(filename, sizeof(filename), "/dev/%s%d", bcm_encoder ? "bcm_enc" : "encoder", encoder_index);
Expand Down Expand Up @@ -238,6 +237,9 @@ int eEncoder::allocateEncoder(const std::string &serviceref, int &buffersize,
default:
{
eWarning("[eEncoder] only encoder 0 and encoder 1 implemented");
close(encoder[encoder_index].encoder_fd);
encoder[encoder_index].encoder_fd = -1;
return(-1);
break;
}
}
Expand All @@ -248,6 +250,12 @@ int eEncoder::allocateEncoder(const std::string &serviceref, int &buffersize,
encoder[encoder_index].state = EncoderContext::state_running;
}

if(encoder[encoder_index].navigation_instance->playService(serviceref) < 0)
{
eWarning("[eEncoder] navigation->playservice failed");
return(-1);
}

return(encoder[encoder_index].encoder_fd);
}

Expand Down Expand Up @@ -440,12 +448,30 @@ void eEncoder::navigation_event(int encoder_index, int event)

if((vpid > 0) && (apid > 0) && (pmtpid > 0))
{
eDebug("[eEncoder] info complete: %d, %d, %d", vpid, apid, pmtpid);
eDebug("[eEncoder] info complete, vpid: %d (0x%x), apid: %d (0x%x), pmptpid: %d (0x%x)", vpid, vpid, apid, apid, pmtpid, pmtpid);

pids.push_back(pmtpid);
pids.push_back(vpid);
pids.push_back(apid);

if(ioctl(encoder[encoder_index].encoder_fd, IOCTL_BROADCOM_SET_PMTPID_MIPS, pmtpid) ||
ioctl(encoder[encoder_index].encoder_fd, IOCTL_BROADCOM_SET_VPID_MIPS, vpid) ||
ioctl(encoder[encoder_index].encoder_fd, IOCTL_BROADCOM_SET_APID_MIPS, apid))
{
eDebug("[eEncoder] set ioctl(mips) failed");

if(ioctl(encoder[encoder_index].encoder_fd, IOCTL_BROADCOM_SET_PMTPID_ARM, pmtpid) ||
ioctl(encoder[encoder_index].encoder_fd, IOCTL_BROADCOM_SET_VPID_ARM, vpid) ||
ioctl(encoder[encoder_index].encoder_fd, IOCTL_BROADCOM_SET_APID_ARM, apid))
{
eWarning("[eEncoder] set ioctl(arm) failed too, giving up");
freeEncoder(encoder[encoder_index].encoder_fd);
return;
}
}

encoder[encoder_index].run();

if(encoder[encoder_index].file_fd < 0)
{
service->tap(tservice);
Expand All @@ -461,36 +487,20 @@ void eEncoder::navigation_event(int encoder_index, int event)
}
else
{
service->stop();

if(encoder[encoder_index].stream_thread != nullptr)
{
eWarning("[eEncoder] datapump already running");
return;
}

encoder[encoder_index].stream_thread = new eDVBRecordStreamThread(188, -1, true);

encoder[encoder_index].stream_thread = new eDVBRecordStreamThread(188, 188 * 256, true);
encoder[encoder_index].stream_thread->setTargetFD(encoder[encoder_index].encoder_fd);
encoder[encoder_index].stream_thread->start(encoder[encoder_index].file_fd);
}

if(ioctl(encoder[encoder_index].encoder_fd, IOCTL_BROADCOM_SET_PMTPID_MIPS, pmtpid) ||
ioctl(encoder[encoder_index].encoder_fd, IOCTL_BROADCOM_SET_VPID_MIPS, vpid) ||
ioctl(encoder[encoder_index].encoder_fd, IOCTL_BROADCOM_SET_APID_MIPS, apid))
{
eDebug("[eEncoder] set ioctl(mips) failed");

if(ioctl(encoder[encoder_index].encoder_fd, IOCTL_BROADCOM_SET_PMTPID_ARM, pmtpid) ||
ioctl(encoder[encoder_index].encoder_fd, IOCTL_BROADCOM_SET_VPID_ARM, vpid) ||
ioctl(encoder[encoder_index].encoder_fd, IOCTL_BROADCOM_SET_APID_ARM, apid))
{
eWarning("[eEncoder] set ioctl(arm) failed too, giving up");
freeEncoder(encoder[encoder_index].encoder_fd);
return;
}
}

encoder[encoder_index].state = EncoderContext::state_running;
encoder[encoder_index].run();
}
}
}
Expand All @@ -510,8 +520,12 @@ void eEncoder::EncoderContext::thread(void)
{
hasStarted();

eDebug("[EncoderContext %x] start ioctl transcoding", (int)pthread_self());

if(ioctl(encoder_fd, IOCTL_BROADCOM_START_TRANSCODING, 0))
eWarning("[eEncoder] thread encoder failed");

eDebug("[EncoderContext %x] finish ioctl transcoding", (int)pthread_self());
}

eAutoInitPtr<eEncoder> init_eEncoder(eAutoInitNumbers::service + 1, "Encoders");

0 comments on commit 7a0062d

Please sign in to comment.