<item level="2" text="Fast Forward speeds">config.seek.speeds_forward</item>
<item level="2" text="Rewind speeds">config.seek.speeds_backward</item>
<item level="2" text="Slow Motion speeds">config.seek.speeds_slowmotion</item>
-<!-- TRANSLATORS: Note that "Enter" in the two strings below should *not*
- be interpreted as "Give speed as input". The intended meaning is
- instead "Initial speed when starting winding", i.e. the speed at
- which "winding mode" is entered when first pressing "rewind" or
- "fast forward". -->
- <item level="2" text="Enter Fast Forward at speed">config.seek.enter_forward</item>
- <item level="2" text="Enter Rewind at speed">config.seek.enter_backward</item>
-<!-- TRANSLATORS: The effect of "Non-smooth winding" is that rather
- than using ordinary "continuous" or "smooth" winding, a fast
- sequence of stills is shown when winding at high speeds. This
- makes it much easier too follow when almost each frame comes from
- a new scene. The effect is achieved by repeating each shown frame
- a couple of times. The settings control both at which speed this
- winding mode sets in, and how many times each frame should be
- repeated. This was previously called "Discontinuous playback"
- which was incomprehensible. "Non-smooth winding" may be a better
- term, but note that there is nothing irregular about it. Synonyms
- better suited for translation to other languages may be "stepwise
- winding/playback", or "winding/playback using stills". -->
- <item level="2" text="Use non-smooth winding at speeds above">config.seek.stepwise_minspeed</item>
- <item level="2" text="Frame repeat count during non-smooth winding">config.seek.stepwise_repeat</item>
+<!-- TRANSLATORS: The following is the speed you get on the first press on fast-forward.
+ It was previously called "enter fast forward at speed" which was easily misunderstood. -->
+ <item level="2" text="Initial Fast Forward speed">config.seek.enter_forward</item>
+ <item level="2" text="Initial Rewind speed">config.seek.enter_backward</item>
<item level="2" text="Behavior of 'pause' when paused">config.seek.on_pause</item>
<item level="2" text="Behavior of 0 key in PiP-mode">config.usage.pip_zero_button</item>
<item level="2" text="Alternative services tuner priority">config.usage.alternatives_priority</item>
case aLPCM:
bypass = 6;
break;
+ case aDTSHD:
+ bypass = 0x10;
+ break;
}
eDebugNoNewLine("AUDIO_SET_BYPASS(%d) - ", bypass);
ePtr<eDVBDemux> m_demux;
int m_fd, m_fd_demux, m_dev, m_is_freezed;
public:
- enum { aMPEG, aAC3, aDTS, aAAC, aAACHE, aLPCM };
+ enum { aMPEG, aAC3, aDTS, aAAC, aAACHE, aLPCM, aDTSHD };
eDVBAudio(eDVBDemux *demux, int dev);
enum { aMonoLeft, aStereo, aMonoRight };
void setChannel(int channel);
/** Set Displayed Video PID and type */
virtual RESULT setVideoPID(int vpid, int type)=0;
- enum { af_MPEG, af_AC3, af_DTS, af_AAC };
+ enum { af_MPEG, af_AC3, af_DTS, af_AAC, af_DTSHD };
/** Set Displayed Audio PID and type */
virtual RESULT setAudioPID(int apid, int type)=0;
ePtr<eTable<ProgramAssociationSection> > ptr;
if (!m_PAT.getCurrent(ptr))
{
+ int service_id_single = -1;
+ int pmtpid_single = -1;
int pmtpid = -1;
std::vector<ProgramAssociationSection*>::const_iterator i;
for (i = ptr->getSections().begin(); pmtpid == -1 && i != ptr->getSections().end(); ++i)
const ProgramAssociationSection &pat = **i;
ProgramAssociationConstIterator program;
for (program = pat.getPrograms()->begin(); pmtpid == -1 && program != pat.getPrograms()->end(); ++program)
+ {
if (eServiceID((*program)->getProgramNumber()) == m_reference.getServiceID())
pmtpid = (*program)->getProgramMapPid();
+ if (pmtpid_single == -1 && pmtpid == -1)
+ {
+ pmtpid_single = (*program)->getProgramMapPid();
+ service_id_single = (*program)->getProgramNumber();
+ }
+ else
+ pmtpid_single = service_id_single = -1;
+ }
+ }
+ if (pmtpid_single != -1) // only one PAT entry .. so we use this one
+ {
+ m_reference.setServiceID(eServiceID(service_id_single));
+ pmtpid = pmtpid_single;
}
if (pmtpid == -1)
serviceEvent(eventNoPATEntry);
serviceEvent(eventNoPAT);
}
-PyObject *eDVBServicePMTHandler::getCaIds()
+PyObject *eDVBServicePMTHandler::getCaIds(bool pair)
{
ePyObject ret;
if ( !getProgramInfo(prog) )
{
- int cnt=prog.caids.size();
- if (cnt)
+ if (pair)
{
+ int cnt=prog.caids.size();
+ if (cnt)
+ {
+ ret=PyList_New(cnt);
+ std::list<program::capid_pair>::iterator it(prog.caids.begin());
+ while(cnt--)
+ {
+ ePyObject tuple = PyTuple_New(2);
+ PyTuple_SET_ITEM(tuple, 0, PyInt_FromLong(it->caid));
+ PyTuple_SET_ITEM(tuple, 1, PyInt_FromLong((it++)->capid));
+ PyList_SET_ITEM(ret, cnt, tuple);
+ }
+ }
+ }
+ else
+ {
+ std::set<program::capid_pair> set(prog.caids.begin(), prog.caids.end());
+ std::set<program::capid_pair>::iterator it(set.begin());
+ int cnt=set.size();
ret=PyList_New(cnt);
- std::set<uint16_t>::iterator it(prog.caids.begin());
while(cnt--)
- PyList_SET_ITEM(ret, cnt, PyInt_FromLong(*it++));
+ PyList_SET_ITEM(ret, cnt, PyInt_FromLong((it++)->caid));
}
}
return ret ? (PyObject*)ret : (PyObject*)PyList_New(0);
}
-int eDVBServicePMTHandler::getProgramInfo(struct program &program)
+int eDVBServicePMTHandler::getProgramInfo(program &program)
{
ePtr<eTable<ProgramMapSection> > ptr;
int cached_apid_ac3 = -1;
for (i = ptr->getSections().begin(); i != ptr->getSections().end(); ++i)
{
const ProgramMapSection &pmt = **i;
+ int is_hdmv = 0;
+
program.pcrPid = pmt.getPcrPid();
+ for (DescriptorConstIterator desc = pmt.getDescriptors()->begin();
+ desc != pmt.getDescriptors()->end(); ++desc)
+ {
+ if ((*desc)->getTag() == CA_DESCRIPTOR)
+ {
+ CaDescriptor *descr = (CaDescriptor*)(*desc);
+ program::capid_pair pair;
+ pair.caid = descr->getCaSystemId();
+ pair.capid = descr->getCaPid();
+ program.caids.push_back(pair);
+ }
+ else if ((*desc)->getTag() == REGISTRATION_DESCRIPTOR)
+ {
+ RegistrationDescriptor *d = (RegistrationDescriptor*)(*desc);
+ if (d->getFormatIdentifier() == 0x48444d56) // HDMV
+ is_hdmv = 1;
+ }
+ }
+
ElementaryStreamInfoConstIterator es;
for (es = pmt.getEsInfo()->begin(); es != pmt.getEsInfo()->end(); ++es)
{
audio.type = audioStream::atAACHE;
forced_audio = 1;
}
- case 0x80: // user private ... but blueray LPCM
- if (!isvideo && !isaudio)
+ case 0x80: // user private ... but bluray LPCM
+ case 0xA0: // bluray secondary LPCM
+ if (!isvideo && !isaudio && is_hdmv)
{
isaudio = 1;
audio.type = audioStream::atLPCM;
}
- case 0x81: // user private ... but blueray AC3
- if (!isvideo && !isaudio)
+ case 0x81: // user private ... but bluray AC3
+ case 0xA1: // bluray secondary AC3
+ if (!isvideo && !isaudio && is_hdmv)
{
isaudio = 1;
audio.type = audioStream::atAC3;
}
- case 0x82: // Blueray DTS (dvb user private...)
- case 0xA2: // Blueray secondary DTS
- if (!isvideo && !isaudio)
+ case 0x82: // bluray DTS (dvb user private...)
+ case 0xA2: // bluray secondary DTS
+ if (!isvideo && !isaudio && is_hdmv)
{
isaudio = 1;
audio.type = audioStream::atDTS;
}
+ case 0x86: // bluray DTS-HD (dvb user private...)
+ case 0xA6: // bluray secondary DTS-HD
+ if (!isvideo && !isaudio && is_hdmv)
+ {
+ isaudio = 1;
+ audio.type = audioStream::atDTSHD;
+ }
case 0x06: // PES Private
case 0xEA: // TS_PSI_ST_SMPTE_VC1
{
case CA_DESCRIPTOR:
{
CaDescriptor *descr = (CaDescriptor*)(*desc);
- program.caids.insert(descr->getCaSystemId());
+ program::capid_pair pair;
+ pair.caid = descr->getCaSystemId();
+ pair.capid = descr->getCaPid();
+ program.caids.push_back(pair);
break;
}
default:
default:
break;
}
- if (isteletext && (isaudio || isvideo))
+ if (isteletext && (isaudio || isvideo))
{
- eDebug("ambiguous streamtype for PID %04x detected.. forced as teletext!", (*es)->getPid());
+ eDebug("ambiguous streamtype for PID %04x detected.. forced as teletext!", (*es)->getPid());
continue; // continue with next PID
}
else if (issubtitle && (isaudio || isvideo))
else
continue;
}
- for (DescriptorConstIterator desc = pmt.getDescriptors()->begin();
- desc != pmt.getDescriptors()->end(); ++desc)
- {
- if ((*desc)->getTag() == CA_DESCRIPTOR)
- {
- CaDescriptor *descr = (CaDescriptor*)(*desc);
- program.caids.insert(descr->getCaSystemId());
- }
- }
}
ret = 0;
program.textPid = cached_tpid;
}
CAID_LIST &caids = m_service->m_ca;
- for (CAID_LIST::iterator it(caids.begin()); it != caids.end(); ++it)
- program.caids.insert(*it);
+ for (CAID_LIST::iterator it(caids.begin()); it != caids.end(); ++it) {
+ program::capid_pair pair;
+ pair.caid = *it;
+ pair.capid = -1; // not known yet
+ program.caids.push_back(pair);
+ }
if ( cnt )
ret = 0;
}
{
if (!ref.getServiceID().get() /* incorrect sid in meta file or recordings.epl*/ )
{
- eWarning("no .meta file found, trying to find PMT pid");
eDVBTSTools tstools;
+ bool b = source || !tstools.openFile(ref.path.c_str(), 1);
+ eWarning("no .meta file found, trying to find PMT pid");
if (source)
- tstools.setSource(source, streaminfo_file ? streaminfo_file : ref.path.c_str());
- else if (tstools.openFile(ref.path.c_str()))
- eWarning("failed to open file");
- else
+ tstools.setSource(source, NULL);
+ if (b)
{
int service_id, pmt_pid;
if (!tstools.findPMT(pmt_pid, service_id))
m_pmt_pid = pmt_pid;
}
}
+ else
+ eWarning("no valid source to find PMT pid!");
}
eDebug("alloc PVR");
/* allocate PVR */
{
int pid,
rdsPid; // hack for some radio services which transmit radiotext on different pid (i.e. harmony fm, HIT RADIO FFH, ...)
- enum { atMPEG, atAC3, atDTS, atAAC, atAACHE, atLPCM };
+ enum { atMPEG, atAC3, atDTS, atAAC, atAACHE, atLPCM, atDTSHD };
int type; // mpeg2, ac3, dts, ...
int component_tag;
struct program
{
+ struct capid_pair
+ {
+ uint16_t caid;
+ int capid;
+ bool operator< (const struct capid_pair &t) { return t.caid < caid; }
+ };
std::vector<videoStream> videoStreams;
std::vector<audioStream> audioStreams;
int defaultAudioStream;
std::vector<subtitleStream> subtitleStreams;
- std::set<uint16_t> caids;
+ std::list<capid_pair> caids;
int pcrPid;
int pmtPid;
int textPid;
PyObject *createPythonObject();
};
- int getProgramInfo(struct program &program);
+ int getProgramInfo(program &program);
int getDataDemux(ePtr<iDVBDemux> &demux);
int getDecodeDemux(ePtr<iDVBDemux> &demux);
- PyObject *getCaIds();
+ PyObject *getCaIds(bool pair=false); // caid / ecmpid pair
int getPVRChannel(ePtr<iDVBPVRChannel> &pvr_channel);
int getServiceReference(eServiceReferenceDVB &service) { service = m_reference; return 0; }
pts_t current = i->second - currentDelta;
pts_t diff = current - lastpts_t;
- if (llabs(diff) > (90000*5)) // 5sec diff
+ if (llabs(diff) > (90000*10)) // 10sec diff
{
// eDebug("%llx < %llx, have discont. new timestamp is %llx (diff is %llx)!", current, lastpts_t, i->second, diff);
currentDelta = i->second - lastpts_t; /* FIXME: should be the extrapolated new timestamp, based on the current rate */
eSecDebugNoSimulate("ret5 %d", ret);
- if (ret && lnb_param.SatCR_idx == -1)
+ if (ret && !is_unicable)
{
int lof = sat.frequency > lnb_param.m_lof_threshold ?
lnb_param.m_lof_hi : lnb_param.m_lof_lo;
if ( sit != lnb_param.m_satellites.end())
{
eSecCommandList sec_sequence;
-
- lnb_param.guard_offset = 0; //HACK
-
- frontend.setData(eDVBFrontend::SATCR, lnb_param.SatCR_idx);
-
eDVBSatelliteSwitchParameters &sw_param = sit->second;
bool doSetFrontend = true;
bool doSetVoltageToneFrontend = true;
eDVBSatelliteDiseqcParameters::t_diseqc_mode diseqc_mode = di_param.m_diseqc_mode;
eDVBSatelliteSwitchParameters::t_voltage_mode voltage_mode = sw_param.m_voltage_mode;
bool diseqc13V = voltage_mode == eDVBSatelliteSwitchParameters::HV_13;
+ bool is_unicable = lnb_param.SatCR_idx != -1;
+
+ lnb_param.guard_offset = 0; //HACK
+
+ frontend.setData(eDVBFrontend::SATCR, lnb_param.SatCR_idx);
if (diseqc13V)
voltage_mode = eDVBSatelliteSwitchParameters::HV;
int lof = (band&1)?lnb_param.m_lof_hi:lnb_param.m_lof_lo;
- int local=0;
-
-
- if(lnb_param.SatCR_idx == -1)
+ if(!is_unicable)
{
- // calc Frequency
- local = abs(sat.frequency
+ // calc Frequency
+ int local= abs(sat.frequency
- lof);
parm.FREQUENCY = ((((local * 2) / 125) + 1) / 2) * 125;
frontend.setData(eDVBFrontend::FREQ_OFFSET, sat.frequency - parm.FREQUENCY);
if ( send_mask )
{
+ int diseqc_repeats = diseqc_mode > eDVBSatelliteDiseqcParameters::V1_0 ? di_param.m_repeats : 0;
int vlt = iDVBFrontend::voltageOff;
eSecCommand::pair compare;
compare.steps = +3;
if ( send_mask & 2 )
++loops;
- loops <<= di_param.m_repeats;
+ loops <<= diseqc_repeats;
for ( int i = 0; i < loops;) // fill commands...
{
int tmp = m_params[DELAY_BETWEEN_DISEQC_REPEATS];
if (cmd)
{
- int delay = di_param.m_repeats ? (tmp - 54) / 2 : tmp; // standard says 100msek between two repeated commands
+ int delay = diseqc_repeats ? (tmp - 54) / 2 : tmp; // standard says 100msek between two repeated commands
sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, delay) );
diseqc.data[2]=cmd;
diseqc.data[3]=(cmd==0x38) ? csw : ucsw;
if ( RotorCmd != -1 && RotorCmd != lastRotorCmd )
{
eSecCommand::pair compare;
- if (!send_mask && lnb_param.SatCR_idx == -1)
+ if (!send_mask && !is_unicable)
{
compare.steps = +3;
compare.tone = iDVBFrontend::toneOff;
diseqc.data[3] = RotorCmd;
diseqc.data[4] = 0x00;
}
-// if(lnb_param.SatCR_idx == -1)
+// if(!is_unicable)
{
int mrt = m_params[MOTOR_RUNNING_TIMEOUT]; // in seconds!
- if ( rotor_param.m_inputpower_parameters.m_use || lnb_param.SatCR_idx == -1)
+ if ( rotor_param.m_inputpower_parameters.m_use && !is_unicable)
{ // use measure rotor input power to detect rotor state
bool turn_fast = need_turn_fast(rotor_param.m_inputpower_parameters.m_turning_speed);
eSecCommand::rotor cmd;
sec_fe->setData(eDVBFrontend::NEW_UCSW, ucsw);
sec_fe->setData(eDVBFrontend::NEW_TONEBURST, di_param.m_toneburst_param);
- if ((doSetVoltageToneFrontend) && (lnb_param.SatCR_idx == -1))
+ if (doSetVoltageToneFrontend && !is_unicable)
{
eSecCommand::pair compare;
compare.voltage = voltage;
sec_sequence.push_back( eSecCommand(eSecCommand::UPDATE_CURRENT_SWITCHPARMS) );
- if(lnb_param.SatCR_idx != -1)
+ if(is_unicable)
{
// check if voltage is disabled
eSecCommand::pair compare;
if (f->open(filename, 1) < 0)
return -1;
- setSource(src, filename);
+ setSource(src, nostreaminfo ? NULL : filename);
return 0;
}
break;
case 0x71: // AC3 / DTS
break;
+ case 0x72: // DTS - HD
+ break;
default:
eDebug("skip unknwn stream_id_extension %02x\n", payload[9+offs]);
continue;
else if (direction == +1)
direction = 0;
}
- /* let's find the next frame after the given offset */
off_t start = offset;
+#if 0
+ /* backtrack to find the previous sequence start, in case of MPEG2 */
+ if ((data & 0xFF) == 0x00) {
+ do {
+ --start;
+ if (m_streaminfo.getStructureEntry(start, data, 0))
+ {
+ eDebug("get previous failed");
+ return -1;
+ }
+ } while (((data & 0xFF) != 9) && ((data & 0xFF) != 0x00) && ((data & 0xFF) != 0xB3)); /* sequence start or previous frame */
+ if ((data & 0xFF) != 0xB3)
+ start = offset; /* Failed to find corresponding sequence start, so never mind */
+ }
+
+#endif
+
+ /* let's find the next frame after the given offset */
do {
if (m_streaminfo.getStructureEntry(offset, data, 1))
{
// eDebug("%08llx@%llx (next)", data, offset);
} while (((data & 0xFF) != 9) && ((data & 0xFF) != 0x00)); /* next frame */
+#if 0
/* align to TS pkt start */
-// start = start - (start % 188);
-// offset = offset - (offset % 188);
+ start = start - (start % 188);
+ offset = offset - (offset % 188);
+#endif
len = offset - start;
_offset = start;
if (!pmthandler->getProgramInfo(p))
{
int cnt=0;
- for (caidSet::reverse_iterator x(p.caids.rbegin()); x != p.caids.rend(); ++x, ++cnt)
- caids.push_front(*x);
+ std::set<eDVBServicePMTHandler::program::capid_pair> set(p.caids.begin(), p.caids.end());
+ for (std::set<eDVBServicePMTHandler::program::capid_pair>::reverse_iterator x(set.rbegin()); x != set.rend(); ++x, ++cnt)
+ caids.push_front(x->caid);
if (service && cnt)
service->m_ca = caids;
}
// painter.fill(eRect(0, 10, s.width(), s.height()-20));
pts_t in = 0, out = 0;
+ int xm, xm_last = -1;
std::multiset<cueEntry>::iterator i(m_cue_entries.begin());
continue;
} else if (i->what == 1) /* out */
out = i++->where;
- else if (i->what == 2) /* mark */
+ else /* mark or last */
{
- int xm = scale(i->where);
- painter.setForegroundColor(gRGB(0xFF8080));
- painter.fill(eRect(xm - 2, 0, 4, s.height()));
+ xm = scale(i->where);
+ if (i->what == 2) {
+ painter.setForegroundColor(gRGB(0xFF8080));
+ if (xm - 2 < xm_last) /* Make sure last is not overdrawn */
+ painter.fill(eRect(xm_last, 0, 2 + xm - xm_last, s.height()));
+ else
+ painter.fill(eRect(xm - 2, 0, 4, s.height()));
+ } else if (i->what == 3) {
+ painter.setForegroundColor(gRGB(0x80FF80));
+ painter.fill(eRect(xm - 1, 0, 3, s.height()));
+ xm_last = xm + 2;
+ }
i++;
continue;
- } else /* other marker, like last position */
- {
- ++i;
- continue;
}
}
"mpeg": "movie",
"mkv": "movie",
"mp4": "movie",
- "mov": "movie"
+ "mov": "movie",
+ "m2ts": "movie",
}
def FileEntryComponent(name, absolute = None, isDir = False):
if currLnb.diseqcMode.value == "1_0":
currCO = currLnb.commandOrder1_0.value
+ sec.setRepeats(0)
else:
currCO = currLnb.commandOrder.value
config.seek.selfdefined_79 = ConfigNumber(default=300)
config.seek.speeds_forward = ConfigSet(default=[2, 4, 8, 16, 32, 64, 128], choices=[2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
- config.seek.speeds_backward = ConfigSet(default=[8, 16, 32, 64, 128], choices=[1, 2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
+ config.seek.speeds_backward = ConfigSet(default=[2, 4, 8, 16, 32, 64, 128], choices=[1, 2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
config.seek.speeds_slowmotion = ConfigSet(default=[2, 4, 8], choices=[2, 4, 6, 8, 12, 16, 25])
config.seek.enter_forward = ConfigSelection(default = "2", choices = ["2", "4", "6", "8", "12", "16", "24", "32", "48", "64", "96", "128"])
config.seek.enter_backward = ConfigSelection(default = "1", choices = ["1", "2", "4", "6", "8", "12", "16", "24", "32", "48", "64", "96", "128"])
- config.seek.stepwise_minspeed = ConfigSelection(default = "16", choices = ["Never", "2", "4", "6", "8", "12", "16", "24", "32", "48", "64", "96", "128"])
- config.seek.stepwise_repeat = ConfigSelection(default = "3", choices = ["2", "3", "4", "5", "6"])
config.seek.on_pause = ConfigSelection(default = "play", choices = [
("play", _("Play")),
from Components.config import config, ConfigSubsection, ConfigInteger, ConfigText, ConfigSelection, getConfigListEntry, ConfigSequence, ConfigSubList
import DVDTitle
import xml.dom.minidom
+from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_FONTS
class ConfigColor(ConfigSequence):
def __init__(self, default = [128,128,128]):
for key in self.filekeys:
val = self.settings.dict()[key].getValue()
if not fileExists(val):
+ if val[0] != "/":
+ if key.find("font") == 0:
+ val = resolveFilename(SCOPE_FONTS)+val
+ else:
+ val = resolveFilename(SCOPE_PLUGINS)+"Extensions/DVDBurn/"+val
+ if fileExists(val):
+ self.settings.dict()[key].setValue(val)
+ continue
self.error += "\n%s '%s' not found" % (key, val)
#except AttributeError:
#print "loadProject AttributeError", self.error
<settings
name="Dreambox DVD record"
authormode="menu_linked"
- menutemplate="/usr/lib/enigma2/python/Plugins/Extensions/DVDBurn/Thumbs_menu_clouds.ddvdm.xml"
+ menutemplate="Thumbs_menu_clouds.ddvdm.xml"
titlesetmode="multi"
- vmgm="/usr/lib/enigma2/python/Plugins/Extensions/DVDBurn/vmgmdream.mpg"
+ vmgm="vmgmdream.mpg"
output="dvd"
- isopath="/media/hdd/movie/"
+ isopath="/hdd/movie/"
dataformat="iso9660_4"
/>
<titles> </titles>
<settings
titleformat="$i. $t"
subtitleformat="$D.$M.$Y, $T $C, $d"
- menubg="/usr/lib/enigma2/python/Plugins/Extensions/DVDBurn/dreamdvd_boat.jpg"
- menuaudio="/usr/lib/enigma2/python/Plugins/Extensions/DVDBurn/silence.mp2"
+ menubg="dreamdvd_boat.jpg"
+ menuaudio="silence.mp2"
dimensions="(720, 576)"
rows="5"
cols="1"
color_button="[8, 0, 0]"
color_highlight="[0, 192, 192]"
color_headline="[0, 0, 128]"
- fontface_headline="/usr/share/fonts/nmsbd.ttf"
- fontface_title="/usr/share/fonts/nmsbd.ttf"
- fontface_subtitle="/usr/share/fonts/nmsbd.ttf"
+ fontface_headline="nmsbd.ttf"
+ fontface_title="nmsbd.ttf"
+ fontface_subtitle="nmsbd.ttf"
fontsize_headline="46"
fontsize_title="24"
fontsize_subtitle="14"
<settings
titleformat="$t"
subtitleformat="$d"
- menubg="/usr/lib/enigma2/python/Plugins/Extensions/DVDBurn/dreamdvd_clouds.jpg"
- menuaudio="/usr/lib/enigma2/python/Plugins/Extensions/DVDBurn/silence.mp2"
+ menubg="dreamdvd_clouds.jpg"
+ menuaudio="silence.mp2"
dimensions="(720, 576)"
rows="2"
cols="2"
color_button="[8, 0, 0]"
color_highlight="[128, 0, 0]"
color_headline="[128, 0, 0]"
- fontface_headline="/usr/share/fonts/nmsbd.ttf"
- fontface_title="/usr/share/fonts/nmsbd.ttf"
- fontface_subtitle="/usr/share/fonts/nmsbd.ttf"
+ fontface_headline="nmsbd.ttf"
+ fontface_title="nmsbd.ttf"
+ fontface_subtitle="nmsbd.ttf"
fontsize_headline="46"
fontsize_title="18"
fontsize_subtitle="12"
currDir = "/media/dvd/"
if not pathExists(currDir):
currDir = "/"
+ if lastpath == "": # 'None' is magic to start at the list of mountpoints
+ currDir = None
+ inhibitDirs = ["/bin", "/boot", "/dev", "/etc", "/home", "/lib", "/proc", "/sbin", "/share", "/sys", "/tmp", "/usr", "/var"]
self.filelist = FileList(currDir, matchingPattern = "(?i)^.*\.(iso)", useServiceRef = True)
self["filelist"] = self.filelist
lastpath = (pathname.rstrip("/").rsplit("/",1))[0]
print "lastpath video_ts.ifo=", lastpath
self.close(pathname)
+ if fileExists(pathname+"VIDEO_TS/VIDEO_TS.IFO"):
+ print "dvd structure found, trying to open..."
+ lastpath = (pathname.rstrip("/").rsplit("/",1))[0]
+ print "lastpath video_ts.ifo=", lastpath
+ pathname += "VIDEO_TS"
+ self.close(pathname)
else:
lastpath = filename[0:filename.rfind("/")]
print "lastpath directory=", lastpath
self.saved_config_speeds_backward = config.seek.speeds_backward.value
self.saved_config_enter_forward = config.seek.enter_forward.value
self.saved_config_enter_backward = config.seek.enter_backward.value
- self.saved_config_seek_stepwise_minspeed = config.seek.stepwise_minspeed.value
- self.saved_config_seek_stepwise_repeat = config.seek.stepwise_repeat.value
self.saved_config_seek_on_pause = config.seek.on_pause.value
self.saved_config_seek_speeds_slowmotion = config.seek.speeds_slowmotion.value
config.seek.speeds_slowmotion.value = [ ]
config.seek.enter_forward.value = "2"
config.seek.enter_backward.value = "2"
- config.seek.stepwise_minspeed.value = "Never"
- config.seek.stepwise_repeat.value = "3"
config.seek.on_pause.value = "play"
def restore_infobar_seek_config(self):
config.seek.speeds_slowmotion.value = self.saved_config_seek_speeds_slowmotion
config.seek.enter_forward.value = self.saved_config_enter_forward
config.seek.enter_backward.value = self.saved_config_enter_backward
- config.seek.stepwise_minspeed.value = self.saved_config_seek_stepwise_minspeed
- config.seek.stepwise_repeat.value = self.saved_config_seek_stepwise_repeat
config.seek.on_pause.value = self.saved_config_seek_on_pause
def __init__(self, session, dvd_device = None, dvd_filelist = [ ], args = None):
HelpableScreen.__init__(self)
self.save_infobar_seek_config()
self.change_infobar_seek_config()
- InfoBarSeek.__init__(self, useSeekBackHack=False)
+ InfoBarSeek.__init__(self)
InfoBarPVRState.__init__(self)
self.dvdScreen = self.session.instantiateDialog(DVDOverlay)
newref = eServiceReference(4369, 0, val)
print "play", newref.toString()
if curref is None or curref != newref:
+ if newref.toString().endswith("/VIDEO_TS") or newref.toString().endswith("/"):
+ names = newref.toString().rsplit("/",3)
+ if names[2].startswith("Disk ") or names[2].startswith("DVD "):
+ name = str(names[1]) + " - " + str(names[2])
+ else:
+ name = names[2]
+ print "setting name to: ", self.service
+ newref.setName(str(name))
self.session.nav.playService(newref)
self.service = self.session.nav.getCurrentService()
print "self.service", self.service
if ( m_ddvd_titlestring[0] != '\0' )
name = m_ddvd_titlestring;
else
- name = m_ref.path;
+ if ( !m_ref.name.empty() )
+ name = m_ref.name;
+ else
+ name = m_ref.path;
return 0;
}
# 'None' is magic to start at the list of mountpoints
defaultDir = config.mediaplayer.defaultDir.getValue()
- self.filelist = FileList(defaultDir, matchingPattern = "(?i)^.*\.(mp2|mp3|ogg|ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|divx|m4v|mkv|mp4|m4a|dat|flac|mov)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls")
+ self.filelist = FileList(defaultDir, matchingPattern = "(?i)^.*\.(mp2|mp3|ogg|ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|divx|m4v|mkv|mp4|m4a|dat|flac|mov|m2ts)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls")
self["filelist"] = self.filelist
self.playlist = MyPlayList()
from Components.ScrollLabel import ScrollLabel
from Components.Harddisk import harddiskmanager
from Components.Task import Task, Job, job_manager, Condition
-from Tools.Directories import fileExists, isMount
+from Tools.Directories import fileExists, isMount, resolveFilename, SCOPE_HDD, SCOPE_MEDIA
from Tools.HardwareInfo import HardwareInfo
from Tools.Downloader import downloadWithProgress
from enigma import eConsoleAppContainer, gFont, RT_HALIGN_LEFT, RT_HALIGN_CENTER, RT_VALIGN_CENTER, RT_WRAP, eTimer
self.box = HardwareInfo().get_device_name()
self.feed_base = "http://www.dreamboxupdate.com/opendreambox" #/1.5/%s/images/" % self.box
- self.usbmountpoint = "/mnt/usb/"
+ self.usbmountpoint = resolveFilename(SCOPE_MEDIA)+"usb/"
self.menulist = []
def ackedDestination(self):
print "[ackedDestination]", self.branch, self.target_dir
- self.container.setCWD("/mnt")
+ self.container.setCWD(resolveFilename(SCOPE_MEDIA)+"usb/")
if self.target_dir[:8] == "/autofs/":
self.target_dir = "/dev/" + self.target_dir[8:-1]
self.umountCallback()
def main(session, **kwargs):
- session.open(NFIDownload,"/home/root")
+ session.open(NFIDownload,resolveFilename(SCOPE_HDD))
def filescan_open(list, session, **kwargs):
dev = "/dev/" + (list[0].path).rsplit('/',1)[0][7:]
- print "mounting device " + dev + " to /mnt/usb..."
- system("mount "+dev+" /mnt/usb/ -o rw,sync")
- session.open(NFIDownload,"/mnt/usb/")
+ print "mounting device " + dev + " to /media/usb..."
+ usbmountpoint = resolveFilename(SCOPE_MEDIA)+"usb/"
+ system("mount %s %s -o rw,sync" % (dev, usbmountpoint))
+ session.open(NFIDownload,usbmountpoint)
def filescan(**kwargs):
from Components.Scanner import Scanner, ScanPath
self["slider"] = self.slider
self.activityslider = Slider(0, 100)
self["activityslider"] = self.activityslider
- self.status = StaticText(_("Upgrading Dreambox... Please wait"))
+ self.status = StaticText(_("Please wait..."))
self["status"] = self.status
- self.package = StaticText()
+ self.package = StaticText(_("Verifying your internet connection..."))
self["package"] = self.package
self.oktext = _("Press OK on your remote control to continue.")
self.activity = 0
self.activityTimer = eTimer()
self.activityTimer.callback.append(self.doActivityTimer)
- self.activityTimer.start(100, False)
self.ipkg = IpkgComponent()
self.ipkg.addCallback(self.ipkgCallback)
- self.updating = True
- self.package.setText(_("Package list update"))
- self.ipkg.startCmd(IpkgComponent.CMD_UPDATE)
+ self.updating = False
self["actions"] = ActionMap(["WizardActions"],
{
"ok": self.exit,
"back": self.exit
}, -1)
+
+ iNetwork.checkNetworkState(self.checkNetworkCB)
+ self.onClose.append(self.cleanup)
+
+ def cleanup(self):
+ iNetwork.stopPingConsole()
+
+ def checkNetworkCB(self,data):
+ if data is not None:
+ if data <= 2:
+ self.updating = True
+ self.activityTimer.start(100, False)
+ self.package.setText(_("Package list update"))
+ self.status.setText(_("Upgrading Dreambox... Please wait"))
+ self.ipkg.startCmd(IpkgComponent.CMD_UPDATE)
+ else:
+ self.package.setText(_("Your network is not working. Please try again."))
+ self.status.setText(self.oktext)
def doActivityTimer(self):
self.activity += 1
self.session.openWithCallback(self.exitAnswer, MessageBox, _("Upgrade finished.") +" "+_("Do you want to reboot your Dreambox?"))
else:
self.close()
+ else:
+ if not self.updating:
+ self.close()
def exitAnswer(self, result):
if result is not None and result:
SEEK_STATE_PAUSE = (1, 0, 0, "||")
SEEK_STATE_EOF = (1, 0, 0, "END")
- def __init__(self, actionmap = "InfobarSeekActions", useSeekBackHack=True):
+ def __init__(self, actionmap = "InfobarSeekActions"):
self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
{
iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged,
self.__seekableStatusChanged()
def makeStateForward(self, n):
-# minspeed = config.seek.stepwise_minspeed.value
-# repeat = int(config.seek.stepwise_repeat.value)
-# if minspeed != "Never" and n >= int(minspeed) and repeat > 1:
-# return (0, n * repeat, repeat, ">> %dx" % n)
-# else:
- return (0, n, 0, ">> %dx" % n)
+ return (0, n, 0, ">> %dx" % n)
def makeStateBackward(self, n):
-# minspeed = config.seek.stepwise_minspeed.value
-# repeat = int(config.seek.stepwise_repeat.value)
-# if minspeed != "Never" and n >= int(minspeed) and repeat > 1:
-# return (0, -n * repeat, repeat, "<< %dx" % n)
-# else:
- return (0, -n, 0, "<< %dx" % n)
+ return (0, -n, 0, "<< %dx" % n)
def makeStateSlowMotion(self, n):
return (0, 0, n, "/%d" % n)
return True
def jumpPreviousMark(self):
- # we add 2 seconds, so if the play position is <2s after
+ # we add 5 seconds, so if the play position is <5s after
# the mark, the mark before will be used
self.jumpPreviousNextMark(lambda x: -x-5*90000, start=True)
def jumpNextMark(self):
- if not self.jumpPreviousNextMark(lambda x: x):
+ if not self.jumpPreviousNextMark(lambda x: x-90000):
self.doSeek(-1)
def getNearestCutPoint(self, pts, cmp=abs, start=False):
# can be optimized
- beforecut = False
+ beforecut = True
nearest = None
+ bestdiff = -1
+ instate = True
if start:
- beforecut = True
bestdiff = cmp(0 - pts)
if bestdiff >= 0:
nearest = [0, False]
beforecut = False
if cp[1] == self.CUT_TYPE_IN: # Start is here, disregard previous marks
diff = cmp(cp[0] - pts)
- if diff >= 0:
+ if start and diff >= 0:
nearest = cp
bestdiff = diff
else:
nearest = None
- if cp[1] in (self.CUT_TYPE_MARK, self.CUT_TYPE_LAST):
+ bestdiff = -1
+ if cp[1] == self.CUT_TYPE_IN:
+ instate = True
+ elif cp[1] == self.CUT_TYPE_OUT:
+ instate = False
+ elif cp[1] in (self.CUT_TYPE_MARK, self.CUT_TYPE_LAST):
diff = cmp(cp[0] - pts)
- if diff >= 0 and (nearest is None or bestdiff > diff):
+ if instate and diff >= 0 and (nearest is None or bestdiff > diff):
nearest = cp
bestdiff = diff
return nearest
return
if self.lang == 'de_DE':
- self.mapping.append (u".,?'+\"0-()@/:_$!=") # 0
- self.mapping.append (u" 1") # 1
- self.mapping.append (u"aäbc2AÄBC") # 2
+ self.mapping.append (u"0,?!&@=*'+\"()$~") # 0
+ self.mapping.append (u" 1.:/-_") # 1
+ self.mapping.append (u"abcä2ABCÄ") # 2
self.mapping.append (u"def3DEF") # 3
self.mapping.append (u"ghi4GHI") # 4
self.mapping.append (u"jkl5JKL") # 5
self.mapping.append (u"mnoö6MNOÖ") # 6
self.mapping.append (u"pqrsß7PQRSß") # 7
- self.mapping.append (u"tuüv8TUÜV") # 8
+ self.mapping.append (u"tuvü8TUVÜ") # 8
self.mapping.append (u"wxyz9WXYZ") # 9
elif self.lang == 'es_ES':
- self.mapping.append (u".,?'+\"0-()@/:_$!=") # 0
- self.mapping.append (u" 1") # 1
+ self.mapping.append (u"0,?!&@=*'+\"()$~") # 0
+ self.mapping.append (u" 1.:/-_") # 1
self.mapping.append (u"abcáà2ABCÁÀ") # 2
self.mapping.append (u"deéèf3DEFÉÈ") # 3
self.mapping.append (u"ghiíì4GHIÍÌ") # 4
self.mapping.append (u"tuvúù8TUVÚÙ") # 8
self.mapping.append (u"wxyz9WXYZ") # 9
if self.lang in ('sv_SE', 'fi_FI'):
- self.mapping.append (u".,?'+\"0-()@/:_$!=") # 0
- self.mapping.append (u" 1") # 1
+ self.mapping.append (u"0,?!&@=*'+\"()$~") # 0
+ self.mapping.append (u" 1.:/-_") # 1
self.mapping.append (u"abcåä2ABCÅÄ") # 2
self.mapping.append (u"defé3DEFÉ") # 3
self.mapping.append (u"ghi4GHI") # 4
self.mapping.append (u"tuv8TUV") # 8
self.mapping.append (u"wxyz9WXYZ") # 9
else:
- self.mapping.append (u".,?'+\"0-()@/:_$!=") # 0
- self.mapping.append (u" 1") # 1
+ self.mapping.append (u"0,?!&@=*'+\"()$~") # 0
+ self.mapping.append (u" 1.:/-_") # 1
self.mapping.append (u"abc2ABC") # 2
self.mapping.append (u"def3DEF") # 3
self.mapping.append (u"ghi4GHI") # 4
servicedvb.cpp \
servicedvbrecord.cpp \
servicefs.cpp \
- servicemp3.cpp
+ servicemp3.cpp \
+ servicem2ts.cpp
serviceincludedir = $(pkgincludedir)/lib/service
serviceinclude_HEADERS = \
servicedvb.h \
servicedvbrecord.h \
servicefs.h \
- servicemp3.h
+ servicemp3.h \
+ servicem2ts.h
if HAVE_LIBXINE
libenigma_service_a_SOURCES += \
sFileSize,
sCAIDs,
+ sCAIDPIDs,
sVideoType, /* MPEG2 MPEG4 */
sTags, /* space seperated list of tags */
RESULT eStaticServiceDVBPVRInformation::getName(const eServiceReference &ref, std::string &name)
{
ASSERT(ref == m_ref);
- if (m_parser.m_name.size())
+ if (!ref.name.empty())
+ name = ref.name;
+ else if (!m_parser.m_name.empty())
name = m_parser.m_name;
else
{
{
eDVBServicePMTHandler::program program;
- if (w == sCAIDs)
+ if (w == sCAIDs || w == sCAIDPIDs)
return resIsPyObject;
eDVBServicePMTHandler &h = m_timeshift_active ? m_service_handler_timeshift : m_service_handler;
{
case sCAIDs:
return m_service_handler.getCaIds();
+ case sCAIDPIDs:
+ return m_service_handler.getCaIds(true);
case sTransponderData:
return eStaticServiceDVBInformation().getInfoObject(m_reference, w);
default:
info.m_description = "AAC-HE";
else if (program.audioStreams[i].type == eDVBServicePMTHandler::audioStream::atDTS)
info.m_description = "DTS";
+ else if (program.audioStreams[i].type == eDVBServicePMTHandler::audioStream::atDTSHD)
+ info.m_description = "DTS-HD";
else
info.m_description = "???";
--- /dev/null
+#include <lib/base/init_num.h>
+#include <lib/base/init.h>
+#include <lib/dvb/metaparser.h>
+#include <lib/service/servicem2ts.h>
+
+DEFINE_REF(eServiceFactoryM2TS)
+
+class eM2TSFile: public iTsSource
+{
+ DECLARE_REF(eM2TSFile);
+ eSingleLock m_lock;
+public:
+ eM2TSFile(const char *filename, bool cached=false);
+ ~eM2TSFile();
+
+ // iTsSource
+ off_t lseek(off_t offset, int whence);
+ ssize_t read(off_t offset, void *buf, size_t count);
+ off_t length();
+ int valid();
+private:
+ int m_sync_offset;
+ int m_fd; /* for uncached */
+ FILE *m_file; /* for cached */
+ off_t m_current_offset, m_length;
+ bool m_cached;
+ off_t lseek_internal(off_t offset, int whence);
+};
+
+class eStaticServiceM2TSInformation: public iStaticServiceInformation
+{
+ DECLARE_REF(eStaticServiceM2TSInformation);
+ eServiceReference m_ref;
+ eDVBMetaParser m_parser;
+public:
+ eStaticServiceM2TSInformation(const eServiceReference &ref);
+ RESULT getName(const eServiceReference &ref, std::string &name);
+ int getLength(const eServiceReference &ref);
+ RESULT getEvent(const eServiceReference &ref, ePtr<eServiceEvent> &SWIG_OUTPUT, time_t start_time);
+ int isPlayable(const eServiceReference &ref, const eServiceReference &ignore) { return 1; }
+ int getInfo(const eServiceReference &ref, int w);
+ std::string getInfoString(const eServiceReference &ref,int w);
+ PyObject *getInfoObject(const eServiceReference &r, int what);
+};
+
+DEFINE_REF(eStaticServiceM2TSInformation);
+
+eStaticServiceM2TSInformation::eStaticServiceM2TSInformation(const eServiceReference &ref)
+{
+ m_ref = ref;
+ m_parser.parseFile(ref.path);
+}
+
+RESULT eStaticServiceM2TSInformation::getName(const eServiceReference &ref, std::string &name)
+{
+ ASSERT(ref == m_ref);
+ if (m_parser.m_name.size())
+ name = m_parser.m_name;
+ else
+ {
+ name = ref.path;
+ size_t n = name.rfind('/');
+ if (n != std::string::npos)
+ name = name.substr(n + 1);
+ }
+ return 0;
+}
+
+int eStaticServiceM2TSInformation::getLength(const eServiceReference &ref)
+{
+ ASSERT(ref == m_ref);
+
+ eDVBTSTools tstools;
+
+ struct stat s;
+ stat(ref.path.c_str(), &s);
+
+ eM2TSFile *file = new eM2TSFile(ref.path.c_str());
+ ePtr<iTsSource> source = file;
+
+ if (!source->valid())
+ return 0;
+
+ tstools.setSource(source);
+
+ /* check if cached data is still valid */
+ if (m_parser.m_data_ok && (s.st_size == m_parser.m_filesize) && (m_parser.m_length))
+ return m_parser.m_length / 90000;
+
+ /* open again, this time with stream info */
+ tstools.setSource(source, ref.path.c_str());
+
+ /* otherwise, re-calc length and update meta file */
+ pts_t len;
+ if (tstools.calcLen(len))
+ return 0;
+
+ m_parser.m_length = len;
+ m_parser.m_filesize = s.st_size;
+ m_parser.updateMeta(ref.path);
+ return m_parser.m_length / 90000;
+}
+
+int eStaticServiceM2TSInformation::getInfo(const eServiceReference &ref, int w)
+{
+ switch (w)
+ {
+ case iServiceInformation::sDescription:
+ return iServiceInformation::resIsString;
+ case iServiceInformation::sServiceref:
+ return iServiceInformation::resIsString;
+ case iServiceInformation::sFileSize:
+ return m_parser.m_filesize;
+ case iServiceInformation::sTimeCreate:
+ if (m_parser.m_time_create)
+ return m_parser.m_time_create;
+ else
+ return iServiceInformation::resNA;
+ default:
+ return iServiceInformation::resNA;
+ }
+}
+
+std::string eStaticServiceM2TSInformation::getInfoString(const eServiceReference &ref,int w)
+{
+ switch (w)
+ {
+ case iServiceInformation::sDescription:
+ return m_parser.m_description;
+ case iServiceInformation::sServiceref:
+ return m_parser.m_ref.toString();
+ case iServiceInformation::sTags:
+ return m_parser.m_tags;
+ default:
+ return "";
+ }
+}
+
+PyObject *eStaticServiceM2TSInformation::getInfoObject(const eServiceReference &r, int what)
+{
+ switch (what)
+ {
+ case iServiceInformation::sFileSize:
+ return PyLong_FromLongLong(m_parser.m_filesize);
+ default:
+ Py_RETURN_NONE;
+ }
+}
+
+RESULT eStaticServiceM2TSInformation::getEvent(const eServiceReference &ref, ePtr<eServiceEvent> &evt, time_t start_time)
+{
+ if (!ref.path.empty())
+ {
+ ePtr<eServiceEvent> event = new eServiceEvent;
+ std::string filename = ref.path;
+ filename.erase(filename.length()-4, 2);
+ filename+="eit";
+ if (!event->parseFrom(filename, (m_parser.m_ref.getTransportStreamID().get()<<16)|m_parser.m_ref.getOriginalNetworkID().get()))
+ {
+ evt = event;
+ return 0;
+ }
+ }
+ evt = 0;
+ return -1;
+}
+
+DEFINE_REF(eM2TSFile);
+
+eM2TSFile::eM2TSFile(const char *filename, bool cached)
+ :m_lock(false), m_sync_offset(0), m_fd(-1), m_file(NULL), m_current_offset(0), m_length(0), m_cached(cached)
+{
+ if (!m_cached)
+ m_fd = ::open(filename, O_RDONLY | O_LARGEFILE);
+ else
+ m_file = ::fopen64(filename, "rb");
+ if (valid())
+ m_current_offset = m_length = lseek_internal(0, SEEK_END);
+}
+
+eM2TSFile::~eM2TSFile()
+{
+ if (m_cached)
+ {
+ if (m_file)
+ {
+ ::fclose(m_file);
+ m_file = 0;
+ }
+ }
+ else
+ {
+ if (m_fd >= 0)
+ ::close(m_fd);
+ m_fd = -1;
+ }
+}
+
+off_t eM2TSFile::lseek(off_t offset, int whence)
+{
+ eSingleLocker l(m_lock);
+
+ offset = (offset % 188) + (offset * 192) / 188;
+
+ if (offset != m_current_offset)
+ m_current_offset = lseek_internal(offset, whence);
+
+ return m_current_offset;
+}
+
+off_t eM2TSFile::lseek_internal(off_t offset, int whence)
+{
+ off_t ret;
+
+ if (!m_cached)
+ ret = ::lseek(m_fd, offset, whence);
+ else
+ {
+ if (::fseeko(m_file, offset, whence) < 0)
+ perror("fseeko");
+ ret = ::ftello(m_file);
+ }
+ return ret <= 0 ? ret : (ret % 192) + (ret*188) / 192;
+}
+
+ssize_t eM2TSFile::read(off_t offset, void *b, size_t count)
+{
+ eSingleLocker l(m_lock);
+ unsigned char tmp[192*3];
+ unsigned char *buf = (unsigned char*)b;
+
+ size_t rd=0;
+ offset = (offset % 188) + (offset * 192) / 188;
+
+sync:
+ if ((offset+m_sync_offset) != m_current_offset)
+ {
+// eDebug("seekTo %lld", offset+m_sync_offset);
+ m_current_offset = lseek_internal(offset+m_sync_offset, SEEK_SET);
+ if (m_current_offset < 0)
+ return m_current_offset;
+ }
+
+ while (rd < count) {
+ size_t ret;
+ if (!m_cached)
+ ret = ::read(m_fd, tmp, 192);
+ else
+ ret = ::fread(tmp, 1, 192, m_file);
+ if (ret < 0 || ret < 192)
+ return rd ? rd : ret;
+
+ if (tmp[4] != 0x47)
+ {
+ if (rd > 0) {
+ eDebug("short read at pos %lld async!!", m_current_offset);
+ return rd;
+ }
+ else {
+ int x=0;
+ if (!m_cached)
+ ret = ::read(m_fd, tmp+192, 384);
+ else
+ ret = ::fread(tmp+192, 1, 384, m_file);
+
+#if 0
+ eDebugNoNewLine("m2ts out of sync at pos %lld, real %lld:", offset + m_sync_offset, m_current_offset);
+ for (; x < 192; ++x)
+ eDebugNoNewLine(" %02x", tmp[x]);
+ eDebug("");
+ x=0;
+#else
+ eDebug("m2ts out of sync at pos %lld, real %lld", offset + m_sync_offset, m_current_offset);
+#endif
+ for (; x < 192; ++x)
+ {
+ if (tmp[x] == 0x47 && tmp[x+192] == 0x47)
+ {
+ int add_offs = (x - 4);
+ eDebug("sync found at pos %d, sync_offset is now %d, old was %d", x, add_offs + m_sync_offset, m_sync_offset);
+ m_sync_offset += add_offs;
+ goto sync;
+ }
+ }
+ }
+ }
+
+ memcpy(buf+rd, tmp+4, 188);
+
+ rd += 188;
+ m_current_offset += 188;
+ }
+
+ m_sync_offset %= 188;
+
+ return rd;
+}
+
+int eM2TSFile::valid()
+{
+ if (!m_cached)
+ return m_fd != -1;
+ else
+ return !!m_file;
+}
+
+off_t eM2TSFile::length()
+{
+ return m_length;
+}
+
+eServiceFactoryM2TS::eServiceFactoryM2TS()
+{
+ ePtr<eServiceCenter> sc;
+ eServiceCenter::getPrivInstance(sc);
+ if (sc)
+ {
+ std::list<std::string> extensions;
+ extensions.push_back("m2ts");
+ extensions.push_back("mts");
+ sc->addServiceFactory(eServiceFactoryM2TS::id, this, extensions);
+ }
+}
+
+eServiceFactoryM2TS::~eServiceFactoryM2TS()
+{
+ ePtr<eServiceCenter> sc;
+
+ eServiceCenter::getPrivInstance(sc);
+ if (sc)
+ sc->removeServiceFactory(eServiceFactoryM2TS::id);
+}
+
+RESULT eServiceFactoryM2TS::play(const eServiceReference &ref, ePtr<iPlayableService> &ptr)
+{
+ ptr = new eServiceM2TS(ref);
+ return 0;
+}
+
+RESULT eServiceFactoryM2TS::record(const eServiceReference &ref, ePtr<iRecordableService> &ptr)
+{
+ ptr=0;
+ return -1;
+}
+
+RESULT eServiceFactoryM2TS::list(const eServiceReference &ref, ePtr<iListableService> &ptr)
+{
+ ptr=0;
+ return -1;
+}
+
+RESULT eServiceFactoryM2TS::info(const eServiceReference &ref, ePtr<iStaticServiceInformation> &ptr)
+{
+ ptr=new eStaticServiceM2TSInformation(ref);
+ return 0;
+}
+
+RESULT eServiceFactoryM2TS::offlineOperations(const eServiceReference &ref, ePtr<iServiceOfflineOperations> &ptr)
+{
+ ptr = 0;
+ return -1;
+}
+
+eServiceM2TS::eServiceM2TS(const eServiceReference &ref)
+ :eDVBServicePlay(ref, NULL)
+{
+}
+
+ePtr<iTsSource> eServiceM2TS::createTsSource(eServiceReferenceDVB &ref)
+{
+ ePtr<iTsSource> source = new eM2TSFile(ref.path.c_str());
+ return source;
+}
+
+RESULT eServiceM2TS::isCurrentlySeekable()
+{
+ return 1; // for fast winding we need index files... so only skip forward/backward yet
+}
+
+eAutoInitPtr<eServiceFactoryM2TS> init_eServiceFactoryM2TS(eAutoInitNumbers::service+1, "eServiceFactoryM2TS");
--- /dev/null
+#ifndef __servicem2ts_h
+#define __servicem2ts_h
+
+#include <lib/service/servicedvb.h>
+
+class eServiceFactoryM2TS: public iServiceHandler
+{
+ DECLARE_REF(eServiceFactoryM2TS);
+public:
+ eServiceFactoryM2TS();
+ virtual ~eServiceFactoryM2TS();
+ enum { id = 0x3 };
+
+ // iServiceHandler
+ RESULT play(const eServiceReference &, ePtr<iPlayableService> &ptr);
+ RESULT record(const eServiceReference &, ePtr<iRecordableService> &ptr);
+ RESULT list(const eServiceReference &, ePtr<iListableService> &ptr);
+ RESULT info(const eServiceReference &, ePtr<iStaticServiceInformation> &ptr);
+ RESULT offlineOperations(const eServiceReference &, ePtr<iServiceOfflineOperations> &ptr);
+};
+
+class eServiceM2TS: public eDVBServicePlay
+{
+ friend class eServiceFactoryM2TS;
+protected:
+ eServiceM2TS(const eServiceReference &ref);
+ ePtr<iTsSource> createTsSource(eServiceReferenceDVB &ref);
+
+ // iSeekableService
+ RESULT isCurrentlySeekable();
+};
+
+#endif
xml.open("image");
xml.stringFromFile("dreamboxmodel", "/proc/stb/info/model");
xml.stringFromFile("kernelcmdline", "/proc/cmdline");
+ xml.stringFromFile("nimsockets", "/proc/bus/nim_sockets");
if (!getConfigBool("config.plugins.crashlogautosubmit.sendAnonCrashlog", true)) {
xml.cDataFromFile("dreamboxca", "/proc/stb/info/ca");
xml.cDataFromFile("enigma2settings", eEnv::resolve("${sysconfdir}/enigma2/settings"), ".password=");