summaryrefslogtreecommitdiff
path: root/dvbapi.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2000-11-01 18:00:00 +0100
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2000-11-01 18:00:00 +0100
commita69b3211dc4f9b34eef440067d5ba304fbfbad94 (patch)
tree7701ccce8cef832eb5ab56293a7ae99aca40b78e /dvbapi.c
parenta379eb714f7f5ef9a12efbe7588bb3509faba056 (diff)
downloadvdr-patch-lnbsharing-a69b3211dc4f9b34eef440067d5ba304fbfbad94.tar.gz
vdr-patch-lnbsharing-a69b3211dc4f9b34eef440067d5ba304fbfbad94.tar.bz2
Version 0.67vdr-0.67
- The EIT information is now gathered in a separate thread. - The sytem time can now be synchronized to the time broadcast in the DVB data stream. This can be enabled in the "Setup" menu by setting "SetSystemTime" to 1. Note that this works only if VDR is running under a user id that has permisson to set the system time. - The new item "Schedule" in the "Main" menu opens VDR's EPG (thanks to Robert Schneider). See the MANUAL file for a detailed description. - The new setup parameters MarginStart and MarginStop define how long (in minutes) before the official start time of a broadcast VDR shall begin recording, and how long after the official end time it shall stop recording. These are used when a recording is programmed from the "Schedules" menu. - The delay value in the dvb.c.071.diff patch to the driver has been increased to '3', because on some systems the OSD was not displayed correctly. If you are running an already patched version 0.71 driver and encounter problems with the OSD, please make sure the parameter in the ddelay call is '3', not '2'. - Fixed initializing the RCU remote control code (didn't work after switching on the system). - Problematic characters in recording names (which can come from timers that are programmed via the "Schedules" menu) are now replaced by suitable substitutes.
Diffstat (limited to 'dvbapi.c')
-rw-r--r--dvbapi.c67
1 files changed, 55 insertions, 12 deletions
diff --git a/dvbapi.c b/dvbapi.c
index e5c692c..cc246d2 100644
--- a/dvbapi.c
+++ b/dvbapi.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: dvbapi.c 1.31 2000/10/08 16:14:45 kls Exp $
+ * $Id: dvbapi.c 1.34 2000/11/01 09:19:27 kls Exp $
*/
#include "dvbapi.h"
@@ -25,6 +25,7 @@ extern "C" {
#include "videodir.h"
#define VIDEODEVICE "/dev/video"
+#define VBIDEVICE "/dev/vbi"
// The size of the array used to buffer video data:
#define VIDEOBUFSIZE (1024*1024)
@@ -1084,14 +1085,27 @@ int cDvbApi::NumDvbApis = 0;
cDvbApi *cDvbApi::dvbApi[MAXDVBAPI] = { NULL };
cDvbApi *cDvbApi::PrimaryDvbApi = NULL;
-cDvbApi::cDvbApi(const char *FileName)
+cDvbApi::cDvbApi(const char *VideoFileName, const char *VbiFileName)
{
+ siProcessor = NULL;
pidRecord = pidReplay = 0;
fromRecord = toRecord = -1;
fromReplay = toReplay = -1;
- videoDev = open(FileName, O_RDWR | O_NONBLOCK);
- if (videoDev < 0)
- LOG_ERROR;
+ videoDev = open(VideoFileName, O_RDWR | O_NONBLOCK);
+ if (videoDev >= 0) {
+ siProcessor = new cSIProcessor(VbiFileName);
+ if (!NumDvbApis) // only the first one shall set the system time
+ siProcessor->SetUseTSTime(Setup.SetSystemTime);
+ siProcessor->AddFilter(0x14, 0x70); // TDT
+ siProcessor->AddFilter(0x14, 0x73); // TOT
+ siProcessor->AddFilter(0x12, 0x4e); // event info, actual TS, present/following
+ siProcessor->AddFilter(0x12, 0x4f); // event info, other TS, present/following
+ siProcessor->AddFilter(0x12, 0x50); // event info, actual TS, schedule
+ siProcessor->AddFilter(0x12, 0x60); // event info, other TS, schedule
+ siProcessor->Start();
+ }
+ else
+ LOG_ERROR_STR(VideoFileName);
cols = rows = 0;
ovlGeoSet = ovlStat = ovlFbSet = false;
@@ -1104,7 +1118,7 @@ cDvbApi::cDvbApi(const char *FileName)
nonl();
cbreak();
noecho();
- timeout(1000);
+ timeout(10);
#endif
#if defined(DEBUG_OSD)
memset(&colorPairs, 0, sizeof(colorPairs));
@@ -1121,6 +1135,7 @@ cDvbApi::cDvbApi(const char *FileName)
cDvbApi::~cDvbApi()
{
if (videoDev >= 0) {
+ delete siProcessor;
Close();
Stop();
StopRecord();
@@ -1174,11 +1189,9 @@ int cDvbApi::Index(void)
bool cDvbApi::Init(void)
{
- char fileName[strlen(VIDEODEVICE) + 10];
- int i;
-
NumDvbApis = 0;
- for (i = 0; i < MAXDVBAPI; i++) {
+ for (int i = 0; i < MAXDVBAPI; i++) {
+ char fileName[strlen(VIDEODEVICE) + 10];
sprintf(fileName, "%s%d", VIDEODEVICE, i);
if (access(fileName, F_OK | R_OK | W_OK) == 0) {
dsyslog(LOG_INFO, "probing %s", fileName);
@@ -1188,7 +1201,9 @@ bool cDvbApi::Init(void)
int r = ioctl(f, VIDIOCGCAP, &cap);
close(f);
if (r == 0 && (cap.type & VID_TYPE_DVB)) {
- dvbApi[i] = new cDvbApi(fileName);
+ char vbiFileName[strlen(VBIDEVICE) + 10];
+ sprintf(vbiFileName, "%s%d", VBIDEVICE, i);
+ dvbApi[i] = new cDvbApi(fileName, vbiFileName);
NumDvbApis++;
}
}
@@ -1223,6 +1238,13 @@ void cDvbApi::Cleanup(void)
PrimaryDvbApi = NULL;
}
+const cSchedules *cDvbApi::Schedules(cThreadLock *ThreadLock) const
+{
+ if (siProcessor && ThreadLock->Lock(siProcessor))
+ return siProcessor->Schedules();
+ return NULL;
+}
+
bool cDvbApi::GrabImage(const char *FileName, bool Jpeg, int Quality, int SizeX, int SizeY)
{
int result = 0;
@@ -1576,6 +1598,24 @@ void cDvbApi::ClrEol(int x, int y, eDvbColor color)
Fill(x, y, cols - x, 1, color);
}
+int cDvbApi::CellWidth(void)
+{
+#ifdef DEBUG_OSD
+ return 1;
+#else
+ return charWidth;
+#endif
+}
+
+int cDvbApi::Width(unsigned char c)
+{
+#ifdef DEBUG_OSD
+ return 1;
+#else
+ return osd->Width(c);
+#endif
+}
+
void cDvbApi::Text(int x, int y, const char *s, eDvbColor colorFg, eDvbColor colorBg)
{
if (x < 0) x = cols + x;
@@ -1671,8 +1711,11 @@ bool cDvbApi::SetChannel(int FrequencyMHz, char Polarization, int Diseqc, int Sr
front.fec = 8;
front.AFC = 1;
ioctl(videoDev, VIDIOCSFRONTEND, &front);
- if (front.sync & 0x1F == 0x1F)
+ if (front.sync & 0x1F == 0x1F) {
+ if (siProcessor)
+ siProcessor->SetCurrentServiceID(Pnr);
return true;
+ }
esyslog(LOG_ERR, "ERROR: channel not sync'ed (front.sync=%X)!", front.sync);
}
return false;