2002-08-04 14:57:29 +02:00
|
|
|
/*
|
|
|
|
* dvbdevice.h: The DVB device interface
|
|
|
|
*
|
|
|
|
* See the main source file 'vdr.c' for copyright information and
|
|
|
|
* how to reach the author.
|
|
|
|
*
|
2002-10-12 14:29:46 +02:00
|
|
|
* $Id: dvbdevice.h 1.14 2002/10/12 11:15:39 kls Exp $
|
2002-08-04 14:57:29 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __DVBDEVICE_H
|
|
|
|
#define __DVBDEVICE_H
|
|
|
|
|
2002-08-10 14:58:25 +02:00
|
|
|
#ifdef NEWSTRUCT
|
|
|
|
#include <linux/dvb/frontend.h>
|
|
|
|
#else
|
2002-08-04 14:57:29 +02:00
|
|
|
#include <ost/frontend.h>
|
2002-08-10 14:58:25 +02:00
|
|
|
#endif
|
2002-08-04 14:57:29 +02:00
|
|
|
#include "device.h"
|
2002-09-08 14:17:51 +02:00
|
|
|
#include "dvbspu.h"
|
2002-08-04 14:57:29 +02:00
|
|
|
#include "eit.h"
|
|
|
|
|
2002-09-04 17:26:02 +02:00
|
|
|
#define MAXDVBDEVICES 4
|
|
|
|
|
2002-08-04 14:57:29 +02:00
|
|
|
class cDvbDevice : public cDevice {
|
|
|
|
friend class cDvbOsd;
|
|
|
|
private:
|
|
|
|
static bool Probe(const char *FileName);
|
|
|
|
// Probes for existing DVB devices.
|
|
|
|
public:
|
|
|
|
static bool Initialize(void);
|
|
|
|
// Initializes the DVB devices.
|
|
|
|
// Must be called before accessing any DVB functions.
|
|
|
|
private:
|
2002-08-10 14:58:25 +02:00
|
|
|
#ifdef NEWSTRUCT
|
2002-10-11 13:23:44 +02:00
|
|
|
fe_type_t frontendType;
|
2002-08-10 14:58:25 +02:00
|
|
|
int fd_osd, fd_frontend, fd_audio, fd_video, fd_dvr;
|
|
|
|
#else
|
2002-10-11 13:23:44 +02:00
|
|
|
FrontendType frontendType;
|
2002-08-04 14:57:29 +02:00
|
|
|
int fd_osd, fd_frontend, fd_sec, fd_audio, fd_video, fd_dvr;
|
2002-08-10 14:58:25 +02:00
|
|
|
#endif
|
2002-08-04 14:57:29 +02:00
|
|
|
int OsdDeviceHandle(void) const { return fd_osd; }
|
|
|
|
protected:
|
|
|
|
virtual void MakePrimaryDevice(bool On);
|
|
|
|
public:
|
|
|
|
cDvbDevice(int n);
|
|
|
|
virtual ~cDvbDevice();
|
|
|
|
virtual bool HasDecoder(void) const;
|
|
|
|
|
2002-08-25 09:36:09 +02:00
|
|
|
// OSD facilities
|
|
|
|
|
2002-09-08 14:17:51 +02:00
|
|
|
private:
|
|
|
|
cDvbSpuDecoder *spuDecoder;
|
2002-08-25 09:36:09 +02:00
|
|
|
public:
|
|
|
|
cOsdBase *NewOsd(int x, int y);
|
2002-09-08 14:17:51 +02:00
|
|
|
virtual cSpuDecoder *GetSpuDecoder(void);
|
2002-08-25 09:36:09 +02:00
|
|
|
|
2002-08-04 14:57:29 +02:00
|
|
|
// Channel facilities
|
|
|
|
|
|
|
|
private:
|
2002-10-06 10:25:42 +02:00
|
|
|
int source;
|
2002-08-04 14:57:29 +02:00
|
|
|
int frequency;
|
2002-10-06 10:25:42 +02:00
|
|
|
const char *diseqcCommands;
|
|
|
|
bool IsTunedTo(const cChannel *Channel) const;
|
2002-08-04 14:57:29 +02:00
|
|
|
public:
|
2002-10-06 10:25:42 +02:00
|
|
|
virtual bool ProvidesSource(int Source) const;
|
2002-09-29 13:40:45 +02:00
|
|
|
virtual bool ProvidesChannel(const cChannel *Channel, int Priority = -1, bool *NeedsDetachReceivers = NULL) const;
|
2002-09-04 17:26:02 +02:00
|
|
|
protected:
|
|
|
|
virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView);
|
2002-08-04 14:57:29 +02:00
|
|
|
|
|
|
|
// PID handle facilities
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual bool SetPid(cPidHandle *Handle, int Type, bool On);
|
|
|
|
|
|
|
|
// Image Grab facilities
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual bool GrabImage(const char *FileName, bool Jpeg = true, int Quality = -1, int SizeX = -1, int SizeY = -1);
|
|
|
|
|
|
|
|
// Video format facilities
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual void SetVideoFormat(bool VideoFormat16_9);
|
|
|
|
|
2002-10-12 14:29:46 +02:00
|
|
|
// Audio facilities
|
2002-08-04 14:57:29 +02:00
|
|
|
|
2002-10-12 14:29:46 +02:00
|
|
|
private:
|
|
|
|
int aPid1, aPid2;
|
2002-08-04 14:57:29 +02:00
|
|
|
protected:
|
|
|
|
virtual void SetVolumeDevice(int Volume);
|
2002-10-12 14:29:46 +02:00
|
|
|
virtual int NumAudioTracksDevice(void) const;
|
|
|
|
virtual const char **GetAudioTracksDevice(int *CurrentTrack = NULL) const;
|
|
|
|
virtual void SetAudioTrackDevice(int Index);
|
2002-08-04 14:57:29 +02:00
|
|
|
|
|
|
|
// EIT facilities
|
|
|
|
|
|
|
|
private:
|
|
|
|
cSIProcessor *siProcessor;
|
|
|
|
|
|
|
|
// Player facilities
|
|
|
|
|
|
|
|
protected:
|
2002-08-15 11:16:34 +02:00
|
|
|
ePlayMode playMode;
|
|
|
|
virtual bool SetPlayMode(ePlayMode PlayMode);
|
2002-08-04 14:57:29 +02:00
|
|
|
public:
|
|
|
|
virtual void TrickSpeed(int Speed);
|
|
|
|
virtual void Clear(void);
|
|
|
|
virtual void Play(void);
|
|
|
|
virtual void Freeze(void);
|
|
|
|
virtual void Mute(void);
|
|
|
|
virtual void StillPicture(const uchar *Data, int Length);
|
2002-08-16 09:22:29 +02:00
|
|
|
virtual bool Poll(cPoller &Poller, int TimeoutMs = 0);
|
2002-08-04 14:57:29 +02:00
|
|
|
virtual int PlayVideo(const uchar *Data, int Length);
|
|
|
|
virtual int PlayAudio(const uchar *Data, int Length);
|
|
|
|
|
|
|
|
// Receiver facilities
|
|
|
|
|
2002-09-08 09:03:10 +02:00
|
|
|
private:
|
|
|
|
cTSBuffer *tsBuffer;
|
2002-08-04 14:57:29 +02:00
|
|
|
protected:
|
|
|
|
virtual bool OpenDvr(void);
|
|
|
|
virtual void CloseDvr(void);
|
2002-09-08 09:03:10 +02:00
|
|
|
virtual bool GetTSPacket(uchar *&Data);
|
2002-08-04 14:57:29 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //__DVBDEVICE_H
|