diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2002-10-11 13:23:44 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2002-10-11 13:23:44 +0200 |
commit | 6439d378067ceaf2b24ce3e19d3d0be3a261f615 (patch) | |
tree | 5ad08508a6bdba97778ee45fa89a2d7173a7acec /dvbdevice.c | |
parent | a3c772330a6e76a0e2442909d5baf4795b38a1d1 (diff) | |
download | vdr-6439d378067ceaf2b24ce3e19d3d0be3a261f615.tar.gz vdr-6439d378067ceaf2b24ce3e19d3d0be3a261f615.tar.bz2 |
Adapted type names to the new HEAD version of the driver
Diffstat (limited to 'dvbdevice.c')
-rw-r--r-- | dvbdevice.c | 58 |
1 files changed, 43 insertions, 15 deletions
diff --git a/dvbdevice.c b/dvbdevice.c index eeaa7b07..418e3c89 100644 --- a/dvbdevice.c +++ b/dvbdevice.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbdevice.c 1.22 2002/10/06 09:07:45 kls Exp $ + * $Id: dvbdevice.c 1.23 2002/10/11 12:49:12 kls Exp $ */ #include "dvbdevice.h" @@ -80,7 +80,11 @@ static int DvbOpen(const char *Name, int n, int Mode, bool ReportError = false) cDvbDevice::cDvbDevice(int n) { +#ifdef NEWSTRUCT + frontendType = fe_type_t(-1); // don't know how else to initialize this - there is no FE_UNKNOWN +#else frontendType = FrontendType(-1); // don't know how else to initialize this - there is no FE_UNKNOWN +#endif siProcessor = NULL; spuDecoder = NULL; playMode = pmNone; @@ -306,12 +310,20 @@ void cDvbDevice::SetVideoFormat(bool VideoFormat16_9) } // ptAudio ptVideo ptTeletext ptDolby ptOther +#ifdef NEWSTRUCT +dmx_pes_type_t PesTypes[] = { DMX_PES_AUDIO, DMX_PES_VIDEO, DMX_PES_TELETEXT, DMX_PES_OTHER, DMX_PES_OTHER }; +#else dmxPesType_t PesTypes[] = { DMX_PES_AUDIO, DMX_PES_VIDEO, DMX_PES_TELETEXT, DMX_PES_OTHER, DMX_PES_OTHER }; +#endif bool cDvbDevice::SetPid(cPidHandle *Handle, int Type, bool On) { if (Handle->pid) { +#ifdef NEWSTRUCT + dmx_pes_filter_params pesFilterParams; +#else dmxPesFilterParams pesFilterParams; +#endif memset(&pesFilterParams, 0, sizeof(pesFilterParams)); if (On) { if (Handle->handle < 0) { @@ -322,7 +334,11 @@ bool cDvbDevice::SetPid(cPidHandle *Handle, int Type, bool On) pesFilterParams.pid = Handle->pid; pesFilterParams.input = DMX_IN_FRONTEND; pesFilterParams.output = (Type <= ptTeletext && Handle->used <= 1) ? DMX_OUT_DECODER : DMX_OUT_TS_TAP; +#ifdef NEWSTRUCT + pesFilterParams.pes_type= PesTypes[Type < ptOther ? Type : ptOther]; +#else pesFilterParams.pesType = PesTypes[Type < ptOther ? Type : ptOther]; +#endif pesFilterParams.flags = DMX_IMMEDIATE_START; if (ioctl(Handle->handle, DMX_SET_PES_FILTER, &pesFilterParams) < 0) { LOG_ERROR; @@ -335,7 +351,11 @@ bool cDvbDevice::SetPid(cPidHandle *Handle, int Type, bool On) pesFilterParams.pid = 0x1FFF; pesFilterParams.input = DMX_IN_FRONTEND; pesFilterParams.output = DMX_OUT_DECODER; +#ifdef NEWSTRUCT + pesFilterParams.pes_type= PesTypes[Type]; +#else pesFilterParams.pesType = PesTypes[Type]; +#endif pesFilterParams.flags = DMX_IMMEDIATE_START; CHECK(ioctl(Handle->handle, DMX_SET_PES_FILTER, &pesFilterParams)); close(Handle->handle); @@ -584,9 +604,9 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView) #ifdef NEWSTRUCT Frontend.frequency = frequency * 1000UL; - Frontend.inversion = SpectralInversion(Channel->Inversion()); + Frontend.inversion = fe_spectral_inversion_t(Channel->Inversion()); Frontend.u.qpsk.symbol_rate = Channel->Srate() * 1000UL; - Frontend.u.qpsk.fec_inner = CodeRate(Channel->CoderateH()); + Frontend.u.qpsk.fec_inner = fe_code_rate_t(Channel->CoderateH()); #else Frontend.Frequency = frequency * 1000UL; Frontend.Inversion = SpectralInversion(Channel->Inversion()); @@ -601,10 +621,10 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView) #ifdef NEWSTRUCT Frontend.frequency = Channel->Frequency() * 1000000UL; - Frontend.inversion = SpectralInversion(Channel->Inversion()); + Frontend.inversion = fe_spectral_inversion_t(Channel->Inversion()); Frontend.u.qam.symbol_rate = Channel->Srate() * 1000UL; - Frontend.u.qam.fec_inner = CodeRate(Channel->CoderateH()); - Frontend.u.qam.modulation = Modulation(Channel->Modulation()); + Frontend.u.qam.fec_inner = fe_code_rate_t(Channel->CoderateH()); + Frontend.u.qam.modulation = fe_modulation_t(Channel->Modulation()); #else Frontend.Frequency = Channel->Frequency() * 1000000UL; Frontend.Inversion = SpectralInversion(Channel->Inversion()); @@ -620,14 +640,14 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView) #ifdef NEWSTRUCT Frontend.frequency = Channel->Frequency() * 1000UL; - Frontend.inversion = SpectralInversion(Channel->Inversion()); - Frontend.u.ofdm.bandwidth = BandWidth(Channel->Bandwidth()); - Frontend.u.ofdm.code_rate_HP = CodeRate(Channel->CoderateH()); - Frontend.u.ofdm.code_rate_LP = CodeRate(Channel->CoderateL()); - Frontend.u.ofdm.constellation = Modulation(Channel->Modulation()); - Frontend.u.ofdm.transmission_mode = TransmitMode(Channel->Transmission()); - Frontend.u.ofdm.guard_interval = GuardInterval(Channel->Guard()); - Frontend.u.ofdm.hierarchy_information = Hierarchy(Channel->Hierarchy()); + Frontend.inversion = fe_spectral_inversion_t(Channel->Inversion()); + Frontend.u.ofdm.bandwidth = fe_bandwidth_t(Channel->Bandwidth()); + Frontend.u.ofdm.code_rate_HP = fe_code_rate_t(Channel->CoderateH()); + Frontend.u.ofdm.code_rate_LP = fe_code_rate_t(Channel->CoderateL()); + Frontend.u.ofdm.constellation = fe_modulation_t(Channel->Modulation()); + Frontend.u.ofdm.transmission_mode = fe_transmit_mode_t(Channel->Transmission()); + Frontend.u.ofdm.guard_interval = fe_guard_interval_t(Channel->Guard()); + Frontend.u.ofdm.hierarchy_information = fe_hierarchy_t(Channel->Hierarchy()); #else Frontend.Frequency = Channel->Frequency() * 1000UL; Frontend.Inversion = SpectralInversion(Channel->Inversion()); @@ -663,7 +683,7 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView) // Wait for channel lock: #ifdef NEWSTRUCT - FrontendStatus status = FrontendStatus(0); + fe_status_t status = fe_status_t(0); for (int i = 0; i < 100; i++) { CHECK(ioctl(fd_frontend, FE_READ_STATUS, &status)); if (status & FE_HAS_LOCK) @@ -726,7 +746,11 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView) void cDvbDevice::SetVolumeDevice(int Volume) { if (HasDecoder()) { +#ifdef NEWSTRUCT + audio_mixer_t am; +#else audioMixer_t am; +#endif am.volume_left = am.volume_right = Volume; CHECK(ioctl(fd_audio, AUDIO_SET_MIXER, &am)); } @@ -916,7 +940,11 @@ bool cDvbDevice::GetTSPacket(uchar *&Data) return true; } else if (FATALERRNO) { +#ifdef NEWSTRUCT + if (errno == EOVERFLOW) +#else if (errno == EBUFFEROVERFLOW) // this error code is not defined in the library +#endif esyslog("ERROR: DVB driver buffer overflow on device %d", CardIndex() + 1); else { LOG_ERROR; |