From 8f9cc68f76c4fd0960f919a77fb16a6455922deb Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 29 Jul 2001 18:00:00 +0200 Subject: =?UTF-8?q?Version=200.85=20-=20Added=20Norwegian=20language=20tex?= =?UTF-8?q?ts=20(thanks=20to=20J=F8rgen=20Tvedt).=20-=20Increased=20the=20?= =?UTF-8?q?usleep=20value=20in=20cDvbOsd::Cmd()=20to=205000=20in=20order?= =?UTF-8?q?=20to=20work=20on=20=20=20systems=20with=20the=20KURT/utime-pat?= =?UTF-8?q?ch=20(thanks=20to=20Guido=20Fiala).=20-=20Changed=20the=20check?= =?UTF-8?q?=20whether=20the=20driver=20is=20loaded=20in=20runvdr=20to=20ch?= =?UTF-8?q?eck=20for=20the=20=20=20'dvb'=20module=20(the=20last=20one=20lo?= =?UTF-8?q?aded).=20-=20Fixed=20repeat=20function=20with=20LIRC=20(thanks?= =?UTF-8?q?=20to=20Stefan=20Huelswitt).=20-=20Increased=20the=20upper=20li?= =?UTF-8?q?mit=20for=20the=20symbol=20rate=20to=2030000=20(thanks=20to=20U?= =?UTF-8?q?lrich=20=20=20R=F6der).=20-=20Made=20the=20position=20of=20the?= =?UTF-8?q?=20channel=20display=20configurable=20(thanks=20to=20Stefan=20?= =?UTF-8?q?=20=20Huelswitt).=20-=20Made=20the=20width=20and=20height=20of?= =?UTF-8?q?=20the=20OSD=20configurable=20(thanks=20to=20Stefan=20Huelswitt?= =?UTF-8?q?).=20-=20DiSEqC=20support=20can=20now=20be=20generally=20enable?= =?UTF-8?q?d/disabled=20in=20the=20Setup=20menu.=20This=20=20=20may=20be?= =?UTF-8?q?=20necessary=20if=20your=20multiswitch=20gets=20irritated=20by?= =?UTF-8?q?=20the=20default=20DiSEqC=20=20=20codes=20'0'=20(thanks=20to=20?= =?UTF-8?q?Markus=20Lang).=20-=20Fixed=20replaying=20in=20case=20there=20i?= =?UTF-8?q?s=20no=20index=20file.=20-=20Fixed=20jumping=20to=20an=20editin?= =?UTF-8?q?g=20mark=20when=20replay=20has=20been=20paused.=20-=20Avoiding?= =?UTF-8?q?=20unnecessary=20code=20execution=20in=20the=20replay=20progres?= =?UTF-8?q?s=20display=20(thanks=20=20=20to=20Guido=20Fiala).=20-=20When?= =?UTF-8?q?=20entering=20time=20values=20the=20digits=20that=20still=20hav?= =?UTF-8?q?e=20to=20be=20entered=20are=20now=20=20=20shown=20as=20'-'=20(a?= =?UTF-8?q?s=20in=20"1-:--").=20-=20When=20setting=20an=20editing=20mark?= =?UTF-8?q?=20while=20the=20progress=20display=20is=20not=20active,=20the?= =?UTF-8?q?=20=20=20display=20will=20now=20be=20turned=20on=20for=20a=20sh?= =?UTF-8?q?ort=20while=20to=20indicate=20the=20successful=20=20=20setting?= =?UTF-8?q?=20of=20the=20mark.=20-=20Updated=20'channels.conf'=20for=20Pre?= =?UTF-8?q?miere=20World=20(thanks=20to=20Helmut=20Sch=E4chner).=20=20=20C?= =?UTF-8?q?heck=20your=20timers=20if=20you=20use=20this=20channels.conf=20?= =?UTF-8?q?file,=20since=20the=20sequence=20of=20=20=20several=20PW=20chan?= =?UTF-8?q?nels=20has=20been=20changed.=20-=20Changed=20the=20color=20of?= =?UTF-8?q?=20"Info"=20messages=20to=20"black=20on=20green"=20and=20that?= =?UTF-8?q?=20of=20the=20=20=20confirmation=20messages=20(like=20"Delete..?= =?UTF-8?q?.")=20to=20"black=20on=20yellow".=20-=20Fixed=20display=20with?= =?UTF-8?q?=20DEBUG=5FOSD=20(it=20still=20crashes=20sometimes,=20esp.=20wh?= =?UTF-8?q?en=20replaying,=20=20=20but=20I=20can't=20seem=20to=20find=20wh?= =?UTF-8?q?at=20causes=20this...=20any=20ideas=20anybody=3F).=20-=20Avoidi?= =?UTF-8?q?ng=20audio/video=20distortions=20in=20'Transfer=20Mode'=20by=20?= =?UTF-8?q?no=20longer=20actually=20=20=20tuning=20the=20primary=20interfa?= =?UTF-8?q?ce=20(which=20can't=20receive=20this=20channel,=20anyway).=20?= =?UTF-8?q?=20=20Apparently=20the=20driver=20gets=20irritated=20when=20the?= =?UTF-8?q?=20channel=20is=20switched=20and=20a=20=20=20replay=20session?= =?UTF-8?q?=20is=20started=20immediately=20after=20that.=20-=20Increased?= =?UTF-8?q?=20timeout=20until=20reporting=20"video=20data=20stream=20broke?= =?UTF-8?q?n"=20when=20recording.=20-=20Explicitly=20switching=20back=20to?= =?UTF-8?q?=20the=20previously=20active=20channel=20after=20ending=20a=20?= =?UTF-8?q?=20=20replay=20session=20(to=20have=20it=20shown=20correctly=20?= =?UTF-8?q?in=20case=20it=20was=20in=20'Transfer=20Mode').?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dvbapi.h | 75 +++++++++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 58 insertions(+), 17 deletions(-) (limited to 'dvbapi.h') 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 #endif +#include // 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 here! +#include +#include +#include +#include +#include +#include +#include #include -#include #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 { -- cgit v1.2.3