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 | |
parent | a3c772330a6e76a0e2442909d5baf4795b38a1d1 (diff) | |
download | vdr-6439d378067ceaf2b24ce3e19d3d0be3a261f615.tar.gz vdr-6439d378067ceaf2b24ce3e19d3d0be3a261f615.tar.bz2 |
Adapted type names to the new HEAD version of the driver
-rw-r--r-- | HISTORY | 7 | ||||
-rw-r--r-- | dvbdevice.c | 58 | ||||
-rw-r--r-- | dvbdevice.h | 5 | ||||
-rw-r--r-- | eit.c | 6 |
4 files changed, 57 insertions, 19 deletions
@@ -1580,10 +1580,15 @@ Video Disk Recorder Revision History - Fixed a bug when pressing the "Blue" button in the main menu without having displayed it (thanks to Oliver Endriss for reporting this one). -2002-10-07: Version 1.1.13 +2002-10-11: Version 1.1.13 - Added cDevice::DeviceNumber() to get the number of a device, not counting any gaps that might be in the index count. - Fixed fetching the current/next information to handle cases where the duration of an event is set wrongly and would last beyond the start time of the next event. +- Adapted type names to the new HEAD version of the driver (which the previous + NEWSTRUCT branch has been merged into). Note that to use this driver version + you still need to add NEWSTRUCT=1 to the make call when building VDR. You + need a HEAD version of the LinuxDVB driver dated 2002-10-11 or later to compile + VDR with NEWSTRUCT=1. 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; diff --git a/dvbdevice.h b/dvbdevice.h index df7aa035..98456643 100644 --- a/dvbdevice.h +++ b/dvbdevice.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbdevice.h 1.12 2002/10/06 08:57:24 kls Exp $ + * $Id: dvbdevice.h 1.13 2002/10/11 12:24:19 kls Exp $ */ #ifndef __DVBDEVICE_H @@ -36,10 +36,11 @@ public: // Initializes the DVB devices. // Must be called before accessing any DVB functions. private: - FrontendType frontendType; #ifdef NEWSTRUCT + fe_type_t frontendType; int fd_osd, fd_frontend, fd_audio, fd_video, fd_dvr; #else + FrontendType frontendType; int fd_osd, fd_frontend, fd_sec, fd_audio, fd_video, fd_dvr; #endif int OsdDeviceHandle(void) const { return fd_osd; } @@ -16,7 +16,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: eit.c 1.55 2002/10/07 16:24:04 kls Exp $ + * $Id: eit.c 1.56 2002/10/11 13:14:57 kls Exp $ ***************************************************************************/ #include "eit.h" @@ -1196,7 +1196,11 @@ void cSIProcessor::Action() table identifer tid */ bool cSIProcessor::AddFilter(u_char pid, u_char tid) { +#ifdef NEWSTRUCT + dmx_sct_filter_params sctFilterParams; +#else dmxSctFilterParams sctFilterParams; +#endif memset(&sctFilterParams, 0, sizeof(sctFilterParams)); sctFilterParams.pid = pid; sctFilterParams.timeout = 0; |