|
From: <lin...@us...> - 2002-10-13 18:39:57
|
Update of /cvsroot/dvbtools/dvbstream
In directory usw-pr-cvs1:/tmp/cvs-serv2186
Modified Files:
Makefile tune.c tune.h dvbstream.c rtpfeed.c
Log Message:
NEWSTRUCT changes
Index: Makefile
===================================================================
RCS file: /cvsroot/dvbtools/dvbstream/Makefile,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Makefile 27 Aug 2002 06:53:31 -0000 1.4
--- Makefile 13 Oct 2002 18:39:53 -0000 1.5
***************
*** 1,3 ****
! INCS=-I ../DVB/ost/include
CC=gcc
CFLAGS = -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
--- 1,8 ----
! # Delete the following line if you are not using a
! # "NEWSTRUCT" driver. If you are using a "NEWSTRUCT"
! # driver, it must be later than October 10th 2002
!
! NEWSTRUCT=1
!
CC=gcc
CFLAGS = -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
***************
*** 6,9 ****
--- 11,17 ----
ifdef NEWSTRUCT
CFLAGS += -DNEWSTRUCT
+ INCS=-I ../DVB/include
+ else
+ INCS=-I ../DVB/ost/include
endif
Index: tune.c
===================================================================
RCS file: /cvsroot/dvbtools/dvbstream/tune.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** tune.c 27 Aug 2002 08:13:57 -0000 1.8
--- tune.c 13 Oct 2002 18:39:53 -0000 1.9
***************
*** 26,29 ****
--- 26,30 ----
#include <sys/poll.h>
#include <unistd.h>
+ #include <error.h>
#ifdef NEWSTRUCT
***************
*** 149,153 ****
#endif
! void print_status(FILE* fd,FrontendStatus festatus) {
fprintf(fd,"FE_STATUS:");
if (festatus & FE_HAS_SIGNAL) fprintf(fd," FE_HAS_SIGNAL");
--- 150,154 ----
#endif
! void print_status(FILE* fd,fe_status_t festatus) {
fprintf(fd,"FE_STATUS:");
if (festatus & FE_HAS_SIGNAL) fprintf(fd," FE_HAS_SIGNAL");
***************
*** 170,174 ****
int i,res;
int32_t strength;
! FrontendStatus festatus;
struct dvb_frontend_event event;
struct dvb_frontend_info fe_info;
--- 171,175 ----
int i,res;
int32_t strength;
! fe_status_t festatus;
struct dvb_frontend_event event;
struct dvb_frontend_info fe_info;
***************
*** 189,193 ****
if (pfd[0].revents & POLLIN){
fprintf(stderr,"Getting frontend event\n");
! if ( ioctl(fd_frontend, FE_GET_EVENT, &event) == -EBUFFEROVERFLOW){
perror("FE_GET_EVENT");
return -1;
--- 190,194 ----
if (pfd[0].revents & POLLIN){
fprintf(stderr,"Getting frontend event\n");
! if ( ioctl(fd_frontend, FE_GET_EVENT, &event) < 0){
perror("FE_GET_EVENT");
return -1;
***************
*** 243,247 ****
int i,res;
int32_t strength;
! FrontendStatus festatus;
FrontendEvent event;
FrontendInfo fe_info;
--- 244,248 ----
int i,res;
int32_t strength;
! fe_status_t festatus;
FrontendEvent event;
FrontendInfo fe_info;
***************
*** 261,265 ****
if (pfd[0].revents & POLLIN){
fprintf(stderr,"Getting frontend event\n");
! if ( ioctl(fd_frontend, FE_GET_EVENT, &event) == -EBUFFEROVERFLOW){
perror("FE_GET_EVENT");
return -1;
--- 262,266 ----
if (pfd[0].revents & POLLIN){
fprintf(stderr,"Getting frontend event\n");
! if ( ioctl(fd_frontend, FE_GET_EVENT, &event) < 0) {
perror("FE_GET_EVENT");
return -1;
***************
*** 348,357 ****
#endif
! int tune_it(int fd_frontend, int fd_sec, unsigned int freq, unsigned int srate, char pol, int tone, SpectralInversion specInv, unsigned int diseqc,Modulation modulation,CodeRate HP_CodeRate,TransmitMode TransmissionMode,GuardInterval guardInterval, BandWidth bandWidth) {
int res;
#ifdef NEWSTRUCT
struct dvb_frontend_parameters feparams;
struct dvb_frontend_info fe_info;
! SecVoltage voltage;
#else
FrontendParameters feparams;
--- 349,358 ----
#endif
! 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;
#ifdef NEWSTRUCT
struct dvb_frontend_parameters feparams;
struct dvb_frontend_info fe_info;
! fe_sec_voltage_t voltage;
#else
FrontendParameters feparams;
***************
*** 389,397 ****
switch(fe_info.type) {
case FE_OFDM:
- fprintf(stderr,"tuning DVB-T (%s) to %d\n",DVB_T_LOCATION,freq);
#ifdef NEWSTRUCT
feparams.frequency=freq;
feparams.inversion=INVERSION_OFF;
! feparams.u.ofdm.bandwidth=bandWidth;
feparams.u.ofdm.code_rate_HP=HP_CodeRate;
feparams.u.ofdm.code_rate_LP=LP_CODERATE_DEFAULT;
--- 390,398 ----
switch(fe_info.type) {
case FE_OFDM:
#ifdef NEWSTRUCT
+ if (freq < 1000000) freq*=1000UL;
feparams.frequency=freq;
feparams.inversion=INVERSION_OFF;
! feparams.u.ofdm.bandwidth=bandwidth;
feparams.u.ofdm.code_rate_HP=HP_CodeRate;
feparams.u.ofdm.code_rate_LP=LP_CODERATE_DEFAULT;
***************
*** 401,407 ****
feparams.u.ofdm.hierarchy_information=HIERARCHY_DEFAULT;
#else
feparams.Frequency=freq;
feparams.Inversion=INVERSION_OFF;
! feparams.u.ofdm.bandWidth=bandWidth;
feparams.u.ofdm.HP_CodeRate=HP_CodeRate;
feparams.u.ofdm.LP_CodeRate=LP_CODERATE_DEFAULT;
--- 402,409 ----
feparams.u.ofdm.hierarchy_information=HIERARCHY_DEFAULT;
#else
+ if (freq < 1000000) freq*=1000UL;
feparams.Frequency=freq;
feparams.Inversion=INVERSION_OFF;
! feparams.u.ofdm.bandWidth=bandwidth;
feparams.u.ofdm.HP_CodeRate=HP_CodeRate;
feparams.u.ofdm.LP_CodeRate=LP_CODERATE_DEFAULT;
***************
*** 411,414 ****
--- 413,417 ----
feparams.u.ofdm.HierarchyInformation=HIERARCHY_DEFAULT;
#endif
+ fprintf(stderr,"tuning DVB-T (%s) to %d Hz\n",DVB_T_LOCATION,freq);
break;
case FE_QPSK:
Index: tune.h
===================================================================
RCS file: /cvsroot/dvbtools/dvbstream/tune.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** tune.h 6 Jul 2002 08:43:12 -0000 1.3
--- tune.h 13 Oct 2002 18:39:53 -0000 1.4
***************
*** 2,9 ****
#define _TUNE_H
! #include <ost/frontend.h>
#include "dvb_defaults.h"
! int tune_it(int fd_frontend, int fd_sec, unsigned int freq, unsigned int srate, char pol, int tone, SpectralInversion specInv, unsigned int diseqc,Modulation modulation,CodeRate HP_CodeRate,TransmitMode TransmissionMode,GuardInterval guardInterval, BandWidth bandwidth);
#endif
--- 2,28 ----
#define _TUNE_H
! #ifdef NEWSTRUCT
! #include <linux/dvb/frontend.h>
! #else
!
! // The following defines make the "OLDSTRUCT" driver more compatible with NEWSTRUCT.
!
! #include <ost/frontend.h>
!
! #define fe_status_t FrontendStatus
! #define fe_spectral_inversion_t SpectralInversion
! #define fe_modulation_t Modulation
! #define fe_code_rate_t CodeRate
! #define fe_transmit_mode_t TransmitMode
! #define fe_guard_interval_t GuardInterval
! #define fe_bandwidth_t BandWidth
! #define fe_sec_voltage_t SecVoltage
! #define dmx_pes_filter_params dmxPesFilterParams
! #define dmx_sct_filter_params dmxSctFilterParams
! #endif
!
#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
Index: dvbstream.c
===================================================================
RCS file: /cvsroot/dvbtools/dvbstream/dvbstream.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** dvbstream.c 27 Aug 2002 07:05:32 -0000 1.6
--- dvbstream.c 13 Oct 2002 18:39:53 -0000 1.7
***************
*** 91,101 ****
int Interrupted=0;
! SpectralInversion specInv=INVERSION_AUTO;
int tone=-1;
! Modulation modulation=CONSTELLATION_DEFAULT;
! TransmitMode TransmissionMode=TRANSMISSION_MODE_DEFAULT;
! BandWidth bandWidth=BANDWIDTH_DEFAULT;
! GuardInterval guardInterval=GUARD_INTERVAL_DEFAULT;
! CodeRate HP_CodeRate=HP_CODERATE_DEFAULT;
unsigned int diseqc=0;
char pol=0;
--- 91,101 ----
int Interrupted=0;
! fe_spectral_inversion_t specInv=INVERSION_AUTO;
int tone=-1;
! fe_modulation_t modulation=CONSTELLATION_DEFAULT;
! fe_transmit_mode_t TransmissionMode=TRANSMISSION_MODE_DEFAULT;
! fe_bandwidth_t bandWidth=BANDWIDTH_DEFAULT;
! fe_guard_interval_t guardInterval=GUARD_INTERVAL_DEFAULT;
! fe_code_rate_t HP_CodeRate=HP_CODERATE_DEFAULT;
unsigned int diseqc=0;
char pol=0;
***************
*** 136,147 ****
#define MAX_CHANNELS 8
! void set_ts_filt(int fd,uint16_t pid, dmxPesType_t pestype)
{
! struct dmxPesFilterParams pesFilterParams;
pesFilterParams.pid = pid;
pesFilterParams.input = DMX_IN_FRONTEND;
pesFilterParams.output = DMX_OUT_TS_TAP;
pesFilterParams.pesType = pestype;
pesFilterParams.flags = DMX_IMMEDIATE_START;
--- 136,151 ----
#define MAX_CHANNELS 8
! void set_ts_filt(int fd,uint16_t pid, dmx_pes_type_t pestype)
{
! struct dmx_pes_filter_params pesFilterParams;
pesFilterParams.pid = pid;
pesFilterParams.input = DMX_IN_FRONTEND;
pesFilterParams.output = DMX_OUT_TS_TAP;
+ #ifdef NEWSTRUCT
+ pesFilterParams.pes_type = pestype;
+ #else
pesFilterParams.pesType = pestype;
+ #endif
pesFilterParams.flags = DMX_IMMEDIATE_START;
***************
*** 202,206 ****
int i;
char* ch;
! dmxPesType_t pestype;
unsigned long freq=0;
unsigned long srate=0;
--- 206,210 ----
int i;
char* ch;
! dmx_pes_type_t pestype;
unsigned long freq=0;
unsigned long srate=0;
***************
*** 419,423 ****
int count;
char* ch;
! dmxPesType_t pestype;
int bytes_read;
unsigned char* free_bytes;
--- 423,427 ----
int count;
char* ch;
! dmx_pes_type_t pestype;
int bytes_read;
unsigned char* free_bytes;
Index: rtpfeed.c
===================================================================
RCS file: /cvsroot/dvbtools/dvbstream/rtpfeed.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** rtpfeed.c 27 Jun 2002 19:11:31 -0000 1.2
--- rtpfeed.c 13 Oct 2002 18:39:53 -0000 1.3
***************
*** 40,45 ****
--- 40,51 ----
// DVB includes:
+ #ifdef NEWSTRUCT
+ #include <linux/dvb/dmx.h>
+ #include <linux/dvb/frontend.h>
+ #else
#include <ost/dmx.h>
#include <ost/frontend.h>
+ #define dmx_pes_filter_params dmxPesFilterParams
+ #endif
***************
*** 64,74 ****
void set_ts_filt(int fd,uint16_t pid, int type)
{
! struct dmxPesFilterParams pesFilterParams;
pesFilterParams.pid = pid;
pesFilterParams.input = DMX_IN_DVR;
pesFilterParams.output = DMX_OUT_DECODER;
if (type==1) pesFilterParams.pesType = DMX_PES_VIDEO;
if (type==2) pesFilterParams.pesType = DMX_PES_AUDIO;
pesFilterParams.flags = DMX_IMMEDIATE_START;
--- 70,85 ----
void set_ts_filt(int fd,uint16_t pid, int type)
{
! struct dmx_pes_filter_params pesFilterParams;
pesFilterParams.pid = pid;
pesFilterParams.input = DMX_IN_DVR;
pesFilterParams.output = DMX_OUT_DECODER;
+ #ifdef NEWSTRUCT
+ if (type==1) pesFilterParams.pes_type = DMX_PES_VIDEO;
+ if (type==2) pesFilterParams.pes_type = DMX_PES_AUDIO;
+ #else
if (type==1) pesFilterParams.pesType = DMX_PES_VIDEO;
if (type==2) pesFilterParams.pesType = DMX_PES_AUDIO;
+ #endif
pesFilterParams.flags = DMX_IMMEDIATE_START;
|