Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: NEWSTRUCT dvbstream patch



On Fri, Aug 09, 2002 at 05:26:46PM +0100, Philip Armstrong wrote:
> On Fri, Aug 09, 2002 at 12:18:17PM +0200, Holger Waechtler wrote:
> > Philip Armstrong wrote:
> > shouldn't you #include <linux/dvb/frontend.h> here?
> > the same for #include <linux/dvb/dmx.h>.
> 
> I think I set INCS in the Makefile instead.

No, wait. You're entirely correct. My solution at then time appears to
have been to add a ost -> . symlink in the relevant place and edit
INCS in the Makefile. Icky.

New patch follows. Edit INCS to suit as before.

Phil

diff -r -u dvbstream-0.4pre2/dvbstream.c dvbstream-newstruct/dvbstream.c
--- dvbstream-0.4pre2/dvbstream.c	2002-01-31 18:41:06.000000000 +0000
+++ dvbstream-newstruct/dvbstream.c	2002-08-09 17:42:19.000000000 +0100
@@ -46,8 +46,8 @@
 #include "mpegtools/remux.h"
 
 // DVB includes:
-#include <ost/dmx.h>
-#include <ost/frontend.h>
+#include <linux/dvb/dmx.h>
+#include <linux/dvb/frontend.h>
 
 // The default telnet port.
 #define DEFAULT_PORT 12345
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-08-09 17:41:45.000000000 +0100
@@ -1,4 +1,4 @@
-INCS=-I ../DVB/ost/include
+INCS=-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/tune2.c dvbstream-newstruct/tune2.c
--- dvbstream-0.4pre2/tune2.c	2001-11-13 22:39:11.000000000 +0000
+++ dvbstream-newstruct/tune2.c	2002-08-09 17:42:05.000000000 +0100
@@ -4,9 +4,9 @@
 #include <sys/ioctl.h>
 #include <sys/poll.h>
 
-#include <ost/dmx.h>
-#include <ost/sec.h>
-#include <ost/frontend.h>
+#include <linux/dvb/dmx.h>
+#include <linux/dvb/sec.h>
+#include <linux/dvb/frontend.h>
 
 #define slof (11700*1000UL)
 #define lof1 (9750*1000UL)
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-08-09 17:41:56.000000000 +0100
@@ -5,9 +5,8 @@
 #include <sys/poll.h>
 #include <fcntl.h>
 
-#include <ost/dmx.h>
-#include <ost/sec.h>
-#include <ost/frontend.h>
+#include <linux/dvb/dmx.h>
+#include <linux/dvb/frontend.h>
 
 #define slof (11700*1000UL)
 #define lof1 (9750*1000UL)
@@ -18,31 +17,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 +49,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 +77,7 @@
     i--;
   }
 
+  /*
   if (res < 0)
     perror("qpsk get event");
   else
@@ -89,19 +89,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 +120,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");
 }
 


-- 
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