summaryrefslogtreecommitdiff
path: root/dvbapi.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2001-07-29 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2001-07-29 18:00:00 +0200
commit8f9cc68f76c4fd0960f919a77fb16a6455922deb (patch)
tree83f607160a07966e97069397580acfb0d9b1be7a /dvbapi.h
parent610c5600df98b35226536ffe92b1fd231128c7d4 (diff)
downloadvdr-patch-lnbsharing-vdr-0.85.tar.gz
vdr-patch-lnbsharing-vdr-0.85.tar.bz2
Version 0.85vdr-0.85
- Added Norwegian language texts (thanks to Jørgen Tvedt). - Increased the usleep value in cDvbOsd::Cmd() to 5000 in order to work on systems with the KURT/utime-patch (thanks to Guido Fiala). - Changed the check whether the driver is loaded in runvdr to check for the 'dvb' module (the last one loaded). - Fixed repeat function with LIRC (thanks to Stefan Huelswitt). - Increased the upper limit for the symbol rate to 30000 (thanks to Ulrich Röder). - Made the position of the channel display configurable (thanks to Stefan Huelswitt). - Made the width and height of the OSD configurable (thanks to Stefan Huelswitt). - DiSEqC support can now be generally enabled/disabled in the Setup menu. This may be necessary if your multiswitch gets irritated by the default DiSEqC codes '0' (thanks to Markus Lang). - Fixed replaying in case there is no index file. - Fixed jumping to an editing mark when replay has been paused. - Avoiding unnecessary code execution in the replay progress display (thanks to Guido Fiala). - When entering time values the digits that still have to be entered are now shown as '-' (as in "1-:--"). - When setting an editing mark while the progress display is not active, the display will now be turned on for a short while to indicate the successful setting of the mark. - Updated 'channels.conf' for Premiere World (thanks to Helmut Schächner). Check your timers if you use this channels.conf file, since the sequence of several PW channels has been changed. - Changed the color of "Info" messages to "black on green" and that of the confirmation messages (like "Delete...") to "black on yellow". - Fixed display with DEBUG_OSD (it still crashes sometimes, esp. when replaying, but I can't seem to find what causes this... any ideas anybody?). - Avoiding audio/video distortions in 'Transfer Mode' by no longer actually tuning the primary interface (which can't receive this channel, anyway). Apparently the driver gets irritated when the channel is switched and a replay session is started immediately after that. - Increased timeout until reporting "video data stream broken" when recording. - Explicitly switching back to the previously active channel after ending a replay session (to have it shown correctly in case it was in 'Transfer Mode').
Diffstat (limited to 'dvbapi.h')
-rw-r--r--dvbapi.h75
1 files changed, 58 insertions, 17 deletions
diff --git a/dvbapi.h b/dvbapi.h
index de64612..2203d79 100644
--- a/dvbapi.h
+++ b/dvbapi.h
@@ -4,22 +4,28 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: dvbapi.h 1.35 2001/02/11 10:41:10 kls Exp $
+ * $Id: dvbapi.h 1.42 2001/07/27 11:40:38 kls Exp $
*/
#ifndef __DVBAPI_H
#define __DVBAPI_H
-// FIXME: these should be defined in ../DVB/driver/dvb.h!!!
-typedef unsigned int __u32;
-typedef unsigned short __u16;
-typedef unsigned char __u8;
-
#if defined(DEBUG_OSD) || defined(REMOTE_KBD)
#include <ncurses.h>
#endif
+#include <stdlib.h> // FIXME: this is apparently necessary for the ost/... header files
+ // FIXME: shouldn't every header file include ALL the other header
+ // FIXME: files it depends on? The sequence in which header files
+ // FIXME: are included here should not matter - and it should NOT
+ // FIXME: be necessary to include <stdlib.h> here!
+#include <linux/videodev.h>
+#include <ost/dmx.h>
+#include <ost/sec.h>
+#include <ost/frontend.h>
+#include <ost/video.h>
+#include <ost/audio.h>
+#include <ost/osd.h>
#include <stdio.h>
-#include <dvb.h>
#include "dvbosd.h"
#include "eit.h"
#include "thread.h"
@@ -30,9 +36,6 @@ typedef struct CRect {
signed short x, y, width, height;
};
-#define MenuLines 15
-#define MenuColumns 40
-
const char *IndexToHMSF(int Index, bool WithFrame = false);
// Converts the given index to a string, optionally containing the frame number.
int HMSFToIndex(const char *HMSF);
@@ -55,9 +58,22 @@ public:
};
class cDvbApi {
+ friend class cRecordBuffer;
+ friend class cReplayBuffer;
+ friend class cTransferBuffer;
private:
int videoDev;
- cDvbApi(const char *VideoFileName, const char *VbiFileName);
+ int fd_osd, fd_qpskfe, fd_qamfe, 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;
+ bool SetPid(int fd, dmxPesType_t PesType, int Pid, dmxOutput_t Output);
+ bool SetVpid(int Vpid, dmxOutput_t Output) { return SetPid(fd_demuxv, DMX_PES_VIDEO, Vpid, Output); }
+ bool SetApid1(int Apid, dmxOutput_t Output) { return SetPid(fd_demuxa1, DMX_PES_AUDIO, Apid, Output); }
+ bool SetApid2(int Apid, dmxOutput_t Output) { return SetPid(fd_demuxa2, DMX_PES_OTHER, Apid, Output); }
+ bool SetDpid1(int Dpid, dmxOutput_t Output) { return SetPid(fd_demuxd1, DMX_PES_OTHER, Dpid, Output); }
+ bool SetDpid2(int Dpid, dmxOutput_t Output) { return SetPid(fd_demuxd2, DMX_PES_OTHER, Dpid, Output); }
+ bool SetTpid(int Tpid, dmxOutput_t Output) { return SetPid(fd_demuxt, DMX_PES_TELETEXT, Tpid, Output); }
+ bool SetPids(bool ForRecording);
+ cDvbApi(int n);
public:
~cDvbApi();
@@ -86,8 +102,10 @@ public:
// recording and stop recording if necessary.
int Index(void);
// Returns the index of this DvbApi.
+ static bool Probe(const char *FileName);
+ // Probes for existing DVB devices.
static bool Init(void);
- // Initializes the DVB API and probes for existing DVB devices.
+ // Initializes the DVB API.
// Must be called before accessing any DVB functions.
static void Cleanup(void);
// Closes down all DVB devices.
@@ -138,7 +156,6 @@ private:
cDvbOsd *osd;
#endif
int cols, rows;
- void Cmd(OSD_Command cmd, int color = 0, int x0 = 0, int y0 = 0, int x1 = 0, int y1 = 0, const void *data = NULL);
public:
void Open(int w, int h);
void Close(void);
@@ -154,12 +171,16 @@ public:
void Text(int x, int y, const char *s, eDvbColor colorFg = clrWhite, eDvbColor colorBg = clrBackground);
void Flush(void);
+ // Video format facilities:
+
+ void SetVideoFormat(videoFormat_t Format);
+
// Channel facilities
private:
int currentChannel;
public:
- bool SetChannel(int ChannelNumber, int FrequencyMHz, char Polarization, int Diseqc, int Srate, int Vpid, int Apid, int Tpid, int Ca, int Pnr);
+ bool SetChannel(int ChannelNumber, int FrequencyMHz, char Polarization, int Diseqc, int Srate, int Vpid, int Apid1, int Apid2, int Dpid1, int Dpid2, int Tpid, int Ca, int Pnr);
static int CurrentChannel(void) { return PrimaryDvbApi ? PrimaryDvbApi->currentChannel : 0; }
int Channel(void) { return currentChannel; }
@@ -184,12 +205,15 @@ private:
cReplayBuffer *replayBuffer;
int ca;
int priority;
-protected:
int Ca(void) { return ca; }
// Returns the ca of the current recording session (0..MAXDVBAPI).
int Priority(void) { return priority; }
- // Returns the priority of the current recording session (0..99),
+ // Returns the priority of the current recording session (0..MAXPRIORITY),
// or -1 if no recording is currently active.
+ int SetModeRecord(void);
+ // Initiates recording mode and returns the file handle to read from.
+ void SetModeReplay(void);
+ void SetModeNormal(bool FromRecording);
public:
int SecondsToFrames(int Seconds);
// Returns the number of frames corresponding to the given number of seconds.
@@ -238,7 +262,24 @@ public:
// nearest I-frame.
void Goto(int Index, bool Still = false);
// Positions to the given index and displays that frame as a still picture
- // if Still is true.
+ // if Still is true.
+
+ // Audio track facilities
+
+public:
+ bool CanToggleAudioTrack(void);
+ // Returns true if we are currently replaying and this recording has two
+ // audio tracks, or if the current channel has two audio PIDs.
+ bool ToggleAudioTrack(void);
+ // Toggles the audio track if possible.
+
+ // Dolby Digital audio facilities
+
+private:
+ static char *audioCommand;
+public:
+ static void SetAudioCommand(const char *Command);
+ static const char *AudioCommand(void) { return audioCommand; }
};
class cEITScanner {