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

Changed the tuning code to use FrontendInfo to detect the type of DVB card

This commit is contained in:
Klaus Schmidinger 2001-10-27 13:01:33 +02:00
parent 3e10aa7839
commit fd4d1f77f2
3 changed files with 89 additions and 74 deletions

View File

@ -842,3 +842,4 @@ Video Disk Recorder Revision History
- Fixed a crash when pressing the '2' button while replaying a DVD.
- Updated 'channels.conf' for the "Bundesliga" channels of Premiere World
(thanks to Helmut Schächner).
- Changed the tuning code to use FrontendInfo to detect the type of DVB card.

View File

@ -7,7 +7,7 @@
* DVD support initially written by Andreas Schultz <aschultz@warp10.net>
* based on dvdplayer-0.5 by Matjaz Thaler <matjaz.thaler@guest.arnes.si>
*
* $Id: dvbapi.c 1.132 2001/10/21 13:36:27 kls Exp $
* $Id: dvbapi.c 1.133 2001/10/27 13:00:29 kls Exp $
*/
//#define DVDDEBUG 1
@ -2488,6 +2488,7 @@ char *cDvbApi::audioCommand = NULL;
cDvbApi::cDvbApi(int n)
{
frontendType = FrontendType(-1); // don't know how else to initialize this - there is no FE_UNKNOWN
vPid = aPid1 = aPid2 = dPid1 = dPid2 = 0;
siProcessor = NULL;
recordBuffer = NULL;
@ -2536,6 +2537,9 @@ cDvbApi::cDvbApi(int n)
siProcessor = new cSIProcessor(OstName(DEV_OST_DEMUX, n));
if (!dvbApi[0]) // only the first one shall set the system time
siProcessor->SetUseTSTime(Setup.SetSystemTime);
FrontendInfo feinfo;
CHECK(ioctl(fd_frontend, FE_GET_INFO, &feinfo));
frontendType = feinfo.type;
}
else
esyslog(LOG_ERR, "ERROR: can't open video device %d", n);
@ -3257,7 +3261,8 @@ eSetChannelResult cDvbApi::SetChannel(int ChannelNumber, int FrequencyMHz, char
bool ChannelSynced = false;
if (fd_sec >= 0) { // DVB-S
switch (frontendType) {
case FE_QPSK: { // DVB-S
// Frequency offsets:
@ -3316,7 +3321,8 @@ eSetChannelResult cDvbApi::SetChannel(int ChannelNumber, int FrequencyMHz, char
else
esyslog(LOG_ERR, "ERROR: timeout while tuning");
}
else if (fd_frontend >= 0) { // DVB-C
break;
case FE_QAM: { // DVB-C
// Frequency and symbol rate:
@ -3344,8 +3350,15 @@ eSetChannelResult cDvbApi::SetChannel(int ChannelNumber, int FrequencyMHz, char
else
esyslog(LOG_ERR, "ERROR: timeout while tuning");
}
else {
esyslog(LOG_ERR, "ERROR: attempt to set channel without DVB-S or DVB-C device");
break;
case FE_OFDM: { // DVB-T
//XXX TODO: implement DVB-T tuning (anybody with a DVB-T card out there?)
esyslog(LOG_ERR, "ERROR: DVB-T tuning support not yet implemented");
return scrFailed;
}
break;
default:
esyslog(LOG_ERR, "ERROR: attempt to set channel with unknown DVB frontend type");
return scrFailed;
}

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: dvbapi.h 1.54 2001/10/27 09:50:03 kls Exp $
* $Id: dvbapi.h 1.55 2001/10/27 12:44:45 kls Exp $
*/
#ifndef __DVBAPI_H
@ -89,6 +89,7 @@ class cDvbApi {
#endif //DVDSUPPORT
friend class cTransferBuffer;
private:
FrontendType frontendType;
int videoDev;
int fd_osd, fd_frontend, fd_sec, fd_dvr, fd_audio, fd_video, fd_demuxa1, fd_demuxa2, fd_demuxd1, fd_demuxd2, fd_demuxv, fd_demuxt;
int vPid, aPid1, aPid2, dPid1, dPid2;