Changeset 4136
- Timestamp:
- 12/17/10 16:40:38 (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Maketype
r3930 r4136 68 68 $(LIBFILE1)(oscam-http.o) \ 69 69 $(LIBFILE1)(oscam-http-helpers.o) \ 70 $(LIBFILE1)(oscam-ac.o) 70 $(LIBFILE1)(oscam-ac.o) \ 71 $(LIBFILE1)(module-coolapi.o) 71 72 72 73 ifneq ($(LIBUSB),) -
trunk/module-dvbapi.c
r4134 r4136 19 19 #endif 20 20 21 const char *boxdesc[] = { "none", "dreambox", "duckbox", "ufs910", "dbox2", "ipbox", "ipbox-pmt", "dm7000", "qboxhd" }; 21 #ifdef COOL 22 int coolapi_set_filter (int fd, int num, int pid, byte * flt, byte * mask); 23 int coolapi_remove_filter (int fd, int num); 24 int coolapi_open_device (int demux_index, int demux_id); 25 int coolapi_close_device(int fd); 26 int coolapi_write_cw(int mask, unsigned short *STREAMpids, int count, ca_descr_t * ca_descr); 27 int coolapi_set_pid (int demux_id, int num, int index, int pid); 28 void coolapi_close_all(); 29 void dvbapi_write_cw(int demux_id, uchar *cw, int index); 30 #endif 31 const char *boxdesc[] = { "none", "dreambox", "duckbox", "ufs910", "dbox2", "ipbox", "ipbox-pmt", "dm7000", "qboxhd", "coolstream" }; 22 32 23 33 const struct box_devices devices[BOX_COUNT] = { … … 25 35 /* dreambox (dvb-api-3)*/ { "/dev/dvb/adapter%d/", "ca%d", "demux%d", "/tmp/camd.socket" }, 26 36 /* dreambox (dvb-api-1)*/ { "/dev/dvb/card%d/", "ca%d", "demux%d", "/tmp/camd.socket" }, 27 /* sh4 (stapi)*/ { "/dev/stapi/", "stpti4_ioctl", "stpti4_ioctl", "/tmp/camd.socket" } 37 /* sh4 (stapi)*/ { "/dev/stapi/", "stpti4_ioctl", "stpti4_ioctl", "/tmp/camd.socket" }, 38 /* coolstream)*/ { "/dev/cnxt/", "null", "null", "/tmp/camd.socket" } 28 39 }; 29 40 … … 96 107 break; 97 108 #endif 109 #ifdef COOL 110 case COOLAPI: 111 demux[demux_id].demux_fd[n].fd = coolapi_open_device(demux[demux_id].demux_index, demux_id); 112 if(demux[demux_id].demux_fd[n].fd > 0) 113 ret = coolapi_set_filter(demux[demux_id].demux_fd[n].fd, n, pid, filt, mask); 114 break; 115 #endif 98 116 default: 99 117 break; … … 117 135 118 136 int dvbapi_detect_api() { 137 #ifdef COOL 138 selected_api=COOLAPI; 139 selected_box = 4; 140 disable_pmt_files = 1; 141 cs_debug("Detected coolstream Api"); 142 return 1; 143 #else 119 144 int num_apis=2, i,devnum=-1, dmx_fd=0, ret=-1; 120 145 uchar filter[32]; … … 168 193 169 194 cs_debug("Detected %s Api: %d", device_path, selected_api); 195 #endif 170 196 171 197 return 1; 172 198 } 173 199 174 int dvbapi_read_device(int dmx_fd, unsigned char *buf, int length) { 200 int dvbapi_read_device(int dmx_fd, unsigned char *buf, int length) 201 { 175 202 int len, rc; 176 203 struct pollfd pfd[1]; … … 237 264 } 238 265 239 int dvbapi_stop_filternum(int demux_index, int num) { 266 int dvbapi_stop_filternum(int demux_index, int num) 267 { 240 268 int ret=-1; 241 269 if (demux[demux_index].demux_fd[num].fd>0) { 270 #ifdef COOL 271 ret=coolapi_remove_filter(demux[demux_index].demux_fd[num].fd, num); 272 coolapi_close_device(demux[demux_index].demux_fd[num].fd); 273 #else 242 274 #ifdef WITH_STAPI 243 275 ret=stapi_remove_filter(demux_index, num, demux[demux_index].pmt_file); … … 246 278 close(demux[demux_index].demux_fd[num].fd); 247 279 #endif 280 #endif 248 281 demux[demux_index].demux_fd[num].fd=0; 249 282 } … … 251 284 } 252 285 253 void dvbapi_start_filter(int demux_id, int pidindex, unsigned short pid, uchar table, uchar mask, int timeout, int type) { 286 void dvbapi_start_filter(int demux_id, int pidindex, unsigned short pid, uchar table, uchar mask, int timeout, int type) 287 { 254 288 uchar filter[32]; 255 289 … … 950 984 if (connfd>0 && demux[i].socket_fd == connfd) { 951 985 //PMT Update 986 #ifdef COOL 987 demux_id = i; 988 unsigned char lastcw[16]; 989 int n; 990 for(n = 0; n < 2; n++) { 991 memcpy(&lastcw[n*8], demux[demux_id].lastcw[n], 8); 992 memset(demux[demux_id].lastcw[n], 0, 8); 993 } 994 demux[demux_id].ca_mask=ca_mask; 995 dvbapi_write_cw(demux_id, lastcw, 0);//FIXME 996 demux[demux_id].curindex = demux[demux_id].pidindex; 997 demux[demux_id].STREAMpidcount=0; 998 demux[demux_id].ECMpidcount=0; 999 demux[demux_id].EMMpidcount=0; 1000 ca_pmt_list_management = 0x01; 1001 #else 952 1002 if (ca_pmt_list_management == 0x05) { 953 1003 demux_id = i; … … 961 1011 if (ca_pmt_list_management == 0x02) 962 1012 demux_id=i; 1013 #endif 963 1014 } 964 1015 } … … 992 1043 demux[demux_id].pidindex=-1; 993 1044 994 cs_debug("id: %d\tdemux_index: %d\tca_mask: %02x\tprogram_info_length: %d", demux_id, demux[demux_id].demux_index, demux[demux_id].ca_mask, program_info_length); 1045 cs_debug("id: %d\tdemux_index: %d\tca_mask: %02x\tprogram_info_length: %d\tca_pmt_list_management %02x", 1046 demux_id, demux[demux_id].demux_index, demux[demux_id].ca_mask, program_info_length, ca_pmt_list_management); 995 1047 996 1048 if (pmtfile) … … 1336 1388 struct s_ecmpids *curpid = &demux[demux_id].ECMpids[demux[demux_id].demux_fd[filter_num].pidindex]; 1337 1389 1390 #ifdef COOL 1391 cs_debug("dvbapi_process_input: demux %d filter %d len %d buffer %x curtable %x curindex %d\n", demux_id, filter_num, len, buffer[0], curpid->table, demux[demux_id].curindex); 1392 #endif 1338 1393 if (demux[demux_id].demux_fd[filter_num].type==TYPE_ECM) { 1339 1394 if (len != (((buffer[1] & 0xf) << 8) | buffer[2]) + 3) //invaild CAT length … … 1375 1430 1376 1431 curpid->table = buffer[0]; 1432 #ifdef COOL 1433 int num = demux[demux_id].curindex;//FIXME or pidindex ? 1434 dvbapi_stop_filternum(demux_id, filter_num); 1435 dvbapi_start_filter(demux_id, num, demux[demux_id].ECMpids[num].ECM_PID, buffer[0] ^ 1, 0xFF, 3000, TYPE_ECM); 1436 #endif 1377 1437 1378 1438 struct s_dvbapi_priority *mapentry = dvbapi_check_prio_match(demux_id, demux[demux_id].demux_fd[filter_num].pidindex, 'm'); … … 1526 1586 for (i=0;i<MAX_DEMUX;i++) { 1527 1587 for (g=0;g<MAX_FILTER;g++) { 1528 if (demux[i].demux_fd[g].fd>0 && selected_api != STAPI ) {1588 if (demux[i].demux_fd[g].fd>0 && selected_api != STAPI && selected_api != COOLAPI) { 1529 1589 pfd2[pfdcount].fd = demux[i].demux_fd[g].fd; 1530 1590 pfd2[pfdcount].events = (POLLIN | POLLPRI); … … 1639 1699 memcpy(demux[demux_id].lastcw[n],cw+(n*8),8); 1640 1700 memcpy(ca_descr.cw,cw+(n*8),8); 1641 1701 #ifdef COOL 1702 cs_debug("write cw%d index: %d (ca_mask %d)", n, ca_descr.index, demux[demux_id].ca_mask); 1703 coolapi_write_cw(demux[demux_id].ca_mask, demux[demux_id].STREAMpids, demux[demux_id].STREAMpidcount, &ca_descr); 1704 #else 1642 1705 int i; 1643 1706 for (i=0;i<8;i++) { 1644 1707 if (demux[demux_id].ca_mask & (1 << i)) { 1645 1708 cs_debug("write cw%d index: %d (ca%d)", n, ca_descr.index, i); 1646 1647 1709 if (ca_fd[i]<=0) { 1648 1710 ca_fd[i]=dvbapi_open_device(1, i, demux[demux_id].adapter_index); … … 1655 1717 } 1656 1718 } 1657 } 1658 } 1659 } 1660 1661 void dvbapi_send_dcw(struct s_client *client, ECM_REQUEST *er) { 1719 #endif 1720 } 1721 } 1722 } 1723 1724 void dvbapi_send_dcw(struct s_client *client, ECM_REQUEST *er) 1725 { 1662 1726 #ifdef AZBOX 1663 1727 azbox_send_dcw(client, er); -
trunk/module-dvbapi.h
r3909 r4136 15 15 #define DVBAPI_1 1 16 16 #define STAPI 2 17 #define COOLAPI 3 17 18 18 19 … … 25 26 #define ECMINFO_FILE "/tmp/ecm.info" 26 27 28 #ifdef COOL 29 #define MAX_DEMUX 3 30 #else 27 31 #define MAX_DEMUX 5 32 #endif 28 33 #define MAX_CAID 50 29 34 #define ECM_PIDS 20 … … 34 39 #endif 35 40 36 #define BOX_COUNT 441 #define BOX_COUNT 5 37 42 38 43 struct box_devices -
trunk/oscam.c
r4125 r4136 10 10 #else 11 11 # define CS_VERSION_X CS_VERSION 12 #endif 13 #ifdef COOL 14 void coolapi_close_all(); 15 extern int cooldebug; 12 16 #endif 13 17 … … 547 551 if (unlink(targetfile) < 0) 548 552 cs_log("cannot remove oscam version file %s errno=(%d)", targetfile, errno); 553 #endif 554 #ifdef COOL 555 coolapi_close_all(); 549 556 #endif 550 557 break; … … 1653 1660 int i, n; 1654 1661 ECM_REQUEST *er=0; 1655 1656 1662 struct s_client *cl = cur_client(); 1663 if(!cl) return NULL; 1657 1664 if (!cl->ecmtask) 1658 1665 { … … 3000 3007 exit(1); 3001 3008 } 3002 3003 3009 #ifdef CS_LED 3004 3010 cs_switch_led(LED1A, LED_DEFAULT); … … 3091 3097 }; 3092 3098 3093 while ((i=getopt(argc, argv, "bc:t:d:hm: "))!=EOF)3099 while ((i=getopt(argc, argv, "bc:t:d:hm:x"))!=EOF) 3094 3100 { 3095 3101 switch(i) { … … 3116 3122 printf("WARNING: -m parameter is deprecated, ignoring it.\n"); 3117 3123 break; 3124 case 'x': 3125 cooldebug = 1; 3126 break; 3118 3127 case 'h': 3119 3128 default :
Note:
See TracChangeset
for help on using the changeset viewer.