mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
oscam: update to oscam-6136, add SSL, CAMD33 and DVBAPI support
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
7f453e251e
commit
8bdb3efd6f
@ -28,6 +28,9 @@ mkdir -p build && cd build
|
||||
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_CONF \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DWITH_SSL=1 -DWITH_SSLv3=1 \
|
||||
-DHAVE_DVBAPI=1 -DWITH_STAPI=0 \
|
||||
-DMODULE_CAMD33=1 \
|
||||
-DWEBIF=1 \
|
||||
..
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
2.0.0
|
||||
- update to oscam-6136
|
||||
|
||||
0.99.2
|
||||
- update to oscam-5386
|
||||
|
||||
|
@ -20,12 +20,12 @@
|
||||
################################################################################
|
||||
|
||||
PKG_NAME="oscam"
|
||||
PKG_VERSION="5386"
|
||||
PKG_REV="1"
|
||||
PKG_VERSION="6136"
|
||||
PKG_REV="0"
|
||||
PKG_ARCH="any"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_SITE="http://streamboard.gmc.to/wiki/index.php/OSCam/en"
|
||||
PKG_URL="$DISTRO_SRC/${PKG_NAME}-${PKG_VERSION}.tar.bz2"
|
||||
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.bz2"
|
||||
PKG_DEPENDS="openssl"
|
||||
PKG_BUILD_DEPENDS="toolchain openssl"
|
||||
PKG_PRIORITY="optional"
|
||||
|
@ -0,0 +1,73 @@
|
||||
--- oscam-1.10/module-dvbapi.c 2011-12-08 00:02:39.058737655 +0100
|
||||
+++ /emu/backup/oscam-1.10/module-dvbapi.c 2011-12-07 23:35:15.708736813 +0100
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "module-dvbapi.h"
|
||||
|
||||
-const char *boxdesc[] = { "none", "dreambox", "duckbox", "ufs910", "dbox2", "ipbox", "ipbox-pmt", "dm7000", "qboxhd", "coolstream", "neumo" };
|
||||
+const char *boxdesc[] = { "none", "dreambox", "duckbox", "ufs910", "dbox2", "ipbox", "ipbox-pmt", "dm7000", "qboxhd", "coolstream", "neumo", "pc" };
|
||||
|
||||
const struct box_devices devices[BOX_COUNT] = {
|
||||
/* QboxHD (dvb-api-3)*/ { "/tmp/virtual_adapter/", "ca%d", "demux%d", "/tmp/camd.socket" },
|
||||
@@ -214,6 +214,9 @@
|
||||
if (cfg.dvbapi_boxtype==BOXTYPE_QBOXHD)
|
||||
num=0;
|
||||
|
||||
+ if (cfg.dvbapi_boxtype==BOXTYPE_PC)
|
||||
+ num=0;
|
||||
+
|
||||
snprintf(device_path2, sizeof(device_path2), devices[selected_box].ca_device, num+ca_offset);
|
||||
snprintf(device_path, sizeof(device_path), devices[selected_box].path, adapter);
|
||||
|
||||
@@ -1090,6 +1093,12 @@
|
||||
adapter_index = buffer[21]; // with STONE 1.0.4 adapter index can be 0,1,2
|
||||
ca_mask = (1 << adapter_index); // use adapter_index as ca_mask (used as index for ca_fd[] array)
|
||||
}
|
||||
+
|
||||
+ if (cfg.dvbapi_boxtype == BOXTYPE_PC ) {
|
||||
+ demux_index = buffer[6]; // it always 0 but you never know
|
||||
+ adapter_index = buffer[7]; // adapter index can be 0,1,2
|
||||
+ ca_mask = (1 << adapter_index); // use adapter_index as ca_mask (used as index for ca_fd[] array)
|
||||
+ }
|
||||
|
||||
demux[demux_id].program_number=((buffer[1] << 8) | buffer[2]);
|
||||
demux[demux_id].demux_index=demux_index;
|
||||
@@ -1106,10 +1115,10 @@
|
||||
cs_strncpy(demux[demux_id].pmt_file, pmtfile, sizeof(demux[demux_id].pmt_file));
|
||||
|
||||
if (program_info_length > 1 && program_info_length < length)
|
||||
- dvbapi_parse_descriptor(demux_id, program_info_length-1, buffer+7);
|
||||
+ dvbapi_parse_descriptor(demux_id, program_info_length-1, buffer+9);
|
||||
|
||||
uint32_t es_info_length=0;
|
||||
- for (i = program_info_length + 6; i < length; i += es_info_length + 5) {
|
||||
+ for (i = program_info_length + 8; i < length; i += es_info_length + 5) {
|
||||
int32_t stream_type = buffer[i];
|
||||
uint16_t elementary_pid = ((buffer[i + 1] & 0x1F) << 8) | buffer[i + 2];
|
||||
es_info_length = ((buffer[i + 3] & 0x0F) << 8) | buffer[i + 4];
|
||||
@@ -1301,9 +1310,10 @@
|
||||
if (pthread_mutex_trylock(&event_handler_lock) == EBUSY)
|
||||
return;
|
||||
|
||||
- int32_t standby_fd = open(STANDBY_FILE, O_RDONLY);
|
||||
- pausecam = (standby_fd > 0) ? 1 : 0;
|
||||
- if (standby_fd) close(standby_fd);
|
||||
+ //int32_t standby_fd = open(STANDBY_FILE, O_RDONLY);
|
||||
+ //pausecam = (standby_fd > 0) ? 1 : 0;
|
||||
+ //if (standby_fd) close(standby_fd);
|
||||
+ pausecam = 0;
|
||||
|
||||
if (cfg.dvbapi_boxtype==BOXTYPE_IPBOX || cfg.dvbapi_pmtmode == 1) {
|
||||
pthread_mutex_unlock(&event_handler_lock);
|
||||
--- oscam-1.10/globals.h 2011-12-08 00:02:39.068737655 +0100
|
||||
+++ /emu/backup/oscam-1.10/globals.h 2011-12-07 23:34:38.678736793 +0100
|
||||
@@ -234,7 +234,8 @@
|
||||
#define BOXTYPE_QBOXHD 8
|
||||
#define BOXTYPE_COOLSTREAM 9
|
||||
#define BOXTYPE_NEUMO 10
|
||||
-#define BOXTYPES 10
|
||||
+#define BOXTYPE_PC 11
|
||||
+#define BOXTYPES 11
|
||||
extern const char *boxdesc[];
|
||||
#endif
|
||||
|
@ -0,0 +1,104 @@
|
||||
commit 35ce4dd3c5871b5a700d4e07965d93a561299df0
|
||||
Author: Mariusz Bialonczyk <manio@skyboo.net>
|
||||
Date: Mon Dec 19 13:45:08 2011 +0100
|
||||
|
||||
Include dvbapi_ca.c functionality in oscam
|
||||
|
||||
diff --git a/module-dvbapi.c b/module-dvbapi.c
|
||||
index 89221b1..cfc2c41 100644
|
||||
--- a/module-dvbapi.c
|
||||
+++ b/module-dvbapi.c
|
||||
@@ -232,6 +232,32 @@ int32_t dvbapi_open_device(int32_t type, int32_t num, int32_t adapter) {
|
||||
return dmx_fd;
|
||||
}
|
||||
|
||||
+int32_t dvbapi_open_netdevice(int32_t type, int32_t num, int32_t adapter) {
|
||||
+ int32_t socket_fd;
|
||||
+
|
||||
+ socket_fd = socket(PF_INET,SOCK_DGRAM,IPPROTO_UDP);
|
||||
+ if(socket_fd==-1) {
|
||||
+ cs_debug_mask(D_DVBAPI, "Failed to open socket (%d %s)", errno, strerror(errno));
|
||||
+ }
|
||||
+ else {
|
||||
+ struct sockaddr_in saddr;
|
||||
+ fcntl(socket_fd,F_SETFL,O_NONBLOCK);
|
||||
+ bzero(&saddr,sizeof(saddr));
|
||||
+ saddr.sin_family = AF_INET;
|
||||
+ saddr.sin_port = htons(PORT + adapter); // port = PORT + adapter number
|
||||
+ saddr.sin_addr.s_addr = inet_addr("127.0.0.1");
|
||||
+ int r = connect(socket_fd, (struct sockaddr *) &saddr, sizeof(saddr));
|
||||
+ if (r<0) {
|
||||
+ cs_debug_mask(D_DVBAPI, "Failed to connect socket (%d %s), at localhost, port=%d", errno, strerror(errno), PORT + adapter);
|
||||
+ close(socket_fd);
|
||||
+ socket_fd=-1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ cs_debug_mask(D_DVBAPI, "NET DEVICE open (port = %d) fd %d", PORT + adapter, socket_fd);
|
||||
+ return socket_fd;
|
||||
+}
|
||||
+
|
||||
int32_t dvbapi_stop_filter(int32_t demux_index, int32_t type) {
|
||||
int32_t g;
|
||||
|
||||
@@ -515,16 +541,21 @@ void dvbapi_set_pid(int32_t demux_id, int32_t num, int32_t index) {
|
||||
for (i=0;i<8;i++) {
|
||||
if (demux[demux_id].ca_mask & (1 << i)) {
|
||||
if (ca_fd[i]<=0)
|
||||
- ca_fd[i]=dvbapi_open_device(1, i, demux[demux_id].adapter_index);
|
||||
+ ca_fd[i]=dvbapi_open_netdevice(1, i, demux[demux_id].adapter_index);
|
||||
if (ca_fd[i]>0) {
|
||||
ca_pid_t ca_pid2;
|
||||
memset(&ca_pid2,0,sizeof(ca_pid2));
|
||||
ca_pid2.pid = demux[demux_id].STREAMpids[num];
|
||||
ca_pid2.index = index;
|
||||
- if (ioctl(ca_fd[i], CA_SET_PID, &ca_pid2)==-1)
|
||||
- cs_debug_mask(D_DVBAPI, "Error CA_SET_PID pid=0x%04x index=%d (errno=%d %s)", ca_pid2.pid, ca_pid2.index, errno, strerror(errno));
|
||||
- else
|
||||
- cs_debug_mask(D_DVBAPI, "CA_SET_PID pid=0x%04x index=%d", ca_pid2.pid, ca_pid2.index);
|
||||
+
|
||||
+ int request=CA_SET_PID;
|
||||
+ send(ca_fd[i],(void*)&request, sizeof(request), 0);
|
||||
+ send(ca_fd[i],(void*)&ca_pid2, sizeof(ca_pid2), 0);
|
||||
+
|
||||
+// if (ioctl(ca_fd[i], CA_SET_PID, &ca_pid2)==-1)
|
||||
+// cs_debug_mask(D_DVBAPI, "Error CA_SET_PID pid=0x%04x index=%d (errno=%d %s)", ca_pid2.pid, ca_pid2.index, errno, strerror(errno));
|
||||
+// else
|
||||
+// cs_debug_mask(D_DVBAPI, "CA_SET_PID pid=0x%04x index=%d", ca_pid2.pid, ca_pid2.index);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1836,13 +1867,17 @@ static void dvbapi_write_cw(int32_t demux_id, uchar *cw, int32_t index) {
|
||||
if (demux[demux_id].ca_mask & (1 << i)) {
|
||||
cs_debug_mask(D_DVBAPI, "write cw%d index: %d (ca%d)", n, ca_descr.index, i);
|
||||
if (ca_fd[i]<=0) {
|
||||
- ca_fd[i]=dvbapi_open_device(1, i, demux[demux_id].adapter_index);
|
||||
+ ca_fd[i]=dvbapi_open_netdevice(1, i, demux[demux_id].adapter_index);
|
||||
if (ca_fd[i]<=0)
|
||||
return;
|
||||
}
|
||||
|
||||
- if (ioctl(ca_fd[i], CA_SET_DESCR, &ca_descr) < 0)
|
||||
- cs_debug_mask(D_DVBAPI, "Error CA_SET_DESCR");
|
||||
+ int request=CA_SET_DESCR;
|
||||
+ send(ca_fd[i],(void*)&request, sizeof(request), 0);
|
||||
+ send(ca_fd[i],(void*)&ca_descr, sizeof(ca_descr), 0);
|
||||
+
|
||||
+// if (ioctl(ca_fd[i], CA_SET_DESCR, &ca_descr) < 0)
|
||||
+// cs_debug_mask(D_DVBAPI, "Error CA_SET_DESCR");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
diff --git a/module-dvbapi.h b/module-dvbapi.h
|
||||
index 2802b03..8720b01 100644
|
||||
--- a/module-dvbapi.h
|
||||
+++ b/module-dvbapi.h
|
||||
@@ -16,6 +16,8 @@
|
||||
#define STAPI 2
|
||||
#define COOLAPI 3
|
||||
|
||||
+#define PORT 9000
|
||||
+
|
||||
#define TMPDIR "/tmp/"
|
||||
#define STANDBY_FILE "/tmp/.pauseoscam"
|
||||
#define ECMINFO_FILE "/tmp/ecm.info"
|
Loading…
x
Reference in New Issue
Block a user