1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Adapted type names to the new HEAD version of the driver

This commit is contained in:
Klaus Schmidinger 2002-10-11 13:23:44 +02:00
parent a3c772330a
commit 6439d37806
4 changed files with 57 additions and 19 deletions

View File

@ -1580,10 +1580,15 @@ Video Disk Recorder Revision History
- Fixed a bug when pressing the "Blue" button in the main menu without having - Fixed a bug when pressing the "Blue" button in the main menu without having
displayed it (thanks to Oliver Endriss for reporting this one). 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 - Added cDevice::DeviceNumber() to get the number of a device, not counting any
gaps that might be in the index count. gaps that might be in the index count.
- Fixed fetching the current/next information to handle cases where the duration - 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 of an event is set wrongly and would last beyond the start time of the next
event. 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.

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "dvbdevice.h"
@ -80,7 +80,11 @@ static int DvbOpen(const char *Name, int n, int Mode, bool ReportError = false)
cDvbDevice::cDvbDevice(int n) 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 frontendType = FrontendType(-1); // don't know how else to initialize this - there is no FE_UNKNOWN
#endif
siProcessor = NULL; siProcessor = NULL;
spuDecoder = NULL; spuDecoder = NULL;
playMode = pmNone; playMode = pmNone;
@ -306,12 +310,20 @@ void cDvbDevice::SetVideoFormat(bool VideoFormat16_9)
} }
// ptAudio ptVideo ptTeletext ptDolby ptOther // 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 }; 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) bool cDvbDevice::SetPid(cPidHandle *Handle, int Type, bool On)
{ {
if (Handle->pid) { if (Handle->pid) {
#ifdef NEWSTRUCT
dmx_pes_filter_params pesFilterParams;
#else
dmxPesFilterParams pesFilterParams; dmxPesFilterParams pesFilterParams;
#endif
memset(&pesFilterParams, 0, sizeof(pesFilterParams)); memset(&pesFilterParams, 0, sizeof(pesFilterParams));
if (On) { if (On) {
if (Handle->handle < 0) { if (Handle->handle < 0) {
@ -322,7 +334,11 @@ bool cDvbDevice::SetPid(cPidHandle *Handle, int Type, bool On)
pesFilterParams.pid = Handle->pid; pesFilterParams.pid = Handle->pid;
pesFilterParams.input = DMX_IN_FRONTEND; pesFilterParams.input = DMX_IN_FRONTEND;
pesFilterParams.output = (Type <= ptTeletext && Handle->used <= 1) ? DMX_OUT_DECODER : DMX_OUT_TS_TAP; 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]; pesFilterParams.pesType = PesTypes[Type < ptOther ? Type : ptOther];
#endif
pesFilterParams.flags = DMX_IMMEDIATE_START; pesFilterParams.flags = DMX_IMMEDIATE_START;
if (ioctl(Handle->handle, DMX_SET_PES_FILTER, &pesFilterParams) < 0) { if (ioctl(Handle->handle, DMX_SET_PES_FILTER, &pesFilterParams) < 0) {
LOG_ERROR; LOG_ERROR;
@ -335,7 +351,11 @@ bool cDvbDevice::SetPid(cPidHandle *Handle, int Type, bool On)
pesFilterParams.pid = 0x1FFF; pesFilterParams.pid = 0x1FFF;
pesFilterParams.input = DMX_IN_FRONTEND; pesFilterParams.input = DMX_IN_FRONTEND;
pesFilterParams.output = DMX_OUT_DECODER; pesFilterParams.output = DMX_OUT_DECODER;
#ifdef NEWSTRUCT
pesFilterParams.pes_type= PesTypes[Type];
#else
pesFilterParams.pesType = PesTypes[Type]; pesFilterParams.pesType = PesTypes[Type];
#endif
pesFilterParams.flags = DMX_IMMEDIATE_START; pesFilterParams.flags = DMX_IMMEDIATE_START;
CHECK(ioctl(Handle->handle, DMX_SET_PES_FILTER, &pesFilterParams)); CHECK(ioctl(Handle->handle, DMX_SET_PES_FILTER, &pesFilterParams));
close(Handle->handle); close(Handle->handle);
@ -584,9 +604,9 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
#ifdef NEWSTRUCT #ifdef NEWSTRUCT
Frontend.frequency = frequency * 1000UL; 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.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 #else
Frontend.Frequency = frequency * 1000UL; Frontend.Frequency = frequency * 1000UL;
Frontend.Inversion = SpectralInversion(Channel->Inversion()); Frontend.Inversion = SpectralInversion(Channel->Inversion());
@ -601,10 +621,10 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
#ifdef NEWSTRUCT #ifdef NEWSTRUCT
Frontend.frequency = Channel->Frequency() * 1000000UL; 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.symbol_rate = Channel->Srate() * 1000UL;
Frontend.u.qam.fec_inner = CodeRate(Channel->CoderateH()); Frontend.u.qam.fec_inner = fe_code_rate_t(Channel->CoderateH());
Frontend.u.qam.modulation = Modulation(Channel->Modulation()); Frontend.u.qam.modulation = fe_modulation_t(Channel->Modulation());
#else #else
Frontend.Frequency = Channel->Frequency() * 1000000UL; Frontend.Frequency = Channel->Frequency() * 1000000UL;
Frontend.Inversion = SpectralInversion(Channel->Inversion()); Frontend.Inversion = SpectralInversion(Channel->Inversion());
@ -620,14 +640,14 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
#ifdef NEWSTRUCT #ifdef NEWSTRUCT
Frontend.frequency = Channel->Frequency() * 1000UL; Frontend.frequency = Channel->Frequency() * 1000UL;
Frontend.inversion = SpectralInversion(Channel->Inversion()); Frontend.inversion = fe_spectral_inversion_t(Channel->Inversion());
Frontend.u.ofdm.bandwidth = BandWidth(Channel->Bandwidth()); Frontend.u.ofdm.bandwidth = fe_bandwidth_t(Channel->Bandwidth());
Frontend.u.ofdm.code_rate_HP = CodeRate(Channel->CoderateH()); Frontend.u.ofdm.code_rate_HP = fe_code_rate_t(Channel->CoderateH());
Frontend.u.ofdm.code_rate_LP = CodeRate(Channel->CoderateL()); Frontend.u.ofdm.code_rate_LP = fe_code_rate_t(Channel->CoderateL());
Frontend.u.ofdm.constellation = Modulation(Channel->Modulation()); Frontend.u.ofdm.constellation = fe_modulation_t(Channel->Modulation());
Frontend.u.ofdm.transmission_mode = TransmitMode(Channel->Transmission()); Frontend.u.ofdm.transmission_mode = fe_transmit_mode_t(Channel->Transmission());
Frontend.u.ofdm.guard_interval = GuardInterval(Channel->Guard()); Frontend.u.ofdm.guard_interval = fe_guard_interval_t(Channel->Guard());
Frontend.u.ofdm.hierarchy_information = Hierarchy(Channel->Hierarchy()); Frontend.u.ofdm.hierarchy_information = fe_hierarchy_t(Channel->Hierarchy());
#else #else
Frontend.Frequency = Channel->Frequency() * 1000UL; Frontend.Frequency = Channel->Frequency() * 1000UL;
Frontend.Inversion = SpectralInversion(Channel->Inversion()); Frontend.Inversion = SpectralInversion(Channel->Inversion());
@ -663,7 +683,7 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
// Wait for channel lock: // Wait for channel lock:
#ifdef NEWSTRUCT #ifdef NEWSTRUCT
FrontendStatus status = FrontendStatus(0); fe_status_t status = fe_status_t(0);
for (int i = 0; i < 100; i++) { for (int i = 0; i < 100; i++) {
CHECK(ioctl(fd_frontend, FE_READ_STATUS, &status)); CHECK(ioctl(fd_frontend, FE_READ_STATUS, &status));
if (status & FE_HAS_LOCK) if (status & FE_HAS_LOCK)
@ -726,7 +746,11 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
void cDvbDevice::SetVolumeDevice(int Volume) void cDvbDevice::SetVolumeDevice(int Volume)
{ {
if (HasDecoder()) { if (HasDecoder()) {
#ifdef NEWSTRUCT
audio_mixer_t am;
#else
audioMixer_t am; audioMixer_t am;
#endif
am.volume_left = am.volume_right = Volume; am.volume_left = am.volume_right = Volume;
CHECK(ioctl(fd_audio, AUDIO_SET_MIXER, &am)); CHECK(ioctl(fd_audio, AUDIO_SET_MIXER, &am));
} }
@ -916,7 +940,11 @@ bool cDvbDevice::GetTSPacket(uchar *&Data)
return true; return true;
} }
else if (FATALERRNO) { else if (FATALERRNO) {
#ifdef NEWSTRUCT
if (errno == EOVERFLOW)
#else
if (errno == EBUFFEROVERFLOW) // this error code is not defined in the library if (errno == EBUFFEROVERFLOW) // this error code is not defined in the library
#endif
esyslog("ERROR: DVB driver buffer overflow on device %d", CardIndex() + 1); esyslog("ERROR: DVB driver buffer overflow on device %d", CardIndex() + 1);
else { else {
LOG_ERROR; LOG_ERROR;

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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 #ifndef __DVBDEVICE_H
@ -36,10 +36,11 @@ public:
// Initializes the DVB devices. // Initializes the DVB devices.
// Must be called before accessing any DVB functions. // Must be called before accessing any DVB functions.
private: private:
FrontendType frontendType;
#ifdef NEWSTRUCT #ifdef NEWSTRUCT
fe_type_t frontendType;
int fd_osd, fd_frontend, fd_audio, fd_video, fd_dvr; int fd_osd, fd_frontend, fd_audio, fd_video, fd_dvr;
#else #else
FrontendType frontendType;
int fd_osd, fd_frontend, fd_sec, fd_audio, fd_video, fd_dvr; int fd_osd, fd_frontend, fd_sec, fd_audio, fd_video, fd_dvr;
#endif #endif
int OsdDeviceHandle(void) const { return fd_osd; } int OsdDeviceHandle(void) const { return fd_osd; }

6
eit.c
View File

@ -16,7 +16,7 @@
* the Free Software Foundation; either version 2 of the License, or * * the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. * * (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" #include "eit.h"
@ -1196,7 +1196,11 @@ void cSIProcessor::Action()
table identifer tid */ table identifer tid */
bool cSIProcessor::AddFilter(u_char pid, u_char tid) bool cSIProcessor::AddFilter(u_char pid, u_char tid)
{ {
#ifdef NEWSTRUCT
dmx_sct_filter_params sctFilterParams;
#else
dmxSctFilterParams sctFilterParams; dmxSctFilterParams sctFilterParams;
#endif
memset(&sctFilterParams, 0, sizeof(sctFilterParams)); memset(&sctFilterParams, 0, sizeof(sctFilterParams));
sctFilterParams.pid = pid; sctFilterParams.pid = pid;
sctFilterParams.timeout = 0; sctFilterParams.timeout = 0;