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. - Fixed a crash when pressing the '2' button while replaying a DVD.
- Updated 'channels.conf' for the "Bundesliga" channels of Premiere World - Updated 'channels.conf' for the "Bundesliga" channels of Premiere World
(thanks to Helmut Schächner). (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> * DVD support initially written by Andreas Schultz <aschultz@warp10.net>
* based on dvdplayer-0.5 by Matjaz Thaler <matjaz.thaler@guest.arnes.si> * 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 //#define DVDDEBUG 1
@ -2488,6 +2488,7 @@ char *cDvbApi::audioCommand = NULL;
cDvbApi::cDvbApi(int n) 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; vPid = aPid1 = aPid2 = dPid1 = dPid2 = 0;
siProcessor = NULL; siProcessor = NULL;
recordBuffer = NULL; recordBuffer = NULL;
@ -2536,6 +2537,9 @@ cDvbApi::cDvbApi(int n)
siProcessor = new cSIProcessor(OstName(DEV_OST_DEMUX, n)); siProcessor = new cSIProcessor(OstName(DEV_OST_DEMUX, n));
if (!dvbApi[0]) // only the first one shall set the system time if (!dvbApi[0]) // only the first one shall set the system time
siProcessor->SetUseTSTime(Setup.SetSystemTime); siProcessor->SetUseTSTime(Setup.SetSystemTime);
FrontendInfo feinfo;
CHECK(ioctl(fd_frontend, FE_GET_INFO, &feinfo));
frontendType = feinfo.type;
} }
else else
esyslog(LOG_ERR, "ERROR: can't open video device %d", n); 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; bool ChannelSynced = false;
if (fd_sec >= 0) { // DVB-S switch (frontendType) {
case FE_QPSK: { // DVB-S
// Frequency offsets: // Frequency offsets:
@ -3316,7 +3321,8 @@ eSetChannelResult cDvbApi::SetChannel(int ChannelNumber, int FrequencyMHz, char
else else
esyslog(LOG_ERR, "ERROR: timeout while tuning"); esyslog(LOG_ERR, "ERROR: timeout while tuning");
} }
else if (fd_frontend >= 0) { // DVB-C break;
case FE_QAM: { // DVB-C
// Frequency and symbol rate: // Frequency and symbol rate:
@ -3344,8 +3350,15 @@ eSetChannelResult cDvbApi::SetChannel(int ChannelNumber, int FrequencyMHz, char
else else
esyslog(LOG_ERR, "ERROR: timeout while tuning"); esyslog(LOG_ERR, "ERROR: timeout while tuning");
} }
else { break;
esyslog(LOG_ERR, "ERROR: attempt to set channel without DVB-S or DVB-C device"); 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; return scrFailed;
} }

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: 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 #ifndef __DVBAPI_H
@ -89,6 +89,7 @@ class cDvbApi {
#endif //DVDSUPPORT #endif //DVDSUPPORT
friend class cTransferBuffer; friend class cTransferBuffer;
private: private:
FrontendType frontendType;
int videoDev; 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 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; int vPid, aPid1, aPid2, dPid1, dPid2;