From a15414989cf82c823f2d00edf5b7c01858bf73a0 Mon Sep 17 00:00:00 2001 From: kos Date: Wed, 23 Oct 2013 18:51:15 +0900 Subject: [PATCH] [openwebif] support file transcoding. --- .../enigma2-plugin-extensions-openwebif.bb | 4 +- .../files/openwebif-filestreamproxy-support.patch | 128 +++++++++++++++++++++ .../enigma2/enigma2-filestreamproxy.bb | 24 ++++ meta-openvuplus/recipes-vuplus/enigma2/enigma2.bb | 2 +- .../recipes-vuplus/tasks/task-vuplus-enigma2.bb | 2 +- .../recipes-vuplus/tasks/task-vuplus-enigma2.inc | 2 +- 6 files changed, 158 insertions(+), 4 deletions(-) create mode 100644 meta-openvuplus/recipes-vuplus/e2openplugins/files/openwebif-filestreamproxy-support.patch create mode 100644 meta-openvuplus/recipes-vuplus/enigma2/enigma2-filestreamproxy.bb 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 8441747..7445828 100644 --- a/meta-openvuplus/recipes-vuplus/e2openplugins/enigma2-plugin-extensions-openwebif.bb +++ b/meta-openvuplus/recipes-vuplus/e2openplugins/enigma2-plugin-extensions-openwebif.bb @@ -9,10 +9,12 @@ RDEPENDS_${PN} = "python-cheetah python-json python-unixadmin python-misc python inherit gitpkgv PV = "0.1+git${SRCPV}" PKGV = "0.1+git${GITPKGV}" -PR = "r0.77" +PR = "r0.78" require openplugins.inc +SRC_URI += " file://openwebif-filestreamproxy-support.patch;apply=yes;striplevel=1 " + # Just a quick hack to "compile" it do_compile() { cheetah-compile -R --nobackup ${S}/plugin diff --git a/meta-openvuplus/recipes-vuplus/e2openplugins/files/openwebif-filestreamproxy-support.patch b/meta-openvuplus/recipes-vuplus/e2openplugins/files/openwebif-filestreamproxy-support.patch new file mode 100644 index 0000000..a530932 --- /dev/null +++ b/meta-openvuplus/recipes-vuplus/e2openplugins/files/openwebif-filestreamproxy-support.patch @@ -0,0 +1,128 @@ +diff --git a/plugin/controllers/ajax.py b/plugin/controllers/ajax.py +index 1a60d78..4db8c5c 100644 +--- a/plugin/controllers/ajax.py ++++ b/plugin/controllers/ajax.py +@@ -123,6 +123,11 @@ class AjaxController(BaseController): + movies = getMovieList(request.args["dirname"][0]) + else: + movies = getMovieList() ++ info = getInfo() ++ model = info["model"] ++ movies['transcoding'] = False ++ if model in ("solo2", "duo2"): ++ movies['transcoding'] = True + return movies + + def P_workinprogress(self, request): +diff --git a/plugin/controllers/models/stream.py b/plugin/controllers/models/stream.py +index de2f6ed..2311c5b 100644 +--- a/plugin/controllers/models/stream.py ++++ b/plugin/controllers/models/stream.py +@@ -73,7 +73,14 @@ def getTS(self,request): + else: + progopt="" + +- response = "#EXTM3U\n#EXTVLCOPT--http-reconnect=true \n%shttp://%s:%s/file?file=%s\n" % (progopt,request.getRequestHostname(), config.OpenWebif.port.value, quote(filename)) ++ portNumber = config.OpenWebif.port.value ++ info = getInfo() ++ model = info["model"] ++ if model in ("solo2","duo2"): ++ if "device" in request.args : ++ if request.args["device"][0] == "phone" : ++ portNumber = 8003; ++ response = "#EXTM3U\n#EXTVLCOPT--http-reconnect=true \n%shttp://%s:%s/file?file=%s\n" % (progopt,request.getRequestHostname(), portNumber, quote(filename)) + request.setHeader('Content-Type', 'application/text') + return response + else: +diff --git a/plugin/controllers/views/ajax/movies.tmpl b/plugin/controllers/views/ajax/movies.tmpl +index 6b0670c..7a026cf 100755 +--- a/plugin/controllers/views/ajax/movies.tmpl ++++ b/plugin/controllers/views/ajax/movies.tmpl +@@ -49,19 +49,28 @@ + + #end if + +-
+-
+- +- +- +- +- +- +- +- +- +-
+-
++
++
++ #if $transcoding ++ ++ ++ ++ ++ ++ ++ #else ++ ++ ++ ++ #end if ++ ++ ++ ++ ++ ++ ++
++
+
+ #set $count += 1 + +@@ -72,4 +81,4 @@ + + +\ No newline at end of file ++ +diff --git a/plugin/controllers/views/main.tmpl b/plugin/controllers/views/main.tmpl +index 760bab8..fc217a7 100755 +--- a/plugin/controllers/views/main.tmpl ++++ b/plugin/controllers/views/main.tmpl +@@ -202,5 +202,9 @@ + + + ++
++ ++ ++
+ + +diff --git a/plugin/public/js/transcoding.js b/plugin/public/js/transcoding.js +index 8729835..785a4b7 100644 +--- a/plugin/public/js/transcoding.js ++++ b/plugin/public/js/transcoding.js +@@ -41,6 +41,20 @@ function getOSType() { + return "unknown"; + } + ++function jumper80( file ) { ++ var deviceType = getDeviceType(); ++ document.portFormTs.file.value = file; ++ document.portFormTs.device.value = "etc"; ++ document.portFormTs.submit(); ++} ++ ++function jumper8003( file ) { ++ var deviceType = getDeviceType(); ++ document.portFormTs.file.value = file; ++ document.portFormTs.device.value = "phone"; ++ document.portFormTs.submit(); ++} ++ + function jumper8002( sref, sname ) { + var deviceType = getDeviceType(); + document.portForm.ref.value = sref; diff --git a/meta-openvuplus/recipes-vuplus/enigma2/enigma2-filestreamproxy.bb b/meta-openvuplus/recipes-vuplus/enigma2/enigma2-filestreamproxy.bb new file mode 100644 index 0000000..ed4d17f --- /dev/null +++ b/meta-openvuplus/recipes-vuplus/enigma2/enigma2-filestreamproxy.bb @@ -0,0 +1,24 @@ +DESCRIPTION = "file transcoding util." +PRIORITY = "required" +LICENSE = "GPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" + +PR = "r0" +SRCREV="4601bc13bc6f08e124d60f7c004ff2e1cacdfc31" + +SRC_URI = "git://code.vuplus.com/git/filestreamproxy.git;protocol=git;branch=master;tag=${SRCREV}" + +inherit autotools pkgconfig + +S = "${WORKDIR}/git" + +do_install() { + install -d ${D}/usr/bin + install -m 0755 ${S}/src/filestreamproxy ${D}/usr/bin +} + +FILES_${PN} = "${bindir}/filestreamproxy" + +PACKAGE_ARCH := "${MACHINE_ARCH}" +PACKAGES = "${PN}" + diff --git a/meta-openvuplus/recipes-vuplus/enigma2/enigma2.bb b/meta-openvuplus/recipes-vuplus/enigma2/enigma2.bb index d2b41b7..46ed230 100644 --- a/meta-openvuplus/recipes-vuplus/enigma2/enigma2.bb +++ b/meta-openvuplus/recipes-vuplus/enigma2/enigma2.bb @@ -88,7 +88,7 @@ RDEPENDS_enigma2-plugin-systemplugins-backupsuitehdd = "mtd-utils-mkfs.ubifs mtd RDEPENDS_enigma2-plugin-systemplugins-backupsuiteusb = "enigma2-plugin-extensions-backupsuitehdd" PN = "enigma2" -PR = "r41" +PR = "r42" SRCDATE = "20121128" #SRCDATE is NOT used by git to checkout a specific revision diff --git a/meta-openvuplus/recipes-vuplus/tasks/task-vuplus-enigma2.bb b/meta-openvuplus/recipes-vuplus/tasks/task-vuplus-enigma2.bb index 7dea47f..f5dddfc 100644 --- a/meta-openvuplus/recipes-vuplus/tasks/task-vuplus-enigma2.bb +++ b/meta-openvuplus/recipes-vuplus/tasks/task-vuplus-enigma2.bb @@ -1,4 +1,4 @@ -PR = "${INC_PR}.5" +PR = "${INC_PR}.6" RDEPENDS_${PN} = " \ " diff --git a/meta-openvuplus/recipes-vuplus/tasks/task-vuplus-enigma2.inc b/meta-openvuplus/recipes-vuplus/tasks/task-vuplus-enigma2.inc index 065333d..debd7c0 100644 --- a/meta-openvuplus/recipes-vuplus/tasks/task-vuplus-enigma2.inc +++ b/meta-openvuplus/recipes-vuplus/tasks/task-vuplus-enigma2.inc @@ -63,7 +63,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)} \ + ${@base_contains("VUPLUS_FEATURES", "transcoding", "enigma2-plugin-systemplugins-transcodingsetup enigma2-transtreamproxy enigma2-filestreamproxy", "", d)} \ ${@base_contains("VUPLUS_FEATURES", "wol", "enigma2-plugin-systemplugins-wolsetup", "", d)} \ ${@base_conditional("MACHINE", "vuduo2", "duo2lcd4linux lcd4linuxsupport", "", d)} \ ${@base_conditional("MACHINE", "vuduo2", "vuplus-checkvfd", "", d)} \ -- 2.7.4