Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linux-dvb] NEWSTRUCT dvbstream patch
OK, I've had a request for the patch to get dvbsteam-0.4pre2 working
with the cvs NEWSTRUCT drivers. The following works for me, but YMMV!
(patch inline, not attached to get it onto the mailing list -- it's
not very big...)
You will probably have to change INCS in the Makefile to point to
wherever you've put the includes for the NEWSTRUCT drivers.
cheers all,
Phil
Patch begins:
diff -r -u dvbstream-0.4pre2/Makefile dvbstream-newstruct/Makefile
--- dvbstream-0.4pre2/Makefile 2002-01-31 13:32:52.000000000 +0000
+++ dvbstream-newstruct/Makefile 2002-07-10 08:53:02.000000000 +0100
@@ -1,4 +1,4 @@
-INCS=-I ../DVB/ost/include
+INCS=-I ../newstruct/DVB/include/linux/dvb -I ../newstruct/DVB/include
CC=gcc
CFLAGS = -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
OBJS=dvbstream dumprtp ts_filter rtpfeed rtp.o
diff -r -u dvbstream-0.4pre2/tune.c dvbstream-newstruct/tune.c
--- dvbstream-0.4pre2/tune.c 2001-11-13 22:48:21.000000000 +0000
+++ dvbstream-newstruct/tune.c 2002-07-10 09:34:00.000000000 +0100
@@ -6,7 +6,7 @@
#include <fcntl.h>
#include <ost/dmx.h>
-#include <ost/sec.h>
+/*#include <ost/sec.h>*/
#include <ost/frontend.h>
#define slof (11700*1000UL)
@@ -18,31 +18,31 @@
int i,res;
int32_t strength;
FrontendStatus festatus;
- FrontendEvent event;
- FrontendParameters feparams;
- secToneMode tone;
- secVoltage voltage;
+ struct dvb_frontend_event event;
+ struct dvb_frontend_parameters feparams;
+ SecToneMode tone;
+ SecVoltage voltage;
if (freq > 100000000) {
fprintf(stderr,"tuning DVB-T to %u\n",freq);
- feparams.Frequency=freq;
- feparams.u.ofdm.bandWidth=BANDWIDTH_8_MHZ; // WAS: 8
- feparams.u.ofdm.HP_CodeRate=FEC_2_3;
- feparams.u.ofdm.LP_CodeRate=FEC_1_2;
- feparams.u.ofdm.Constellation=QAM_64; // WAS: 16
- feparams.u.ofdm.TransmissionMode=TRANSMISSION_MODE_2K;
- feparams.u.ofdm.guardInterval=GUARD_INTERVAL_1_32;
- feparams.u.ofdm.HierarchyInformation=HIERARCHY_NONE;
+ feparams.frequency=freq;
+ feparams.u.ofdm.bandwidth=BANDWIDTH_8_MHZ; // WAS: 8
+ feparams.u.ofdm.code_rate_HP=FEC_2_3;
+ feparams.u.ofdm.code_rate_LP=FEC_1_2;
+ feparams.u.ofdm.constellation=QAM_64; // WAS: 16
+ feparams.u.ofdm.transmission_mode=TRANSMISSION_MODE_2K;
+ feparams.u.ofdm.guard_interval=GUARD_INTERVAL_1_32;
+ feparams.u.ofdm.hierarchy_information=HIERARCHY_NONE;
} else {
fprintf(stderr,"tuning DVB-S to %d%c %d\n",freq,pol,srate);
if (freq < slof) {
- feparams.Frequency=(freq-lof1);
+ feparams.frequency=(freq-lof1);
tone = SEC_TONE_OFF;
} else {
- feparams.Frequency=(freq-lof2);
+ feparams.frequency=(freq-lof2);
tone = SEC_TONE_ON;
}
- feparams.Inversion=INVERSION_AUTO;
+ feparams.inversion=INVERSION_AUTO;
if ((pol=='h') || (pol=='H')) {
voltage = SEC_VOLTAGE_18;
@@ -50,14 +50,14 @@
voltage = SEC_VOLTAGE_13;
}
- feparams.u.qpsk.SymbolRate=srate;
- feparams.u.qpsk.FEC_inner=FEC_AUTO;
+ feparams.u.qpsk.symbol_rate=srate;
+ feparams.u.qpsk.fec_inner=FEC_AUTO;
- if (ioctl(fd_sec,SEC_SET_TONE,tone) < 0) {
+ if (ioctl(fd_sec,FE_SET_TONE,tone) < 0) {
perror("ERROR setting tone\n");
}
- if (ioctl(fd_sec,SEC_SET_VOLTAGE,voltage) < 0) {
+ if (ioctl(fd_sec,FE_SET_VOLTAGE,voltage) < 0) {
perror("ERROR setting voltage\n");
}
usleep(200000);
@@ -78,6 +78,7 @@
i--;
}
+ /*
if (res < 0)
perror("qpsk get event");
else
@@ -89,19 +90,19 @@
case FE_FAILURE_EV: fprintf(stderr,"FE_FAILURE_EV\n");
break;
}
-
+ */
if (freq > 100000000) {
- fprintf(stderr,"Event: iFrequency: %ld\n",event.u.completionEvent.Frequency);
+ fprintf(stderr,"Event: iFrequency: %ld\n",event.parameters.frequency);
} else {
- fprintf(stderr,"Event: iFrequency: %ld\n",(event.u.completionEvent.Frequency)+(tone==SEC_TONE_OFF ? lof1 : lof2));
- fprintf(stderr," SymbolRate: %ld\n",event.u.completionEvent.u.qpsk.SymbolRate);
- fprintf(stderr," FEC_inner: %d\n",event.u.completionEvent.u.qpsk.FEC_inner);
+ fprintf(stderr,"Event: iFrequency: %ld\n",(event.parameters.frequency)+(tone==SEC_TONE_OFF ? lof1 : lof2));
+ fprintf(stderr," SymbolRate: %ld\n",event.parameters.u.qpsk.symbol_rate);
+ fprintf(stderr," FEC_inner: %d\n",event.parameters.u.qpsk.fec_inner);
fprintf(stderr,"\n");
ioctl(fd_frontend,FE_READ_STATUS,&feparams);
- fprintf(stderr,"Status: iFrequency: %ld\n",(feparams.Frequency)+(tone==SEC_TONE_OFF ? lof1 : lof2));
- fprintf(stderr," SymbolRate: %ld\n",feparams.u.qpsk.SymbolRate);
- fprintf(stderr," FEC_inner: %d\n",feparams.u.qpsk.FEC_inner);
+ fprintf(stderr,"Status: iFrequency: %ld\n",(feparams.frequency)+(tone==SEC_TONE_OFF ? lof1 : lof2));
+ fprintf(stderr," SymbolRate: %ld\n",feparams.u.qpsk.symbol_rate);
+ fprintf(stderr," FEC_inner: %d\n",feparams.u.qpsk.fec_inner);
}
strength=0;
@@ -120,14 +121,14 @@
ioctl(fd_frontend,FE_READ_STATUS,&festatus);
fprintf(stderr,"FE_STATUS:");
- if (festatus & FE_HAS_POWER) fprintf(stderr," FE_HAS_POWER");
+ /*if (festatus & FE_HAS_POWER) fprintf(stderr," FE_HAS_POWER");*/
if (festatus & FE_HAS_SIGNAL) fprintf(stderr," FE_HAS_SIGNAL");
- if (festatus & FE_SPECTRUM_INV) fprintf(stderr," FE_SPECTRUM_INV");
+ /*if (festatus & FE_SPECTRUM_INV) fprintf(stderr," FE_SPECTRUM_INV");*/
if (festatus & FE_HAS_LOCK) fprintf(stderr," FE_HAS_LOCK");
if (festatus & FE_HAS_CARRIER) fprintf(stderr," FE_HAS_CARRIER");
if (festatus & FE_HAS_VITERBI) fprintf(stderr," FE_HAS_VITERBI");
if (festatus & FE_HAS_SYNC) fprintf(stderr," FE_HAS_SYNC");
- if (festatus & FE_TUNER_HAS_LOCK) fprintf(stderr," FE_TUNER_HAS_LOCK");
+ /* if (festatus & FE_TUNER_HAS_LOCK) fprintf(stderr," FE_TUNER_HAS_LOCK");*/
fprintf(stderr,"\n");
}
Patch ends.
--
http://www.kantaka.co.uk/ .oOo. public key: http://www.kantaka.co.uk/gpg.txt
--
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.
Home |
Main Index |
Thread Index