mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
* reworked CA menu code
* added support for internal cardreaders for future conax support * added inactivity shutdown timer for EuP WARNING: new libcoolstream and libOpenThreads needed. git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@925 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -1,7 +1,19 @@
|
||||
/* public header file */
|
||||
/*******************************************************************************/
|
||||
/* */
|
||||
/* libcoolstream/audio_cs.h */
|
||||
/* Public header file for audio API */
|
||||
/* */
|
||||
/* (C) 2008 CoolStream International */
|
||||
/* */
|
||||
/*******************************************************************************/
|
||||
#ifndef __AUDIO_CS_H_
|
||||
#define __AUDIO_CS_H_
|
||||
|
||||
#ifndef _AUDIO_CS_H_
|
||||
#define _AUDIO_CS_H_
|
||||
#ifndef CS_AUDIO_PDATA
|
||||
#define CS_AUDIO_PDATA void
|
||||
#endif
|
||||
|
||||
#include "cs_types.h"
|
||||
|
||||
typedef enum {
|
||||
AUDIO_SYNC_WITH_PTS,
|
||||
@@ -25,12 +37,6 @@ typedef enum {
|
||||
AUDIO_FMT_ADVANCED = AUDIO_FMT_MLP
|
||||
} AUDIO_FORMAT;
|
||||
|
||||
#ifndef CS_AUDIO_PDATA
|
||||
#define CS_AUDIO_PDATA void
|
||||
#endif
|
||||
|
||||
#include "cs_types.h"
|
||||
|
||||
class cAudio {
|
||||
private:
|
||||
CS_AUDIO_PDATA *privateData;
|
||||
@@ -110,5 +116,4 @@ public:
|
||||
void EnableAnalogOut(bool Enable);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif //__AUDIO_CS_H_
|
||||
|
119
lib/libcoolstream/ca_cs.h
Normal file
119
lib/libcoolstream/ca_cs.h
Normal file
@@ -0,0 +1,119 @@
|
||||
/*******************************************************************************/
|
||||
/* */
|
||||
/* libcoolstream/ca.h */
|
||||
/* Public header for CA interface */
|
||||
/* */
|
||||
/* (C) 2010 CoolStream International Ltd. */
|
||||
/* */
|
||||
/*******************************************************************************/
|
||||
#ifndef __CA_CS_H_
|
||||
#define __CA_CS_H_
|
||||
|
||||
#include <OpenThreads/Thread>
|
||||
#include "cs_types.h"
|
||||
|
||||
enum CA_INIT_MASK {
|
||||
CA_INIT_SC = 1,
|
||||
CA_INIT_CI,
|
||||
CA_INIT_BOTH
|
||||
};
|
||||
|
||||
enum CA_SLOT_TYPE {
|
||||
CA_SLOT_TYPE_SMARTCARD,
|
||||
CA_SLOT_TYPE_CI,
|
||||
CA_SLOT_TYPE_ALL,
|
||||
};
|
||||
|
||||
enum CA_MESSAGE_FLAGS {
|
||||
CA_MESSAGE_EMPTY = (1 << 0),
|
||||
CA_MESSAGE_HAS_PARAM1_DATA = (1 << 1), // Free after use!
|
||||
CA_MESSAGE_HAS_PARAM1_INT = (1 << 2),
|
||||
CA_MESSAGE_HAS_PARAM1_PTR = (1 << 3),
|
||||
CA_MESSAGE_HAS_PARAM2_INT = (1 << 4),
|
||||
CA_MESSAGE_HAS_PARAM2_PTR = (1 << 5),
|
||||
CA_MESSAGE_HAS_PARAM2_DATA = (1 << 6),
|
||||
CA_MESSAGE_HAS_PARAM3_DATA = (1 << 7), // Free after use!
|
||||
CA_MESSAGE_HAS_PARAM3_INT = (1 << 8),
|
||||
CA_MESSAGE_HAS_PARAM3_PTR = (1 << 9),
|
||||
CA_MESSAGE_HAS_PARAM4_INT = (1 << 10),
|
||||
CA_MESSAGE_HAS_PARAM4_PTR = (1 << 11),
|
||||
CA_MESSAGE_HAS_PARAM4_DATA = (1 << 12),
|
||||
CA_MESSAGE_HAS_PARAM_LONG = (1 << 13),
|
||||
};
|
||||
|
||||
enum CA_MESSAGE_MSGID {
|
||||
CA_MESSAGE_MSG_INSERTED,
|
||||
CA_MESSAGE_MSG_REMOVED,
|
||||
CA_MESSAGE_MSG_INIT_OK,
|
||||
CA_MESSAGE_MSG_INIT_FAILED,
|
||||
CA_MESSAGE_MSG_MMI_MENU,
|
||||
CA_MESSAGE_MSG_MMI_MENU_ENTER,
|
||||
CA_MESSAGE_MSG_MMI_MENU_ANSWER,
|
||||
CA_MESSAGE_MSG_MMI_LIST,
|
||||
CA_MESSAGE_MSG_MMI_TEXT,
|
||||
CA_MESSAGE_MSG_MMI_REQ_INPUT,
|
||||
CA_MESSAGE_MSG_MMI_CLOSE,
|
||||
CA_MESSAGE_MSG_INTERNAL,
|
||||
CA_MESSAGE_MSG_PMT_ARRIVED,
|
||||
CA_MESSAGE_MSG_CAT_ARRIVED,
|
||||
CA_MESSAGE_MSG_ECM_ARRIVED,
|
||||
CA_MESSAGE_MSG_EMM_ARRIVED,
|
||||
CA_MESSAGE_MSG_CHANNEL_CHANGE,
|
||||
CA_MESSAGE_MSG_EXIT,
|
||||
};
|
||||
|
||||
typedef struct CA_MESSAGE {
|
||||
u32 MsgId;
|
||||
enum CA_SLOT_TYPE SlotType;
|
||||
int Slot;
|
||||
u32 Flags;
|
||||
union {
|
||||
u8 *Data[4];
|
||||
u32 Param[4];
|
||||
void *Ptr[4];
|
||||
u64 ParamLong;
|
||||
} Msg;
|
||||
} CA_MESSAGE;
|
||||
|
||||
#define CA_MESSAGE_SIZE sizeof(CA_MESSAGE)
|
||||
#define CA_MESSAGE_ENTRIES 256
|
||||
#define CA_MESSAGE_ENTRIES_CI 128
|
||||
#define CA_MESSAGE_ENTRIES_SC 64
|
||||
|
||||
#ifndef CS_CA_PDATA
|
||||
#define CS_CA_PDATA void
|
||||
#endif
|
||||
|
||||
class cCA : public OpenThreads::Thread {
|
||||
private:
|
||||
static cCA *inst;
|
||||
//
|
||||
cCA(void);
|
||||
//
|
||||
CS_CA_PDATA *privateData;
|
||||
enum CA_INIT_MASK initMask;
|
||||
bool exit;
|
||||
bool started;
|
||||
bool guiReady;
|
||||
virtual void run(void);
|
||||
public:
|
||||
u32 GetNumberCISlots(void);
|
||||
u32 GetNumberSmartCardSlots(void); //
|
||||
static cCA *GetInstance(void);
|
||||
bool SendPMT(int Unit, unsigned char *Data, int Len);
|
||||
bool SendMessage(const CA_MESSAGE *Msg);
|
||||
void SetInitMask(enum CA_INIT_MASK InitMask);
|
||||
bool Start(void);
|
||||
void Stop(void);
|
||||
void Ready(bool Set);
|
||||
void ModuleReset(enum CA_SLOT_TYPE, u32 Slot);
|
||||
bool ModulePresent(enum CA_SLOT_TYPE, u32 Slot);
|
||||
void ModuleName(enum CA_SLOT_TYPE, u32 Slot, char *Name);
|
||||
void MenuEnter(enum CA_SLOT_TYPE, u32 Slot);
|
||||
void MenuAnswer(enum CA_SLOT_TYPE, u32 Slot, u32 choice);
|
||||
void InputAnswer(enum CA_SLOT_TYPE, u32 Slot, u8 * Data, int Len);
|
||||
void MenuClose(enum CA_SLOT_TYPE, u32 Slot);
|
||||
virtual ~cCA();
|
||||
};
|
||||
|
||||
#endif //__CA_H_
|
@@ -1,6 +1,17 @@
|
||||
/*******************************************************************************/
|
||||
/* */
|
||||
/* libcoolstream/cs_api.h */
|
||||
/* Public header file for CoolStream Public API */
|
||||
/* */
|
||||
/* (C) 2010 CoolStream International */
|
||||
/* */
|
||||
/*******************************************************************************/
|
||||
#ifndef __CS_API_H_
|
||||
#define __CS_API_H_
|
||||
|
||||
#include <coolstream/control.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
typedef void (*cs_messenger) (unsigned int msg, unsigned int data);
|
||||
|
||||
enum CS_LOG_MODULE {
|
||||
@@ -14,10 +25,12 @@ enum CS_LOG_MODULE {
|
||||
CS_LOG_DENC,
|
||||
CS_LOG_PVR_RECORD,
|
||||
CS_LOG_PVR_PLAY,
|
||||
CS_LOG_FILEPLAYER,
|
||||
CS_LOG_POWER_CTRL,
|
||||
CS_LOG_POWER_CLK,
|
||||
CS_LOG_MEM,
|
||||
CS_LOG_API,
|
||||
CS_LOG_CA,
|
||||
};
|
||||
|
||||
// Initialization
|
||||
@@ -45,9 +58,12 @@ void cs_log_module_message(enum CS_LOG_MODULE module, const char *fmt, ...);
|
||||
// TS Routing
|
||||
unsigned int cs_get_ts_output(void);
|
||||
int cs_set_ts_output(unsigned int port);
|
||||
int cs_set_ts_config(unsigned int port, tsrouter_hsdp_config_t *hsdp_config);
|
||||
int cs_get_ts_config(unsigned int port, tsrouter_hsdp_config_t *hsdp_config);
|
||||
|
||||
// Serial nr and revision accessors
|
||||
unsigned long long cs_get_serial(void);
|
||||
unsigned int cs_get_revision(void);
|
||||
|
||||
|
||||
#endif //__CS_API_H_
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#ifndef __CS_TYPES
|
||||
#define __CS_TYPES
|
||||
#ifndef __CS_TYPES_H_
|
||||
#define __CS_TYPES_H_
|
||||
|
||||
typedef enum
|
||||
{
|
||||
@@ -8,4 +8,13 @@ typedef enum
|
||||
AVSYNC_AUDIO_IS_MASTER
|
||||
} AVSYNC_TYPE;
|
||||
|
||||
#endif
|
||||
typedef unsigned long long u64;
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned short u16;
|
||||
typedef unsigned char u8;
|
||||
typedef signed long long s64;
|
||||
typedef signed int s32;
|
||||
typedef signed short s16;
|
||||
typedef signed char s8;
|
||||
|
||||
#endif // __CS_TYPES_H_
|
||||
|
@@ -1,18 +1,18 @@
|
||||
/*******************************************************************************/
|
||||
/* */
|
||||
/* libcoolstream/cszapper/demux.h */
|
||||
/* ZAP interface for neutrino frontend */
|
||||
/* libcoolstream/dmx_cs.h */
|
||||
/* Public header for demux API */
|
||||
/* */
|
||||
/* (C) 2008 CoolStream International */
|
||||
/* */
|
||||
/*******************************************************************************/
|
||||
#ifndef __DEMUX_CS_H
|
||||
#define __DEMUX_CS_H
|
||||
#ifndef __DEMUX_CS_H_
|
||||
#define __DEMUX_CS_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
#define DEMUX_POLL_TIMEOUT 0 // timeout in ms
|
||||
#define MAX_FILTER_LENGTH 16 // maximum number of filters
|
||||
#define MAX_FILTER_LENGTH 12 // maximum number of filters
|
||||
#ifndef DMX_FILTER_SIZE
|
||||
#define DMX_FILTER_SIZE MAX_FILTER_LENGTH
|
||||
#endif
|
||||
@@ -38,7 +38,6 @@ class cDemux {
|
||||
private:
|
||||
int timeout;
|
||||
unsigned short pid;
|
||||
unsigned char tid[MAX_FILTER_LENGTH], mask[MAX_FILTER_LENGTH];
|
||||
bool nb; // non block
|
||||
pthread_cond_t read_cond;
|
||||
pthread_mutex_t mutex;
|
||||
@@ -48,7 +47,7 @@ private:
|
||||
int unit;
|
||||
|
||||
DMX_CHANNEL_TYPE type;
|
||||
CS_DMX_PDATA * privateData;
|
||||
CS_DMX_PDATA *privateData;
|
||||
public:
|
||||
cDemux(int num = 0);
|
||||
~cDemux();
|
||||
@@ -60,8 +59,10 @@ public:
|
||||
int Read(unsigned char *buff, int len, int Timeout = 0);
|
||||
void SignalRead(int len);
|
||||
unsigned short GetPID(void) { return pid; }
|
||||
const unsigned char *GetFilterTID(void) { return tid; }
|
||||
const unsigned char *GetFilterMask(void) { return mask; }
|
||||
const unsigned char *GetFilterTID(u8 FilterIndex = 0);
|
||||
const unsigned char *GetFilterMask(u8 FilterIndex = 0);
|
||||
const unsigned int GetFilterLength(u8 FilterIndex = 0);
|
||||
bool AddSectionFilter(unsigned short Pid, const unsigned char * const Filter, const unsigned char * const Mask, int len, const unsigned char * const nMask = NULL);
|
||||
bool sectionFilter(unsigned short Pid, const unsigned char * const Tid, const unsigned char * const Mask, int len, int Timeout = DEMUX_POLL_TIMEOUT, const unsigned char * const nMask = NULL);
|
||||
bool pesFilter(const unsigned short Pid);
|
||||
void SetSyncMode(AVSYNC_TYPE SyncMode);
|
||||
@@ -70,6 +71,7 @@ public:
|
||||
DMX_CHANNEL_TYPE getChannelType(void);
|
||||
void addPid(unsigned short Pid);
|
||||
void getSTC(int64_t *STC);
|
||||
int getUnit(void);
|
||||
//
|
||||
};
|
||||
#endif //__DEMUX_H
|
||||
#endif //__DMX_CS_H_
|
||||
|
@@ -1,60 +0,0 @@
|
||||
#ifndef __DVBCI_H
|
||||
#define __DVBCI_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void CI_MenuAnswer(unsigned char bSlotIndex,unsigned char choice);
|
||||
void CI_Answer(unsigned char bSlotIndex,unsigned char *pBuffer,unsigned char nLength);
|
||||
void CI_CloseMMI(unsigned char bSlotIndex);
|
||||
void CI_EnterMenu(unsigned char bSlotIndex);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include <cs_api.h>
|
||||
|
||||
#define MAX_MMI_ITEMS 20
|
||||
#define MAX_MMI_TEXT_LEN 255
|
||||
#define MAX_MMI_CHOICE_TEXT_LEN 255
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int slot;
|
||||
int choice_nb;
|
||||
char title[MAX_MMI_TEXT_LEN];
|
||||
char subtitle[MAX_MMI_TEXT_LEN];
|
||||
char bottom[MAX_MMI_TEXT_LEN];
|
||||
char choice_item[MAX_MMI_ITEMS][MAX_MMI_CHOICE_TEXT_LEN];
|
||||
} MMI_MENU_LIST_INFO;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int slot;
|
||||
int blind;
|
||||
int answerlen;
|
||||
char enguiryText[MAX_MMI_TEXT_LEN];
|
||||
} MMI_ENGUIRY_INFO;
|
||||
|
||||
|
||||
class cDvbCi {
|
||||
private:
|
||||
int slots;
|
||||
bool init;
|
||||
int pmtlen;
|
||||
unsigned char * pmtbuf;
|
||||
void SendPMT();
|
||||
pthread_mutex_t ciMutex;
|
||||
cDvbCi(int Slots);
|
||||
public:
|
||||
bool Init(void);
|
||||
bool SendPMT(unsigned char *data, int len);
|
||||
bool SendDateTime(void);
|
||||
//
|
||||
~cDvbCi();
|
||||
static cDvbCi * getInstance();
|
||||
bool CamPresent(int slot);
|
||||
bool GetName(int slot, char * name);
|
||||
bool Reset(int slot);
|
||||
};
|
||||
|
||||
#endif //__DVBCI_H
|
23
lib/libcoolstream/mmi.h
Normal file
23
lib/libcoolstream/mmi.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef __MMI_H_
|
||||
#define __MMI_H_
|
||||
|
||||
#define MAX_MMI_ITEMS 40
|
||||
#define MAX_MMI_TEXT_LEN 255
|
||||
#define MAX_MMI_CHOICE_TEXT_LEN 255
|
||||
|
||||
typedef struct {
|
||||
int choice_nb;
|
||||
char title[MAX_MMI_TEXT_LEN];
|
||||
char subtitle[MAX_MMI_TEXT_LEN];
|
||||
char bottom[MAX_MMI_TEXT_LEN];
|
||||
char choice_item[MAX_MMI_ITEMS][MAX_MMI_CHOICE_TEXT_LEN];
|
||||
} MMI_MENU_LIST_INFO;
|
||||
|
||||
typedef struct {
|
||||
int blind;
|
||||
int answerlen;
|
||||
char enguiryText[MAX_MMI_TEXT_LEN];
|
||||
} MMI_ENGUIRY_INFO;
|
||||
|
||||
#endif // __MMI_H_
|
||||
|
@@ -1,13 +1,13 @@
|
||||
/*******************************************************************************/
|
||||
/* */
|
||||
/* libcoolstream/cszapper/demux.h */
|
||||
/* ZAP interface for neutrino frontend */
|
||||
/* libcoolstream/playback_cs.h */
|
||||
/* Public header file for playback API */
|
||||
/* */
|
||||
/* (C) 2008 CoolStream International */
|
||||
/* */
|
||||
/*******************************************************************************/
|
||||
#ifndef __PLAYBACK_CS_H
|
||||
#define __PLAYBACK_CS_H
|
||||
#ifndef __PLAYBACK_CS_H_
|
||||
#define __PLAYBACK_CS_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
@@ -20,49 +20,47 @@ typedef enum {
|
||||
PLAYMODE_FILE
|
||||
} playmode_t;
|
||||
|
||||
class cPlayback
|
||||
{
|
||||
private:
|
||||
int timeout;
|
||||
pthread_cond_t read_cond;
|
||||
pthread_mutex_t mutex;
|
||||
CS_PLAYBACK_PDATA * privateData;
|
||||
bool enabled;
|
||||
bool paused;
|
||||
bool playing;
|
||||
int unit;
|
||||
int nPlaybackFD;
|
||||
int video_type;
|
||||
int nPlaybackSpeed;
|
||||
int mSpeed;
|
||||
playmode_t playMode;
|
||||
//
|
||||
void Attach(void);
|
||||
void Detach(void);
|
||||
bool SetAVDemuxChannel(bool On, bool Video = true, bool Audio = true);
|
||||
public:
|
||||
void PlaybackNotify (int Event, void *pData, void *pTag);
|
||||
void DMNotify(int Event, void *pTsBuf, void *Tag);
|
||||
bool Open(playmode_t PlayMode);
|
||||
void Close(void);
|
||||
bool Start(char * filename, unsigned short vpid, int vtype, unsigned short apid, int audio_flag);
|
||||
bool Stop(void);
|
||||
bool SetAPid(unsigned short pid, int audio_flag);
|
||||
bool SetSpeed(int speed);
|
||||
bool GetSpeed(int &speed) const;
|
||||
bool GetPosition(int &position, int &duration);
|
||||
bool GetOffset(off64_t &offset);
|
||||
bool SetPosition(int position, bool absolute = false);
|
||||
bool IsPlaying(void) const { return playing; }
|
||||
bool IsEnabled(void) const { return enabled; }
|
||||
void * GetHandle(void);
|
||||
void * GetDmHandle(void);
|
||||
int GetCurrPlaybackSpeed(void) const { return nPlaybackSpeed; }
|
||||
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language);
|
||||
//
|
||||
cPlayback(int num = 0);
|
||||
~cPlayback();
|
||||
|
||||
class cPlayback {
|
||||
private:
|
||||
int timeout;
|
||||
pthread_cond_t read_cond;
|
||||
pthread_mutex_t mutex;
|
||||
CS_PLAYBACK_PDATA * privateData;
|
||||
bool enabled;
|
||||
bool paused;
|
||||
bool playing;
|
||||
int unit;
|
||||
int nPlaybackFD;
|
||||
int video_type;
|
||||
int nPlaybackSpeed;
|
||||
int mSpeed;
|
||||
playmode_t playMode;
|
||||
//
|
||||
void Attach(void);
|
||||
void Detach(void);
|
||||
bool SetAVDemuxChannel(bool On, bool Video = true, bool Audio = true);
|
||||
public:
|
||||
void PlaybackNotify (int Event, void *pData, void *pTag);
|
||||
void DMNotify(int Event, void *pTsBuf, void *Tag);
|
||||
bool Open(playmode_t PlayMode);
|
||||
void Close(void);
|
||||
bool Start(char * filename, unsigned short vpid, int vtype, unsigned short apid, int audio_flag);
|
||||
bool Stop(void);
|
||||
bool SetAPid(unsigned short pid, int audio_flag);
|
||||
bool SetSpeed(int speed);
|
||||
bool GetSpeed(int &speed) const;
|
||||
bool GetPosition(int &position, int &duration);
|
||||
bool GetOffset(off64_t &offset);
|
||||
bool SetPosition(int position, bool absolute = false);
|
||||
bool IsPlaying(void) const { return playing; }
|
||||
bool IsEnabled(void) const { return enabled; }
|
||||
void * GetHandle(void);
|
||||
void * GetDmHandle(void);
|
||||
int GetCurrPlaybackSpeed(void) const { return nPlaybackSpeed; }
|
||||
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language);
|
||||
//
|
||||
cPlayback(int num = 0);
|
||||
~cPlayback();
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // __PLAYBACK_CS_H_
|
||||
|
@@ -1,5 +1,13 @@
|
||||
#ifndef __PWRMNGR_H__
|
||||
#define __PWRMNGR_H__
|
||||
/*******************************************************************************/
|
||||
/* */
|
||||
/* libcoolstream/pwrmngr.h */
|
||||
/* Private header of the Powermanager API */
|
||||
/* */
|
||||
/* (C) 2010 CoolStream International */
|
||||
/* */
|
||||
/*******************************************************************************/
|
||||
#ifndef __PWRMNGR_H_
|
||||
#define __PWRMNGR_H_
|
||||
|
||||
// -- cCpuFreqManager ----------------------------------------------------------
|
||||
|
||||
@@ -23,8 +31,7 @@ public:
|
||||
|
||||
// -- cPowerManageger ----------------------------------------------------------
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
PWR_INIT = 1,
|
||||
PWR_FULL_ACTIVE, /* all devices/clocks up */
|
||||
PWR_ACTIVE_STANDBY,
|
||||
@@ -38,7 +45,7 @@ private:
|
||||
bool opened;
|
||||
PWR_STATE powerState;
|
||||
//
|
||||
// static void ApplicationCallback(void *hHandle, void *pUserData, signed long eEvent, void *pEventData, void *pTag) {}
|
||||
static void ApplicationCallback(void *hHandle, void *pUserData, signed long eEvent, void *pEventData, void *pTag) {}
|
||||
bool SetState(PWR_STATE PowerState);
|
||||
public:
|
||||
bool Open(void);
|
||||
|
@@ -1,13 +1,13 @@
|
||||
/*******************************************************************************/
|
||||
/* */
|
||||
/* libcoolstream/cszapper/demux.h */
|
||||
/* ZAP interface for neutrino frontend */
|
||||
/* libcoolstream/record_cs.h */
|
||||
/* Public header file for record API */
|
||||
/* */
|
||||
/* (C) 2008 CoolStream International */
|
||||
/* */
|
||||
/*******************************************************************************/
|
||||
#ifndef __RECORD_CS_H
|
||||
#define __RECORD_CS_H
|
||||
#ifndef __RECORD_CS_H_
|
||||
#define __RECORD_CS_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
@@ -15,24 +15,23 @@
|
||||
#define CS_RECORD_PDATA void
|
||||
#endif
|
||||
|
||||
class cRecord
|
||||
{
|
||||
private:
|
||||
CS_RECORD_PDATA * privateData;
|
||||
bool enabled;
|
||||
int num_apids;
|
||||
int unit;
|
||||
int nRecordFD;
|
||||
class cRecord {
|
||||
private:
|
||||
CS_RECORD_PDATA * privateData;
|
||||
bool enabled;
|
||||
int num_apids;
|
||||
int unit;
|
||||
int nRecordFD;
|
||||
|
||||
public:
|
||||
cRecord(int num = 0);
|
||||
~cRecord();
|
||||
public:
|
||||
cRecord(int num = 0);
|
||||
~cRecord();
|
||||
|
||||
bool Open(int numpids);
|
||||
void Close(void);
|
||||
bool Start(int fd, unsigned short vpid, unsigned short * apids, int numpids);
|
||||
bool Stop(void);
|
||||
void RecordNotify(int Event, void *pData);
|
||||
bool Open(int numpids);
|
||||
void Close(void);
|
||||
bool Start(int fd, unsigned short vpid, unsigned short * apids, int numpids);
|
||||
bool Stop(void);
|
||||
void RecordNotify(int Event, void *pData);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // __RECORD_CS_H_
|
||||
|
@@ -1,11 +1,23 @@
|
||||
#ifndef _VIDEO_CS_H
|
||||
#define _VIDEO_CS_H
|
||||
/*******************************************************************************/
|
||||
/* */
|
||||
/* libcoolstream/video_cs.h */
|
||||
/* Public header file for video API */
|
||||
/* */
|
||||
/* (C) 2008 CoolStream International */
|
||||
/* */
|
||||
/*******************************************************************************/
|
||||
#ifndef __VIDEO_CS_H_
|
||||
#define __VIDEO_CS_H_
|
||||
|
||||
#include <coolstream/cs_vfd.h>
|
||||
#include <coolstream/control.h>
|
||||
|
||||
#include "cs_types.h"
|
||||
|
||||
#ifndef CS_VIDEO_PDATA
|
||||
#define CS_VIDEO_PDATA void
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
ANALOG_SD_RGB_CINCH = 0x00,
|
||||
ANALOG_SD_YPRPB_CINCH,
|
||||
@@ -110,122 +122,114 @@ typedef enum
|
||||
VIDEO_CONTROL_MAX = VIDEO_CONTROL_SHARPNESS
|
||||
} VIDEO_CONTROL;
|
||||
|
||||
#ifndef CS_VIDEO_PDATA
|
||||
#define CS_VIDEO_PDATA void
|
||||
#endif
|
||||
class cVideo {
|
||||
private:
|
||||
CS_VIDEO_PDATA *privateData;
|
||||
VIDEO_FORMAT StreamType;
|
||||
VIDEO_DEFINITION VideoDefinition;
|
||||
DISPLAY_AR DisplayAR;
|
||||
VIDEO_PLAY_MODE playMode;
|
||||
AVSYNC_TYPE syncMode;
|
||||
DISPLAY_AR_MODE ARMode;
|
||||
VIDEO_DB_DR eDbDr;
|
||||
DISPLAY_AR PictureAR;
|
||||
VIDEO_FRAME_RATE FrameRate;
|
||||
VIDEO_HDMI_CEC_MODE hdmiCECMode;
|
||||
bool Interlaced;
|
||||
unsigned int uDRMDisplayDelay;
|
||||
unsigned int uVideoPTSDelay;
|
||||
int StcPts;
|
||||
bool started;
|
||||
unsigned int bStandby;
|
||||
bool blank;
|
||||
bool playing;
|
||||
bool auto_format;
|
||||
int uFormatIndex;
|
||||
bool vbi_started;
|
||||
bool receivedDRMDelay;
|
||||
bool receivedVideoDelay;
|
||||
int cfd; // control driver fd
|
||||
analog_mode_t analog_mode_cinch;
|
||||
analog_mode_t analog_mode_scart;
|
||||
vfd_icon mode_icon;
|
||||
//
|
||||
int SelectAutoFormat();
|
||||
void ScalePic();
|
||||
public:
|
||||
/* constructor & destructor */
|
||||
cVideo(int mode, void * hChannel, void * hBuffer);
|
||||
~cVideo(void);
|
||||
|
||||
class cVideo
|
||||
{
|
||||
private:
|
||||
CS_VIDEO_PDATA *privateData;
|
||||
VIDEO_FORMAT StreamType;
|
||||
VIDEO_DEFINITION VideoDefinition;
|
||||
DISPLAY_AR DisplayAR;
|
||||
VIDEO_PLAY_MODE playMode;
|
||||
AVSYNC_TYPE syncMode;
|
||||
DISPLAY_AR_MODE ARMode;
|
||||
VIDEO_DB_DR eDbDr;
|
||||
DISPLAY_AR PictureAR;
|
||||
VIDEO_FRAME_RATE FrameRate;
|
||||
VIDEO_HDMI_CEC_MODE hdmiCECMode;
|
||||
bool Interlaced;
|
||||
void * GetDRM(void);
|
||||
void * GetTVEnc();
|
||||
void * GetTVEncSD();
|
||||
void * GetHandle();
|
||||
|
||||
unsigned int uDRMDisplayDelay;
|
||||
unsigned int uVideoPTSDelay;
|
||||
int StcPts;
|
||||
bool started;
|
||||
unsigned int bStandby;
|
||||
bool blank;
|
||||
bool playing;
|
||||
bool auto_format;
|
||||
int uFormatIndex;
|
||||
bool vbi_started;
|
||||
void SetAudioHandle(void * handle);
|
||||
/* aspect ratio */
|
||||
int getAspectRatio(void);
|
||||
void getPictureInfo(int &width, int &height, int &rate);
|
||||
int setAspectRatio(int aspect, int mode);
|
||||
|
||||
bool receivedDRMDelay;
|
||||
bool receivedVideoDelay;
|
||||
int cfd; // control driver fd
|
||||
analog_mode_t analog_mode_cinch;
|
||||
analog_mode_t analog_mode_scart;
|
||||
/* cropping mode */
|
||||
int getCroppingMode(void);
|
||||
int setCroppingMode(void);
|
||||
|
||||
vfd_icon mode_icon;
|
||||
int SelectAutoFormat();
|
||||
void ScalePic();
|
||||
public:
|
||||
/* constructor & destructor */
|
||||
cVideo(int mode, void * hChannel, void * hBuffer);
|
||||
~cVideo(void);
|
||||
/* stream source */
|
||||
int getSource(void);
|
||||
int setSource(void);
|
||||
int GetStreamType(void) { return StreamType; };
|
||||
|
||||
void * GetDRM(void);
|
||||
void * GetTVEnc();
|
||||
void * GetTVEncSD();
|
||||
void * GetHandle();
|
||||
/* blank on freeze */
|
||||
int getBlank(void);
|
||||
int setBlank(int enable);
|
||||
|
||||
void SetAudioHandle(void * handle);
|
||||
/* aspect ratio */
|
||||
int getAspectRatio(void);
|
||||
void getPictureInfo(int &width, int &height, int &rate);
|
||||
int setAspectRatio(int aspect, int mode);
|
||||
/* get play state */
|
||||
int getPlayState(void);
|
||||
void SetDRMDelay(unsigned int delay) { uDRMDisplayDelay = delay;};
|
||||
void SetVideoDelay(unsigned int delay) { uVideoPTSDelay = delay;};
|
||||
/* Notification handlers */
|
||||
void HandleDRMMessage(int Event, void *pData);
|
||||
void HandleVideoMessage(void * hHandle, int Event, void *pData);
|
||||
void HandleEncoderMessage(void *hHandle, int Event, void *pData);
|
||||
VIDEO_DEFINITION GetVideoDef(void) { return VideoDefinition; }
|
||||
|
||||
/* cropping mode */
|
||||
int getCroppingMode(void);
|
||||
int setCroppingMode(void);
|
||||
/* change video play state */
|
||||
int Prepare(void * PcrChannel, unsigned short PcrPid, unsigned short VideoPid, void * hChannel = NULL);
|
||||
int Start(void * PcrChannel, unsigned short PcrPid, unsigned short VideoPid, void * hChannel = NULL);
|
||||
int Stop(bool Blank = true);
|
||||
bool Pause(void);
|
||||
bool Resume(void);
|
||||
int LipsyncAdjust();
|
||||
int64_t GetPTS(void);
|
||||
int Flush(void);
|
||||
|
||||
/* stream source */
|
||||
int getSource(void);
|
||||
int setSource(void);
|
||||
int GetStreamType(void) { return StreamType; };
|
||||
|
||||
/* blank on freeze */
|
||||
int getBlank(void);
|
||||
int setBlank(int enable);
|
||||
|
||||
/* get play state */
|
||||
int getPlayState(void);
|
||||
void SetDRMDelay(unsigned int delay) { uDRMDisplayDelay = delay;};
|
||||
void SetVideoDelay(unsigned int delay) { uVideoPTSDelay = delay;};
|
||||
/* Notification handlers */
|
||||
void HandleDRMMessage(int Event, void *pData);
|
||||
void HandleVideoMessage(void * hHandle, int Event, void *pData);
|
||||
void HandleEncoderMessage(void *hHandle, int Event, void *pData);
|
||||
VIDEO_DEFINITION GetVideoDef(void) { return VideoDefinition; }
|
||||
|
||||
/* change video play state */
|
||||
int Prepare(void * PcrChannel, unsigned short PcrPid, unsigned short VideoPid, void * hChannel = NULL);
|
||||
int Start(void * PcrChannel, unsigned short PcrPid, unsigned short VideoPid, void * hChannel = NULL);
|
||||
int Stop(bool blank = true);
|
||||
bool Pause(void);
|
||||
bool Resume(void);
|
||||
int LipsyncAdjust();
|
||||
int64_t GetPTS(void);
|
||||
|
||||
int Flush(void);
|
||||
|
||||
/* set video_system */
|
||||
int SetVideoSystem(int video_system, bool remember = true);
|
||||
int SetStreamType(VIDEO_FORMAT type);
|
||||
void SetSyncMode(AVSYNC_TYPE mode);
|
||||
bool SetCECMode(VIDEO_HDMI_CEC_MODE Mode);
|
||||
void SetCECAutoView(bool OnOff);
|
||||
void SetCECAutoStandby(bool OnOff);
|
||||
void ShowPicture(const char * fname);
|
||||
void StopPicture();
|
||||
void Standby(unsigned int bOn);
|
||||
void Pig(int x, int y, int w, int h, int osd_w = 1064, int osd_h = 600);
|
||||
void SetControl(int num, int val);
|
||||
bool ReceivedDRMDelay(void) { return receivedDRMDelay; }
|
||||
bool ReceivedVideoDelay(void) { return receivedVideoDelay; }
|
||||
void SetReceivedDRMDelay(bool Received) { receivedDRMDelay = Received; }
|
||||
void SetReceivedVideoDelay(bool Received) { receivedVideoDelay = Received; }
|
||||
void SetFastBlank(bool onoff);
|
||||
void SetTVAV(bool onoff);
|
||||
void SetWideScreen(bool onoff);
|
||||
void SetVideoMode(analog_mode_t mode);
|
||||
void SetDBDR(int dbdr);
|
||||
void SetAutoModes(int modes[VIDEO_STD_MAX]);
|
||||
int OpenVBI(int num);
|
||||
int CloseVBI(void);
|
||||
int StartVBI(unsigned short pid);
|
||||
int StopVBI(void);
|
||||
/* set video_system */
|
||||
int SetVideoSystem(int video_system, bool remember = true);
|
||||
int SetStreamType(VIDEO_FORMAT type);
|
||||
void SetSyncMode(AVSYNC_TYPE mode);
|
||||
bool SetCECMode(VIDEO_HDMI_CEC_MODE Mode);
|
||||
void SetCECAutoView(bool OnOff);
|
||||
void SetCECAutoStandby(bool OnOff);
|
||||
void ShowPicture(const char * fname);
|
||||
void StopPicture();
|
||||
void Standby(unsigned int bOn);
|
||||
void Pig(int x, int y, int w, int h, int osd_w = 1064, int osd_h = 600);
|
||||
void SetControl(int num, int val);
|
||||
bool ReceivedDRMDelay(void) { return receivedDRMDelay; }
|
||||
bool ReceivedVideoDelay(void) { return receivedVideoDelay; }
|
||||
void SetReceivedDRMDelay(bool Received) { receivedDRMDelay = Received; }
|
||||
void SetReceivedVideoDelay(bool Received) { receivedVideoDelay = Received; }
|
||||
void SetFastBlank(bool onoff);
|
||||
void SetTVAV(bool onoff);
|
||||
void SetWideScreen(bool onoff);
|
||||
void SetVideoMode(analog_mode_t mode);
|
||||
void SetDBDR(int dbdr);
|
||||
void SetAutoModes(int modes[VIDEO_STD_MAX]);
|
||||
int OpenVBI(int num);
|
||||
int CloseVBI(void);
|
||||
int StartVBI(unsigned short pid);
|
||||
int StopVBI(void);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // __VIDEO_CS_H_
|
||||
|
Reference in New Issue
Block a user