From: hschang Date: Tue, 23 Jun 2015 08:11:42 +0000 (+0900) Subject: Add satipclient. X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_openvuplus;a=commitdiff_plain;h=0fca99fc3a8d23c8ee0c8ee60af10f788f3529dd Add satipclient. --- diff --git a/meta-openvuplus/recipes-vuplus/enigma2/enigma2.bb b/meta-openvuplus/recipes-vuplus/enigma2/enigma2.bb index 639718d..c1fe85a 100644 --- a/meta-openvuplus/recipes-vuplus/enigma2/enigma2.bb +++ b/meta-openvuplus/recipes-vuplus/enigma2/enigma2.bb @@ -7,6 +7,7 @@ DEPENDS = "jpeg libungif libmad libpng libsigc++-1.2 gettext-native \ libfribidi libxmlccwrap libdreamdvd gstreamer gst-plugin-dvbmediasink \ gst-plugins-bad gst-plugins-good gst-plugins-ugly python-wifi \ hostap-daemon bridge-utils ntfs-3g dosfstools util-linux \ + satipclient \ " RDEPENDS_GST= "gst-plugins-base-decodebin gst-plugins-base-decodebin2 gst-plugins-base-app gst-plugins-bad-fragmented \ @@ -88,11 +89,13 @@ RDEPENDS_enigma2-plugin-systemplugins-netdrive = "curlftpfs kernel-module-fuse l RDEPENDS_enigma2-plugin-systemplugins-backupsuitehdd = "mtd-utils-mkfs.ubifs mtd-utils-nanddump mtd-utils-ubinize" RDEPENDS_enigma2-plugin-systemplugins-backupsuiteusb = "enigma2-plugin-extensions-backupsuitehdd" +RDEPENDS_enigma2-plugin-extensions-satipclient = "satipclient" + DEPENDS += "${@base_contains("VUPLUS_FEATURES", "uianimation", "libgles libvugles2" , "", d)}" RDEPENDS_append_vuplus += "${@base_contains("VUPLUS_FEATURES", "uianimation", "libgles libvugles2" , "", d)}" PN = "enigma2" -PR = "r99" +PR = "r100" SRCDATE = "20121128" #SRCDATE is NOT used by git to checkout a specific revision diff --git a/meta-openvuplus/recipes-vuplus/satipclient/satipclient.bb b/meta-openvuplus/recipes-vuplus/satipclient/satipclient.bb new file mode 100644 index 0000000..9131eb2 --- /dev/null +++ b/meta-openvuplus/recipes-vuplus/satipclient/satipclient.bb @@ -0,0 +1,26 @@ +DESCIPTION = "Support satip client using vtuner" +LICENSE = "CLOSED" + +SRCDATE = "20150623" +SRCDATE_PR = "r1" +PR = "${SRCDATE}.${SRCDATE_PR}" + +SRC_URI = " \ + http://code.vuplus.com/download/build.fc3abf29fb03f797e78f907928125638/embedded/satipclient/satipclient_${SRCDATE}_${SRCDATE_PR}.tar.gz \ + file://satipclient.sh \ + " + +inherit update-rc.d + +INITSCRIPT_NAME = "${PN}" +INITSCRIPT_PARAMS = "defaults" + +do_install_append() { + install -d ${D}/usr/bin + install -m 0755 ${WORKDIR}/satipclient ${D}/usr/bin + install -d ${D}/etc/init.d + install -m 0755 ${WORKDIR}/${PN}.sh ${D}/etc/init.d/${PN} +} + +SRC_URI[md5sum] = "6b4123717ab2c0f74b53761ddc5f058e" +SRC_URI[sha256sum] = "4bbd2446cd1cdb60546385db2938275b80e6c86eb03ca52dbeeedf1bd3b10cad" diff --git a/meta-openvuplus/recipes-vuplus/satipclient/satipclient/satipclient.sh b/meta-openvuplus/recipes-vuplus/satipclient/satipclient/satipclient.sh new file mode 100644 index 0000000..42cf39b --- /dev/null +++ b/meta-openvuplus/recipes-vuplus/satipclient/satipclient/satipclient.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +if ! [ -x /usr/bin/satipclient ]; then + exit 0 +fi + +case "$1" in + start) + start-stop-daemon -S -b -x /usr/bin/satipclient + ;; + stop) + start-stop-daemon -K -x /usr/bin/satipclient + ;; + restart|reload) + $0 stop + $0 start + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; +esac + +exit 0 diff --git a/meta-openvuplus/recipes-vuplus/tasks/task-vuplus-enigma2.inc b/meta-openvuplus/recipes-vuplus/tasks/task-vuplus-enigma2.inc index b8f7fb5..b3b785e 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 = "r21" +INC_PR = "r22" inherit task @@ -48,6 +48,7 @@ RDEPENDS_${PN} += " \ enigma2-plugin-systemplugins-uipositionsetup \ enigma2-plugin-systemplugins-hdmicec \ enigma2-plugin-extensions-openwebif \ + enigma2-plugin-extensions-satipclient \ ${@base_contains("MACHINE_FEATURES", "wifi", "enigma2-plugin-systemplugins-wirelessaccesspoint", "", d)} \ ${@base_contains("VUPLUS_FEATURES", "fan_simple", "enigma2-plugin-systemplugins-fancontrol","", d)} \ ${@base_contains("VUPLUS_FEATURES", "fan_manual", "enigma2-plugin-systemplugins-manualfancontrol", "", d)} \ diff --git a/meta-openvuplus/recipes-vuplus/usbtunerhelper/usbtunerhelper.bb b/meta-openvuplus/recipes-vuplus/usbtunerhelper/usbtunerhelper.bb index 7e126b5..91e5bae 100644 --- a/meta-openvuplus/recipes-vuplus/usbtunerhelper/usbtunerhelper.bb +++ b/meta-openvuplus/recipes-vuplus/usbtunerhelper/usbtunerhelper.bb @@ -4,13 +4,14 @@ LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://${THISDIR}/${PN}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" PV = "1.0+git${SRCPV}" -PR = "r4" +PR = "r5" SRC_REV = "" SRC_URI = " \ git://code.vuplus.com/git/vtuner.git;protocol=git;tag=${SRC_REV} \ file://no_usb_device.patch;striplevel=1 \ file://fix_set_delsys.patch \ + file://get_avail_vtuner.patch \ file://${PN}.sh \ " @@ -20,6 +21,7 @@ inherit autotools update-rc.d INITSCRIPT_NAME = "${PN}" INITSCRIPT_PARAMS = "defaults" +INITSCRIPT_PARAMS = "start 21 2 3 4 5 . stop 20 0 1 6 ." do_install_append() { install -d ${D}/etc/init.d diff --git a/meta-openvuplus/recipes-vuplus/usbtunerhelper/usbtunerhelper/get_avail_vtuner.patch b/meta-openvuplus/recipes-vuplus/usbtunerhelper/usbtunerhelper/get_avail_vtuner.patch new file mode 100644 index 0000000..2b4dece --- /dev/null +++ b/meta-openvuplus/recipes-vuplus/usbtunerhelper/usbtunerhelper/get_avail_vtuner.patch @@ -0,0 +1,188 @@ +diff --git a/usbtunerhelper.c b/usbtunerhelper.c +index 77b8728..7906f9b 100644 +--- a/usbtunerhelper.c ++++ b/usbtunerhelper.c +@@ -94,7 +94,7 @@ struct vtuner_adapter + + struct vtuner_adapter adapters[MAX_ADAPTERS]; + int adaptercount = 0; +-int vtunercount = 0; ++int available_vtuner = 0; + + int running = 1; + void sigint_handler(int sig) +@@ -166,31 +166,6 @@ int scan_adapters() + + } + +- dirvtun = opendir(VTUNER_PATH); +- if (dirvtun) +- { +- while ((edirvtun = readdir(dirvtun)) != NULL) +- { +- if (strlen(edirvtun->d_name) < 7) continue; +- if (!strncmp(edirvtun->d_name, "vtuner", 6)) vtunercount++; +- } +- closedir(dirvtun); +- } +- +- +- for (i = 0; i < adaptercount; i++) +- { +- if (i < vtunercount) +- { +- adapters[i].vtunerindex = i; +- printf("usb device %s (adapter%d) assigned to vtuner%d\n", adapters[i].name, adapters[i].index, i); +- } +- else +- { +- adapters[i].vtunerindex = -1; +- printf("usb device %s (adapter%d) not assigned\n", adapters[i].name, adapters[i].index); +- } +- } + return adaptercount; + + } +@@ -448,25 +423,112 @@ error: + return NULL; + } + ++int get_avail_vtuner() ++{ ++ int total_vtuner = 0; ++ int reserved_vtuner = 0; ++ char filename[32]; ++ ++ const char* conf = "/etc/vtuner.conf"; ++ FILE *fp; ++ ++ /* total vtuner */ ++ while(1) ++ { ++ sprintf(filename, "/dev/misc/vtuner%d", total_vtuner); ++ if (access(filename, F_OK) < 0 ) break; ++ total_vtuner++; ++ } ++ ++ /* reserved vtuner */ ++ fp = fopen(conf, "rt"); ++ if (fp) ++ { ++ char line[256]; ++ const char *vtuner_type = "vtuner_type:"; ++ const char *usb_tuner = "usb_tuner"; ++ ++ while (!feof(fp)) ++ { ++ if (!fgets(line, sizeof(line), fp)) ++ break; ++ ++ char *p = strstr(line, vtuner_type); ++ if (p != NULL) ++ { ++ p += strlen(vtuner_type); ++ if (strncmp(p, usb_tuner, strlen(usb_tuner))) ++ { ++ reserved_vtuner ++; ++ } ++ } ++ } ++ fclose(fp); ++ } ++ return total_vtuner - reserved_vtuner; ++} ++ ++int get_vtuner(int id) ++{ ++ char filename[256]; ++ int vtuner_fd = -1; ++ int vtuner_idx = 0; ++ ++ struct vtuner_adapter *adapter = &adapters[id]; ++ ++ adapter->vtuner = -1; ++ adapter->vtunerindex = -1; ++ ++ if (!available_vtuner) ++ return -1; ++ ++ while (vtuner_fd < 0) ++ { ++ sprintf(filename, "/dev/misc/vtuner%d", vtuner_idx); ++ if (access(filename, F_OK) < 0) break; ++ ++ printf("open vtuner %s\n", filename); ++ vtuner_fd = open(filename, O_RDWR); ++ ++ if (vtuner_fd < 0) ++ { ++ vtuner_idx++; ++ } ++ } ++ ++ if (vtuner_fd < 0) ++ return -1; ++ ++ adapter->vtuner = vtuner_fd; ++ adapter->vtunerindex = vtuner_idx; ++ available_vtuner--; ++ ++ return 0; ++} ++ + int init_adapter(int id) + { + char type[8]; + struct dmx_pes_filter_params filter; + struct dvb_frontend_info fe_info; +- char frontend_filename[256], demux_filename[256], vtuner_filename[256]; ++ char frontend_filename[256], demux_filename[256]; + + struct vtuner_adapter *adapter = &adapters[id]; + + adapter->eventthread = 0; + adapter->pumpthread = 0; + ++ get_vtuner(id); ++ ++ if (adapter->vtunerindex == -1) ++ goto error; ++ + printf("linking adapter%d/frontend0 to vtuner%d\n", adapter->index, adapter->vtunerindex); + + sprintf(frontend_filename, "/dev/dvb/adapter%d/frontend0", adapter->index); + sprintf(demux_filename, "/dev/dvb/adapter%d/demux0", adapter->index); +- sprintf(vtuner_filename, "/dev/misc/vtuner%d", adapter->vtunerindex); + +- adapter->frontend = adapter->demux = adapter->vtuner = -1; ++ adapter->frontend = adapter->demux = -1; + + adapter->frontend = open(frontend_filename, O_RDWR); + if (adapter->frontend < 0) +@@ -482,13 +544,6 @@ int init_adapter(int id) + goto error; + } + +- adapter->vtuner = open(vtuner_filename, O_RDWR); +- if (adapter->vtuner < 0) +- { +- perror(vtuner_filename); +- goto error; +- } +- + if (ioctl(adapter->frontend, FE_GET_INFO, &fe_info) < 0) + { + perror("FE_GET_INFO"); +@@ -635,9 +690,11 @@ int main(int argc, char *argv[]) + sleep(scan_inverval); + } + ++ available_vtuner = get_avail_vtuner(); ++ + for (i = 0; i < adaptercount; i++) + { +- if (adapters[i].vtunerindex >= 0) init_adapter(i); ++ init_adapter(i); + } + + for (i = 0; i < adaptercount; i++)