diff options
author | Chang.H.S <jhs@dev3> | 2013-01-04 06:33:00 (GMT) |
---|---|---|
committer | Chang.H.S <jhs@dev3> | 2013-01-04 09:15:51 (GMT) |
commit | dadea9d343abea0ead4e532ae37f7ed993b7358d (patch) | |
tree | c79b4a3f5631f425703e36915b5114b7d3f1c818 | |
parent | 6a5f6a390b7d68f70629e7539de2574f37007435 (diff) |
Support transcoding solo2/duo2.
-vuplus-dvb-modules update.
-openwebif patched.
-enigma2-streamproxy update.
-enigma2-transtreamproxy appended.
-update dvbapp PR.
-update task-vuplus-enigma2
15 files changed, 671 insertions, 11 deletions
diff --git a/meta-bsp/vuduo2/conf/machine/vuduo2.conf b/meta-bsp/vuduo2/conf/machine/vuduo2.conf index 2c9c0ae..b5290e4 100644 --- a/meta-bsp/vuduo2/conf/machine/vuduo2.conf +++ b/meta-bsp/vuduo2/conf/machine/vuduo2.conf @@ -13,6 +13,7 @@ VUPLUS_FEATURES += "streamtv" VUPLUS_FEATURES += "dlna" VUPLUS_FEATURES += "3gmodem" VUPLUS_FEATURES += "webif" +VUPLUS_FEATURES += "transcoding" IMAGE_UNPACK_PATH = "vuplus/duo2" MKFS_UBI_MAX_ERASE_BLK_COUNT = "4096" diff --git a/meta-bsp/vusolo2/conf/machine/vusolo2.conf b/meta-bsp/vusolo2/conf/machine/vusolo2.conf index e436584..fa14a48 100644 --- a/meta-bsp/vusolo2/conf/machine/vusolo2.conf +++ b/meta-bsp/vusolo2/conf/machine/vusolo2.conf @@ -14,6 +14,7 @@ VUPLUS_FEATURES += "dlna" VUPLUS_FEATURES += "3gmodem" VUPLUS_FEATURES += "webif" VUPLUS_FEATURES += "autoshutdown" +VUPLUS_FEATURES += "transcoding" IMAGE_UNPACK_PATH = "vuplus/solo2" MKFS_UBI_MAX_ERASE_BLK_COUNT = "4096" diff --git a/meta-bsp/vusolo2/recipes/vuplus/vuplus-dvb-modules.bbappend b/meta-bsp/vusolo2/recipes/vuplus/vuplus-dvb-modules.bbappend index 951a050..54c934d 100644 --- a/meta-bsp/vusolo2/recipes/vuplus/vuplus-dvb-modules.bbappend +++ b/meta-bsp/vusolo2/recipes/vuplus/vuplus-dvb-modules.bbappend @@ -1,8 +1,6 @@ -SRCDATE = "20121109" +SRCDATE = "20121220" MODULES_NAME = "procmk\ndvb-bcm7356\nbrcmfb\nfpga_directc" -SRC_URI = "http://archive.vuplus.com/download/drivers/beta/private/vuplus-dvb-modules-${MACHINE}-${PV}-${PREFERRED_GCC_VERSION}-${SRCDATE}.tar.gz " - -SRC_URI[md5sum] = "8eeba3ee93d9ef55e452a87ca59efc0e" -SRC_URI[sha256sum] = "0885c737333a6c588abcdd9ce1535eba809a22fcd32864411718408d0bb2bb80" +SRC_URI[md5sum] = "0905b572b36ee68ffdf30e11bca0b1de" +SRC_URI[sha256sum] = "db9bfabc804ad288f0e253be2e4547a76846a1a8b05ec635c3567aa18cbb1827" diff --git a/meta-openvuplus/recipes-vuplus/e2openplugins/enigma2-plugin-extensions-openwebif.bb b/meta-openvuplus/recipes-vuplus/e2openplugins/enigma2-plugin-extensions-openwebif.bb index c4c6f9e..bdf2242 100644 --- a/meta-openvuplus/recipes-vuplus/e2openplugins/enigma2-plugin-extensions-openwebif.bb +++ b/meta-openvuplus/recipes-vuplus/e2openplugins/enigma2-plugin-extensions-openwebif.bb @@ -4,15 +4,17 @@ LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://README;firstline=10;lastline=12;md5=9c14f792d0aeb54e15490a28c89087f7" DEPENDS = "python-cheetah-native" -RDEPENDS_${PN} = "python-cheetah python-json python-unixadmin python-misc" +RDEPENDS_${PN} = "python-cheetah python-json python-unixadmin python-misc python-pyopenssl aio-grab" inherit gitpkgv PV = "0.1+git${SRCPV}" PKGV = "0.1+git${GITPKGV}" -PR = "r0.72" +PR = "r0.73" require openplugins.inc +SRC_URI += "file://openwebif_8001_8002.patch;patch=1;pnum=1" + # Just a quick hack to "compile" it do_compile() { cheetah-compile -R --nobackup ${S}/plugin diff --git a/meta-openvuplus/recipes-vuplus/e2openplugins/enigma2-plugin-extensions-openwebif/openwebif_8001_8002.patch b/meta-openvuplus/recipes-vuplus/e2openplugins/enigma2-plugin-extensions-openwebif/openwebif_8001_8002.patch new file mode 100644 index 0000000..909a9ae --- /dev/null +++ b/meta-openvuplus/recipes-vuplus/e2openplugins/enigma2-plugin-extensions-openwebif/openwebif_8001_8002.patch @@ -0,0 +1,143 @@ +diff --git a/plugin/controllers/models/stream.py b/plugin/controllers/models/stream.py +index fe4ddd4..71b1eaa 100644 +--- a/plugin/controllers/models/stream.py ++++ b/plugin/controllers/models/stream.py +@@ -25,11 +25,21 @@ def getStream(session, request, m3ufile): + if "name" in request.args: + name = request.args["name"][0] + # #EXTINF:-1,%s\n remove not compatiple with old api +- if sRef != '': ++ ++ if "device" in request.args : ++ if request.args["device"][0] == "phone" : ++ portNumber = 8002; ++ else : ++ portNumber = config.OpenWebif.streamport.value ++ else : ++ portNumber = config.OpenWebif.streamport.value ++ ++ if sRef != '' : + progopt="#EXTVLCOPT:program=%d\n" % (int(sRef.split(':')[3],16)) + else: + progopt="" +- response = "#EXTM3U \n#EXTVLCOPT--http-reconnect=true \n%shttp://%s:%s/%s\n" % (progopt,request.getRequestHostname(),config.OpenWebif.streamport.value, sRef) ++ response = "#EXTM3U \n#EXTVLCOPT--http-reconnect=true \n%shttp://%s:%s/%s\n" % (progopt,request.getRequestHostname(), portNumber, sRef) ++ + request.setHeader('Content-Type', 'application/text') + return response + +diff --git a/plugin/controllers/views/ajax/channels.tmpl b/plugin/controllers/views/ajax/channels.tmpl +index 5975ce8..2915c5b 100755 +--- a/plugin/controllers/views/ajax/channels.tmpl ++++ b/plugin/controllers/views/ajax/channels.tmpl +@@ -12,9 +12,12 @@ + <a href="#" onclick="open_epg_pop('$channel.ref')"> + <img src="../images/ico_epg.png" title="Show EPG for $channel.name" border="0"> + </a> +- <a target="_blank" href='/web/stream.m3u?ref=$channel.ref&name=$channel.name'> ++ <a href="#" onclick="jumper8001('$channel.ref', '$channel.name');"> + <img align="top" src="../images/ico_stream.png" title="Stream $channel.name" border="0"> + </a> ++ <a href="#" onclick="jumper8002('$channel.ref', '$channel.name');"> ++ <img align="top" src="../images/ico_stream.png" title="Stream Port 8002 $channel.name" border="0"> ++ </a> + </div> + + #if $channel.has_key('now_title') +diff --git a/plugin/controllers/views/main.tmpl b/plugin/controllers/views/main.tmpl +index 1844226..6dcfb66 100755 +--- a/plugin/controllers/views/main.tmpl ++++ b/plugin/controllers/views/main.tmpl +@@ -9,6 +9,79 @@ + <script type="text/javascript" src="/js/jquery-ui-1.8.18.custom.min.js"></script>
+ <script type="text/javascript" src="/js/openwebif.js"></script>
+
++<script>
++
++ // VuPlus Port Jumper
++ // 2012.12.10
++
++ function getWinSize(win) {
++ if(!win) win = window;
++ var s = {};
++
++ if(typeof win.innerWidth != "undefined") {
++ s.screenWidth = win.screen.width;
++ s.screenHeight = win.screen.height;
++ } else {
++ s.screenWidth = 0;
++ s.screenHeight = 0;
++ }
++
++ return s;
++ }
++
++ function getDeviceType() {
++ var ss = getWinSize();
++ var screenLen = 0;
++
++ // alert( ss.screenHeight );
++ // alert( ss.screenWidth );
++
++ if( ss.screenHeight > ss.screenWdith ) {
++ screenLen = ss.screenHeight;
++ } else {
++ screenLen = ss.screenWidth;
++ }
++
++ if( screenLen < 500 ) {
++ return "phone";
++ } else {
++ return "tab"; }
++ }
++
++ function getOSType() {
++ var agentStr = navigator.userAgent;
++
++ if(agentStr.indexOf("iPod") > -1 || agentStr.indexOf("iPhone") > -1)
++ return "ios";
++ else if(agentStr.indexOf("Android") > -1)
++ return "android";
++ else
++ return "unknown";
++ }
++
++ function jumper8002( sref, sname ) {
++ var deviceType = getDeviceType();
++
++ document.portForm.ref.value = sref;
++ document.portForm.name.value = sname;
++
++ document.portForm.device.value = "phone";
++ document.portForm.submit();
++ }
++
++ function jumper8001( sref, sname ) {
++ var deviceType = getDeviceType();
++
++ document.portForm.ref.value = sref;
++ document.portForm.name.value = sname;
++
++ document.portForm.device.value = "etc";
++ document.portForm.submit();
++ }
++
++</script>
++
++
+ <title>Open Webif</title>
+ </head>
+
+@@ -195,5 +268,12 @@ + <div id="footer"><h3> <a href="https://github.com/E2OpenPlugins">E2OpenPlugins</a> | <a href="http://www.vuplus-community.net">Black Hole</a> | <a href="http://openpli.org">OpenPli</a> | <a href="http://forum.sifteam.eu">Sif</a> | <a href="http://www.vuplus-support.org">Vti</a></h3></div>
+ </div>
+ </div>
++
++ <form name="portForm" action="/web/stream.m3u" method="GET" target="_blank">
++ <input type="hidden" name="ref">
++ <input type="hidden" name="name">
++ <input type="hidden" name="device">
++ </form>
++
+ </body>
+ </html>
diff --git a/meta-openvuplus/recipes-vuplus/enigma2/enigma2-streamproxy.bb b/meta-openvuplus/recipes-vuplus/enigma2/enigma2-streamproxy.bb index 197c569..07c284d 100644 --- a/meta-openvuplus/recipes-vuplus/enigma2/enigma2-streamproxy.bb +++ b/meta-openvuplus/recipes-vuplus/enigma2/enigma2-streamproxy.bb @@ -1,8 +1,8 @@ SUMMARY = "streamproxy manages streaming data to a PC using enigma2" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552" -SRCREV = "b927ed8498a41a77e965abad099eb01dc5fef562" -PR = "r3" +SRCREV = "37a3f198a22d90cdfebf07cf56409cf93a4e74ba" +PR = "r4" SRC_URI = "file://streamproxy.xinetd.in \ file://streamproxy@.service \ diff --git a/meta-openvuplus/recipes-vuplus/enigma2/enigma2-transtreamproxy.bb b/meta-openvuplus/recipes-vuplus/enigma2/enigma2-transtreamproxy.bb new file mode 100644 index 0000000..af394f3 --- /dev/null +++ b/meta-openvuplus/recipes-vuplus/enigma2/enigma2-transtreamproxy.bb @@ -0,0 +1,28 @@ +SUMMARY = "streamproxy manages streaming data to a Mobile device using enigma2" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552" +SRCREV = "37a3f198a22d90cdfebf07cf56409cf93a4e74ba" +PR = "r4" + +SRC_URI = "file://transtreamproxy.xinetd.in \ + file://transtreamproxy@.service \ + file://transtreamproxy.socket \ + file://transcoding.patch;patch=1;pnum=1 \ +" + +SCHWERKRAFT_PROJECT = "streamproxy" + +inherit autotools schwerkraft-git systemd xinetd + +do_install() { + install -d ${D}/usr/bin + install -m 0755 ${S}/src/streamproxy ${D}/usr/bin/transtreamproxy + install -d ${D}${systemd_unitdir}/system + ln -sf /dev/null ${D}${systemd_unitdir}/system/transtreamproxy.service +} + +SYSTEMD_PACKAGES = "${PN}-systemd" +SYSTEMD_SERVICE_${PN}-systemd = "transtreamproxy.socket" + +XINETD_PACKAGES = "${PN}-xinetd" +XINETD_SERVICE_${PN}-xinetd = "transtreamproxy" diff --git a/meta-openvuplus/recipes-vuplus/enigma2/enigma2-transtreamproxy/transcoding.patch b/meta-openvuplus/recipes-vuplus/enigma2/enigma2-transtreamproxy/transcoding.patch new file mode 100755 index 0000000..0dc464a --- /dev/null +++ b/meta-openvuplus/recipes-vuplus/enigma2/enigma2-transtreamproxy/transcoding.patch @@ -0,0 +1,284 @@ +diff --git a/src/streamproxy.c b/src/streamproxy.c +index 3f82412..321d9c9 100644 +--- a/src/streamproxy.c ++++ b/src/streamproxy.c +@@ -42,6 +42,25 @@ char *reason = ""; + + int active_pids[MAX_PIDS]; + ++int g_video_pid = 0; ++int g_audio_pid = 0; ++int g_pcr_pid = 0; ++int g_pmt_pid = 0; ++ ++struct proc_dmx_pid ++{ ++ char *proc_path; ++ char *str_match; ++ int pid; ++}; ++ ++struct proc_dmx_pid proc_dmx_setup[] = { ++ {"/proc/stb/encoder/0/video_pid", "video", 0}, ++ {"/proc/stb/encoder/0/audio_pid", "audio", 0}, ++ {"/proc/stb/encoder/0/pcr_pid", "pcr", 0}, ++ {"/proc/stb/encoder/0/pmt_pid", "pmt", 0}, ++}; ++ + int handle_upstream(void); + int handle_upstream_line(void); + +@@ -81,6 +100,7 @@ int main(int argc, char **argv) + int i; + for (i=0; i<MAX_PIDS; ++i) + active_pids[i] = -1; ++ + + while (1) + { +@@ -113,6 +133,8 @@ int main(int argc, char **argv) + goto bad_gateway; + } + ++ memset(upstream_request, 0, 256); ++ + snprintf(upstream_request, sizeof(upstream_request), "GET /web/stream?StreamService=%s HTTP/1.0\r\n%s%s\r\n", service_ref, xff_header, authorization); + + if (write(upstream, upstream_request, strlen(upstream_request)) != strlen(upstream_request)) +@@ -168,6 +190,7 @@ bad_gateway: + int handle_upstream(void) + { + char buffer[MAX_LINE_LENGTH]; ++ memset(buffer, 0, MAX_LINE_LENGTH); + int n = read(upstream, buffer, MAX_LINE_LENGTH); + if (n == 0) + return 1; +@@ -180,6 +203,7 @@ int handle_upstream(void) + + char *c = buffer; + ++ + while (n) + { + char *next_line; +@@ -218,6 +242,9 @@ int handle_upstream(void) + + int handle_upstream_line(void) + { ++ int i; ++ const char *str; ++ + switch (upstream_state) + { + case 0: +@@ -244,104 +271,137 @@ int handle_upstream_line(void) + if (response_line[0] == '+') { + /* parse (and possibly open) demux */ + int demux = atoi(response_line + 1); +- ++ { ++ FILE *f = fopen("/proc/stb/encoder/0/demux", "w"); ++ if(f) ++ { ++ fprintf(f, "%d\n", demux); ++ fclose(f); ++ } ++ } + +- /* parse new pids */ +- const char *p = strchr(response_line, ':'); +- int old_active_pids[MAX_PIDS]; +- +- memcpy(old_active_pids, active_pids, sizeof(active_pids)); +- +- int nr_pids = 0, i, j; +- while (p) ++ for(i = 0 ; i < sizeof(proc_dmx_setup)/sizeof(proc_dmx_setup[0]) ; i++) + { +- ++p; +- int pid = strtoul(p, 0, 0x10); +- p = strchr(p, ','); ++ str = strstr(response_line, proc_dmx_setup[i].str_match); ++ if(str) ++ { ++ while(*str != ',') str--; ++ proc_dmx_setup[i].pid = strtoul(str+1, 0, 0x10); ++ FILE *f = fopen(proc_dmx_setup[i].proc_path, "w"); ++ if(f) ++ { ++ fprintf(f, "%d\n", proc_dmx_setup[i].pid); ++ fclose(f); ++ } ++ } + +- /* do not add pids twice */ +- for (i = 0; i < nr_pids; ++i) +- if (active_pids[i] == pid) +- break; ++ } + +- if (i != nr_pids) +- continue; + +- active_pids[nr_pids++] = pid; ++ if(proc_dmx_setup[3].pid && ( (g_video_pid != proc_dmx_setup[0].pid) || (g_audio_pid != proc_dmx_setup[1].pid) || (g_pcr_pid != proc_dmx_setup[2].pid)) ) ++ { ++ g_video_pid = proc_dmx_setup[0].pid; ++ g_audio_pid = proc_dmx_setup[1].pid; ++ g_pcr_pid = proc_dmx_setup[2].pid; ++ ++ ++ /* parse new pids */ ++ const char *p = strchr(response_line, ':'); ++ int old_active_pids[MAX_PIDS]; + +- if (nr_pids == MAX_PIDS) +- break; +- } +- +- for (i = nr_pids; i < MAX_PIDS; ++i) +- active_pids[i] = -1; ++ memcpy(old_active_pids, active_pids, sizeof(active_pids)); + +- /* check for added pids */ +- for (i = 0; i < nr_pids; ++i) +- { +- for (j = 0; j < MAX_PIDS; ++j) +- if (active_pids[i] == old_active_pids[j]) ++ int nr_pids = 0, i, j; ++ while (p) ++ { ++ ++p; ++ int pid = strtoul(p, 0, 0x10); ++ p = strchr(p, ','); ++ ++ /* do not add pids twice */ ++ for (i = 0; i < nr_pids; ++i) ++ if (active_pids[i] == pid) ++ break; ++ ++ if (i != nr_pids) ++ continue; ++ ++ active_pids[nr_pids++] = pid; ++ ++ if (nr_pids == MAX_PIDS) + break; +- if (j == MAX_PIDS) { +- if (demux_fd < 0) { +- struct dmx_pes_filter_params flt; +- char demuxfn[32]; +- sprintf(demuxfn, "/dev/dvb/adapter0/demux%d", demux); +- demux_fd = open(demuxfn, O_RDWR | O_NONBLOCK); ++ } ++ ++ for (i = nr_pids; i < MAX_PIDS; ++i) ++ active_pids[i] = -1; ++ ++ /* check for added pids */ ++ for (i = 0; i < nr_pids; ++i) ++ { ++ for (j = 0; j < MAX_PIDS; ++j) ++ if (active_pids[i] == old_active_pids[j]) ++ break; ++ if (j == MAX_PIDS) { + if (demux_fd < 0) { +- reason = "DEMUX OPEN FAILED"; +- return 2; +- } ++ struct dmx_pes_filter_params flt; ++ char demuxfn[32]; ++ sprintf(demuxfn, "/dev/dvb/adapter0/demux%d", demux); ++ demux_fd = open(demuxfn, O_RDWR | O_NONBLOCK); ++ if (demux_fd < 0) { ++ reason = "DEMUX OPEN FAILED"; ++ return 2; ++ } + +- ioctl(demux_fd, DMX_SET_BUFFER_SIZE, 1024*1024); ++ ioctl(demux_fd, DMX_SET_BUFFER_SIZE, 1024*1024); + +- flt.pid = active_pids[i]; +- flt.input = DMX_IN_FRONTEND; ++ flt.pid = active_pids[i]; ++ flt.input = DMX_IN_FRONTEND; + #if DVB_API_VERSION > 3 +- flt.output = DMX_OUT_TSDEMUX_TAP; +- flt.pes_type = DMX_PES_OTHER; ++ flt.output = DMX_OUT_TSDEMUX_TAP; ++ flt.pes_type = DMX_PES_OTHER; + #else +- flt.output = DMX_OUT_TAP; +- flt.pes_type = DMX_TAP_TS; ++ flt.output = DMX_OUT_TAP; ++ flt.pes_type = DMX_TAP_TS; + #endif +- flt.flags = DMX_IMMEDIATE_START; ++ flt.flags = DMX_IMMEDIATE_START; + +- if (ioctl(demux_fd, DMX_SET_PES_FILTER, &flt) < 0) { +- reason = "DEMUX PES FILTER SET FAILED"; +- return 2; ++ if (ioctl(demux_fd, DMX_SET_PES_FILTER, &flt) < 0) { ++ reason = "DEMUX PES FILTER SET FAILED"; ++ return 2; ++ } + } +- } +- else { +- uint16_t pid = active_pids[i]; +- int ret; ++ else { ++ uint16_t pid = active_pids[i]; ++ int ret; + #if DVB_API_VERSION > 3 +- ret = ioctl(demux_fd, DMX_ADD_PID, &pid); ++ ret = ioctl(demux_fd, DMX_ADD_PID, &pid); + #else +- ret = ioctl(demux_fd, DMX_ADD_PID, pid); ++ ret = ioctl(demux_fd, DMX_ADD_PID, pid); + #endif +- if (ret < 0) { +- reason = "DMX_ADD_PID FAILED"; +- return 2; ++ if (ret < 0) { ++ reason = "DMX_ADD_PID FAILED"; ++ return 2; ++ } + } + } + } +- } +- +- /* check for removed pids */ +- for (i = 0; i < MAX_PIDS; ++i) +- { +- if (old_active_pids[i] == -1) +- continue; +- for (j = 0; j < nr_pids; ++j) +- if (old_active_pids[i] == active_pids[j]) +- break; +- if (j == nr_pids) { ++ ++ /* check for removed pids */ ++ for (i = 0; i < MAX_PIDS; ++i) ++ { ++ if (old_active_pids[i] == -1) ++ continue; ++ for (j = 0; j < nr_pids; ++j) ++ if (old_active_pids[i] == active_pids[j]) ++ break; ++ if (j == nr_pids) { + #if DVB_API_VERSION > 3 +- uint16_t pid = old_active_pids[i]; +- ioctl(demux_fd, DMX_REMOVE_PID, &pid); ++ uint16_t pid = old_active_pids[i]; ++ ioctl(demux_fd, DMX_REMOVE_PID, &pid); + #else +- ioctl(demux_fd, DMX_REMOVE_PID, old_active_pids[i]); ++ ioctl(demux_fd, DMX_REMOVE_PID, old_active_pids[i]); + #endif ++ } + } + } + if (upstream_state == 2) { diff --git a/meta-openvuplus/recipes-vuplus/enigma2/enigma2-transtreamproxy/transtreamproxy.socket b/meta-openvuplus/recipes-vuplus/enigma2/enigma2-transtreamproxy/transtreamproxy.socket new file mode 100644 index 0000000..21258f8 --- /dev/null +++ b/meta-openvuplus/recipes-vuplus/enigma2/enigma2-transtreamproxy/transtreamproxy.socket @@ -0,0 +1,8 @@ +[Unit] + +[Socket] +ListenStream=8002 +Accept=yes + +[Install] +WantedBy=sockets.target diff --git a/meta-openvuplus/recipes-vuplus/enigma2/enigma2-transtreamproxy/transtreamproxy.xinetd.in b/meta-openvuplus/recipes-vuplus/enigma2/enigma2-transtreamproxy/transtreamproxy.xinetd.in new file mode 100644 index 0000000..9761df2 --- /dev/null +++ b/meta-openvuplus/recipes-vuplus/enigma2/enigma2-transtreamproxy/transtreamproxy.xinetd.in @@ -0,0 +1,10 @@ +service transtreamproxy +{ + type = UNLISTED + socket_type = stream + protocol = tcp + wait = no + user = root + server = @BINDIR@/transtreamproxy + port = 8002 +} diff --git a/meta-openvuplus/recipes-vuplus/enigma2/enigma2-transtreamproxy/transtreamproxy@.service b/meta-openvuplus/recipes-vuplus/enigma2/enigma2-transtreamproxy/transtreamproxy@.service new file mode 100644 index 0000000..b6c83e3 --- /dev/null +++ b/meta-openvuplus/recipes-vuplus/enigma2/enigma2-transtreamproxy/transtreamproxy@.service @@ -0,0 +1,5 @@ +[Unit] + +[Service] +ExecStart=-/usr/bin/transtreamproxy +StandardInput=socket diff --git a/meta-openvuplus/recipes-vuplus/enigma2/enigma2.bb b/meta-openvuplus/recipes-vuplus/enigma2/enigma2.bb index 0ed67d6..1089994 100644 --- a/meta-openvuplus/recipes-vuplus/enigma2/enigma2.bb +++ b/meta-openvuplus/recipes-vuplus/enigma2/enigma2.bb @@ -82,7 +82,7 @@ RDEPENDS_enigma2-plugin-systemplugins-3gmodemmanager = "ppp usb-modeswitch usb-m RDEPENDS_enigma2-plugin-systemplugins-devicemanager = "util-linux-blkid ntfs-3g dosfstools" PN = "enigma2" -PR = "r1" +PR = "r2" SRCDATE = "20121128" #SRCDATE is NOT used by git to checkout a specific revision @@ -106,6 +106,7 @@ SRC_URI = "git://code.vuplus.com/git/dvbapp.git;protocol=http;branch=${BRANCH};t file://enigma2_vuplus_vfd_mode.patch;patch=1;pnum=1 \ file://enigma2_vuplus_addlibpythondeps.patch;patch=1;pnum=1 \ file://enigma2_vuplus_pluginbrowser.patch;striplevel=1 \ + file://enigma2_vuplus_transcodingsetup_xinetd.patch;striplevel=1 \ file://MyriadPro-Regular.otf \ file://MyriadPro-Semibold.otf \ file://MyriadPro-SemiboldIt.otf \ diff --git a/meta-openvuplus/recipes-vuplus/enigma2/enigma2/enigma2_vuplus_transcodingsetup_xinetd.patch b/meta-openvuplus/recipes-vuplus/enigma2/enigma2/enigma2_vuplus_transcodingsetup_xinetd.patch new file mode 100644 index 0000000..77044d1 --- /dev/null +++ b/meta-openvuplus/recipes-vuplus/enigma2/enigma2/enigma2_vuplus_transcodingsetup_xinetd.patch @@ -0,0 +1,177 @@ +diff --git a/lib/python/Plugins/SystemPlugins/TransCodingSetup/plugin.py b/lib/python/Plugins/SystemPlugins/TransCodingSetup/plugin.py +index 09ec093..f73da01 100755 +--- a/lib/python/Plugins/SystemPlugins/TransCodingSetup/plugin.py ++++ b/lib/python/Plugins/SystemPlugins/TransCodingSetup/plugin.py +@@ -7,7 +7,7 @@ from Components.Sources.StaticText import StaticText + from Plugins.Plugin import PluginDescriptor + from Tools.Directories import fileExists + from enigma import eTimer +-from os import system as os_system ++from os import system as os_system, popen as os_popen + from __init__ import _ + + config.plugins.transcodingsetup = ConfigSubsection() +@@ -15,13 +15,17 @@ config.plugins.transcodingsetup.transcoding = ConfigSelection(default = "disable + config.plugins.transcodingsetup.port = ConfigSelection(default = "8002", choices = [ ("8001", "8001"), ("8002", "8002")] ) + + error_msg ={ +- -1 : "File not exist - /proc/stb/encoder/enable.", +- -2 : "File not exist - /etc/inetd.conf.", +- -3 : "File open error - /proc/stb/encoder/enable.", +- -4 : "File open error - /etc/inetd.conf.", +- -5 : "Set encoder error.", +- -6 : "Set port error.", +- -7 : "Setting value is incorrect." ++ -1 : "File not exist - /proc/stb/encoder/enable", ++ -2 : "File not exist - /etc/inetd.conf", ++ -3 : "File open error - /proc/stb/encoder/enable", ++ -4 : "File open error - /etc/inetd.conf", ++ -5 : "Set encoder error", ++ -6 : "Set port error", ++ -7 : "Setting value is incorrect", ++ -8 : "File not exist - /etc/xinetd.d/streamproxy", ++ -9 : "File not exist - /etc/xinetd.d/transtreamproxy", ++ -10 : "File open error - /etc/xinetd.d/streamproxy", ++ -11 : "File open error - /etc/xinetd.d/transtreamproxy", + } + class TranscodingSetupInit: + def __init__(self): +@@ -44,8 +48,6 @@ class TranscodingSetupInit: + return -7 + if not fileExists("/proc/stb/encoder/enable"): + return -1 +- elif not fileExists("/etc/inetd.conf"): +- return -2 + if self.setEncoder(transcoding) < 0: + return -5 + res = self.setPort(port) +@@ -53,11 +55,11 @@ class TranscodingSetupInit: + self.setEncoder(self.transcoding_old) + return res + else: +- self.inetdRestart() ++ self.restartDaemon() + return res + + def setEncoder(self,mode = "disabled"): +- print "<TranscodingSetup> set encoder : %s" % mode ++# print "<TranscodingSetup> set encoder : %s" % mode + mode = mode.strip(' ').strip('\n') + try: + fd = open("/proc/stb/encoder/enable",'r') +@@ -78,14 +80,29 @@ class TranscodingSetupInit: + # print "setEncoder exception error" + return -1 + ++ def isXinetd(self): ++ ps_xinetd = os_popen('ps -ef | grep xinetd | grep -v grep').read() ++ if ps_xinetd.strip() == '': ++ return False ++ else: ++ return True ++ + def setPort(self, port = "8001"): +- print "<TranscodingSetup> set port : %s" % port ++# print "<TranscodingSetup> set port : %s" % port ++ if self.isXinetd(): ++ res = self.setPort_xinetd(port) ++ else: ++ res = self.setPort_inetd(port) ++ return res ++ ++ def setPort_inetd(self, port = "8001"): ++ if not fileExists("/etc/inetd.conf"): ++ return -2 + try: + fp = file('/etc/inetd.conf', 'r') + datas = fp.readlines() + fp.close() + except: +-# print "file open error, inetd.conf!" + return -4 + try: + newdatas="" +@@ -112,9 +129,65 @@ class TranscodingSetupInit: + return -6 + return 0 + +- def inetdRestart(self): +- if fileExists("/etc/init.d/inetd"): +- os_system("/etc/init.d/inetd restart") ++ def setPort_xinetd(self, port = "8001"): ++ if not fileExists("/etc/xinetd.d/streamproxy") : ++ return -8 ++ if not fileExists("/etc/xinetd.d/transtreamproxy"): ++ return -9 ++ ++ try: ++ fp_s = file('/etc/xinetd.d/streamproxy') ++ data_s = fp_s.readlines() ++ fp_s.close() ++ except: ++ return -10 ++ ++ try: ++ fp_t = file('/etc/xinetd.d/transtreamproxy') ++ data_t = fp_t.readlines() ++ fp_t.close() ++ except: ++ return -11 ++# fix xinetd port ++ try: ++ if port == "8001": ++ port_s = "8002" ++ port_t = "8001" ++ else: ++ port_s = "8001" ++ port_t = "8002" ++ ++ newdata_s="" ++ for line in data_s: ++ if line.find("port") != -1: ++ line = "\tport = %s\n"%port_s ++ newdata_s+=line ++ ++ newdata_t="" ++ for line in data_t: ++ if line.find("port") != -1: ++ line = "\tport = %s\n"%port_t ++ newdata_t+=line ++ ++ fd = file("/etc/xinetd.d/streamproxy",'w') ++ fd.write(newdata_s) ++ fd.close() ++ ++ fd = file("/etc/xinetd.d/transtreamproxy",'w') ++ fd.write(newdata_t) ++ fd.close() ++ ++ except: ++ return -6 ++ return 0 ++ ++ def restartDaemon(self): ++ if self.isXinetd(): ++ if fileExists("/etc/init.d/xinetd"): ++ os_system("/etc/init.d/xinetd restart") ++ else: ++ if fileExists("/etc/init.d/inetd"): ++ os_system("/etc/init.d/inetd restart") + + def getModel(self): + if fileExists("/proc/stb/info/vumodel"): +@@ -182,12 +255,12 @@ class TranscodingSetup(Screen,ConfigListScreen, TranscodingSetupInit): + def keySave(self): + transcoding = config.plugins.transcodingsetup.transcoding.value + port = config.plugins.transcodingsetup.port.value +- print "<TranscodingSetup> Transcoding %s(port : %s)"%(transcoding, port) ++# print "<TranscodingSetup> Transcoding %s(port : %s)"%(transcoding, port) + ret = self.setupTranscoding(transcoding, port) + if ret is not None and ret <0 : + self.resetConfig() + global error_msg +- self.session.openWithCallback(self.close, MessageBox, _("Failed, Encoder %s\n(%s).")%(transcoding, error_msg[ret]), MessageBox.TYPE_ERROR) ++ self.session.openWithCallback(self.close, MessageBox, _("Failed, Encoder %s.\n(%s)")%(transcoding, error_msg[ret]), MessageBox.TYPE_ERROR) + else: + self.saveAll() + if transcoding == "enabled" and port == "8001" : diff --git a/meta-openvuplus/recipes-vuplus/tasks/task-vuplus-enigma2.bb b/meta-openvuplus/recipes-vuplus/tasks/task-vuplus-enigma2.bb index 0312271..4db6693 100644 --- a/meta-openvuplus/recipes-vuplus/tasks/task-vuplus-enigma2.bb +++ b/meta-openvuplus/recipes-vuplus/tasks/task-vuplus-enigma2.bb @@ -2,6 +2,7 @@ PR = "${INC_PR}.3" RDEPENDS_${PN} = " \ enigma2-streamproxy-xinetd \ + enigma2-transtreamproxy-xinetd \ " require task-vuplus-enigma2.inc diff --git a/meta-openvuplus/recipes-vuplus/tasks/task-vuplus-enigma2.inc b/meta-openvuplus/recipes-vuplus/tasks/task-vuplus-enigma2.inc index 6f288a7..a1f1a61 100644 --- a/meta-openvuplus/recipes-vuplus/tasks/task-vuplus-enigma2.inc +++ b/meta-openvuplus/recipes-vuplus/tasks/task-vuplus-enigma2.inc @@ -2,7 +2,7 @@ SUMMARY = "Enigma2 Task for Vuplus" SECTION = "vuplus/base" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" -INC_PR = "r4" +INC_PR = "r5" inherit task @@ -58,6 +58,7 @@ RDEPENDS_${PN} += " \ ${@base_contains("VUPLUS_FEATURES", "dlna", "enigma2-plugin-extensions-dlnaserver enigma2-plugin-extensions-dlnabrowser", "", d)} \ ${@base_contains("VUPLUS_FEATURES", "3gmodem", "enigma2-plugin-systemplugins-3gmodemmanager", "", d)} \ ${@base_contains("VUPLUS_FEATURES", "autoshutdown", "enigma2-plugin-systemplugins-autoshutdown", "", d)} \ + ${@base_contains("VUPLUS_FEATURES", "transcoding", "enigma2-plugin-systemplugins-transcodingsetup enigma2-transtreamproxy", "", d)} \ " PACKAGE_ARCH = "${MACHINE_ARCH}" |