You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(10) |
Jun
(35) |
Jul
(11) |
Aug
(9) |
Sep
|
Oct
(9) |
Nov
(1) |
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
(9) |
Nov
(3) |
Dec
|
| 2004 |
Jan
(2) |
Feb
|
Mar
(28) |
Apr
(5) |
May
|
Jun
(1) |
Jul
(5) |
Aug
(2) |
Sep
|
Oct
(2) |
Nov
|
Dec
(5) |
| 2005 |
Jan
(2) |
Feb
(8) |
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
|
Mar
(26) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
(5) |
Oct
|
Nov
|
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ni...@us...> - 2004-12-29 19:22:02
|
Update of /cvsroot/dvbtools/dvbstream In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5899 Modified Files: tune.c dvbstream.c Log Message: replaced call of FE_GET_EVENT with FE_READ_STATUS; added workaround for frontends that lack FE_TIMEOUTD; restored freq*1000 for DVB-S Index: tune.c =================================================================== RCS file: /cvsroot/dvbtools/dvbstream/tune.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tune.c 26 Aug 2004 20:12:22 -0000 1.19 --- tune.c 29 Dec 2004 19:21:53 -0000 1.20 *************** *** 28,31 **** --- 28,32 ---- #include <unistd.h> #include <error.h> + #include <time.h> #include <errno.h> *************** *** 127,139 **** int32_t strength; fe_status_t festatus; - struct dvb_frontend_event event; struct pollfd pfd[1]; ! int status; - while(1) { - if (ioctl(fd_frontend, FE_GET_EVENT, &event) < 0) //EMPTY THE EVENT QUEUE - break; - } - if (ioctl(fd_frontend,FE_SET_FRONTEND,feparams) < 0) { perror("ERROR tuning channel\n"); --- 128,135 ---- int32_t strength; fe_status_t festatus; struct pollfd pfd[1]; ! int status, locks=0, ok=0; ! time_t tm1, tm2; if (ioctl(fd_frontend,FE_SET_FRONTEND,feparams) < 0) { perror("ERROR tuning channel\n"); *************** *** 144,201 **** pfd[0].events = POLLPRI; ! event.status=0; ! while (((event.status & FE_TIMEDOUT)==0) && ((event.status & FE_HAS_LOCK)==0)) { ! fprintf(stderr,"polling....\n"); ! if (poll(pfd,1,10000) > 0){ if (pfd[0].revents & POLLPRI){ ! fprintf(stderr,"Getting frontend event\n"); ! if ((status = ioctl(fd_frontend, FE_GET_EVENT, &event)) < 0){ ! if (errno != EOVERFLOW) { ! perror("FE_GET_EVENT"); ! fprintf(stderr,"status = %d\n", status); ! fprintf(stderr,"errno = %d\n", errno); ! return -1; ! } ! else fprintf(stderr,"Overflow error, trying again (status = %d, errno = %d)", status, errno); ! } } - print_status(stderr,event.status); } } ! if (event.status & FE_HAS_LOCK) { ! switch(type) { case FE_OFDM: ! fprintf(stderr,"Event: Frequency: %d\n",event.parameters.frequency); break; case FE_QPSK: ! fprintf(stderr,"Event: Frequency: %d\n",(unsigned int)((event.parameters.frequency)+(hi_lo ? LOF2 : LOF1))); ! fprintf(stderr," SymbolRate: %d\n",event.parameters.u.qpsk.symbol_rate); ! fprintf(stderr," FEC_inner: %d\n",event.parameters.u.qpsk.fec_inner); fprintf(stderr,"\n"); break; case FE_QAM: ! fprintf(stderr,"Event: Frequency: %d\n",event.parameters.frequency); ! fprintf(stderr," SymbolRate: %d\n",event.parameters.u.qpsk.symbol_rate); ! fprintf(stderr," FEC_inner: %d\n",event.parameters.u.qpsk.fec_inner); break; default: break; } strength=0; if(ioctl(fd_frontend,FE_READ_BER,&strength) >= 0) ! fprintf(stderr,"Bit error rate: %d\n",strength); strength=0; if(ioctl(fd_frontend,FE_READ_SIGNAL_STRENGTH,&strength) >= 0) ! fprintf(stderr,"Signal strength: %d\n",strength); strength=0; if(ioctl(fd_frontend,FE_READ_SNR,&strength) >= 0) ! fprintf(stderr,"SNR: %d\n",strength); - festatus=0; - if(ioctl(fd_frontend,FE_READ_STATUS,&festatus) >= 0) print_status(stderr,festatus); } else { --- 140,198 ---- pfd[0].events = POLLPRI; ! tm1 = tm2 = time((time_t*) NULL); ! fprintf(stderr,"Getting frontend status\n"); ! while (!ok) { ! festatus = 0; ! if (poll(pfd,1,3000) > 0){ if (pfd[0].revents & POLLPRI){ ! if(ioctl(fd_frontend,FE_READ_STATUS,&festatus) >= 0) ! if(festatus & FE_HAS_LOCK) ! locks++; } } + usleep(10000); + tm2 = time((time_t*) NULL); + if((festatus & FE_TIMEDOUT) || (locks >= 2) || (tm2 - tm1 >= 3)) + ok = 1; } ! if (festatus & FE_HAS_LOCK) { ! if(ioctl(fd_frontend,FE_GET_FRONTEND,feparams) >= 0) { ! switch(type) { case FE_OFDM: ! fprintf(stderr,"Event: Frequency: %d\n",feparams->frequency); break; case FE_QPSK: ! fprintf(stderr,"Event: Frequency: %d\n",(unsigned int)((feparams->frequency)+(hi_lo ? LOF2 : LOF1))); ! fprintf(stderr," SymbolRate: %d\n",feparams->u.qpsk.symbol_rate); ! fprintf(stderr," FEC_inner: %d\n",feparams->u.qpsk.fec_inner); fprintf(stderr,"\n"); break; case FE_QAM: ! fprintf(stderr,"Event: Frequency: %d\n",feparams->frequency); ! fprintf(stderr," SymbolRate: %d\n",feparams->u.qpsk.symbol_rate); ! fprintf(stderr," FEC_inner: %d\n",feparams->u.qpsk.fec_inner); break; default: break; + } } strength=0; if(ioctl(fd_frontend,FE_READ_BER,&strength) >= 0) ! fprintf(stderr,"Bit error rate: %d\n",strength); strength=0; if(ioctl(fd_frontend,FE_READ_SIGNAL_STRENGTH,&strength) >= 0) ! fprintf(stderr,"Signal strength: %d\n",strength); strength=0; if(ioctl(fd_frontend,FE_READ_SNR,&strength) >= 0) ! fprintf(stderr,"SNR: %d\n",strength); ! ! strength=0; ! if(ioctl(fd_frontend,FE_READ_UNCORRECTED_BLOCKS,&strength) >= 0) ! fprintf(stderr,"UNC: %d\n",strength); print_status(stderr,festatus); } else { *************** *** 218,224 **** fprintf(stderr,"Using DVB card \"%s\"\n",fe_info.name); switch(fe_info.type) { case FE_OFDM: - if (freq < 1000000) freq*=1000UL; feparams.frequency=freq; feparams.inversion=INVERSION_OFF; --- 215,221 ---- fprintf(stderr,"Using DVB card \"%s\"\n",fe_info.name); + if (freq < 1000000) freq*=1000UL; switch(fe_info.type) { case FE_OFDM: feparams.frequency=freq; feparams.inversion=INVERSION_OFF; *************** *** 243,247 **** } ! fprintf(stderr,"tuning DVB-S to Freq: %u, Pol:%c Srate=%d, 22kHz tone=%s, LNB: %d\n",feparams.frequency,pol,srate,tone == SEC_TONE_ON ? "on" : "off", diseqc); feparams.inversion=specInv; feparams.u.qpsk.symbol_rate=srate; --- 240,244 ---- } ! fprintf(stderr,"tuning DVB-S to Freq: %u, Pol:%c Srate=%d, 22kHz tone=%s, LNB: %d\n",feparams.frequency,pol,srate,tone == SEC_TONE_ON ? "on" : "off", diseqc); feparams.inversion=specInv; feparams.u.qpsk.symbol_rate=srate; Index: dvbstream.c =================================================================== RCS file: /cvsroot/dvbtools/dvbstream/dvbstream.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** dvbstream.c 6 Dec 2004 21:26:10 -0000 1.24 --- dvbstream.c 29 Dec 2004 19:21:53 -0000 1.25 *************** *** 271,275 **** } ! if((fd[npids] = open(demuxdev[card],O_RDWR)) < 0){ fprintf(stderr,"FD %i: ",i); perror("DEMUX DEVICE: "); --- 271,275 ---- } ! if((fd[npids] = open(demuxdev[card],O_RDWR|O_NONBLOCK)) < 0){ fprintf(stderr,"FD %i: ",i); perror("DEMUX DEVICE: "); *************** *** 301,305 **** i=4; while (cmd[i]==' ') i++; ! freq=atoi(&cmd[i])*1000UL; while ((cmd[i]!=' ') && (cmd[i]!=0)) i++; if (cmd[i]!=0) { --- 301,305 ---- i=4; while (cmd[i]==' ') i++; ! freq=atoi(&cmd[i]); while ((cmd[i]!=' ') && (cmd[i]!=0)) i++; if (cmd[i]!=0) { *************** *** 562,566 **** } else if (strcmp(argv[i],"-f")==0) { i++; ! freq=atoi(argv[i])*1000UL; } else if (strcmp(argv[i],"-p")==0) { i++; --- 562,566 ---- } else if (strcmp(argv[i],"-f")==0) { i++; ! freq=atoi(argv[i]); } else if (strcmp(argv[i],"-p")==0) { i++; *************** *** 819,827 **** alarm(ALARM_TIME); ! if ( (freq>100000000)) { ! if (open_fe(&fd_frontend)) { ! i=tune_it(fd_frontend,freq,srate,0,tone,specInv,diseqc,modulation,HP_CodeRate,TransmissionMode,guardInterval,bandWidth, LP_CodeRate, hier); ! } ! } else if ((freq!=0) && (pol!=0) && (srate!=0)) { if (open_fe(&fd_frontend)) { fprintf(stderr,"Tuning to %ld Hz\n",freq); --- 819,823 ---- alarm(ALARM_TIME); ! if (freq!=0) { if (open_fe(&fd_frontend)) { fprintf(stderr,"Tuning to %ld Hz\n",freq); *************** *** 847,851 **** for (i=0;i<npids;i++) { ! if((fd[i] = open(demuxdev[card],O_RDWR)) < 0){ fprintf(stderr,"FD %i: ",i); perror("DEMUX DEVICE: "); --- 843,847 ---- for (i=0;i<npids;i++) { ! if((fd[i] = open(demuxdev[card],O_RDWR|O_NONBLOCK)) < 0){ fprintf(stderr,"FD %i: ",i); perror("DEMUX DEVICE: "); |
|
From: <ni...@us...> - 2004-12-29 19:19:44
|
Update of /cvsroot/dvbtools/dvbtune In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5229 Modified Files: tune.c dvbtune.c Log Message: replaced call of FE_GET_EVENT with FE_READ_STATUS; added workaround for frontends that lack FE_TIMEOUTD; restored freq*1000 for DVB-S Index: tune.c =================================================================== RCS file: /cvsroot/dvbtools/dvbtune/tune.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** tune.c 4 Apr 2004 08:41:03 -0000 1.26 --- tune.c 29 Dec 2004 19:19:32 -0000 1.27 *************** *** 29,32 **** --- 29,33 ---- #include <error.h> #include <errno.h> + #include <time.h> #include <linux/dvb/dmx.h> *************** *** 126,139 **** int check_status(int fd_frontend,int type, struct dvb_frontend_parameters* feparams,int hi_lo) { int32_t strength; - fe_status_t festatus; - struct dvb_frontend_event event; struct pollfd pfd[1]; ! int status; - while(1) { - if (ioctl(fd_frontend, FE_GET_EVENT, &event) < 0) //EMPTY THE EVENT QUEUE - break; - } - if (ioctl(fd_frontend,FE_SET_FRONTEND,feparams) < 0) { perror("ERROR tuning channel\n"); --- 127,134 ---- int check_status(int fd_frontend,int type, struct dvb_frontend_parameters* feparams,int hi_lo) { int32_t strength; struct pollfd pfd[1]; ! int festatus, locks=0, ok=0; ! time_t tm1, tm2; if (ioctl(fd_frontend,FE_SET_FRONTEND,feparams) < 0) { perror("ERROR tuning channel\n"); *************** *** 143,201 **** pfd[0].fd = fd_frontend; pfd[0].events = POLLPRI; ! ! event.status=0; ! while (((event.status & FE_TIMEDOUT)==0) && ((event.status & FE_HAS_LOCK)==0)) { ! fprintf(stderr,"polling....\n"); ! if (poll(pfd,1,10000) > 0){ if (pfd[0].revents & POLLPRI){ ! fprintf(stderr,"Getting frontend event\n"); ! if ((status = ioctl(fd_frontend, FE_GET_EVENT, &event)) < 0){ ! if (errno != EOVERFLOW) { ! perror("FE_GET_EVENT"); ! fprintf(stderr,"status = %d\n", status); ! fprintf(stderr,"errno = %d\n", errno); ! return -1; ! } ! else fprintf(stderr,"Overflow error, trying again (status = %d, errno = %d)", status, errno); ! } } - print_status(stderr,event.status); } } ! ! if (event.status & FE_HAS_LOCK) { ! switch(type) { case FE_OFDM: ! fprintf(stderr,"Event: Frequency: %d\n",event.parameters.frequency); break; case FE_QPSK: ! fprintf(stderr,"Event: Frequency: %d\n",(unsigned int)((event.parameters.frequency)+(hi_lo ? LOF2 : LOF1))); ! fprintf(stderr," SymbolRate: %d\n",event.parameters.u.qpsk.symbol_rate); ! fprintf(stderr," FEC_inner: %d\n",event.parameters.u.qpsk.fec_inner); fprintf(stderr,"\n"); break; case FE_QAM: ! fprintf(stderr,"Event: Frequency: %d\n",event.parameters.frequency); ! fprintf(stderr," SymbolRate: %d\n",event.parameters.u.qpsk.symbol_rate); ! fprintf(stderr," FEC_inner: %d\n",event.parameters.u.qpsk.fec_inner); break; default: break; } - strength=0; if(ioctl(fd_frontend,FE_READ_BER,&strength) >= 0) ! fprintf(stderr,"Bit error rate: %d\n",strength); strength=0; if(ioctl(fd_frontend,FE_READ_SIGNAL_STRENGTH,&strength) >= 0) ! fprintf(stderr,"Signal strength: %d\n",strength); strength=0; if(ioctl(fd_frontend,FE_READ_SNR,&strength) >= 0) ! fprintf(stderr,"SNR: %d\n",strength); festatus=0; ! if(ioctl(fd_frontend,FE_READ_STATUS,&festatus) >= 0) print_status(stderr,festatus); } else { --- 138,196 ---- pfd[0].fd = fd_frontend; pfd[0].events = POLLPRI; ! ! tm1 = tm2 = time((time_t*) NULL); ! fprintf(stderr,"Getting frontend status\n"); ! while (!ok) { ! festatus = 0; ! if (poll(pfd,1,3000) > 0){ if (pfd[0].revents & POLLPRI){ ! if(ioctl(fd_frontend,FE_READ_STATUS,&festatus) >= 0) ! if(festatus & FE_HAS_LOCK) ! locks++; } } + usleep(10000); + tm2 = time((time_t*) NULL); + if((festatus & FE_TIMEDOUT) || (locks >= 2) || (tm2 - tm1 >= 3)) + ok = 1; } ! ! if (festatus & FE_HAS_LOCK) { ! if(ioctl(fd_frontend,FE_GET_FRONTEND,feparams) >= 0) { ! switch(type) { case FE_OFDM: ! fprintf(stderr,"Event: Frequency: %d\n",feparams->frequency); break; case FE_QPSK: ! fprintf(stderr,"Event: Frequency: %d\n",(unsigned int)((feparams->frequency)+(hi_lo ? LOF2 : LOF1))); ! fprintf(stderr," SymbolRate: %d\n",feparams->u.qpsk.symbol_rate); ! fprintf(stderr," FEC_inner: %d\n",feparams->u.qpsk.fec_inner); fprintf(stderr,"\n"); break; case FE_QAM: ! fprintf(stderr,"Event: Frequency: %d\n",feparams->frequency); ! fprintf(stderr," SymbolRate: %d\n",feparams->u.qpsk.symbol_rate); ! fprintf(stderr," FEC_inner: %d\n",feparams->u.qpsk.fec_inner); break; default: break; + } } strength=0; if(ioctl(fd_frontend,FE_READ_BER,&strength) >= 0) ! fprintf(stderr,"Bit error rate: %d\n",strength); strength=0; if(ioctl(fd_frontend,FE_READ_SIGNAL_STRENGTH,&strength) >= 0) ! fprintf(stderr,"Signal strength: %d\n",strength); strength=0; if(ioctl(fd_frontend,FE_READ_SNR,&strength) >= 0) ! fprintf(stderr,"SNR: %d\n",strength); festatus=0; ! if(ioctl(fd_frontend,FE_READ_UNCORRECTED_BLOCKS,&strength) >= 0) ! fprintf(stderr,"SNR: %d\n",strength); ! print_status(stderr,festatus); } else { *************** *** 218,224 **** fprintf(stderr,"Using DVB card \"%s\"\n",fe_info.name); switch(fe_info.type) { case FE_OFDM: - if (freq < 1000000) freq*=1000UL; feparams.frequency=freq; feparams.inversion=INVERSION_OFF; --- 213,219 ---- fprintf(stderr,"Using DVB card \"%s\"\n",fe_info.name); + if (freq < 1000000) freq*=1000UL; switch(fe_info.type) { case FE_OFDM: feparams.frequency=freq; feparams.inversion=INVERSION_OFF; *************** *** 243,247 **** } ! fprintf(stderr,"tuning DVB-S to Freq: %u, Pol:%c Srate=%d, 22kHz tone=%s, LNB: %d\n",feparams.frequency,pol,srate,tone == SEC_TONE_ON ? "on" : "off", diseqc); feparams.inversion=specInv; feparams.u.qpsk.symbol_rate=srate; --- 238,242 ---- } ! fprintf(stderr,"tuning DVB-S to Freq: %u, Pol:%c Srate=%d, 22kHz tone=%s, LNB: %d\n",feparams.frequency,pol,srate,tone == SEC_TONE_ON ? "on" : "off", diseqc); feparams.inversion=specInv; feparams.u.qpsk.symbol_rate=srate; Index: dvbtune.c =================================================================== RCS file: /cvsroot/dvbtools/dvbtune/dvbtune.c,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** dvbtune.c 1 Apr 2004 19:39:29 -0000 1.30 --- dvbtune.c 29 Dec 2004 19:19:33 -0000 1.31 *************** *** 1009,1013 **** if (festatus & FE_HAS_CARRIER) fprintf(stderr,"C|"); if (festatus & FE_HAS_VITERBI) fprintf(stderr,"V|"); ! if (festatus & FE_HAS_SYNC) fprintf(stderr,"SY|"); fprintf(stderr,")\n"); sleep(1); --- 1009,1013 ---- if (festatus & FE_HAS_CARRIER) fprintf(stderr,"C|"); if (festatus & FE_HAS_VITERBI) fprintf(stderr,"V|"); ! if (festatus & FE_HAS_SYNC) fprintf(stderr,"SY"); fprintf(stderr,")\n"); sleep(1); |
|
From: Ivan G. <ger...@ya...> - 2004-12-08 07:56:55
|
Hi Dave, take a look here please! http://home.t-online.de/home/intek-bg/mpg2stream/ Best regards: Ivan --- dvb...@li... wrote: > Send dvbtools-cvs mailing list submissions to > dvb...@li... > > To subscribe or unsubscribe via the World Wide Web, > visit > > https://lists.sourceforge.net/lists/listinfo/dvbtools-cvs > or, via email, send a message with subject or body > 'help' to > dvb...@li... > > You can reach the person managing the list at > dvb...@li... > > When replying, please edit your Subject line so it > is more specific > than "Re: Contents of dvbtools-cvs digest..." > > > Today's Topics: > > 1. dvbstream dvbstream.c,1.23,1.24 > (ni...@us...) > > --__--__-- > > Message: 1 > From: ni...@us... > To: dvb...@li... > Date: Mon, 06 Dec 2004 13:26:13 -0800 > Subject: [dvbtools-cvs] dvbstream > dvbstream.c,1.23,1.24 > > Update of /cvsroot/dvbtools/dvbstream > In directory > sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28295 > > Modified Files: > dvbstream.c > Log Message: > Added multi-rtp support and more sanity checks in > the ralloc()s of the map structure > > Index: dvbstream.c > =================================================================== > RCS file: /cvsroot/dvbtools/dvbstream/dvbstream.c,v > retrieving revision 1.23 > retrieving revision 1.24 > diff -C2 -d -r1.23 -r1.24 > *** dvbstream.c 26 Aug 2004 20:12:22 -0000 1.23 > --- dvbstream.c 6 Dec 2004 21:26:10 -0000 1.24 > *************** > *** 130,134 **** > struct dmx_pes_filter_params pesFilterParams; > > ! fprintf(stderr,"Setting filter for PID > %d\n",pid); > pesFilterParams.pid = pid; > pesFilterParams.input = DMX_IN_FRONTEND; > --- 130,134 ---- > struct dmx_pes_filter_params pesFilterParams; > > ! //fprintf(stderr,"Setting filter for PID > %d\n",pid); > pesFilterParams.pid = pid; > pesFilterParams.input = DMX_IN_FRONTEND; > *************** > *** 138,142 **** > > if (ioctl(fd, DMX_SET_PES_FILTER, > &pesFilterParams) < 0) { > ! fprintf(stderr,"FILTER %i: ",pid); > perror("DMX SET PES FILTER"); > } > --- 138,142 ---- > > if (ioctl(fd, DMX_SET_PES_FILTER, > &pesFilterParams) < 0) { > ! fprintf(stderr,"Failed setting filter for pid > %i: ",pid); > perror("DMX SET PES FILTER"); > } > *************** > *** 401,404 **** > --- 401,411 ---- > long start_time; // in seconds > long end_time; // in seconds > + int socket; > + struct rtpheader hdr; > + struct sockaddr_in sOut; > + unsigned char buf[MTU]; > + unsigned char net[20]; > + int pos; > + int port; > } pids_map_t; > > *************** > *** 460,463 **** > --- 467,471 ---- > fprintf(stderr,"-i IP multicast > address\n"); > fprintf(stderr,"-r IP multicast > port\n"); > + fprintf(stderr,"-net ip:prt IP address:port > combination to be followed by pids list. Can be > repeated to generate multiple RTP streams\n"); > fprintf(stderr,"-o Stream to stdout > instead of network\n"); > fprintf(stderr,"-o:file.ts Stream to named > file instead of network\n"); > *************** > *** 503,511 **** > --- 511,563 ---- > if (secs==-1) { secs=10; } > } else if (strcmp(argv[i],"-i")==0) { > + if(pids_map != NULL) { > + fprintf(stderr, "ERROR! -i and -r can't be used > with -o and -net. Use -net instead\n"); > + exit(1); > + } > i++; > strcpy(ipOut,argv[i]); > } else if (strcmp(argv[i],"-r")==0) { > + if(pids_map != NULL) { > + fprintf(stderr, "ERROR! -i and -r can't be used > with -o and -net. Use -net instead\n"); > + exit(1); > + } > i++; > portOut=atoi(argv[i]); > + } else if (strcmp(argv[i],"-net")==0) { > + char *tmp; > + i++; > + tmp = strchr(argv[i], ':'); > + if((tmp == NULL) || (tmp - argv[i] > 19)) { > + fprintf(stderr, "No valid IP:port found after > -net switch, discarding\n"); > + } else { > + int len = (int) (tmp - argv[i]); > + char addr[20]; > + int port; > + strncpy(ipOut, argv[i], len); > + ipOut[len] = 0; > + strncpy(addr, argv[i], len); > + addr[len] = 0; > + port = portOut = atoi(tmp+1); > + > + > + pids_map = (pids_map_t*) > realloc(pids_map, sizeof(pids_map_t) * (map_cnt+1)); > + if(pids_map != NULL) { > + map_cnt++; > + pids_map[map_cnt-1].pid_cnt = 0; > + > pids_map[map_cnt-1].start_time=start_time; > + pids_map[map_cnt-1].end_time=end_time; > + for(j=0; j < MAX_CHANNELS; j++) > pids_map[map_cnt-1].pids[j] = -1; > + pids_map[map_cnt-1].filename = NULL; > + strncpy(pids_map[map_cnt-1].net, addr, len); > + pids_map[map_cnt-1].net[len] = 0; > + pids_map[map_cnt-1].port = port; > + pids_map[map_cnt-1].pos = 0; > + > + pids_map[map_cnt-1].socket = > makesocket(addr,port,ttl,&(pids_map[map_cnt-1].sOut)); > + > initrtp(&(pids_map[map_cnt-1].hdr),(output_type==RTP_TS > ? 33 : 34)); > + output_type = MAP_TS; > + } else > + fprintf(stderr, "Couldn't alloc enough > entry for this %s:%d address\n", addr, port); > + } > } else if (strcmp(argv[i],"-f")==0) { > i++; > *************** > *** 675,689 **** > } else if (strstr(argv[i], "-o:")==argv[i]) > { > if (strlen(argv[i]) > 3) { > ! fprintf(stderr,"Processing > %s\n",argv[i]); > ! map_cnt++; > ! pids_map = (pids_map_t*) > realloc(pids_map, sizeof(pids_map_t) * map_cnt); > ! pids_map[map_cnt-1].pid_cnt = 0; > ! > pids_map[map_cnt-1].start_time=start_time; > ! pids_map[map_cnt-1].end_time=end_time; > ! for(j=0; j < MAX_CHANNELS; j++) > pids_map[map_cnt-1].pids[j] = -1; > ! pids_map[map_cnt-1].filename = (char *) > malloc(strlen(argv[i]) - 2); > ! strcpy(pids_map[map_cnt-1].filename, > &argv[i][3]); > > ! output_type = MAP_TS; > } > } else { > --- 727,749 ---- > === message truncated === __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
|
From: <ni...@us...> - 2004-12-06 21:26:20
|
Update of /cvsroot/dvbtools/dvbstream In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28295 Modified Files: dvbstream.c Log Message: Added multi-rtp support and more sanity checks in the ralloc()s of the map structure Index: dvbstream.c =================================================================== RCS file: /cvsroot/dvbtools/dvbstream/dvbstream.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** dvbstream.c 26 Aug 2004 20:12:22 -0000 1.23 --- dvbstream.c 6 Dec 2004 21:26:10 -0000 1.24 *************** *** 130,134 **** struct dmx_pes_filter_params pesFilterParams; ! fprintf(stderr,"Setting filter for PID %d\n",pid); pesFilterParams.pid = pid; pesFilterParams.input = DMX_IN_FRONTEND; --- 130,134 ---- struct dmx_pes_filter_params pesFilterParams; ! //fprintf(stderr,"Setting filter for PID %d\n",pid); pesFilterParams.pid = pid; pesFilterParams.input = DMX_IN_FRONTEND; *************** *** 138,142 **** if (ioctl(fd, DMX_SET_PES_FILTER, &pesFilterParams) < 0) { ! fprintf(stderr,"FILTER %i: ",pid); perror("DMX SET PES FILTER"); } --- 138,142 ---- if (ioctl(fd, DMX_SET_PES_FILTER, &pesFilterParams) < 0) { ! fprintf(stderr,"Failed setting filter for pid %i: ",pid); perror("DMX SET PES FILTER"); } *************** *** 401,404 **** --- 401,411 ---- long start_time; // in seconds long end_time; // in seconds + int socket; + struct rtpheader hdr; + struct sockaddr_in sOut; + unsigned char buf[MTU]; + unsigned char net[20]; + int pos; + int port; } pids_map_t; *************** *** 460,463 **** --- 467,471 ---- fprintf(stderr,"-i IP multicast address\n"); fprintf(stderr,"-r IP multicast port\n"); + fprintf(stderr,"-net ip:prt IP address:port combination to be followed by pids list. Can be repeated to generate multiple RTP streams\n"); fprintf(stderr,"-o Stream to stdout instead of network\n"); fprintf(stderr,"-o:file.ts Stream to named file instead of network\n"); *************** *** 503,511 **** --- 511,563 ---- if (secs==-1) { secs=10; } } else if (strcmp(argv[i],"-i")==0) { + if(pids_map != NULL) { + fprintf(stderr, "ERROR! -i and -r can't be used with -o and -net. Use -net instead\n"); + exit(1); + } i++; strcpy(ipOut,argv[i]); } else if (strcmp(argv[i],"-r")==0) { + if(pids_map != NULL) { + fprintf(stderr, "ERROR! -i and -r can't be used with -o and -net. Use -net instead\n"); + exit(1); + } i++; portOut=atoi(argv[i]); + } else if (strcmp(argv[i],"-net")==0) { + char *tmp; + i++; + tmp = strchr(argv[i], ':'); + if((tmp == NULL) || (tmp - argv[i] > 19)) { + fprintf(stderr, "No valid IP:port found after -net switch, discarding\n"); + } else { + int len = (int) (tmp - argv[i]); + char addr[20]; + int port; + strncpy(ipOut, argv[i], len); + ipOut[len] = 0; + strncpy(addr, argv[i], len); + addr[len] = 0; + port = portOut = atoi(tmp+1); + + + pids_map = (pids_map_t*) realloc(pids_map, sizeof(pids_map_t) * (map_cnt+1)); + if(pids_map != NULL) { + map_cnt++; + pids_map[map_cnt-1].pid_cnt = 0; + pids_map[map_cnt-1].start_time=start_time; + pids_map[map_cnt-1].end_time=end_time; + for(j=0; j < MAX_CHANNELS; j++) pids_map[map_cnt-1].pids[j] = -1; + pids_map[map_cnt-1].filename = NULL; + strncpy(pids_map[map_cnt-1].net, addr, len); + pids_map[map_cnt-1].net[len] = 0; + pids_map[map_cnt-1].port = port; + pids_map[map_cnt-1].pos = 0; + + pids_map[map_cnt-1].socket = makesocket(addr,port,ttl,&(pids_map[map_cnt-1].sOut)); + initrtp(&(pids_map[map_cnt-1].hdr),(output_type==RTP_TS ? 33 : 34)); + output_type = MAP_TS; + } else + fprintf(stderr, "Couldn't alloc enough entry for this %s:%d address\n", addr, port); + } } else if (strcmp(argv[i],"-f")==0) { i++; *************** *** 675,689 **** } else if (strstr(argv[i], "-o:")==argv[i]) { if (strlen(argv[i]) > 3) { ! fprintf(stderr,"Processing %s\n",argv[i]); ! map_cnt++; ! pids_map = (pids_map_t*) realloc(pids_map, sizeof(pids_map_t) * map_cnt); ! pids_map[map_cnt-1].pid_cnt = 0; ! pids_map[map_cnt-1].start_time=start_time; ! pids_map[map_cnt-1].end_time=end_time; ! for(j=0; j < MAX_CHANNELS; j++) pids_map[map_cnt-1].pids[j] = -1; ! pids_map[map_cnt-1].filename = (char *) malloc(strlen(argv[i]) - 2); ! strcpy(pids_map[map_cnt-1].filename, &argv[i][3]); ! output_type = MAP_TS; } } else { --- 727,749 ---- } else if (strstr(argv[i], "-o:")==argv[i]) { if (strlen(argv[i]) > 3) { ! char * fname; ! fname = (char *) malloc(strlen(argv[i]) - 2); ! if(fname == NULL) { ! fprintf(stderr, "Couldn't alloc enough memory for this -o: entry, discarding\n"); ! } else { ! strcpy(fname, &argv[i][3]); ! pids_map = (pids_map_t*) realloc(pids_map, sizeof(pids_map_t) * (map_cnt+1)); ! if(pids_map != NULL) { ! map_cnt++; ! pids_map[map_cnt-1].pid_cnt = 0; ! pids_map[map_cnt-1].start_time=start_time; ! pids_map[map_cnt-1].end_time=end_time; ! for(j=0; j < MAX_CHANNELS; j++) pids_map[map_cnt-1].pids[j] = -1; ! pids_map[map_cnt-1].filename = fname; ! output_type = MAP_TS; ! } else ! fprintf(stderr, "Couldn't alloc enough memory for file %s: entry, discarding\n", fname); ! } } } else { *************** *** 739,742 **** --- 799,803 ---- for (i=0;i<map_cnt;i++) { + if(pids_map[i].filename) { FILE *f; f = fopen(pids_map[i].filename, "w+b"); *************** *** 750,753 **** --- 811,815 ---- } } + } if (signal(SIGHUP, SignalHandler) == SIG_IGN) signal(SIGHUP, SIG_IGN); *************** *** 770,776 **** // if (i<0) { exit(i); } for (i=0;i<map_cnt;i++) { if ((secs==-1) || (secs < pids_map[i].end_time)) { secs=pids_map[i].end_time; } ! fprintf(stderr,"MAP %d, file %s: From %ld secs, To %ld secs, %d PIDs - ",i,pids_map[i].filename,pids_map[i].start_time,pids_map[i].end_time,pids_map[i].pid_cnt); for (j=0;j<MAX_CHANNELS;j++) { if (pids_map[i].pids[j]!=-1) fprintf(stderr," %d",pids_map[i].pids[j]); } fprintf(stderr,"\n"); --- 832,843 ---- // if (i<0) { exit(i); } + if(map_cnt > 0) + fprintf(stderr, "\n"); for (i=0;i<map_cnt;i++) { if ((secs==-1) || (secs < pids_map[i].end_time)) { secs=pids_map[i].end_time; } ! if(pids_map[i].filename != NULL) ! fprintf(stderr,"MAP %d, file %s: From %ld secs, To %ld secs, %d PIDs - ",i,pids_map[i].filename,pids_map[i].start_time,pids_map[i].end_time,pids_map[i].pid_cnt); ! else ! fprintf(stderr,"MAP %d, addr %s:%d From %ld secs, To %ld secs, %d PIDs - ",i,pids_map[i].net,pids_map[i].port,pids_map[i].start_time,pids_map[i].end_time,pids_map[i].pid_cnt); for (j=0;j<MAX_CHANNELS;j++) { if (pids_map[i].pids[j]!=-1) fprintf(stderr," %d",pids_map[i].pids[j]); } fprintf(stderr,"\n"); *************** *** 902,906 **** } } else if(output_type==MAP_TS) { ! if(read(fd_dvr, buf, TS_SIZE) > 0) { if(buf[0] == 0x47) { int pid, i, j; --- 969,975 ---- } } else if(output_type==MAP_TS) { ! int bytes_read; ! bytes_read = read(fd_dvr, buf, TS_SIZE); ! if(bytes_read > 0) { if(buf[0] == 0x47) { int pid, i, j; *************** *** 914,918 **** if (pids_map[i].pids[j] == pid) { errno = 0; ! write(pids_map[i].fd, buf, TS_SIZE); } } --- 983,998 ---- if (pids_map[i].pids[j] == pid) { errno = 0; ! if(pids_map[i].filename) ! write(pids_map[i].fd, buf, TS_SIZE); ! else { ! if((pids_map[i].pos + PACKET_SIZE) > MAX_RTP_SIZE) { ! hdr.timestamp = getmsec()*90; ! sendrtp2(pids_map[i].socket, &(pids_map[i].sOut), &(pids_map[i].hdr), pids_map[i].buf, pids_map[i].pos); ! pids_map[i].pos = 0; ! } ! ! memcpy(&(pids_map[i].buf[pids_map[i].pos]), buf, bytes_read); ! pids_map[i].pos += bytes_read; ! } } } |
|
From: <lin...@us...> - 2004-10-23 08:50:44
|
Update of /cvsroot/dvbtools/dvbsubs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31428 Modified Files: dvbtextsubs.c Log Message: Attempt to fix compatibility with ttxtsubs Index: dvbtextsubs.c =================================================================== RCS file: /cvsroot/dvbtools/dvbsubs/dvbtextsubs.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** dvbtextsubs.c 23 Oct 2004 08:14:52 -0000 1.15 --- dvbtextsubs.c 23 Oct 2004 08:50:33 -0000 1.16 *************** *** 534,540 **** data_unit_id=buf[k++]; data_len=buf[k++]; ! if (data_len!=0x2c) { data_len=0x2c; } // fprintf(stdout,"data_unit_id=%02x,data_len=%d\n",data_unit_id,data_len); ! // if ((data_unit_id==0x02) || (data_unit_id==0x03)) { for (j=k;j<k+data_len;j++) { buf[j]=invtab[buf[j]]; --- 534,540 ---- data_unit_id=buf[k++]; data_len=buf[k++]; ! // if (data_len!=0x2c) { data_len=0x2c; } // fprintf(stdout,"data_unit_id=%02x,data_len=%d\n",data_unit_id,data_len); ! if ((data_unit_id==0x02) || (data_unit_id==0x03)) { for (j=k;j<k+data_len;j++) { buf[j]=invtab[buf[j]]; *************** *** 546,555 **** if (mag==0) mag=8; set_line(line,&buf[k+4],mag,the_page); ! // } k+=data_len; } - } else { - fprintf(stderr,"This is not a private data type 1 stream - are you sure you specified the correct PID? stream_id=%02x\n",stream_id); - exit(1); } return(0); --- 546,552 ---- if (mag==0) mag=8; set_line(line,&buf[k+4],mag,the_page); ! } k+=data_len; } } return(0); |
|
From: <lin...@us...> - 2004-10-23 08:15:10
|
Update of /cvsroot/dvbtools/dvbsubs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24154 Modified Files: dvbtextsubs.c Log Message: Add (undocumented) -a option to dump teletext page numbers Index: dvbtextsubs.c =================================================================== RCS file: /cvsroot/dvbtools/dvbsubs/dvbtextsubs.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** dvbtextsubs.c 9 Jul 2004 09:17:47 -0000 1.14 --- dvbtextsubs.c 23 Oct 2004 08:14:52 -0000 1.15 *************** *** 76,79 **** --- 76,80 ---- int debug=0; + int analyse=0; int no_pts_warning=0; int keeppts=0; *************** *** 418,422 **** // fprintf(stderr,"the_page=%04x\n",the_page); // fprintf(stdout,"In set_line - mag=%d, line=%d!\n",mag,line); ! // if (line==0) { fprintf(stderr,"mag=%d, page=%02x\n",mag,unham(data[0],data[1])); } if (mag!=((the_page&0x0f00)>>8)) { return; --- 419,423 ---- // fprintf(stderr,"the_page=%04x\n",the_page); // fprintf(stdout,"In set_line - mag=%d, line=%d!\n",mag,line); ! if ((analyse) && (line==0) && (unham(data[0],data[1])!=0xff)) { fprintf(stderr,"mag=%d, page=%02x\n",mag,unham(data[0],data[1])); } if (mag!=((the_page&0x0f00)>>8)) { return; *************** *** 591,594 **** --- 592,597 ---- if (strcmp(argv[i],"-d")==0) { debug=1; + } else if (strcmp(argv[i],"-a")==0) { + analyse=1; } else if (strcmp(argv[i],"-vdr")==0) { pes_format=1; |
|
From: <ni...@us...> - 2004-08-26 20:18:33
|
Update of /cvsroot/dvbtools/dvbstream In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20651/dvbstream Modified Files: dvb_defaults.h Log Message: better use macros than numbers Index: dvb_defaults.h =================================================================== RCS file: /cvsroot/dvbtools/dvbstream/dvb_defaults.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dvb_defaults.h 6 Jul 2002 08:43:12 -0000 1.3 --- dvb_defaults.h 26 Aug 2004 20:18:22 -0000 1.4 *************** *** 98,102 **** #if HIERARCHY_DEFAULT == HIERARCHY_NONE && !defined (LP_CODERATE_DEFAULT) ! #define LP_CODERATE_DEFAULT (0) /* unused if HIERARCHY_NONE */ #endif --- 98,102 ---- #if HIERARCHY_DEFAULT == HIERARCHY_NONE && !defined (LP_CODERATE_DEFAULT) ! #define LP_CODERATE_DEFAULT (FEC_NONE) /* unused if HIERARCHY_NONE */ #endif |
|
From: <ni...@us...> - 2004-08-26 20:12:31
|
Update of /cvsroot/dvbtools/dvbstream In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19546/dvbstream Modified Files: dvbstream.c tune.c tune.h Log Message: added -crlp (coderate_lp) and -hy (hierarchy) parameters for dvb-t Index: dvbstream.c =================================================================== RCS file: /cvsroot/dvbtools/dvbstream/dvbstream.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** dvbstream.c 3 Jul 2004 11:01:21 -0000 1.22 --- dvbstream.c 26 Aug 2004 20:12:22 -0000 1.23 *************** *** 89,93 **** fe_bandwidth_t bandWidth=BANDWIDTH_DEFAULT; fe_guard_interval_t guardInterval=GUARD_INTERVAL_DEFAULT; ! fe_code_rate_t HP_CodeRate=HP_CODERATE_DEFAULT; unsigned char diseqc=0; char pol=0; --- 89,94 ---- fe_bandwidth_t bandWidth=BANDWIDTH_DEFAULT; fe_guard_interval_t guardInterval=GUARD_INTERVAL_DEFAULT; ! fe_code_rate_t HP_CodeRate=HP_CODERATE_DEFAULT, LP_CodeRate=LP_CODERATE_DEFAULT; ! fe_hierarchy_t hier=HIERARCHY_DEFAULT; unsigned char diseqc=0; char pol=0; *************** *** 310,314 **** srate=atoi(&cmd[i])*1000UL; fprintf(stderr,"Tuning to %ld,%ld,%c\n",freq,srate,pol); ! tune_it(fd_frontend,freq,srate,pol,tone,specInv,diseqc,modulation,HP_CodeRate,TransmissionMode,guardInterval,bandWidth); } } --- 311,315 ---- srate=atoi(&cmd[i])*1000UL; fprintf(stderr,"Tuning to %ld,%ld,%c\n",freq,srate,pol); ! tune_it(fd_frontend,freq,srate,pol,tone,specInv,diseqc,modulation,HP_CodeRate,TransmissionMode,guardInterval,bandWidth, LP_CodeRate, hier); } } *************** *** 480,486 **** fprintf(stderr,"-qam X DVB-T modulation - 16%s, 32%s, 64%s, 128%s or 256%s\n",(CONSTELLATION_DEFAULT==QAM_16 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_32 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_64 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_128 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_256 ? " (default)" : "")); fprintf(stderr,"-gi N DVB-T guard interval 1_N (N=32%s, 16%s, 8%s or 4%s)\n",(GUARD_INTERVAL_DEFAULT==GUARD_INTERVAL_1_32 ? " (default)" : ""),(GUARD_INTERVAL_DEFAULT==GUARD_INTERVAL_1_16 ? " (default)" : ""),(GUARD_INTERVAL_DEFAULT==GUARD_INTERVAL_1_8 ? " (default)" : ""),(GUARD_INTERVAL_DEFAULT==GUARD_INTERVAL_1_4 ? " (default)" : "")); ! fprintf(stderr,"-cr N DVB-T code rate. N=AUTO%s, 1_2%s, 2_3%s, 3_4%s, 5_6%s, 7_8%s\n",(HP_CODERATE_DEFAULT==FEC_AUTO ? " (default)" : ""),(HP_CODERATE_DEFAULT==FEC_1_2 ? " (default)" : ""),(HP_CODERATE_DEFAULT==FEC_2_3 ? " (default)" : ""),(HP_CODERATE_DEFAULT==FEC_3_4 ? " (default)" : ""),(HP_CODERATE_DEFAULT==FEC_5_6 ? " (default)" : ""),(HP_CODERATE_DEFAULT==FEC_7_8 ? " (default)" : "")); fprintf(stderr,"-bw N DVB-T bandwidth (Mhz) - N=6%s, 7%s or 8%s\n",(BANDWIDTH_DEFAULT==BANDWIDTH_6_MHZ ? " (default)" : ""),(BANDWIDTH_DEFAULT==BANDWIDTH_7_MHZ ? " (default)" : ""),(BANDWIDTH_DEFAULT==BANDWIDTH_8_MHZ ? " (default)" : "")); fprintf(stderr,"-tm N DVB-T transmission mode - N=2%s or 8%s\n",(TRANSMISSION_MODE_DEFAULT==TRANSMISSION_MODE_2K ? " (default)" : ""),(TRANSMISSION_MODE_DEFAULT==TRANSMISSION_MODE_8K ? " (default)" : "")); fprintf(stderr,"\n-analyse Perform a simple analysis of the bitrates of the PIDs in the transport stream\n"); --- 481,489 ---- fprintf(stderr,"-qam X DVB-T modulation - 16%s, 32%s, 64%s, 128%s or 256%s\n",(CONSTELLATION_DEFAULT==QAM_16 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_32 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_64 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_128 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_256 ? " (default)" : "")); fprintf(stderr,"-gi N DVB-T guard interval 1_N (N=32%s, 16%s, 8%s or 4%s)\n",(GUARD_INTERVAL_DEFAULT==GUARD_INTERVAL_1_32 ? " (default)" : ""),(GUARD_INTERVAL_DEFAULT==GUARD_INTERVAL_1_16 ? " (default)" : ""),(GUARD_INTERVAL_DEFAULT==GUARD_INTERVAL_1_8 ? " (default)" : ""),(GUARD_INTERVAL_DEFAULT==GUARD_INTERVAL_1_4 ? " (default)" : "")); ! fprintf(stderr,"-cr N DVB-T/C code rate. N=AUTO%s, 1_2%s, 2_3%s, 3_4%s, 5_6%s, 7_8%s\n",(HP_CODERATE_DEFAULT==FEC_AUTO ? " (default)" : ""),(HP_CODERATE_DEFAULT==FEC_1_2 ? " (default)" : ""),(HP_CODERATE_DEFAULT==FEC_2_3 ? " (default)" : ""),(HP_CODERATE_DEFAULT==FEC_3_4 ? " (default)" : ""),(HP_CODERATE_DEFAULT==FEC_5_6 ? " (default)" : ""),(HP_CODERATE_DEFAULT==FEC_7_8 ? " (default)" : "")); ! fprintf(stderr,"-crlp N DVB-T code rate LP. N=AUTO%s, 1_2%s, 2_3%s, 3_4%s, 5_6%s, 7_8%s\n",(LP_CODERATE_DEFAULT==FEC_AUTO ? " (default)" : ""),(LP_CODERATE_DEFAULT==FEC_1_2 ? " (default)" : ""),(LP_CODERATE_DEFAULT==FEC_2_3 ? " (default)" : ""),(LP_CODERATE_DEFAULT==FEC_3_4 ? " (default)" : ""),(LP_CODERATE_DEFAULT==FEC_5_6 ? " (default)" : ""),(LP_CODERATE_DEFAULT==FEC_7_8 ? " (default)" : "")); fprintf(stderr,"-bw N DVB-T bandwidth (Mhz) - N=6%s, 7%s or 8%s\n",(BANDWIDTH_DEFAULT==BANDWIDTH_6_MHZ ? " (default)" : ""),(BANDWIDTH_DEFAULT==BANDWIDTH_7_MHZ ? " (default)" : ""),(BANDWIDTH_DEFAULT==BANDWIDTH_8_MHZ ? " (default)" : "")); fprintf(stderr,"-tm N DVB-T transmission mode - N=2%s or 8%s\n",(TRANSMISSION_MODE_DEFAULT==TRANSMISSION_MODE_2K ? " (default)" : ""),(TRANSMISSION_MODE_DEFAULT==TRANSMISSION_MODE_8K ? " (default)" : "")); + fprintf(stderr,"-hy N DVB-T hierarchy - N=1%s, 2%s, 4%s, NONE%s or AUTO%s\n",(HIERARCHY_DEFAULT==HIERARCHY_1 ? " (default)" : ""),(HIERARCHY_DEFAULT==HIERARCHY_2 ? " (default)" : ""),(HIERARCHY_DEFAULT==HIERARCHY_4 ? " (default)" : ""),(HIERARCHY_DEFAULT==HIERARCHY_NONE ? " (default)" : ""),(HIERARCHY_DEFAULT==HIERARCHY_AUTO ? " (default)" : "")); fprintf(stderr,"\n-analyse Perform a simple analysis of the bitrates of the PIDs in the transport stream\n"); *************** *** 623,626 **** --- 626,661 ---- exit(0); } + } else if (strcmp(argv[i],"-crlp")==0) { + i++; + if (!strcmp(argv[i],"AUTO")) { + LP_CodeRate=FEC_AUTO; + } else if (!strcmp(argv[i],"1_2")) { + LP_CodeRate=FEC_1_2; + } else if (!strcmp(argv[i],"2_3")) { + LP_CodeRate=FEC_2_3; + } else if (!strcmp(argv[i],"3_4")) { + LP_CodeRate=FEC_3_4; + } else if (!strcmp(argv[i],"5_6")) { + LP_CodeRate=FEC_5_6; + } else if (!strcmp(argv[i],"7_8")) { + LP_CodeRate=FEC_7_8; + } else { + fprintf(stderr,"Invalid Code Rate LP: %s\n",argv[i]); + exit(0); + } + } else if (strcmp(argv[i],"-hier")==0) { + i++; + if (!strcmp(argv[i],"AUTO")) { + hier=HIERARCHY_AUTO; + } else if (!strcmp(argv[i],"1")) { + hier=HIERARCHY_2; + } else if (!strcmp(argv[i],"4")) { + hier=HIERARCHY_4; + } else if (!strcmp(argv[i],"NONE")) { + hier=HIERARCHY_NONE; + } else { + fprintf(stderr,"Invalid HIERARCHY: %s\n",argv[i]); + exit(0); + } } else if (strcmp(argv[i],"-from")==0) { i++; *************** *** 724,733 **** if ( (freq>100000000)) { if (open_fe(&fd_frontend)) { ! i=tune_it(fd_frontend,freq,srate,0,tone,specInv,diseqc,modulation,HP_CodeRate,TransmissionMode,guardInterval,bandWidth); } } else if ((freq!=0) && (pol!=0) && (srate!=0)) { if (open_fe(&fd_frontend)) { fprintf(stderr,"Tuning to %ld Hz\n",freq); ! i=tune_it(fd_frontend,freq,srate,pol,tone,specInv,diseqc,modulation,HP_CodeRate,TransmissionMode,guardInterval,bandWidth); } } --- 759,768 ---- if ( (freq>100000000)) { if (open_fe(&fd_frontend)) { ! i=tune_it(fd_frontend,freq,srate,0,tone,specInv,diseqc,modulation,HP_CodeRate,TransmissionMode,guardInterval,bandWidth, LP_CodeRate, hier); } } else if ((freq!=0) && (pol!=0) && (srate!=0)) { if (open_fe(&fd_frontend)) { fprintf(stderr,"Tuning to %ld Hz\n",freq); ! i=tune_it(fd_frontend,freq,srate,pol,tone,specInv,diseqc,modulation,HP_CodeRate,TransmissionMode,guardInterval,bandWidth, LP_CodeRate, hier); } } Index: tune.c =================================================================== RCS file: /cvsroot/dvbtools/dvbstream/tune.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tune.c 27 Apr 2004 06:54:42 -0000 1.18 --- tune.c 26 Aug 2004 20:12:22 -0000 1.19 *************** *** 206,210 **** } ! int tune_it(int fd_frontend, unsigned int freq, unsigned int srate, char pol, int tone, fe_spectral_inversion_t specInv, unsigned char diseqc,fe_modulation_t modulation,fe_code_rate_t HP_CodeRate,fe_transmit_mode_t TransmissionMode,fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth) { int res, hi_lo, dfd; struct dvb_frontend_parameters feparams; --- 206,210 ---- } ! int tune_it(int fd_frontend, unsigned int freq, unsigned int srate, char pol, int tone, fe_spectral_inversion_t specInv, unsigned char diseqc,fe_modulation_t modulation,fe_code_rate_t HP_CodeRate,fe_transmit_mode_t TransmissionMode,fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth, fe_code_rate_t LP_CodeRate, fe_hierarchy_t hier) { int res, hi_lo, dfd; struct dvb_frontend_parameters feparams; *************** *** 225,233 **** feparams.u.ofdm.bandwidth=bandwidth; feparams.u.ofdm.code_rate_HP=HP_CodeRate; ! feparams.u.ofdm.code_rate_LP=LP_CODERATE_DEFAULT; feparams.u.ofdm.constellation=modulation; feparams.u.ofdm.transmission_mode=TransmissionMode; feparams.u.ofdm.guard_interval=guardInterval; ! feparams.u.ofdm.hierarchy_information=HIERARCHY_DEFAULT; fprintf(stderr,"tuning DVB-T (%s) to %d Hz, Bandwidth: %d\n",DVB_T_LOCATION,freq, bandwidth==BANDWIDTH_8_MHZ ? 8 : (bandwidth==BANDWIDTH_7_MHZ ? 7 : 6)); --- 225,233 ---- feparams.u.ofdm.bandwidth=bandwidth; feparams.u.ofdm.code_rate_HP=HP_CodeRate; ! feparams.u.ofdm.code_rate_LP=LP_CodeRate; feparams.u.ofdm.constellation=modulation; feparams.u.ofdm.transmission_mode=TransmissionMode; feparams.u.ofdm.guard_interval=guardInterval; ! feparams.u.ofdm.hierarchy_information=hier; fprintf(stderr,"tuning DVB-T (%s) to %d Hz, Bandwidth: %d\n",DVB_T_LOCATION,freq, bandwidth==BANDWIDTH_8_MHZ ? 8 : (bandwidth==BANDWIDTH_7_MHZ ? 7 : 6)); Index: tune.h =================================================================== RCS file: /cvsroot/dvbtools/dvbstream/tune.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tune.h 27 Apr 2004 06:54:42 -0000 1.8 --- tune.h 26 Aug 2004 20:12:22 -0000 1.9 *************** *** 6,10 **** #include "dvb_defaults.h" ! int tune_it(int fd_frontend, unsigned int freq, unsigned int srate, char pol, int tone, fe_spectral_inversion_t specInv, unsigned char diseqc,fe_modulation_t modulation,fe_code_rate_t HP_CodeRate,fe_transmit_mode_t TransmissionMode,fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth); #endif --- 6,10 ---- #include "dvb_defaults.h" ! int tune_it(int fd_frontend, unsigned int freq, unsigned int srate, char pol, int tone, fe_spectral_inversion_t specInv, unsigned char diseqc,fe_modulation_t modulation,fe_code_rate_t HP_CodeRate,fe_transmit_mode_t TransmissionMode,fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth, fe_code_rate_t LP_CodeRate, fe_hierarchy_t hier); #endif |
|
From: <lin...@us...> - 2004-07-09 09:17:57
|
Update of /cvsroot/dvbtools/dvbsubs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20891 Modified Files: dvbtextsubs.c Log Message: Replace call to bcmp with memcmp Index: dvbtextsubs.c =================================================================== RCS file: /cvsroot/dvbtools/dvbsubs/dvbtextsubs.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** dvbtextsubs.c 9 Jul 2004 08:05:24 -0000 1.13 --- dvbtextsubs.c 9 Jul 2004 09:17:47 -0000 1.14 *************** *** 438,442 **** fprintf(stdout,"Actual subtitle output:\n"); } ! i=bcmp(&thepage.pagebuf[40],&prevpage.pagebuf[40],24*40); if (debug) { fprintf(stdout,"Comparison of pages: %d\n",i); } if (i!=0) { --- 438,442 ---- fprintf(stdout,"Actual subtitle output:\n"); } ! i=memcmp(&thepage.pagebuf[40],&prevpage.pagebuf[40],24*40); if (debug) { fprintf(stdout,"Comparison of pages: %d\n",i); } if (i!=0) { |
|
From: <lin...@us...> - 2004-07-09 08:05:33
|
Update of /cvsroot/dvbtools/dvbsubs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7878 Modified Files: pes.c dvbtextsubs.c Log Message: Add WIN32 conditional code to aid compilation with lcc-win - thanks to Alexandre Ferrieux Index: pes.c =================================================================== RCS file: /cvsroot/dvbtools/dvbsubs/pes.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pes.c 5 Apr 2004 21:16:45 -0000 1.5 --- pes.c 9 Jul 2004 08:05:14 -0000 1.6 *************** *** 8,11 **** --- 8,15 ---- #include "pes.h" + #ifdef WIN32 + typedef int ssize_t; + #endif + extern uint64_t audio_pts,first_audio_pts; extern int audio_pts_wrap; Index: dvbtextsubs.c =================================================================== RCS file: /cvsroot/dvbtools/dvbsubs/dvbtextsubs.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** dvbtextsubs.c 9 Jul 2004 07:57:47 -0000 1.12 --- dvbtextsubs.c 9 Jul 2004 08:05:24 -0000 1.13 *************** *** 53,56 **** --- 53,57 ---- #include "pes.h" + #define PESBUFSIZE 1265536 #define VERSION "0.3" #define USAGE "\n\ *************** *** 556,560 **** int main(int argc, char** argv) { ! unsigned char pesbuf[1265536]; int pes_format=0; int PES_packet_length; --- 557,561 ---- int main(int argc, char** argv) { ! unsigned char* pesbuf; int pes_format=0; int PES_packet_length; *************** *** 566,569 **** --- 567,577 ---- is_first=0; + pesbuf=malloc(PESBUFSIZE); + if (!pesbuf) { + fprintf(stderr,"ERROR: Can not allocate memory for PES buffer, aborting.\n"); + fflush(stderr); + exit(1); + } + memset(prevpage.pagebuf,' ', 25*40); for (i=1;i<25;i++) { prevpage.line_transmitted[i]=0; } *************** *** 618,621 **** --- 626,634 ---- thepage.valid=0; + #ifdef WIN32 + // stupid idiot non-binary mode is default there + _setmode(_fileno(stdin),_O_BINARY); + #endif + if (subformat==SUBFORMAT_XML) { printf("<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n"); |
|
From: <lin...@us...> - 2004-07-09 07:57:59
|
Update of /cvsroot/dvbtools/dvbsubs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6356 Modified Files: dvbtextsubs.c Log Message: Remove unecessary includes - helps compilation under Windows Index: dvbtextsubs.c =================================================================== RCS file: /cvsroot/dvbtools/dvbsubs/dvbtextsubs.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** dvbtextsubs.c 5 Apr 2004 21:16:44 -0000 1.11 --- dvbtextsubs.c 9 Jul 2004 07:57:47 -0000 1.12 *************** *** 44,52 **** #include <string.h> #include <ctype.h> - #include <sys/ioctl.h> #include <fcntl.h> #include <unistd.h> #include <errno.h> - #include <sys/time.h> // dvbtext includes: --- 44,50 ---- |
|
From: <ni...@us...> - 2004-07-03 11:01:29
|
Update of /cvsroot/dvbtools/dvbstream In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20092 Modified Files: dvbstream.c Log Message: use RTP only if all other output types are discarded Index: dvbstream.c =================================================================== RCS file: /cvsroot/dvbtools/dvbstream/dvbstream.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** dvbstream.c 3 Jul 2004 10:44:33 -0000 1.21 --- dvbstream.c 3 Jul 2004 11:01:21 -0000 1.22 *************** *** 770,774 **** fprintf(stderr,"Output to stdout\n"); } ! else { ttl = 2; fprintf(stderr,"Using %s:%d:%d\n",ipOut,portOut,ttl); --- 770,774 ---- fprintf(stderr,"Output to stdout\n"); } ! else if(! map_cnt) { ttl = 2; fprintf(stderr,"Using %s:%d:%d\n",ipOut,portOut,ttl); *************** *** 907,911 **** close(socketIn); ! if (!to_stdout) close(socketOut); for (i=0;i<npids;i++) close(fd[i]); close(fd_dvr); --- 907,911 ---- close(socketIn); ! if (!to_stdout && !map_cnt) close(socketOut); for (i=0;i<npids;i++) close(fd[i]); close(fd_dvr); |
|
From: <ni...@us...> - 2004-07-03 10:44:41
|
Update of /cvsroot/dvbtools/dvbstream In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17812 Modified Files: dvbstream.c Log Message: documented -from and -to options Index: dvbstream.c =================================================================== RCS file: /cvsroot/dvbtools/dvbstream/dvbstream.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** dvbstream.c 27 Apr 2004 06:54:42 -0000 1.20 --- dvbstream.c 3 Jul 2004 10:44:33 -0000 1.21 *************** *** 462,465 **** --- 462,467 ---- fprintf(stderr,"-o:file.ts Stream to named file instead of network\n"); fprintf(stderr,"-n secs Stop after secs seconds\n"); + fprintf(stderr,"-from n Start saving the file previously specified with -o: syntax in n minutes time\n"); + fprintf(stderr,"-to n Stop saving the file previously specified with -o: syntax in n minutes time\n"); fprintf(stderr,"-ps Convert stream to Program Stream format (needs exactly 2 pids)\n"); fprintf(stderr,"-v vpid Decode video PID (full cards only)\n"); |
|
From: <lin...@us...> - 2004-06-18 21:57:53
|
Update of /cvsroot/dvbtools/dvbtext In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29769 Modified Files: dvbtext.c Log Message: Fix update to NEWSTRUCT Index: dvbtext.c =================================================================== RCS file: /cvsroot/dvbtools/dvbtext/dvbtext.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dvbtext.c 18 Jul 2003 07:05:09 -0000 1.2 --- dvbtext.c 18 Jun 2004 21:57:44 -0000 1.3 *************** *** 32,35 **** --- 32,37 ---- #include <stdio.h> #include <stdlib.h> + #include <stdint.h> + #include <string.h> #include <sys/ioctl.h> #include <fcntl.h> *************** *** 219,223 **** --- 221,229 ---- for (i=0;i<count;i++) { + #ifdef NEWSTRUCT + if((fd[i] = open("/dev/dvb/adapter0/demux0",O_RDWR)) < 0){ + #else if((fd[i] = open("/dev/ost/demux",O_RDWR)) < 0){ + #endif fprintf(stderr,"FD %i: ",i); perror("DEMUX DEVICE: "); *************** *** 226,230 **** --- 232,240 ---- } + #ifdef NEWSTRUCT + if((fd_dvr = open("/dev/dvb/adapter0/dvr0",O_RDONLY)) < 0){ + #else if((fd_dvr = open("/dev/ost/dvr",O_RDONLY)) < 0){ + #endif perror("DVR DEVICE: "); return -1; |
|
From: <ni...@us...> - 2004-04-27 06:54:51
|
Update of /cvsroot/dvbtools/dvbstream In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19510/dvbstream Modified Files: tune.h tune.c dvbstream.c Log Message: sync with dvbtune tuning code: do_diseqc() sends 1..4 command sequence xor A/B burst Index: tune.h =================================================================== RCS file: /cvsroot/dvbtools/dvbstream/tune.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tune.h 19 Mar 2004 16:53:56 -0000 1.7 --- tune.h 27 Apr 2004 06:54:42 -0000 1.8 *************** *** 6,10 **** #include "dvb_defaults.h" ! int tune_it(int fd_frontend, unsigned int freq, unsigned int srate, char pol, int tone, fe_spectral_inversion_t specInv, unsigned int diseqc,fe_modulation_t modulation,fe_code_rate_t HP_CodeRate,fe_transmit_mode_t TransmissionMode,fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth); #endif --- 6,10 ---- #include "dvb_defaults.h" ! int tune_it(int fd_frontend, unsigned int freq, unsigned int srate, char pol, int tone, fe_spectral_inversion_t specInv, unsigned char diseqc,fe_modulation_t modulation,fe_code_rate_t HP_CodeRate,fe_transmit_mode_t TransmissionMode,fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth); #endif Index: tune.c =================================================================== RCS file: /cvsroot/dvbtools/dvbstream/tune.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tune.c 19 Mar 2004 16:58:15 -0000 1.17 --- tune.c 27 Apr 2004 06:54:42 -0000 1.18 *************** *** 54,58 **** static int diseqc_send_msg(int fd, fe_sec_voltage_t v, struct diseqc_cmd *cmd, ! fe_sec_tone_mode_t t, fe_sec_mini_cmd_t b) { if(ioctl(fd, FE_SET_TONE, SEC_TONE_OFF) < 0) --- 54,58 ---- static int diseqc_send_msg(int fd, fe_sec_voltage_t v, struct diseqc_cmd *cmd, ! fe_sec_tone_mode_t t, unsigned char sat_no) { if(ioctl(fd, FE_SET_TONE, SEC_TONE_OFF) < 0) *************** *** 61,71 **** return -1; usleep(15 * 1000); ! if(ioctl(fd, FE_DISEQC_SEND_MASTER_CMD, &cmd->cmd) < 0) return -1; ! usleep(cmd->wait * 1000); ! usleep(15 * 1000); ! if(ioctl(fd, FE_DISEQC_SEND_BURST, b) < 0) return -1; ! usleep(15 * 1000); if(ioctl(fd, FE_SET_TONE, t) < 0) return -1; --- 61,78 ---- return -1; usleep(15 * 1000); ! if(sat_no >= 1 && sat_no <= 4) //1.x compatible equipment ! { ! if(ioctl(fd, FE_DISEQC_SEND_MASTER_CMD, &cmd->cmd) < 0) return -1; ! usleep(cmd->wait * 1000); ! usleep(15 * 1000); ! } ! else //A or B simple diseqc ! { ! fprintf(stderr, "SETTING SIMPLE %c BURST\n", sat_no); ! if(ioctl(fd, FE_DISEQC_SEND_BURST, (sat_no == 'B' ? SEC_MINI_B : SEC_MINI_A)) < 0) return -1; ! usleep(15 * 1000); ! } if(ioctl(fd, FE_SET_TONE, t) < 0) return -1; *************** *** 78,94 **** */ ! static int do_diseqc(int secfd, int sat_no, int polv, int hi_lo) { ! struct diseqc_cmd cmd = { {{0xe0, 0x10, 0x38, 0xf0, 0x00, 0x00}, 4}, 0 }; ! /* param: high nibble: reset bits, low nibble set bits, ! * bits are: option, position, polarizaion, band ! */ ! cmd.cmd.msg[3] = ! 0xf0 | (((sat_no * 4) & 0x0f) | (hi_lo ? 1 : 0) | (polv ? 0 : 2)); ! return diseqc_send_msg(secfd, polv ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18, ! &cmd, hi_lo ? SEC_TONE_ON : SEC_TONE_OFF, ! (sat_no / 4) % 2 ? SEC_MINI_B : SEC_MINI_A); } --- 85,125 ---- */ ! static int do_diseqc(int fd, unsigned char sat_no, int polv, int hi_lo) { ! struct diseqc_cmd cmd = { {{0xe0, 0x10, 0x38, 0xf0, 0x00, 0x00}, 4}, 0 }; ! if(sat_no != 0) ! { ! unsigned char d = sat_no; ! /* param: high nibble: reset bits, low nibble set bits, ! * bits are: option, position, polarizaion, band ! */ ! sat_no--; ! cmd.cmd.msg[3] = ! 0xf0 | (((sat_no * 4) & 0x0f) | (polv ? 0 : 2) | (hi_lo ? 1 : 0)); ! ! return diseqc_send_msg(fd, ! polv ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18, ! &cmd, ! hi_lo ? SEC_TONE_ON : SEC_TONE_OFF, ! d); ! } ! else //only tone and voltage ! { ! fe_sec_voltage_t voltage; ! ! fprintf(stderr, "Setting only tone %s and voltage %dV\n", (hi_lo ? "ON" : "OFF"), (polv ? 13 : 18)); ! ! if(ioctl(fd, FE_SET_VOLTAGE, (polv ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18)) < 0) ! return -1; ! ! if(ioctl(fd, FE_SET_TONE, (hi_lo ? SEC_TONE_ON : SEC_TONE_OFF)) < 0) ! return -1; ! ! usleep(15 * 1000); ! ! return 0; ! } } *************** *** 175,179 **** } ! int tune_it(int fd_frontend, unsigned int freq, unsigned int srate, char pol, int tone, fe_spectral_inversion_t specInv, unsigned int diseqc,fe_modulation_t modulation,fe_code_rate_t HP_CodeRate,fe_transmit_mode_t TransmissionMode,fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth) { int res, hi_lo, dfd; struct dvb_frontend_parameters feparams; --- 206,210 ---- } ! int tune_it(int fd_frontend, unsigned int freq, unsigned int srate, char pol, int tone, fe_spectral_inversion_t specInv, unsigned char diseqc,fe_modulation_t modulation,fe_code_rate_t HP_CodeRate,fe_transmit_mode_t TransmissionMode,fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth) { int res, hi_lo, dfd; struct dvb_frontend_parameters feparams; *************** *** 199,203 **** feparams.u.ofdm.guard_interval=guardInterval; feparams.u.ofdm.hierarchy_information=HIERARCHY_DEFAULT; ! fprintf(stderr,"tuning DVB-T (%s) to %d Hz, Bandwidth: %d\n",DVB_T_LOCATION,freq, bandwidth); break; case FE_QPSK: --- 230,235 ---- feparams.u.ofdm.guard_interval=guardInterval; feparams.u.ofdm.hierarchy_information=HIERARCHY_DEFAULT; ! fprintf(stderr,"tuning DVB-T (%s) to %d Hz, Bandwidth: %d\n",DVB_T_LOCATION,freq, ! bandwidth==BANDWIDTH_8_MHZ ? 8 : (bandwidth==BANDWIDTH_7_MHZ ? 7 : 6)); break; case FE_QPSK: Index: dvbstream.c =================================================================== RCS file: /cvsroot/dvbtools/dvbstream/dvbstream.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** dvbstream.c 19 Mar 2004 16:53:56 -0000 1.19 --- dvbstream.c 27 Apr 2004 06:54:42 -0000 1.20 *************** *** 90,98 **** fe_guard_interval_t guardInterval=GUARD_INTERVAL_DEFAULT; fe_code_rate_t HP_CodeRate=HP_CODERATE_DEFAULT; ! unsigned int diseqc=0; char pol=0; int open_fe(int* fd_frontend) { - if((*fd_frontend = open(frontenddev[card],O_RDWR | O_NONBLOCK)) < 0){ perror("FRONTEND DEVICE: "); --- 90,97 ---- fe_guard_interval_t guardInterval=GUARD_INTERVAL_DEFAULT; fe_code_rate_t HP_CodeRate=HP_CODERATE_DEFAULT; ! unsigned char diseqc=0; char pol=0; int open_fe(int* fd_frontend) { if((*fd_frontend = open(frontenddev[card],O_RDWR | O_NONBLOCK)) < 0){ perror("FRONTEND DEVICE: "); *************** *** 475,479 **** fprintf(stderr,"\nAdvanced tuning options:\n\n"); fprintf(stderr,"-c [0-3] Use DVB card #[0-3]\n"); ! fprintf(stderr,"-D [0-4] DiSEqC command (0=none)\n\n"); fprintf(stderr,"-I [0|1|2] 0=Spectrum Inversion off, 1=Spectrum Inversion on, 2=auto\n"); fprintf(stderr,"-qam X DVB-T modulation - 16%s, 32%s, 64%s, 128%s or 256%s\n",(CONSTELLATION_DEFAULT==QAM_16 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_32 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_64 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_128 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_256 ? " (default)" : "")); --- 474,478 ---- fprintf(stderr,"\nAdvanced tuning options:\n\n"); fprintf(stderr,"-c [0-3] Use DVB card #[0-3]\n"); ! fprintf(stderr,"-D [0-4AB] DiSEqC command (0=none)\n\n"); fprintf(stderr,"-I [0|1|2] 0=Spectrum Inversion off, 1=Spectrum Inversion on, 2=auto\n"); fprintf(stderr,"-qam X DVB-T modulation - 16%s, 32%s, 64%s, 128%s or 256%s\n",(CONSTELLATION_DEFAULT==QAM_16 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_32 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_64 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_128 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_256 ? " (default)" : "")); *************** *** 524,530 **** { i++; ! diseqc=atoi(argv[i]); ! if(diseqc < 1 || diseqc > 4) diseqc = 1; ! diseqc--; } else if (strcmp(argv[i],"-I")==0) { i++; --- 523,538 ---- { i++; ! diseqc = argv[i][0]; ! if(toupper(diseqc) == 'A') ! diseqc = 'A'; ! else if(toupper(diseqc) == 'B') ! diseqc = 'B'; ! else if(diseqc >= '0' && diseqc <= '4') { ! diseqc=diseqc - '0'; ! } ! else { ! fprintf(stderr,"DiSEqC must be between 0 and 4 or A | B\n"); ! exit(-1); ! } } else if (strcmp(argv[i],"-I")==0) { i++; |
|
From: <lin...@us...> - 2004-04-05 21:29:40
|
Update of /cvsroot/dvbtools/dvbsubs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18037 Modified Files: dvbsubs.c dvbtextsubs.c pes.c Log Message: Attempt to deal with PTS wrapping from 0x1ffffffff to 0x000000000 Index: dvbsubs.c =================================================================== RCS file: /cvsroot/dvbtools/dvbsubs/dvbsubs.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** dvbsubs.c 22 Mar 2004 20:53:37 -0000 1.18 --- dvbsubs.c 5 Apr 2004 21:16:43 -0000 1.19 *************** *** 66,69 **** --- 66,70 ---- uint64_t video_pts,first_video_pts,audio_pts,first_audio_pts; + int audio_pts_wrap=0; void init_data() { *************** *** 507,510 **** --- 508,512 ---- fprintf(stderr,"PNG: displaying region %d at %d,%d width=%d,height=%d\n",r,page.regions[r].x,page.regions[r].y,regions[r].width,regions[r].height); out_y=page.regions[r].y*720; + for (v=0;v<16;v++) { fprintf(stderr,"Colour %c=dave r=%d, g=%d, b=%d\n",'0'+v,colours[regions[r].CLUT_id*48+v*3+0],colours[regions[r].CLUT_id*48+v*3+1],colours[regions[r].CLUT_id*48+v*3+2]); } for (y=0;y<regions[r].height;y++) { for (x=0;x<regions[r].width;x++) { *************** *** 512,516 **** --- 514,520 ---- if (v>0) { found=1; } bitmap.buffer[out_y+x+page.regions[r].x]=v+16*regions[r].CLUT_id; + fprintf(stderr,"%c",'.'+bitmap.buffer[out_y+x+page.regions[r].x]); } + fprintf(stderr,"\n"); out_y+=720; } *************** *** 575,579 **** // fprintf(stderr,"READ PES PACKET: length=%d\n",PES_packet_length); while (PES_packet_length >= 0) { ! PTS=get_pes_pts(buf); if (first_PTS==0) { first_PTS=PTS; } --- 579,583 ---- // fprintf(stderr,"READ PES PACKET: length=%d\n",PES_packet_length); while (PES_packet_length >= 0) { ! PTS=get_pes_pts(buf)/90; if (first_PTS==0) { first_PTS=PTS; } Index: dvbtextsubs.c =================================================================== RCS file: /cvsroot/dvbtools/dvbsubs/dvbtextsubs.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** dvbtextsubs.c 8 Mar 2004 22:20:32 -0000 1.10 --- dvbtextsubs.c 5 Apr 2004 21:16:44 -0000 1.11 *************** *** 111,116 **** --- 111,119 ---- uint64_t audio_pts=0; uint64_t first_audio_pts=0; + int audio_pts_wrap=0; + int pts_wrap=0; uint64_t FIRST_PTS=0; int sub_count=0; + int prev_PTS=0; typedef struct { *************** *** 506,510 **** PTS=p0|(p1<<8)|(p2<<16)|(p3<<24)|(p4<<32); ! PTS=PTS/90; if (FIRST_PTS==0) { FIRST_PTS=PTS-USER_PTS; } } else { --- 509,518 ---- PTS=p0|(p1<<8)|(p2<<16)|(p3<<24)|(p4<<32); ! if ((prev_PTS > (uint64_t)0x1ffff0000LL) && (PTS < (uint64_t)0x000100000LL)) { ! pts_wrap=1; ! } ! if (pts_wrap) { PTS+=0x200000000LL; } ! prev_PTS=PTS; ! if (FIRST_PTS==0) { FIRST_PTS=PTS-USER_PTS; } } else { *************** *** 551,555 **** int main(int argc, char** argv) { unsigned char pesbuf[1265536]; - uint64_t tmp_pts; int pes_format=0; int PES_packet_length; --- 559,562 ---- *************** *** 620,625 **** while ((PES_packet_length=read_pes_packet(0,the_pid,pesbuf,pes_format)) > 0) { - tmp_pts=get_pes_pts(pesbuf); - process_pes_packet(pesbuf,PES_packet_length+6,the_page); } --- 627,630 ---- Index: pes.c =================================================================== RCS file: /cvsroot/dvbtools/dvbsubs/pes.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pes.c 8 Mar 2004 21:12:58 -0000 1.4 --- pes.c 5 Apr 2004 21:16:45 -0000 1.5 *************** *** 9,12 **** --- 9,13 ---- extern uint64_t audio_pts,first_audio_pts; + extern int audio_pts_wrap; extern uint16_t apid; *************** *** 22,25 **** --- 23,27 ---- int h,m,s,u; + pts/=90; // Convert to milliseconds h=(pts/(1000*60*60)); m=(pts/(1000*60))-(h*60); *************** *** 46,50 **** PTS=p0|(p1<<8)|(p2<<16)|(p3<<24)|(p4<<32); - PTS=PTS/90; } else { PTS=0; --- 48,51 ---- *************** *** 81,85 **** } else if (stream_id==0xc0) { tmp_pts=get_pes_pts(buf); ! //fprintf(stdout,"stream_id=%02x, PTS=%lld ms\n",stream_id,tmp_pts); if (tmp_pts > audio_pts) { audio_pts=tmp_pts; } if ((first_audio_pts==0) || ((tmp_pts!=0) && (tmp_pts < first_audio_pts))) { first_audio_pts=tmp_pts; } --- 82,91 ---- } else if (stream_id==0xc0) { tmp_pts=get_pes_pts(buf); ! if (tmp_pts != 0) { ! if ((audio_pts > (uint64_t)0x1ffff0000LL) && (tmp_pts < (uint64_t)0x000100000LL)) { ! audio_pts_wrap=1; ! } ! if (audio_pts_wrap) { tmp_pts+=0x200000000LL; } ! } if (tmp_pts > audio_pts) { audio_pts=tmp_pts; } if ((first_audio_pts==0) || ((tmp_pts!=0) && (tmp_pts < first_audio_pts))) { first_audio_pts=tmp_pts; } *************** *** 144,149 **** } if (apid==packet_pid) { ! tmp_pts=get_pes_pts(&tsbuf[i]); ! // fprintf(stderr,"Found Audio stream, PID=%d, PTS=%s\n",packet_pid,pts2hmsu(last_tmp_pts,'.')); if (tmp_pts > audio_pts) { audio_pts=tmp_pts; } if ((first_audio_pts==0) || ((tmp_pts!=0) && (tmp_pts < first_audio_pts))) { first_audio_pts=tmp_pts; } --- 150,160 ---- } if (apid==packet_pid) { ! tmp_pts=get_pes_pts(buf); ! if (tmp_pts != 0) { ! if ((audio_pts > (uint64_t)0x1ffff0000LL) && (tmp_pts < (uint64_t)0x000100000LL)) { ! audio_pts_wrap=1; ! } ! if (audio_pts_wrap) { tmp_pts+=0x200000000LL; } ! } if (tmp_pts > audio_pts) { audio_pts=tmp_pts; } if ((first_audio_pts==0) || ((tmp_pts!=0) && (tmp_pts < first_audio_pts))) { first_audio_pts=tmp_pts; } |
|
From: <ni...@us...> - 2004-04-04 08:53:38
|
Update of /cvsroot/dvbtools/dvbtune In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14669/dvbtune Modified Files: tune.c Log Message: fixed wrong reporting of bandwidth Index: tune.c =================================================================== RCS file: /cvsroot/dvbtools/dvbtune/tune.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** tune.c 1 Apr 2004 19:39:29 -0000 1.25 --- tune.c 4 Apr 2004 08:41:03 -0000 1.26 *************** *** 230,234 **** feparams.u.ofdm.guard_interval=guardInterval; feparams.u.ofdm.hierarchy_information=HIERARCHY_DEFAULT; ! fprintf(stderr,"tuning DVB-T (%s) to %d Hz, Bandwidth: %d\n",DVB_T_LOCATION,freq, bandwidth); break; case FE_QPSK: --- 230,235 ---- feparams.u.ofdm.guard_interval=guardInterval; feparams.u.ofdm.hierarchy_information=HIERARCHY_DEFAULT; ! fprintf(stderr,"tuning DVB-T (%s) to %d Hz, Bandwidth: %d\n",DVB_T_LOCATION,freq, ! bandwidth==BANDWIDTH_8_MHZ ? 8 : (bandwidth==BANDWIDTH_7_MHZ ? 7 : 6)); break; case FE_QPSK: |
|
From: <lin...@us...> - 2004-04-01 19:59:44
|
Update of /cvsroot/dvbtools/dvbtune In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26532 Modified Files: si.c Log Message: Bug fix for parsing of canal_radio descriptors Index: si.c =================================================================== RCS file: /cvsroot/dvbtools/dvbtune/si.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** si.c 25 Mar 2004 00:16:37 -0000 1.1 --- si.c 1 Apr 2004 19:47:44 -0000 1.2 *************** *** 328,333 **** /* This is guessed from the data */ printf("<canal_radio tag=\"0x%02x\" id=\"%d\" name=\"",descriptor_tag,buf[i]); ! i++; ! for (j=0;j<descriptor_length;j++) if (buf[i+j]!=0) printf("%c",buf[i+j]); printf("\" />\n"); --- 328,332 ---- /* This is guessed from the data */ printf("<canal_radio tag=\"0x%02x\" id=\"%d\" name=\"",descriptor_tag,buf[i]); ! for (j=1;j<descriptor_length;j++) if (buf[i+j]!=0) printf("%c",buf[i+j]); printf("\" />\n"); |
|
From: <ni...@us...> - 2004-04-01 19:51:31
|
Update of /cvsroot/dvbtools/dvbtune In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24846/dvbtune Modified Files: tune.c tune.h dvbtune.c Log Message: Added workaround against buggy? Diseqc switches that don't ignore tone bursts after a Diseqc sequence; changed -D to 1..4/A/B; removed -tone parameter Index: tune.c =================================================================== RCS file: /cvsroot/dvbtools/dvbtune/tune.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** tune.c 19 Mar 2004 16:55:34 -0000 1.24 --- tune.c 1 Apr 2004 19:39:29 -0000 1.25 *************** *** 54,58 **** static int diseqc_send_msg(int fd, fe_sec_voltage_t v, struct diseqc_cmd *cmd, ! fe_sec_tone_mode_t t, fe_sec_mini_cmd_t b) { if(ioctl(fd, FE_SET_TONE, SEC_TONE_OFF) < 0) --- 54,58 ---- static int diseqc_send_msg(int fd, fe_sec_voltage_t v, struct diseqc_cmd *cmd, ! fe_sec_tone_mode_t t, unsigned char sat_no) { if(ioctl(fd, FE_SET_TONE, SEC_TONE_OFF) < 0) *************** *** 61,71 **** return -1; usleep(15 * 1000); ! if(ioctl(fd, FE_DISEQC_SEND_MASTER_CMD, &cmd->cmd) < 0) return -1; ! usleep(cmd->wait * 1000); ! usleep(15 * 1000); ! if(ioctl(fd, FE_DISEQC_SEND_BURST, b) < 0) return -1; ! usleep(15 * 1000); if(ioctl(fd, FE_SET_TONE, t) < 0) return -1; --- 61,78 ---- return -1; usleep(15 * 1000); ! if(sat_no >= 1 && sat_no <= 4) //1.x compatible equipment ! { ! if(ioctl(fd, FE_DISEQC_SEND_MASTER_CMD, &cmd->cmd) < 0) return -1; ! usleep(cmd->wait * 1000); ! usleep(15 * 1000); ! } ! else //A or B simple diseqc ! { ! fprintf(stderr, "SETTING SIMPLE %c BURST\n", sat_no); ! if(ioctl(fd, FE_DISEQC_SEND_BURST, (sat_no == 'B' ? SEC_MINI_B : SEC_MINI_A)) < 0) return -1; ! usleep(15 * 1000); ! } if(ioctl(fd, FE_SET_TONE, t) < 0) return -1; *************** *** 78,94 **** */ ! static int do_diseqc(int secfd, int sat_no, int polv, int hi_lo) { ! struct diseqc_cmd cmd = { {{0xe0, 0x10, 0x38, 0xf0, 0x00, 0x00}, 4}, 0 }; ! /* param: high nibble: reset bits, low nibble set bits, ! * bits are: option, position, polarizaion, band ! */ ! cmd.cmd.msg[3] = ! 0xf0 | (((sat_no * 4) & 0x0f) | (hi_lo ? 1 : 0) | (polv ? 0 : 2)); ! return diseqc_send_msg(secfd, polv ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18, ! &cmd, hi_lo ? SEC_TONE_ON : SEC_TONE_OFF, ! (sat_no / 4) % 2 ? SEC_MINI_B : SEC_MINI_A); } --- 85,125 ---- */ ! static int do_diseqc(int fd, unsigned char sat_no, int polv, int hi_lo) { ! struct diseqc_cmd cmd = { {{0xe0, 0x10, 0x38, 0xf0, 0x00, 0x00}, 4}, 0 }; ! if(sat_no != 0) ! { ! unsigned char d = sat_no; ! /* param: high nibble: reset bits, low nibble set bits, ! * bits are: option, position, polarizaion, band ! */ ! sat_no--; ! cmd.cmd.msg[3] = ! 0xf0 | (((sat_no * 4) & 0x0f) | (polv ? 0 : 2) | (hi_lo ? 1 : 0)); ! ! return diseqc_send_msg(fd, ! polv ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18, ! &cmd, ! hi_lo ? SEC_TONE_ON : SEC_TONE_OFF, ! d); ! } ! else //only tone and voltage ! { ! fe_sec_voltage_t voltage; ! ! fprintf(stderr, "Setting only tone %s and voltage %dV\n", (hi_lo ? "ON" : "OFF"), (polv ? 13 : 18)); ! ! if(ioctl(fd, FE_SET_VOLTAGE, (polv ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18)) < 0) ! return -1; ! ! if(ioctl(fd, FE_SET_TONE, (hi_lo ? SEC_TONE_ON : SEC_TONE_OFF)) < 0) ! return -1; ! ! usleep(15 * 1000); ! ! return 0; ! } } *************** *** 175,179 **** } ! int tune_it(int fd_frontend, unsigned int freq, unsigned int srate, char pol, int tone, fe_spectral_inversion_t specInv, unsigned int diseqc,fe_modulation_t modulation,fe_code_rate_t HP_CodeRate,fe_transmit_mode_t TransmissionMode,fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth) { int res, hi_lo, dfd; struct dvb_frontend_parameters feparams; --- 206,210 ---- } ! int tune_it(int fd_frontend, unsigned int freq, unsigned int srate, char pol, int tone, fe_spectral_inversion_t specInv, unsigned char diseqc,fe_modulation_t modulation,fe_code_rate_t HP_CodeRate,fe_transmit_mode_t TransmissionMode,fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth) { int res, hi_lo, dfd; struct dvb_frontend_parameters feparams; Index: tune.h =================================================================== RCS file: /cvsroot/dvbtools/dvbtune/tune.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tune.h 19 Mar 2004 16:51:14 -0000 1.8 --- tune.h 1 Apr 2004 19:39:29 -0000 1.9 *************** *** 6,10 **** #include "dvb_defaults.h" ! int tune_it(int fd_frontend, unsigned int freq, unsigned int srate, char pol, int tone, fe_spectral_inversion_t specInv, unsigned int diseqc,fe_modulation_t modulation,fe_code_rate_t HP_CodeRate,fe_transmit_mode_t TransmissionMode,fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth); #endif --- 6,10 ---- #include "dvb_defaults.h" ! int tune_it(int fd_frontend, unsigned int freq, unsigned int srate, char pol, int tone, fe_spectral_inversion_t specInv, unsigned char diseqc,fe_modulation_t modulation,fe_code_rate_t HP_CodeRate,fe_transmit_mode_t TransmissionMode,fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth); #endif Index: dvbtune.c =================================================================== RCS file: /cvsroot/dvbtools/dvbtune/dvbtune.c,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** dvbtune.c 27 Mar 2004 13:51:51 -0000 1.29 --- dvbtune.c 1 Apr 2004 19:39:29 -0000 1.30 *************** *** 675,679 **** char pol=0; unsigned int srate=0; ! unsigned int diseqc = 0; int ttpid=0; int dpid=0; --- 675,679 ---- char pol=0; unsigned int srate=0; ! unsigned char diseqc = 0; int ttpid=0; int dpid=0; *************** *** 704,710 **** fprintf(stderr,"\nAdvanced tuning options:\n\n"); fprintf(stderr,"-c [0-3] Use DVB card #[0-3]\n"); - fprintf(stderr,"-tone [0|1] 0=22kHz off, 1=22kHz on\n"); fprintf(stderr,"-I [0|1|2] 0=Spectrum Inversion off, 1=Spectrum Inversion on, 2=auto\n"); ! fprintf(stderr,"-D [1-4] DiSEqC command\n\n"); fprintf(stderr,"-qam X DVB-T modulation - 16%s, 32%s, 64%s, 128%s or 256%s\n",(CONSTELLATION_DEFAULT==QAM_16 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_32 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_64 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_128 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_256 ? " (default)" : "")); fprintf(stderr,"-gi N DVB-T guard interval 1_N (N=32%s, 16%s, 8%s or 4%s)\n",(GUARD_INTERVAL_DEFAULT==GUARD_INTERVAL_1_32 ? " (default)" : ""),(GUARD_INTERVAL_DEFAULT==GUARD_INTERVAL_1_16 ? " (default)" : ""),(GUARD_INTERVAL_DEFAULT==GUARD_INTERVAL_1_8 ? " (default)" : ""),(GUARD_INTERVAL_DEFAULT==GUARD_INTERVAL_1_4 ? " (default)" : "")); --- 704,709 ---- fprintf(stderr,"\nAdvanced tuning options:\n\n"); fprintf(stderr,"-c [0-3] Use DVB card #[0-3]\n"); fprintf(stderr,"-I [0|1|2] 0=Spectrum Inversion off, 1=Spectrum Inversion on, 2=auto\n"); ! fprintf(stderr,"-D [1-4AB] DiSEqC command\n\n"); fprintf(stderr,"-qam X DVB-T modulation - 16%s, 32%s, 64%s, 128%s or 256%s\n",(CONSTELLATION_DEFAULT==QAM_16 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_32 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_64 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_128 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_256 ? " (default)" : "")); fprintf(stderr,"-gi N DVB-T guard interval 1_N (N=32%s, 16%s, 8%s or 4%s)\n",(GUARD_INTERVAL_DEFAULT==GUARD_INTERVAL_1_32 ? " (default)" : ""),(GUARD_INTERVAL_DEFAULT==GUARD_INTERVAL_1_16 ? " (default)" : ""),(GUARD_INTERVAL_DEFAULT==GUARD_INTERVAL_1_8 ? " (default)" : ""),(GUARD_INTERVAL_DEFAULT==GUARD_INTERVAL_1_4 ? " (default)" : "")); *************** *** 831,846 **** } else if (strcmp(argv[i],"-D")==0) { i++; ! diseqc=atoi(argv[i]); ! if ((diseqc < 1) || (diseqc > 4)) { ! fprintf(stderr,"DiSEqC must be between 1 and 4\n"); ! exit(-1); ! } ! diseqc--; ! } else if (strcmp(argv[i],"-tone")==0) { ! i++; ! if (atoi(argv[i])==0) ! tone = SEC_TONE_OFF; ! else ! tone = SEC_TONE_ON; } else if (strcmp(argv[i],"-I")==0) { i++; --- 830,845 ---- } else if (strcmp(argv[i],"-D")==0) { i++; ! diseqc = argv[i][0]; ! if(toupper(diseqc) == 'A') ! diseqc = 'A'; ! else if(toupper(diseqc) == 'B') ! diseqc = 'B'; ! else if(diseqc >= '1' && diseqc <= '4') { ! diseqc=diseqc - '0'; ! } ! else { ! fprintf(stderr,"DiSEqC must be between 0 and 4 or A | B\n"); ! exit(-1); ! } } else if (strcmp(argv[i],"-I")==0) { i++; |
|
From: <ni...@us...> - 2004-03-27 14:03:01
|
Update of /cvsroot/dvbtools/dvbtune In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25365/dvbtune Modified Files: dvbtune.c Log Message: shift diseqc parameter in the right range: [0..3] Index: dvbtune.c =================================================================== RCS file: /cvsroot/dvbtools/dvbtune/dvbtune.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** dvbtune.c 25 Mar 2004 00:16:37 -0000 1.28 --- dvbtune.c 27 Mar 2004 13:51:51 -0000 1.29 *************** *** 692,696 **** fprintf(stderr,"Usage: dvbtune [OPTIONS]\n\n"); fprintf(stderr,"Standard options:\n\n"); ! fprintf(stderr,"-f freq absolute Frequency (DVB-S in Hz or DVB-T in Hz)\n"); fprintf(stderr," or L-band Frequency (DVB-S in Hz or DVB-T in Hz)\n"); fprintf(stderr,"-p [H,V] Polarity (DVB-S only)\n"); --- 692,696 ---- fprintf(stderr,"Usage: dvbtune [OPTIONS]\n\n"); fprintf(stderr,"Standard options:\n\n"); ! fprintf(stderr,"-f freq absolute Frequency (DVB-S in KHz or DVB-T in Hz)\n"); fprintf(stderr," or L-band Frequency (DVB-S in Hz or DVB-T in Hz)\n"); fprintf(stderr,"-p [H,V] Polarity (DVB-S only)\n"); *************** *** 706,710 **** fprintf(stderr,"-tone [0|1] 0=22kHz off, 1=22kHz on\n"); fprintf(stderr,"-I [0|1|2] 0=Spectrum Inversion off, 1=Spectrum Inversion on, 2=auto\n"); ! fprintf(stderr,"-D [0-4] DiSEqC command (0=none)\n\n"); fprintf(stderr,"-qam X DVB-T modulation - 16%s, 32%s, 64%s, 128%s or 256%s\n",(CONSTELLATION_DEFAULT==QAM_16 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_32 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_64 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_128 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_256 ? " (default)" : "")); fprintf(stderr,"-gi N DVB-T guard interval 1_N (N=32%s, 16%s, 8%s or 4%s)\n",(GUARD_INTERVAL_DEFAULT==GUARD_INTERVAL_1_32 ? " (default)" : ""),(GUARD_INTERVAL_DEFAULT==GUARD_INTERVAL_1_16 ? " (default)" : ""),(GUARD_INTERVAL_DEFAULT==GUARD_INTERVAL_1_8 ? " (default)" : ""),(GUARD_INTERVAL_DEFAULT==GUARD_INTERVAL_1_4 ? " (default)" : "")); --- 706,710 ---- fprintf(stderr,"-tone [0|1] 0=22kHz off, 1=22kHz on\n"); fprintf(stderr,"-I [0|1|2] 0=Spectrum Inversion off, 1=Spectrum Inversion on, 2=auto\n"); ! fprintf(stderr,"-D [1-4] DiSEqC command\n\n"); fprintf(stderr,"-qam X DVB-T modulation - 16%s, 32%s, 64%s, 128%s or 256%s\n",(CONSTELLATION_DEFAULT==QAM_16 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_32 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_64 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_128 ? " (default)" : ""),(CONSTELLATION_DEFAULT==QAM_256 ? " (default)" : "")); fprintf(stderr,"-gi N DVB-T guard interval 1_N (N=32%s, 16%s, 8%s or 4%s)\n",(GUARD_INTERVAL_DEFAULT==GUARD_INTERVAL_1_32 ? " (default)" : ""),(GUARD_INTERVAL_DEFAULT==GUARD_INTERVAL_1_16 ? " (default)" : ""),(GUARD_INTERVAL_DEFAULT==GUARD_INTERVAL_1_8 ? " (default)" : ""),(GUARD_INTERVAL_DEFAULT==GUARD_INTERVAL_1_4 ? " (default)" : "")); *************** *** 832,839 **** i++; diseqc=atoi(argv[i]); ! if (diseqc > 4) { ! fprintf(stderr,"DiSEqC must be between 0 and 4\n"); exit(-1); } } else if (strcmp(argv[i],"-tone")==0) { i++; --- 832,840 ---- i++; diseqc=atoi(argv[i]); ! if ((diseqc < 1) || (diseqc > 4)) { ! fprintf(stderr,"DiSEqC must be between 1 and 4\n"); exit(-1); } + diseqc--; } else if (strcmp(argv[i],"-tone")==0) { i++; |
|
From: <lin...@us...> - 2004-03-25 00:27:20
|
Update of /cvsroot/dvbtools/dvbtune In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12986 Modified Files: Makefile dvbtune.c Added Files: si.c si.h Log Message: Split SI descriptor parsing to separate files --- NEW FILE: si.c --- #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdint.h> #include <ctype.h> #include "si.h" char xmlify_result[10]; char* xmlify (char c) { switch(c) { case '&': strcpy(xmlify_result,"&"); break; case '<': strcpy(xmlify_result,"<"); break; case '>': strcpy(xmlify_result,">"); break; case '\"': strcpy(xmlify_result,"""); break; case 0: xmlify_result[0]=0; break; default: xmlify_result[0]=c; xmlify_result[1]=0; break; } return(xmlify_result); } /* Get the first unscanned transponder (or return NULL) */ transponder_t* get_unscanned(transponder_t* transponders) { transponder_t* t; t=transponders; while (t!=NULL) { if (t->scanned==0) { return(t); }; t=t->next; } return NULL; } void add_transponder(transponder_t* transponder,transponder_t** transponders) { transponder_t* t; int found; if (*transponders==NULL) { *transponders=(transponder_t*)malloc(sizeof(transponder_t)); (*transponders)->freq=transponder->freq; (*transponders)->srate=transponder->srate; (*transponders)->pol=transponder->pol; (*transponders)->pos=transponder->pos; (*transponders)->we_flag=transponder->we_flag; (*transponders)->mod=transponder->mod; (*transponders)->scanned=0; (*transponders)->next=NULL; } else { t=(*transponders); found=0; while ((!found) && (t!=NULL)) { /* Some transponders appear with slightly different frequencies - ignore a new transponder if it is within 3MHz of another */ if ((abs(t->freq-transponder->freq)<=3000) && (t->pol==transponder->pol)) { found=1; } else { t=t->next; } } if (!found) { t=(transponder_t*)malloc(sizeof(transponder_t)); t->freq=transponder->freq; t->srate=transponder->srate; t->pol=transponder->pol; t->pos=transponder->pos; t->we_flag=transponder->we_flag; t->mod=transponder->mod; t->scanned=0; t->next=(*transponders); (*transponders)=t; } } } void parse_descriptors(int info_len,unsigned char *buf, transponder_t* transponder, transponder_t** transponders) { int i=0; int descriptor_tag,descriptor_length,j,k,pid,id; int service_type; char tmp[128]; unsigned int freq, pol, sr; while (i < info_len) { descriptor_tag=buf[i++]; descriptor_length=buf[i++]; // printf("Found descriptor: 0x%02x - length %02d\n",descriptor_tag,descriptor_length); while (descriptor_length > 0) { switch(descriptor_tag) { case 0x03: // audio_stream_descriptor printf("<audio_info tag=\"0x03\" info=\"%02x\" />\n",buf[i]); i+=descriptor_length; descriptor_length=0; break; case 0x06: // data_stream_alignmentdescriptor printf("<data_stream_alignment tag=\"0x06\" data=\"%02x\" />\n",buf[i]); i+=descriptor_length; descriptor_length=0; break; case 0x0a: // iso_639_language_descriptor for (j=0;j<((descriptor_length)/4);j++) { printf("<iso_639 language=\""); if (buf[i]!=0) printf("%c",buf[i]); if (buf[i+1]!=0) printf("%c",buf[i+1]); if (buf[i+2]!=0) printf("%c",buf[i+2]); printf("\" type=\"%d\" />\n",buf[i+3]); i+=4; descriptor_length-=4; } break; case 0x0b: // system_clock_descriptor printf("<system_clock tag=\"0x0b\" data=\"%02x%02x\" />\n",buf[i],buf[i+1]); i+=descriptor_length; descriptor_length=0; break; case 0x09: // ca_descriptor k=((buf[i]<<8)|buf[i+1]); switch(k&0xff00) { case SECA_CA_SYSTEM: for (j=2; j<descriptor_length; j+=15) { pid = ((buf[i+j] & 0x1f) << 8) | buf[i+j+1]; id = (buf[i+j+2] << 8) | buf[i+j+3]; printf("<ca_system_descriptor type=\"seca\" system_id=\"0x%04x\" ecm_pid=\"%d\" ecm_id=\"%06x\" />\n",k,pid,id); } break; case VIACCESS_CA_SYSTEM: j = 4; while (j < descriptor_length) { if (buf[i+j]==0x14) { pid = ((buf[i+2] & 0x1f) << 8) | buf[i+3]; id = (buf[i+j+2] << 16) | (buf[i+j+3] << 8) | (buf[i+j+4] & 0xf0); printf("<ca_system_descriptor type=\"viaccess\" system_id=\"0x%04x\" ecm_pid=\"%d\" ecm_id=\"%06x\" />\n",k,pid,id); } j += 2+buf[i+j+1]; } break; case IRDETO_CA_SYSTEM: case BETA_CA_SYSTEM: pid = ((buf[i+2] & 0x1f) << 8) | buf[i+3]; printf("<ca_system_descriptor type=\"irdeto\" system_id=\"0x%04x\" ecm_pid=\"%d\" />\n",k,pid); break; case NAGRA_CA_SYSTEM: pid = ((buf[i+2] & 0x1f) << 8) | buf[i+3]; printf("<ca_system_descriptor type=\"nagra\" system_id=\"0x%04x\" ecm_pid=\"%d\" />\n",k,pid); break; case CONAX_CA_SYSTEM: pid = ((buf[i+2] & 0x1f) << 8) | buf[i+3]; printf("<ca_system_descriptor type=\"conax\" system_id=\"0x%04x\" ecm_pid=\"%d\" />\n",k,pid); break; case VIDEOGUARD_CA_SYSTEM: pid = ((buf[i+2] & 0x1f) << 8) | buf[i+3]; printf("<ca_system_descriptor type=\"videoguard\" system_id=\"0x%04x\" ecm_pid=\"%d\" />\n",k,pid); break; default: pid = ((buf[i+2] & 0x1f) << 8) | buf[i+3]; printf("<ca_system_descriptor type=\"unknown\" system_id=\"0x%04x\" />\n",k); break; } i+=descriptor_length; descriptor_length=0; break; case 0x40: // network_name // printf("<network_name tag=\"0x40\">"); j=descriptor_length; while(j > 0) { // printf("%c",buf[i++]); j--; } descriptor_length=0; // printf("</network_name>\n"); break; case 0x41: // service_list // printf("<services tag=\"0x41\" n=\"%d\">\n",descriptor_length/3); while (descriptor_length > 0) { // printf("<service id=\"%d\" type=\"%d\" />\n",(buf[i]<<8)|buf[i+1],buf[i+2]); i+=3; descriptor_length-=3; } // printf("</services>\n"); break; case 0x43: // satellite_delivery_system freq=(unsigned int)(buf[i]<<24)|(buf[i+1]<<16)|(buf[i+2]<<8)|buf[i+3]; sprintf(tmp,"%x",freq); transponder->freq=atoi(tmp)*10; i+=4; transponder->pos=(buf[i]<<8)|buf[i+1]; i+=2; transponder->we_flag=(buf[i]&0x80)>>7; pol=(buf[i]&0x60)>>5; switch(pol) { case 0 : transponder->pol='H'; break; case 1 : transponder->pol='V'; break; case 2 : transponder->pol='L'; break; case 3 : transponder->pol='R'; break; } transponder->mod=buf[i]&0x1f; i++; sr=(unsigned int)(buf[i]<<24)|(buf[i+1]<<16)|(buf[i+2]<<8)|(buf[i+3]&0xf0); sr=(unsigned int)(sr >> 4); sprintf(tmp,"%x",sr); transponder->srate=atoi(tmp)*100; i+=4; descriptor_length=0; add_transponder(transponder,transponders); // printf("<satellite_delivery tag=\"0x43\" freq=\"%05d\" srate=\"%d\" pos=\"%04x\" we_flag=\"%d\" polarity=\"%c\" modulation=\"%d\" />\n",transponder->freq,transponder->srate,transponder->pos,transponder->we_flag,transponder->pol,transponder->mod); break; case 0x48: // service_description service_type=buf[i++]; printf("<description tag=\"0x48\" type=\"%d\"",service_type); descriptor_length--; j=buf[i++]; descriptor_length-=(j+1); printf(" provider_name=\"");; while(j > 0) { printf("%s",xmlify(buf[i++])); j--; } printf("\" service_name=\""); j=buf[i++]; descriptor_length-=(j+1); while(j > 0) { printf("%s",xmlify(buf[i])); i++; j--; } printf("\" />\n"); break; case 0x49: // country_availability: printf("<country_availability tag=\"0x49\" type=\"%d\" countries=\" ",(buf[i]&0x80)>>7); i++; j=descriptor_length-1; while (j > 0) { printf("%c",buf[i++]); j--; } printf("\" />\n"); descriptor_length=0; break; case 0x4c: printf("<time_shifted_copy_of tag=\"0x4c\" service_id=\"%d\" />\n",(buf[i]<<8)|buf[i+1]); i+=descriptor_length; descriptor_length=0; break; case 0x52: // stream_identifier_descriptor printf("<stream_id id=\"%d\" />\n",buf[i]); i+=descriptor_length; descriptor_length=0; break; case 0x53: printf("<ca_identifier tag=\"0x53\" length=\"%02x\">\n",descriptor_length); for (j=0;j<descriptor_length;j+=2) { k=(buf[i+j]<<8)|buf[i+j+1]; printf("<ca_system_id>%04x</ca_system_id>\n",k); } i+=descriptor_length; descriptor_length=0; printf("</ca_identifier>\n"); break; case 0x56: j=0; printf("<teletext tag=\"0x56\">\n"); while (j < descriptor_length) { printf("<teletext_info lang=\""); printf("%s",xmlify(buf[i])); printf("%s",xmlify(buf[i+1])); printf("%s",xmlify(buf[i+2])); k=(buf[i+3]&0x07); printf("\" type=\"%d\" page=\"%d%02x\" />\n",(buf[i+3]&0xf8)>>3,(k==0 ? 8 : k),buf[i+4]); i+=5; j+=5; } printf("</teletext>\n"); descriptor_length=0; break; case 0x59: j=0; printf("<subtitling_descriptor tag=\"0x59\">\n"); while (j < descriptor_length) { printf("<subtitle_stream lang=\""); printf("%s",xmlify(buf[i])); printf("%s",xmlify(buf[i+1])); printf("%s",xmlify(buf[i+2])); printf("\" type=\"%d\" composition_page_id=\"%04x\" ancillary_page_id=\"%04x\" />\n",buf[i+3],(buf[i+4]<<8)|buf[i+5],(buf[i+6]<<8)|buf[i+7]); i+=8; j+=8; } printf("</subtitling_descriptor>\n"); descriptor_length=0; break; case 0x6a: printf("<ac3_descriptor tag=\"0x6a\" data=\""); for (j=0;j<descriptor_length;j++) printf("%02x",buf[i+j]); printf("\" />\n"); i+=descriptor_length; descriptor_length=0; break; case 0xc5: // canal_satellite_radio_descriptor /* This is guessed from the data */ printf("<canal_radio tag=\"0x%02x\" id=\"%d\" name=\"",descriptor_tag,buf[i]); i++; for (j=0;j<descriptor_length;j++) if (buf[i+j]!=0) printf("%c",buf[i+j]); printf("\" />\n"); i+=descriptor_length; descriptor_length=0; break; default: printf("<descriptor tag=\"0x%02x\" data=\"",descriptor_tag); for (j=0;j<descriptor_length;j++) printf("%02x",buf[i+j]); printf("\" text=\""); for (j=0;j<descriptor_length;j++) printf("%c",(isalnum(buf[i+j]) ? buf[i+j] : '.')); printf("\" />\n"); i+=descriptor_length; descriptor_length=0; break; } } } } --- NEW FILE: si.h --- #ifndef _SI_H #define _SI_H #define SECA_CA_SYSTEM 0x0100 #define VIACCESS_CA_SYSTEM 0x0500 #define IRDETO_CA_SYSTEM 0x0600 #define VIDEOGUARD_CA_SYSTEM 0x0900 #define BETA_CA_SYSTEM 0x1700 #define NAGRA_CA_SYSTEM 0x1800 #define CONAX_CA_SYSTEM 0x0b00 typedef struct _transponder_t { int id; int onid; unsigned int freq; int srate; int pos; int we_flag; char pol; int mod; int scanned; struct _transponder_t* next; } transponder_t; void add_transponder(transponder_t* transponder, transponder_t** transponders); void parse_descriptors(int info_len,unsigned char *buf, transponder_t* transponder, transponder_t** transponders); transponder_t* get_unscanned(transponder_t* transponders); #endif Index: Makefile =================================================================== RCS file: /cvsroot/dvbtools/dvbtune/Makefile,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Makefile 19 Mar 2004 16:49:32 -0000 1.7 --- Makefile 25 Mar 2004 00:16:37 -0000 1.8 *************** *** 1,4 **** --- 1,5 ---- INCS=-I /usr/include/libxml2 CFLAGS= -Wall $(INCS) + LDFLAGS=-lxml2 CC=gcc all: dvbtune *************** *** 19,27 **** tune.o: tune.c tune.h dvb_defaults.h ! dvbtune: dvbtune.c tune.o xml2vdr: xml2vdr.c - $(CC) $(CFLAGS) -o xml2vdr xml2vdr.c -lxml2 clean: --- 20,30 ---- tune.o: tune.c tune.h dvb_defaults.h + si.o: si.c si.h ! dvbtune.o: dvbtune.c tune.h si.h ! ! dvbtune: dvbtune.o tune.o si.o xml2vdr: xml2vdr.c clean: Index: dvbtune.c =================================================================== RCS file: /cvsroot/dvbtools/dvbtune/dvbtune.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** dvbtune.c 19 Mar 2004 16:51:14 -0000 1.27 --- dvbtune.c 25 Mar 2004 00:16:37 -0000 1.28 *************** *** 56,67 **** #include "tune.h" ! ! #define SECA_CA_SYSTEM 0x0100 ! #define VIACCESS_CA_SYSTEM 0x0500 ! #define IRDETO_CA_SYSTEM 0x0600 ! #define VIDEOGUARD_CA_SYSTEM 0x0900 ! #define BETA_CA_SYSTEM 0x1700 ! #define NAGRA_CA_SYSTEM 0x1800 ! #define CONAX_CA_SYSTEM 0x0b00 int fd_demuxv,fd_demuxa,fd_demuxtt,fd_demuxsi,fd_demuxrec,fd_demuxd; --- 56,60 ---- #include "tune.h" ! #include "si.h" int fd_demuxv,fd_demuxa,fd_demuxtt,fd_demuxsi,fd_demuxrec,fd_demuxd; *************** *** 77,94 **** char* demuxdev[4]={"/dev/dvb/adapter0/demux0","/dev/dvb/adapter1/demux0","/dev/dvb/adapter2/demux0","/dev/dvb/adapter3/demux0"}; - typedef struct _transponder_t { - int id; - int onid; - unsigned int freq; - int srate; - int pos; - int we_flag; - char pol; - int mod; - - int scanned; - struct _transponder_t* next; - } transponder_t; - transponder_t* transponders=NULL; int num_trans=0; --- 70,73 ---- *************** *** 105,186 **** pat_t* pats=NULL; - /* Get the first unscanned transponder (or return NULL) */ - transponder_t* get_unscanned() { - transponder_t* t; - - t=transponders; - - while (t!=NULL) { - if (t->scanned==0) { return(t); }; - t=t->next; - } - return NULL; - } - - char xmlify_result[10]; - char* xmlify (char c) { - switch(c) { - case '&': strcpy(xmlify_result,"&"); - break; - case '<': strcpy(xmlify_result,"<"); - break; - case '>': strcpy(xmlify_result,">"); - break; - case '\"': strcpy(xmlify_result,"""); - break; - case 0: xmlify_result[0]=0; - break; - default: xmlify_result[0]=c; - xmlify_result[1]=0; - break; - } - return(xmlify_result); - } - - void add_transponder(transponder_t transponder) { - transponder_t* t; - int found; - - if (transponders==NULL) { - transponders=(transponder_t*)malloc(sizeof(transponder)); - - transponders->freq=transponder.freq; - transponders->srate=transponder.srate; - transponders->pol=transponder.pol; - transponders->pos=transponder.pos; - transponders->we_flag=transponder.we_flag; - transponders->mod=transponder.mod; - transponders->scanned=0; - transponders->next=NULL; - } else { - t=transponders; - found=0; - while ((!found) && (t!=NULL)) { - /* Some transponders appear with slightly different frequencies - - ignore a new transponder if it is within 3MHz of another */ - if ((abs(t->freq-transponder.freq)<=3000) && (t->pol==transponder.pol)) { - found=1; - } else { - t=t->next; - } - } - - if (!found) { - t=(transponder_t*)malloc(sizeof(transponder)); - - t->freq=transponder.freq; - t->srate=transponder.srate; - t->pol=transponder.pol; - t->pos=transponder.pos; - t->we_flag=transponder.we_flag; - t->mod=transponder.mod; - t->scanned=0; - t->next=transponders; - - transponders=t; - } - } - } - void free_pat_list() { pat_t* t=pats; --- 84,87 ---- *************** *** 379,646 **** - void parse_descriptors(int info_len,unsigned char *buf) { - int i=0; - int descriptor_tag,descriptor_length,j,k,pid,id; - int service_type; - char tmp[128]; - unsigned int freq, pol, sr; - - while (i < info_len) { - descriptor_tag=buf[i++]; - descriptor_length=buf[i++]; - // printf("Found descriptor: 0x%02x - length %02d\n",descriptor_tag,descriptor_length); - while (descriptor_length > 0) { - switch(descriptor_tag) { - case 0x03: // audio_stream_descriptor - printf("<audio_info tag=\"0x03\" info=\"%02x\" />\n",buf[i]); - i+=descriptor_length; - descriptor_length=0; - break; - - case 0x06: // data_stream_alignmentdescriptor - printf("<data_stream_alignment tag=\"0x06\" data=\"%02x\" />\n",buf[i]); - i+=descriptor_length; - descriptor_length=0; - break; - - case 0x0a: // iso_639_language_descriptor - for (j=0;j<((descriptor_length)/4);j++) { - printf("<iso_639 language=\""); - if (buf[i]!=0) printf("%c",buf[i]); - if (buf[i+1]!=0) printf("%c",buf[i+1]); - if (buf[i+2]!=0) printf("%c",buf[i+2]); - printf("\" type=\"%d\" />\n",buf[i+3]); - i+=4; - descriptor_length-=4; - } - break; - - case 0x0b: // system_clock_descriptor - printf("<system_clock tag=\"0x0b\" data=\"%02x%02x\" />\n",buf[i],buf[i+1]); - i+=descriptor_length; - descriptor_length=0; - break; - - case 0x09: // ca_descriptor - k=((buf[i]<<8)|buf[i+1]); - switch(k&0xff00) { - case SECA_CA_SYSTEM: - for (j=2; j<descriptor_length; j+=15) - { - pid = ((buf[i+j] & 0x1f) << 8) | buf[i+j+1]; - id = (buf[i+j+2] << 8) | buf[i+j+3]; - printf("<ca_system_descriptor type=\"seca\" system_id=\"0x%04x\" ecm_pid=\"%d\" ecm_id=\"%06x\" />\n",k,pid,id); - } - break; - case VIACCESS_CA_SYSTEM: - j = 4; - while (j < descriptor_length) - { - if (buf[i+j]==0x14) - { - pid = ((buf[i+2] & 0x1f) << 8) | buf[i+3]; - id = (buf[i+j+2] << 16) | (buf[i+j+3] << 8) | (buf[i+j+4] & 0xf0); - printf("<ca_system_descriptor type=\"viaccess\" system_id=\"0x%04x\" ecm_pid=\"%d\" ecm_id=\"%06x\" />\n",k,pid,id); - } - j += 2+buf[i+j+1]; - } - break; - case IRDETO_CA_SYSTEM: - case BETA_CA_SYSTEM: - pid = ((buf[i+2] & 0x1f) << 8) | buf[i+3]; - printf("<ca_system_descriptor type=\"irdeto\" system_id=\"0x%04x\" ecm_pid=\"%d\" />\n",k,pid); - break; - case NAGRA_CA_SYSTEM: - pid = ((buf[i+2] & 0x1f) << 8) | buf[i+3]; - printf("<ca_system_descriptor type=\"nagra\" system_id=\"0x%04x\" ecm_pid=\"%d\" />\n",k,pid); - break; - case CONAX_CA_SYSTEM: - pid = ((buf[i+2] & 0x1f) << 8) | buf[i+3]; - printf("<ca_system_descriptor type=\"conax\" system_id=\"0x%04x\" ecm_pid=\"%d\" />\n",k,pid); - break; - case VIDEOGUARD_CA_SYSTEM: - pid = ((buf[i+2] & 0x1f) << 8) | buf[i+3]; - printf("<ca_system_descriptor type=\"videoguard\" system_id=\"0x%04x\" ecm_pid=\"%d\" />\n",k,pid); - break; - default: - pid = ((buf[i+2] & 0x1f) << 8) | buf[i+3]; - printf("<ca_system_descriptor type=\"unknown\" system_id=\"0x%04x\" />\n",k); - break; - } - i+=descriptor_length; - descriptor_length=0; - break; - - case 0x40: // network_name - // printf("<network_name tag=\"0x40\">"); - j=descriptor_length; - while(j > 0) { - // printf("%c",buf[i++]); - j--; - } - descriptor_length=0; - // printf("</network_name>\n"); - break; - - case 0x41: // service_list - // printf("<services tag=\"0x41\" n=\"%d\">\n",descriptor_length/3); - while (descriptor_length > 0) { - // printf("<service id=\"%d\" type=\"%d\" />\n",(buf[i]<<8)|buf[i+1],buf[i+2]); - i+=3; - descriptor_length-=3; - } - // printf("</services>\n"); - break; - - case 0x43: // satellite_delivery_system - freq=(unsigned int)(buf[i]<<24)|(buf[i+1]<<16)|(buf[i+2]<<8)|buf[i+3]; - sprintf(tmp,"%x",freq); - transponder.freq=atoi(tmp)*10; - i+=4; - transponder.pos=(buf[i]<<8)|buf[i+1]; - i+=2; - transponder.we_flag=(buf[i]&0x80)>>7; - pol=(buf[i]&0x60)>>5; - switch(pol) { - case 0 : transponder.pol='H'; break; - case 1 : transponder.pol='V'; break; - case 2 : transponder.pol='L'; break; - case 3 : transponder.pol='R'; break; - } - transponder.mod=buf[i]&0x1f; - i++; - sr=(unsigned int)(buf[i]<<24)|(buf[i+1]<<16)|(buf[i+2]<<8)|(buf[i+3]&0xf0); - sr=(unsigned int)(sr >> 4); - sprintf(tmp,"%x",sr); - transponder.srate=atoi(tmp)*100; - i+=4; - descriptor_length=0; - add_transponder(transponder); - // printf("<satellite_delivery tag=\"0x43\" freq=\"%05d\" srate=\"%d\" pos=\"%04x\" we_flag=\"%d\" polarity=\"%c\" modulation=\"%d\" />\n",transponder.freq,transponder.srate,transponder.pos,transponder.we_flag,transponder.pol,transponder.mod); - break; - - case 0x48: // service_description - service_type=buf[i++]; - printf("<description tag=\"0x48\" type=\"%d\"",service_type); - descriptor_length--; - j=buf[i++]; - descriptor_length-=(j+1); - printf(" provider_name=\"");; - while(j > 0) { - printf("%s",xmlify(buf[i++])); - j--; - } - printf("\" service_name=\""); - j=buf[i++]; - descriptor_length-=(j+1); - while(j > 0) { - printf("%s",xmlify(buf[i])); - i++; - j--; - } - printf("\" />\n"); - break; - - case 0x49: // country_availability: - printf("<country_availability tag=\"0x49\" type=\"%d\" countries=\" ",(buf[i]&0x80)>>7); - i++; - j=descriptor_length-1; - while (j > 0) { - printf("%c",buf[i++]); - j--; - } - printf("\" />\n"); - descriptor_length=0; - break; - - case 0x4c: - printf("<time_shifted_copy_of tag=\"0x4c\" service_id=\"%d\" />\n",(buf[i]<<8)|buf[i+1]); - i+=descriptor_length; - descriptor_length=0; - break; - - case 0x52: // stream_identifier_descriptor - printf("<stream_id id=\"%d\" />\n",buf[i]); - i+=descriptor_length; - descriptor_length=0; - break; - - case 0x53: - printf("<ca_identifier tag=\"0x53\" length=\"%02x\">\n",descriptor_length); - for (j=0;j<descriptor_length;j+=2) { - k=(buf[i+j]<<8)|buf[i+j+1]; - printf("<ca_system_id>%04x</ca_system_id>\n",k); - } - i+=descriptor_length; - descriptor_length=0; - printf("</ca_identifier>\n"); - break; - - case 0x56: - j=0; - printf("<teletext tag=\"0x56\">\n"); - while (j < descriptor_length) { - printf("<teletext_info lang=\""); - printf("%s",xmlify(buf[i])); - printf("%s",xmlify(buf[i+1])); - printf("%s",xmlify(buf[i+2])); - k=(buf[i+3]&0x07); - printf("\" type=\"%d\" page=\"%d%02x\" />\n",(buf[i+3]&0xf8)>>3,(k==0 ? 8 : k),buf[i+4]); - i+=5; - j+=5; - } - printf("</teletext>\n"); - descriptor_length=0; - break; - - case 0x59: - j=0; - printf("<subtitling_descriptor tag=\"0x59\">\n"); - while (j < descriptor_length) { - printf("<subtitle_stream lang=\""); - printf("%s",xmlify(buf[i])); - printf("%s",xmlify(buf[i+1])); - printf("%s",xmlify(buf[i+2])); - printf("\" type=\"%d\" composition_page_id=\"%04x\" ancillary_page_id=\"%04x\" />\n",buf[i+3],(buf[i+4]<<8)|buf[i+5],(buf[i+6]<<8)|buf[i+7]); - i+=8; - j+=8; - } - printf("</subtitling_descriptor>\n"); - descriptor_length=0; - break; - - case 0x6a: - printf("<ac3_descriptor tag=\"0x6a\" data=\""); - for (j=0;j<descriptor_length;j++) printf("%02x",buf[i+j]); - printf("\" />\n"); - i+=descriptor_length; - descriptor_length=0; - break; - - case 0xc5: // canal_satellite_radio_descriptor - /* This is guessed from the data */ - printf("<canal_radio tag=\"0x%02x\" id=\"%d\" name=\"",descriptor_tag,buf[i]); - i++; - for (j=0;j<descriptor_length;j++) - if (buf[i+j]!=0) printf("%c",buf[i+j]); - printf("\" />\n"); - i+=descriptor_length; - descriptor_length=0; - break; - - default: - printf("<descriptor tag=\"0x%02x\" data=\"",descriptor_tag); - for (j=0;j<descriptor_length;j++) printf("%02x",buf[i+j]); - printf("\" text=\""); - for (j=0;j<descriptor_length;j++) printf("%c",(isalnum(buf[i+j]) ? buf[i+j] : '.')); - printf("\" />\n"); - i+=descriptor_length; - descriptor_length=0; - break; - } - } - } - } - void dump(char* fname, int len, char* buf) { FILE* f; --- 280,283 ---- *************** *** 699,703 **** info_len=((buf[8]&0x0f)<<8)|buf[9]; i=10; ! parse_descriptors(info_len,&buf[i]); i+=info_len; i+=2; --- 336,340 ---- info_len=((buf[8]&0x0f)<<8)|buf[9]; i=10; ! parse_descriptors(info_len,&buf[i],&transponder,&transponders); i+=info_len; i+=2; *************** *** 710,714 **** info_len=((buf[i]&0x0f)<<8)|buf[i+1]; i+=2; ! parse_descriptors(info_len,&buf[i]); // printf("</transponder>\n"); i+=info_len; --- 347,351 ---- info_len=((buf[i]&0x0f)<<8)|buf[i+1]; i+=2; ! parse_descriptors(info_len,&buf[i],&transponder,&transponders); // printf("</transponder>\n"); i+=info_len; *************** *** 783,787 **** info_len=((buf[10]&0x0f)<<8)|buf[11]; i=12; ! parse_descriptors(info_len,&buf[i]); i+=info_len; while (i < (seclen-4)) { --- 420,424 ---- info_len=((buf[10]&0x0f)<<8)|buf[11]; i=12; ! parse_descriptors(info_len,&buf[i],&transponder,&transponders); i+=info_len; while (i < (seclen-4)) { *************** *** 801,805 **** info_len=((buf[i]&0x0f)<<8)|buf[i+1]; i+=2; ! parse_descriptors(info_len,&buf[i]); i+=info_len; printf("</stream>\n"); --- 438,442 ---- info_len=((buf[i]&0x0f)<<8)|buf[i+1]; i+=2; ! parse_descriptors(info_len,&buf[i],&transponder,&transponders); i+=info_len; printf("</stream>\n"); *************** *** 951,955 **** printf("<service id=\"%d\" ca=\"%d\">\n",service_id,ca); i+=2; ! parse_descriptors(loop_length,&buf[i]); i+=loop_length; scan_pmt(get_pmt_pid(service_id),service_id,(service_id==pnr)); --- 588,592 ---- printf("<service id=\"%d\" ca=\"%d\">\n",service_id,ca); i+=2; ! parse_descriptors(loop_length,&buf[i],&transponder,&transponders); i+=loop_length; scan_pmt(get_pmt_pid(service_id),service_id,(service_id==pnr)); |
|
From: <lin...@us...> - 2004-03-22 21:04:04
|
Update of /cvsroot/dvbtools/dvbsubs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22977 Modified Files: dvbsubs.c Log Message: Bug fix from Pasi Hietamaki Index: dvbsubs.c =================================================================== RCS file: /cvsroot/dvbtools/dvbsubs/dvbsubs.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** dvbsubs.c 11 Mar 2004 21:01:40 -0000 1.17 --- dvbsubs.c 22 Mar 2004 20:53:37 -0000 1.18 *************** *** 174,177 **** --- 174,178 ---- bits=0; + pixel_code=0; next_bits=next_nibble(); |
|
From: <lin...@us...> - 2004-03-20 00:39:56
|
Update of /cvsroot/dvbtools/dvbstream In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12523 Modified Files: dvbstream.c tune.c tune.h Log Message: Remove references to fd_sec - it is not used with NEWSTRUCT Index: dvbstream.c =================================================================== RCS file: /cvsroot/dvbtools/dvbstream/dvbstream.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** dvbstream.c 19 Mar 2004 09:59:32 -0000 1.18 --- dvbstream.c 19 Mar 2004 16:53:56 -0000 1.19 *************** *** 93,97 **** char pol=0; ! int open_fe(int* fd_frontend,int* fd_sec) { if((*fd_frontend = open(frontenddev[card],O_RDWR | O_NONBLOCK)) < 0){ --- 93,97 ---- char pol=0; ! int open_fe(int* fd_frontend) { if((*fd_frontend = open(frontenddev[card],O_RDWR | O_NONBLOCK)) < 0){ *************** *** 99,103 **** return -1; } - fd_sec=0; return 1; } --- 99,102 ---- *************** *** 164,168 **** unsigned char hi_mappids[8192]; unsigned char lo_mappids[8192]; - int fd_sec; int fd_frontend; int pid,pid2; --- 163,166 ---- *************** *** 313,317 **** srate=atoi(&cmd[i])*1000UL; fprintf(stderr,"Tuning to %ld,%ld,%c\n",freq,srate,pol); ! tune_it(fd_frontend,fd_sec,freq,srate,pol,tone,specInv,diseqc,modulation,HP_CodeRate,TransmissionMode,guardInterval,bandWidth); } } --- 311,315 ---- srate=atoi(&cmd[i])*1000UL; fprintf(stderr,"Tuning to %ld,%ld,%c\n",freq,srate,pol); ! tune_it(fd_frontend,freq,srate,pol,tone,specInv,diseqc,modulation,HP_CodeRate,TransmissionMode,guardInterval,bandWidth); } } *************** *** 715,725 **** if ( (freq>100000000)) { ! if (open_fe(&fd_frontend,0)) { ! i=tune_it(fd_frontend,0,freq,srate,0,tone,specInv,diseqc,modulation,HP_CodeRate,TransmissionMode,guardInterval,bandWidth); } } else if ((freq!=0) && (pol!=0) && (srate!=0)) { ! if (open_fe(&fd_frontend,&fd_sec)) { fprintf(stderr,"Tuning to %ld Hz\n",freq); ! i=tune_it(fd_frontend,fd_sec,freq,srate,pol,tone,specInv,diseqc,modulation,HP_CodeRate,TransmissionMode,guardInterval,bandWidth); } } --- 713,723 ---- if ( (freq>100000000)) { ! if (open_fe(&fd_frontend)) { ! i=tune_it(fd_frontend,freq,srate,0,tone,specInv,diseqc,modulation,HP_CodeRate,TransmissionMode,guardInterval,bandWidth); } } else if ((freq!=0) && (pol!=0) && (srate!=0)) { ! if (open_fe(&fd_frontend)) { fprintf(stderr,"Tuning to %ld Hz\n",freq); ! i=tune_it(fd_frontend,freq,srate,pol,tone,specInv,diseqc,modulation,HP_CodeRate,TransmissionMode,guardInterval,bandWidth); } } *************** *** 903,907 **** close(fd_dvr); close(fd_frontend); - if (fd_sec) close(fd_sec); if (do_analyse) { --- 901,904 ---- Index: tune.c =================================================================== RCS file: /cvsroot/dvbtools/dvbstream/tune.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tune.c 19 Mar 2004 09:59:33 -0000 1.15 --- tune.c 19 Mar 2004 16:53:56 -0000 1.16 *************** *** 175,179 **** } ! int tune_it(int fd_frontend, int fd_sec, unsigned int freq, unsigned int srate, char pol, int tone, fe_spectral_inversion_t specInv, unsigned int diseqc,fe_modulation_t modulation,fe_code_rate_t HP_CodeRate,fe_transmit_mode_t TransmissionMode,fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth) { int res, hi_lo, dfd; struct dvb_frontend_parameters feparams; --- 175,179 ---- } ! int tune_it(int fd_frontend, unsigned int freq, unsigned int srate, char pol, int tone, fe_spectral_inversion_t specInv, unsigned int diseqc,fe_modulation_t modulation,fe_code_rate_t HP_CodeRate,fe_transmit_mode_t TransmissionMode,fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth) { int res, hi_lo, dfd; struct dvb_frontend_parameters feparams; Index: tune.h =================================================================== RCS file: /cvsroot/dvbtools/dvbstream/tune.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tune.h 19 Mar 2004 09:59:33 -0000 1.6 --- tune.h 19 Mar 2004 16:53:56 -0000 1.7 *************** *** 6,10 **** #include "dvb_defaults.h" ! int tune_it(int fd_frontend, int fd_sec, unsigned int freq, unsigned int srate, char pol, int tone, fe_spectral_inversion_t specInv, unsigned int diseqc,fe_modulation_t modulation,fe_code_rate_t HP_CodeRate,fe_transmit_mode_t TransmissionMode,fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth); #endif --- 6,10 ---- #include "dvb_defaults.h" ! int tune_it(int fd_frontend, unsigned int freq, unsigned int srate, char pol, int tone, fe_spectral_inversion_t specInv, unsigned int diseqc,fe_modulation_t modulation,fe_code_rate_t HP_CodeRate,fe_transmit_mode_t TransmissionMode,fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth); #endif |
|
From: <lin...@us...> - 2004-03-19 17:08:18
|
Update of /cvsroot/dvbtools/dvbstream In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13411 Modified Files: tune.c Log Message: Remove unused variable "voltage" from tune_it() Index: tune.c =================================================================== RCS file: /cvsroot/dvbtools/dvbstream/tune.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tune.c 19 Mar 2004 16:53:56 -0000 1.16 --- tune.c 19 Mar 2004 16:58:15 -0000 1.17 *************** *** 179,183 **** struct dvb_frontend_parameters feparams; struct dvb_frontend_info fe_info; - fe_sec_voltage_t voltage; if ( (res = ioctl(fd_frontend,FE_GET_INFO, &fe_info) < 0)){ --- 179,182 ---- |
|
From: <lin...@us...> - 2004-03-19 17:05:30
|
Update of /cvsroot/dvbtools/dvbtune In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12881 Modified Files: tune.c Log Message: Remove unused variable "voltage" from tune_it() Index: tune.c =================================================================== RCS file: /cvsroot/dvbtools/dvbtune/tune.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** tune.c 19 Mar 2004 16:51:14 -0000 1.23 --- tune.c 19 Mar 2004 16:55:34 -0000 1.24 *************** *** 179,183 **** struct dvb_frontend_parameters feparams; struct dvb_frontend_info fe_info; - fe_sec_voltage_t voltage; if ( (res = ioctl(fd_frontend,FE_GET_INFO, &fe_info) < 0)){ --- 179,182 ---- |