mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
add libduckbox
This commit is contained in:
@@ -40,3 +40,11 @@ libstb_hal_la_LIBADD += \
|
||||
libspark/libspark.la \
|
||||
libeplayer3/libeplayer3.la
|
||||
endif
|
||||
if BOXTYPE_DUCKBOX
|
||||
libstb_hal_test_LDADD += -lasound
|
||||
SUBDIRS += libduckbox libeplayer3 libdvbci
|
||||
libstb_hal_la_LIBADD += \
|
||||
libduckbox/libduckbox.la \
|
||||
libeplayer3/libeplayer3.la \
|
||||
libdvbci/libdvbci.la
|
||||
endif
|
||||
|
83
acinclude.m4
83
acinclude.m4
@@ -278,22 +278,51 @@ _TUXBOX_APPS_LIB_SYMBOL($1,$2,$3,WARN)
|
||||
|
||||
AC_DEFUN([TUXBOX_BOXTYPE],[
|
||||
AC_ARG_WITH(boxtype,
|
||||
[ --with-boxtype valid values: dbox2,tripledragon,dreambox,ipbox,coolstream,spark,azbox,generic],
|
||||
[ --with-boxtype valid values: dbox2,tripledragon,dreambox,ipbox,coolstream,spark,azbox,generic,duckbox,spark7162],
|
||||
[case "${withval}" in
|
||||
dbox2|dreambox|ipbox|tripledragon|coolstream|spark|azbox|generic)
|
||||
BOXTYPE="$withval"
|
||||
;;
|
||||
spark7162)
|
||||
BOXTYPE="spark"
|
||||
BOXMODEL="$withval"
|
||||
;;
|
||||
dm*)
|
||||
BOXTYPE="dreambox"
|
||||
BOXMODEL="$withval"
|
||||
;;
|
||||
ufs*)
|
||||
BOXTYPE="duckbox"
|
||||
BOXMODEL="$withval"
|
||||
;;
|
||||
atevio*)
|
||||
BOXTYPE="duckbox"
|
||||
BOXMODEL="$withval"
|
||||
;;
|
||||
fortis*)
|
||||
BOXTYPE="duckbox"
|
||||
BOXMODEL="$withval"
|
||||
;;
|
||||
octagon*)
|
||||
BOXTYPE="duckbox"
|
||||
BOXMODEL="$withval"
|
||||
;;
|
||||
cuberevo*)
|
||||
BOXTYPE="duckbox"
|
||||
BOXMODEL="$withval"
|
||||
;;
|
||||
tf*)
|
||||
BOXTYPE="duckbox"
|
||||
BOXMODEL="$withval"
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([bad value $withval for --with-boxtype]) ;;
|
||||
esac], [BOXTYPE="generic"])
|
||||
|
||||
AC_ARG_WITH(boxmodel,
|
||||
[ --with-boxmodel valid for dreambox: dm500, dm500plus, dm600pvr, dm56x0, dm7000, dm7020, dm7025
|
||||
valid for ipbox: ip200, ip250, ip350, ip400],
|
||||
valid for ipbox: ip200, ip250, ip350, ip400
|
||||
valid for duckbox: ufs910, ufs912, ufs913, ufs922, atevio7500, fortis_hdbox, octagon1008, cuberevo, cuberevo_mini2, cuberevo_2000hd, tf7700],
|
||||
[case "${withval}" in
|
||||
dm500|dm500plus|dm600pvr|dm56x0|dm7000|dm7020|dm7025)
|
||||
if test "$BOXTYPE" = "dreambox"; then
|
||||
@@ -309,6 +338,13 @@ AC_ARG_WITH(boxmodel,
|
||||
AC_MSG_ERROR([unknown model $withval for boxtype $BOXTYPE])
|
||||
fi
|
||||
;;
|
||||
ufs910|ufs912|ufs913|ufs922|atevio7500|fortis_hdbox|octagon1008|cuberevo|cuberevo_mini2|cuberevo_2000hd|tf7700)
|
||||
if test "$BOXTYPE" = "duckbox"; then
|
||||
BOXMODEL="$withval"
|
||||
else
|
||||
AC_MSG_ERROR([unknown model $withval for boxtype $BOXTYPE])
|
||||
fi
|
||||
;;
|
||||
raspi)
|
||||
if test "$BOXTYPE" = "generic"; then
|
||||
BOXMODEL="$withval"
|
||||
@@ -335,6 +371,7 @@ AM_CONDITIONAL(BOXTYPE_DREAMBOX, test "$BOXTYPE" = "dreambox")
|
||||
AM_CONDITIONAL(BOXTYPE_IPBOX, test "$BOXTYPE" = "ipbox")
|
||||
AM_CONDITIONAL(BOXTYPE_COOL, test "$BOXTYPE" = "coolstream")
|
||||
AM_CONDITIONAL(BOXTYPE_GENERIC, test "$BOXTYPE" = "generic")
|
||||
AM_CONDITIONAL(BOXTYPE_DUCKBOX, test "$BOXTYPE" = "duckbox")
|
||||
|
||||
AM_CONDITIONAL(BOXMODEL_DM500,test "$BOXMODEL" = "dm500")
|
||||
AM_CONDITIONAL(BOXMODEL_DM500PLUS,test "$BOXMODEL" = "dm500plus")
|
||||
@@ -347,6 +384,22 @@ AM_CONDITIONAL(BOXMODEL_IP250,test "$BOXMODEL" = "ip250")
|
||||
AM_CONDITIONAL(BOXMODEL_IP350,test "$BOXMODEL" = "ip350")
|
||||
AM_CONDITIONAL(BOXMODEL_IP400,test "$BOXMODEL" = "ip400")
|
||||
|
||||
AM_CONDITIONAL(BOXMODEL_UFS910, test "$BOXMODEL" = "ufs910")
|
||||
AM_CONDITIONAL(BOXMODEL_UFS912,test "$BOXMODEL" = "ufs912")
|
||||
AM_CONDITIONAL(BOXMODEL_UFS913,test "$BOXMODEL" = "ufs913")
|
||||
AM_CONDITIONAL(BOXMODEL_UFS922,test "$BOXMODEL" = "ufs922")
|
||||
|
||||
AM_CONDITIONAL(BOXMODEL_SPARK7162,test "$BOXMODEL" = "spark7162")
|
||||
|
||||
AM_CONDITIONAL(BOXMODEL_ATEVIO7500, test "$BOXMODEL" = "atevio7500")
|
||||
AM_CONDITIONAL(BOXMODEL_FORTIS_HDBOX,test "$BOXMODEL" = "fortis_hdbox")
|
||||
AM_CONDITIONAL(BOXMODEL_OCTAGON1008,test "$BOXMODEL" = "octagon1008")
|
||||
AM_CONDITIONAL(BOXMODEL_CUBEREVO,test "$BOXMODEL" = "cuberevo")
|
||||
AM_CONDITIONAL(BOXMODEL_CUBEREVO_MINI2,test "$BOXMODEL" = "cuberevo_mini2")
|
||||
AM_CONDITIONAL(BOXMODEL_CUBEREVO_2000HD,test "$BOXMODEL" = "cuberevo_2000hd")
|
||||
AM_CONDITIONAL(BOXMODEL_TF7700,test "$BOXMODEL" = "tf7700")
|
||||
|
||||
|
||||
AM_CONDITIONAL(BOXMODEL_RASPI,test "$BOXMODEL" = "raspi")
|
||||
|
||||
if test "$BOXTYPE" = "dbox2"; then
|
||||
@@ -365,6 +418,8 @@ elif test "$BOXTYPE" = "coolstream"; then
|
||||
AC_DEFINE(HAVE_COOL_HARDWARE, 1, [building for a coolstream])
|
||||
elif test "$BOXTYPE" = "generic"; then
|
||||
AC_DEFINE(HAVE_GENERIC_HARDWARE, 1, [building for a generic device like a standard PC])
|
||||
elif test "$BOXTYPE" = "duckbox"; then
|
||||
AC_DEFINE(HAVE_DUCKBOX_HARDWARE, 1, [building for a duckbox])
|
||||
fi
|
||||
|
||||
# TODO: do we need more defines?
|
||||
@@ -378,6 +433,30 @@ elif test "$BOXMODEL" = "ip350"; then
|
||||
AC_DEFINE(BOXMODEL_IP350, 1, [ipbox 350])
|
||||
elif test "$BOXMODEL" = "ip400"; then
|
||||
AC_DEFINE(BOXMODEL_IP400, 1, [ipbox 400])
|
||||
elif test "$BOXMODEL" = "ufs910"; then
|
||||
AC_DEFINE(BOXMODEL_UFS910, 1, [ufs910])
|
||||
elif test "$BOXMODEL" = "ufs912"; then
|
||||
AC_DEFINE(BOXMODEL_UFS912, 1, [ufs912])
|
||||
elif test "$BOXMODEL" = "ufs913"; then
|
||||
AC_DEFINE(BOXMODEL_UFS913, 1, [ufs913])
|
||||
elif test "$BOXMODEL" = "ufs922"; then
|
||||
AC_DEFINE(BOXMODEL_UFS922, 1, [ufs922])
|
||||
elif test "$BOXMODEL" = "spark7162"; then
|
||||
AC_DEFINE(BOXMODEL_SPARK7162, 1, [spark7162])
|
||||
elif test "$BOXMODEL" = "atevio7500"; then
|
||||
AC_DEFINE(BOXMODEL_ATEVIO7500, 1, [atevio7500])
|
||||
elif test "$BOXMODEL" = "fortis_hdbox"; then
|
||||
AC_DEFINE(BOXMODEL_FORTIS_HDBOX, 1, [fortis_hdbox])
|
||||
elif test "$BOXMODEL" = "octagon1008"; then
|
||||
AC_DEFINE(BOXMODEL_OCTAGON1008, 1, [octagon1008])
|
||||
elif test "$BOXMODEL" = "cuberevo"; then
|
||||
AC_DEFINE(BOXMODEL_CUBEREVO, 1, [cuberevo])
|
||||
elif test "$BOXMODEL" = "cuberevo_mini2"; then
|
||||
AC_DEFINE(BOXMODEL_CUBEREVO_MINI2, 1, [cuberevo_mini2])
|
||||
elif test "$BOXMODEL" = "cuberevo_2000hd"; then
|
||||
AC_DEFINE(BOXMODEL_CUBEREVO_2000HD, 1, [cuberevo_2000hd])
|
||||
elif test "$BOXMODEL" = "tf7700"; then
|
||||
AC_DEFINE(BOXMODEL_TF7700, 1, [tf7700])
|
||||
elif test "$BOXMODEL" = "raspi"; then
|
||||
AC_DEFINE(BOXMODEL_RASPI, 1, [Raspberry pi])
|
||||
fi
|
||||
|
@@ -1,8 +1,22 @@
|
||||
noinst_LTLIBRARIES = libcommon.la
|
||||
|
||||
AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing
|
||||
AM_LDFLAGS = -lpthread
|
||||
|
||||
if BOXTYPE_DUCKBOX
|
||||
AM_CXXFLAGS += \
|
||||
-I $(top_srcdir)/include \
|
||||
-I $(top_srcdir)/libdvbci
|
||||
endif
|
||||
|
||||
if BOXTYPE_DUCKBOX
|
||||
libcommon_la_SOURCES = \
|
||||
ca.cpp \
|
||||
ca_ci.cpp
|
||||
else
|
||||
libcommon_la_SOURCES = \
|
||||
ca.cpp
|
||||
endif
|
||||
|
||||
libcommon_la_SOURCES += \
|
||||
lt_debug.cpp \
|
||||
proc_tools.c
|
||||
|
17
common/ca.h
17
common/ca.h
@@ -1,12 +1,16 @@
|
||||
/*
|
||||
* dummy functions to implement ca_cs.h interface
|
||||
*/
|
||||
#if HAVE_DUCKBOX_HARDWARE
|
||||
#include "ca_ci.h"
|
||||
#else
|
||||
#ifndef __CA_LIBTRIPLE_H_
|
||||
#define __CA_LIBTRIPLE_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include "cs_types.h"
|
||||
#include <vector>
|
||||
#include <set>
|
||||
typedef std::vector<u16> CaIdVector;
|
||||
typedef std::vector<u16>::iterator CaIdVectorIterator;
|
||||
typedef std::vector<u16>::const_iterator CaIdVectorConstIterator;
|
||||
@@ -20,7 +24,7 @@ enum CA_INIT_MASK {
|
||||
enum CA_SLOT_TYPE {
|
||||
CA_SLOT_TYPE_SMARTCARD,
|
||||
CA_SLOT_TYPE_CI,
|
||||
CA_SLOT_TYPE_ALL,
|
||||
CA_SLOT_TYPE_ALL
|
||||
};
|
||||
|
||||
enum CA_MESSAGE_FLAGS {
|
||||
@@ -63,13 +67,18 @@ enum CA_MESSAGE_MSGID {
|
||||
CA_MESSAGE_MSG_MMI_CLOSE,
|
||||
CA_MESSAGE_MSG_INTERNAL,
|
||||
CA_MESSAGE_MSG_PMT_ARRIVED,
|
||||
CA_MESSAGE_MSG_CAPMT_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,
|
||||
CA_MESSAGE_MSG_GUI_READY,
|
||||
CA_MESSAGE_MSG_EXIT
|
||||
};
|
||||
|
||||
typedef std::set<int> ca_map_t;
|
||||
typedef ca_map_t::iterator ca_map_iterator_t;
|
||||
|
||||
typedef struct CA_MESSAGE {
|
||||
uint32_t MsgId;
|
||||
enum CA_SLOT_TYPE SlotType;
|
||||
@@ -91,7 +100,8 @@ public:
|
||||
uint32_t GetNumberSmartCardSlots(void);
|
||||
static cCA *GetInstance(void);
|
||||
bool SendPMT(int Unit, unsigned char *Data, int Len, CA_SLOT_TYPE SlotType = CA_SLOT_TYPE_ALL);
|
||||
bool SendCAPMT(u64 /*Source*/, u8 /*DemuxSource*/, u8 /*DemuxMask*/, const unsigned char * /*CAPMT*/, u32 /*CAPMTLen*/, const unsigned char * /*RawPMT*/, u32 /*RawPMTLen*/) { return true; };
|
||||
// bool SendCAPMT(u64 /*Source*/, u8 /*DemuxSource*/, u8 /*DemuxMask*/, const unsigned char * /*CAPMT*/, u32 /*CAPMTLen*/, const unsigned char * /*RawPMT*/, u32 /*RawPMTLen*/) { return true; };
|
||||
bool SendCAPMT(u64 /*Source*/, u8 /*DemuxSource*/, u8 /*DemuxMask*/, const unsigned char * /*CAPMT*/, u32 /*CAPMTLen*/, const unsigned char * /*RawPMT*/, u32 /*RawPMTLen*/, unsigned char /*scrambled = 0*/, ca_map_t /*camap = std::set<int>()*/, int /*mode = 0*/, bool /*enabled = false*/) { return true; };
|
||||
bool SendMessage(const CA_MESSAGE *Msg);
|
||||
void SetInitMask(enum CA_INIT_MASK InitMask);
|
||||
int GetCAIDS(CaIdVector & /*Caids*/) { return 0; };
|
||||
@@ -110,3 +120,4 @@ public:
|
||||
};
|
||||
|
||||
#endif // __CA_LIBTRIPLE_H_
|
||||
#endif // HAVE_DUCKBOX_HARDWARE
|
||||
|
1098
common/ca_ci.cpp
Normal file
1098
common/ca_ci.cpp
Normal file
File diff suppressed because it is too large
Load Diff
283
common/ca_ci.h
Normal file
283
common/ca_ci.h
Normal file
@@ -0,0 +1,283 @@
|
||||
#ifndef __CA_H_
|
||||
#define __CA_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <asm/types.h>
|
||||
#include <pthread.h>
|
||||
#include <list>
|
||||
#include <queue>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
|
||||
#include "mmi.h"
|
||||
#include "cs_types.h"
|
||||
#include "cs_api.h"
|
||||
|
||||
/* constants taken from dvb-apps */
|
||||
#define T_SB 0x80 // sb primitive h<--m
|
||||
#define T_RCV 0x81 // receive primitive h-->m
|
||||
#define T_CREATE_T_C 0x82 // create transport connection primitive h-->m
|
||||
#define T_C_T_C_REPLY 0x83 // ctc reply primitive h<--m
|
||||
#define T_DELETE_T_C 0x84 // delete tc primitive h<->m
|
||||
#define T_D_T_C_REPLY 0x85 // dtc reply primitive h<->m
|
||||
#define T_REQUEST_T_C 0x86 // request transport connection primitive h<--m
|
||||
#define T_NEW_T_C 0x87 // new tc / reply to t_request primitive h-->m
|
||||
#define T_T_C_ERROR 0x77 // error creating tc primitive h-->m
|
||||
#define T_DATA_LAST 0xA0 // convey data from higher constructed h<->m
|
||||
#define T_DATA_MORE 0xA1 // convey data from higher constructed h<->m
|
||||
|
||||
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_PARAM5_INT = (1 << 13),
|
||||
CA_MESSAGE_HAS_PARAM5_PTR = (1 << 14),
|
||||
CA_MESSAGE_HAS_PARAM5_DATA = (1 << 15),
|
||||
CA_MESSAGE_HAS_PARAM6_INT = (1 << 16),
|
||||
CA_MESSAGE_HAS_PARAM6_PTR = (1 << 17),
|
||||
CA_MESSAGE_HAS_PARAM6_DATA = (1 << 18),
|
||||
CA_MESSAGE_HAS_PARAM1_LONG = (1 << 19),
|
||||
CA_MESSAGE_HAS_PARAM2_LONG = (1 << 20),
|
||||
CA_MESSAGE_HAS_PARAM3_LONG = (1 << 21),
|
||||
CA_MESSAGE_HAS_PARAM4_LONG = (1 << 22)
|
||||
};
|
||||
|
||||
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_CAPMT_ARRIVED,
|
||||
CA_MESSAGE_MSG_CAT_ARRIVED,
|
||||
CA_MESSAGE_MSG_ECM_ARRIVED,
|
||||
CA_MESSAGE_MSG_EMM_ARRIVED,
|
||||
CA_MESSAGE_MSG_CHANNEL_CHANGE,
|
||||
CA_MESSAGE_MSG_GUI_READY,
|
||||
CA_MESSAGE_MSG_EXIT
|
||||
};
|
||||
|
||||
typedef struct CA_MESSAGE {
|
||||
uint32_t MsgId;
|
||||
enum CA_SLOT_TYPE SlotType;
|
||||
int Slot;
|
||||
uint32_t Flags;
|
||||
union {
|
||||
uint8_t *Data[4];
|
||||
uint32_t Param[4];
|
||||
void *Ptr[4];
|
||||
uint64_t ParamLong[4];
|
||||
} Msg;
|
||||
} CA_MESSAGE;
|
||||
|
||||
typedef std::set<int> ca_map_t;
|
||||
typedef ca_map_t::iterator ca_map_iterator_t;
|
||||
|
||||
typedef std::vector<u16> CaIdVector;
|
||||
typedef std::vector<u16>::iterator CaIdVectorIterator;
|
||||
typedef std::vector<u16>::const_iterator CaIdVectorConstIterator;
|
||||
|
||||
#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
|
||||
|
||||
typedef enum {
|
||||
TUNER_A,
|
||||
TUNER_B,
|
||||
TUNER_C,
|
||||
TUNER_D
|
||||
} source_t;
|
||||
|
||||
typedef enum {
|
||||
eDataTimeout,
|
||||
eDataError,
|
||||
eDataReady,
|
||||
eDataWrite,
|
||||
eDataStatusChanged
|
||||
} eData;
|
||||
|
||||
typedef enum {
|
||||
eStatusNone,
|
||||
eStatusWait,
|
||||
eStatusReset
|
||||
} eStatus;
|
||||
|
||||
struct queueData
|
||||
{
|
||||
__u8 prio;
|
||||
unsigned char *data;
|
||||
unsigned int len;
|
||||
queueData(unsigned char *_data, unsigned int _len, __u8 _prio = 0)
|
||||
:prio(_prio), data(_data), len(_len)
|
||||
{
|
||||
|
||||
}
|
||||
bool operator < ( const struct queueData &a ) const
|
||||
{
|
||||
return prio < a.prio;
|
||||
}
|
||||
};
|
||||
|
||||
class eDVBCIMMISession;
|
||||
class eDVBCIApplicationManagerSession;
|
||||
class eDVBCICAManagerSession;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
pthread_t slot_thread;
|
||||
int slot;
|
||||
int fd;
|
||||
int connection_id;
|
||||
eStatus status;
|
||||
|
||||
int receivedLen;
|
||||
unsigned char* receivedData;
|
||||
|
||||
void* pClass;
|
||||
|
||||
bool pollConnection;
|
||||
bool camIsReady;
|
||||
|
||||
eDVBCIMMISession* mmiSession;
|
||||
eDVBCIApplicationManagerSession* appSession;
|
||||
eDVBCICAManagerSession* camgrSession;
|
||||
|
||||
bool hasAppManager;
|
||||
bool hasMMIManager;
|
||||
bool hasCAManager;
|
||||
bool hasDateTime;
|
||||
bool mmiOpened;
|
||||
bool init;
|
||||
|
||||
char name[512];
|
||||
|
||||
bool newCapmt;
|
||||
bool inUse;
|
||||
u64 tpid;
|
||||
u32 pmtlen;
|
||||
u8 source;
|
||||
u8 camask;
|
||||
unsigned char pmtdata[1024];
|
||||
|
||||
int counter;
|
||||
CaIdVector cam_caids;
|
||||
std::priority_queue<queueData> sendqueue;
|
||||
} tSlot;
|
||||
|
||||
eData sendData(tSlot *slot, unsigned char* data, int len);
|
||||
|
||||
typedef std::list<tSlot*>::iterator SlotIt;
|
||||
|
||||
/// CA module class
|
||||
class cCA {
|
||||
private:
|
||||
/// Static instance of the CA module
|
||||
// static cCA *inst;
|
||||
/// Private constructor (singleton method)
|
||||
cCA(void);
|
||||
/// Private data for the CA module
|
||||
CS_CA_PDATA *privateData;
|
||||
enum CA_INIT_MASK initMask;
|
||||
int num_slots;
|
||||
bool init;
|
||||
void SendPMT();
|
||||
pthread_mutex_t ciMutex;
|
||||
std::list<tSlot*> slot_data;
|
||||
pthread_t slot_thread;
|
||||
|
||||
public:
|
||||
bool Init(void);
|
||||
cCA(int Slots);
|
||||
/// Returns the number of CI slots
|
||||
uint32_t GetNumberCISlots(void);
|
||||
/// Returns the number of Smartcard slots
|
||||
uint32_t GetNumberSmartCardSlots(void);
|
||||
/// Singleton
|
||||
static cCA *GetInstance(void);
|
||||
/// Send PMT to a individual or to all available modules (DEPRECATED)
|
||||
bool SendPMT(int Unit, unsigned char *Data, int Len, enum CA_SLOT_TYPE SlotType = CA_SLOT_TYPE_ALL);
|
||||
/// Sends a message to the CA thread
|
||||
bool SendMessage(const CA_MESSAGE *Msg);
|
||||
/// Sets which modules to initialize. It is only
|
||||
/// possible to change this once!
|
||||
void SetInitMask(enum CA_INIT_MASK InitMask);
|
||||
/// Sets the frequency (in Hz) of the TS stream input (only valid for CI)
|
||||
void SetTSClock(u32 /*Speed*/) { return; };
|
||||
/// Start the CA module
|
||||
bool Start(void);
|
||||
/// Stops the CA module
|
||||
void Stop(void);
|
||||
/// Notify that the GUI is ready to receive messages
|
||||
/// (CA messages coming from a module)
|
||||
void Ready(bool Set);
|
||||
/// Resets a module (if possible)
|
||||
void ModuleReset(enum CA_SLOT_TYPE, uint32_t Slot);
|
||||
/// Checks if a module is present
|
||||
bool ModulePresent(enum CA_SLOT_TYPE, uint32_t Slot);
|
||||
/// Returns the module name in array Name
|
||||
void ModuleName(enum CA_SLOT_TYPE, uint32_t Slot, char *Name);
|
||||
/// Notify the module we want to enter menu
|
||||
void MenuEnter(enum CA_SLOT_TYPE, uint32_t Slot);
|
||||
/// Notify the module with our answer (choice nr)
|
||||
void MenuAnswer(enum CA_SLOT_TYPE, uint32_t Slot, uint32_t choice);
|
||||
/// Notify the module with our answer (binary)
|
||||
void InputAnswer(enum CA_SLOT_TYPE, uint32_t Slot, uint8_t * Data, int Len);
|
||||
/// Notify the module we closed the menu
|
||||
void MenuClose(enum CA_SLOT_TYPE, uint32_t Slot);
|
||||
/// Get the supported CAIDs
|
||||
int GetCAIDS(CaIdVector &Caids);
|
||||
/// Send a CA-PMT object and Raw unparsed PMT to the CA layer
|
||||
bool SendCAPMT(u64 /*Source*/, u8 /*DemuxSource*/, u8 /*DemuxMask*/, const unsigned char * /*CAPMT*/, u32 /*CAPMTLen*/, const unsigned char * /*RawPMT*/, u32 /*RawPMTLen*/,
|
||||
unsigned char scrambled = 0, ca_map_t camap = std::set<int>(), int mode = 0, bool enabled = false);
|
||||
|
||||
bool StopRecordCI( u64 tpid, u8 source, u32 calen);
|
||||
SlotIt FindFreeSlot(ca_map_t camap, unsigned char scrambled);
|
||||
bool SendDateTime(void);
|
||||
bool SendCaPMT(tSlot* slot);
|
||||
void slot_pollthread(void *c);
|
||||
void setSource(tSlot* slot);
|
||||
bool checkQueueSize(tSlot* slot);
|
||||
void process_tpdu(tSlot* slot, unsigned char tpdu_tag, __u8* data, int asn_data_length, int con_id);
|
||||
|
||||
void Test(int slot, CaIdVector caids);
|
||||
void DelTest(int slot);
|
||||
/// Virtual destructor
|
||||
virtual ~cCA();
|
||||
};
|
||||
|
||||
#endif // __CA_H_
|
@@ -37,6 +37,8 @@ common/Makefile
|
||||
libeplayer3/Makefile
|
||||
azbox/Makefile
|
||||
generic-pc/Makefile
|
||||
libduckbox/Makefile
|
||||
libdvbci/Makefile
|
||||
libtriple/Makefile
|
||||
libspark/Makefile
|
||||
raspi/Makefile
|
||||
|
@@ -1,6 +1,9 @@
|
||||
#include <config.h>
|
||||
#if HAVE_TRIPLEDRAGON
|
||||
#include "../libtriple/audio_td.h"
|
||||
#elif HAVE_DUCKBOX_HARDWARE
|
||||
#include "../libduckbox/audio_lib.h"
|
||||
#include "../libduckbox/audio_mixer.h"
|
||||
#elif HAVE_SPARK_HARDWARE
|
||||
#include "../libspark/audio_lib.h"
|
||||
#include "../libspark/audio_mixer.h"
|
||||
|
@@ -1,6 +1,8 @@
|
||||
#include <config.h>
|
||||
#if HAVE_TRIPLEDRAGON
|
||||
#include "../libtriple/cs_api.h"
|
||||
#elif HAVE_DUCKBOX_HARDWARE
|
||||
#include "../libduckbox/cs_api.h"
|
||||
#elif HAVE_SPARK_HARDWARE
|
||||
#include "../libspark/cs_api.h"
|
||||
#elif HAVE_AZBOX_HARDWARE
|
||||
|
184
include/cs_frontpanel.h
Normal file
184
include/cs_frontpanel.h
Normal file
@@ -0,0 +1,184 @@
|
||||
#ifndef __DUCKBOX_VFD__
|
||||
#define __DUCKBOX_VFD__
|
||||
|
||||
#define VFDDISPLAYCHARS 0xc0425a00
|
||||
#define VFDWRITECGRAM 0x40425a01
|
||||
#define VFDBRIGHTNESS 0xc0425a03
|
||||
#define VFDPWRLED 0xc0425a04
|
||||
#define VFDDRIVERINIT 0xc0425a08
|
||||
#define VFDICONDISPLAYONOFF 0xc0425a0a
|
||||
#define VFDDISPLAYWRITEONOFF 0xc0425a05
|
||||
|
||||
#define VFDCLEARICONS 0xc0425af6
|
||||
#define VFDSETRF 0xc0425af7
|
||||
#define VFDSETFAN 0xc0425af8
|
||||
#define VFDGETWAKEUPMODE 0xc0425af9
|
||||
#define VFDGETTIME 0xc0425afa
|
||||
#define VFDSETTIME 0xc0425afb
|
||||
#define VFDSTANDBY 0xc0425afc
|
||||
#define VFDREBOOT 0xc0425afd
|
||||
#define VFDSETLED 0xc0425afe
|
||||
#define VFDSETMODE 0xc0425aff
|
||||
|
||||
#define VFDGETWAKEUPTIME 0xc0425b00
|
||||
#define VFDGETVERSION 0xc0425b01
|
||||
#define VFDSETDISPLAYTIME 0xc0425b02
|
||||
#define VFDSETTIMEMODE 0xc0425b03
|
||||
#define VFDDISPLAYCLR 0xc0425b00
|
||||
|
||||
typedef enum {
|
||||
#if defined(BOXMODEL_OCTAGON1008)
|
||||
ICON_DTS,
|
||||
ICON_VIDEO,
|
||||
ICON_AUDIO,
|
||||
ICON_LINK,
|
||||
ICON_HDD,
|
||||
ICON_DISC,
|
||||
ICON_DVB,
|
||||
FP_ICON_USB = 0x27,
|
||||
FP_ICON_HD = 0x27,
|
||||
FP_ICON_HDD = ICON_HDD,
|
||||
FP_ICON_LOCK = 0x27,
|
||||
FP_ICON_BT = 0x27,
|
||||
FP_ICON_MP3 = 0x27,
|
||||
FP_ICON_MUSIC = 0x27,
|
||||
FP_ICON_DD = 0x27,
|
||||
FP_ICON_MAIL = 0x27,
|
||||
FP_ICON_MUTE = 0x27,
|
||||
FP_ICON_PLAY = 0x27,
|
||||
FP_ICON_PAUSE = 0x27,
|
||||
FP_ICON_FF = 0x27,
|
||||
FP_ICON_FR = 0x27,
|
||||
FP_ICON_REC = 0x27,
|
||||
FP_ICON_CLOCK = 0x27,
|
||||
#elif defined(BOXMODEL_FORTIS_HDBOX)
|
||||
ICON_STANDBY = 0x10,
|
||||
ICON_SAT,
|
||||
ICON_REC,
|
||||
ICON_TIMESHIFT,
|
||||
ICON_TIMER,
|
||||
ICON_HD,
|
||||
ICON_USB,
|
||||
ICON_SCRAMBLED,
|
||||
ICON_DOLBY,
|
||||
ICON_MUTE,
|
||||
ICON_TUNER1,
|
||||
ICON_TUNER2,
|
||||
ICON_MP3,
|
||||
ICON_REPEAT,
|
||||
ICON_Play,
|
||||
FP_ICON_PAUSE,
|
||||
ICON_TER,
|
||||
ICON_FILE,
|
||||
ICON_480i,
|
||||
ICON_480p,
|
||||
ICON_576i,
|
||||
ICON_576p,
|
||||
ICON_720p,
|
||||
ICON_1080i,
|
||||
ICON_1080p,
|
||||
ICON_Play_1,
|
||||
FP_ICON_USB = ICON_USB,
|
||||
FP_ICON_REC = ICON_REC,
|
||||
FP_ICON_CLOCK = ICON_TIMER,
|
||||
FP_ICON_HD = ICON_HD,
|
||||
FP_ICON_LOCK = ICON_SCRAMBLED,
|
||||
FP_ICON_DD = ICON_DOLBY,
|
||||
FP_ICON_MUTE = ICON_MUTE,
|
||||
FP_ICON_MP3 = ICON_MP3,
|
||||
FP_ICON_PLAY = ICON_Play,
|
||||
FP_ICON_HDD,
|
||||
FP_ICON_MUSIC,
|
||||
FP_ICON_MAIL,
|
||||
FP_ICON_FF,
|
||||
FP_ICON_FR,
|
||||
#elif defined(BOXMODEL_UFS910)
|
||||
FP_ICON_USB = 0x10,
|
||||
FP_ICON_HD,
|
||||
FP_ICON_HDD,
|
||||
FP_ICON_LOCK,
|
||||
FP_ICON_BT,
|
||||
FP_ICON_MP3,
|
||||
FP_ICON_MUSIC,
|
||||
FP_ICON_DD,
|
||||
FP_ICON_MAIL,
|
||||
FP_ICON_MUTE,
|
||||
FP_ICON_PLAY,
|
||||
FP_ICON_PAUSE,
|
||||
FP_ICON_FF,
|
||||
FP_ICON_FR,
|
||||
FP_ICON_REC,
|
||||
FP_ICON_CLOCK,
|
||||
#else
|
||||
FP_ICON_USB = 0x10,
|
||||
FP_ICON_HD,
|
||||
FP_ICON_HDD,
|
||||
FP_ICON_LOCK,
|
||||
FP_ICON_BT,
|
||||
FP_ICON_MP3,
|
||||
FP_ICON_MUSIC,
|
||||
FP_ICON_DD,
|
||||
FP_ICON_MAIL,
|
||||
FP_ICON_MUTE,
|
||||
FP_ICON_PLAY,
|
||||
FP_ICON_PAUSE,
|
||||
FP_ICON_FF,
|
||||
FP_ICON_FR,
|
||||
FP_ICON_REC,
|
||||
FP_ICON_CLOCK,
|
||||
#endif
|
||||
FP_ICON_RECORD,
|
||||
FP_ICON_DOWNLOAD,
|
||||
FP_ICON_TIMESHIFT,
|
||||
FP_ICON_MAX
|
||||
} fp_icon;
|
||||
|
||||
typedef enum {
|
||||
FP_FLAG_NONE = 0x00,
|
||||
FP_FLAG_SCROLL_ON = 0x01, /* switch scrolling on */
|
||||
FP_FLAG_SCROLL_LTR = 0x02, /* scroll from left to rightinstead of default right to left direction (i.e. for arabic text) */
|
||||
FP_FLAG_SCROLL_SIO = 0x04, /* start/stop scrolling with empty screen (scroll in/out) */
|
||||
FP_FLAG_SCROLL_DELAY = 0x08, /* delayed scroll start */
|
||||
FP_FLAG_ALIGN_LEFT = 0x10, /* align the text in display from the left (default) */
|
||||
FP_FLAG_ALIGN_RIGHT = 0x20, /* align the text in display from the right (arabic) */
|
||||
FP_FLAG_UPDATE_SCROLL_POS = 0x40, /* update the current position for scrolling */
|
||||
} fp_flag;
|
||||
|
||||
typedef struct {
|
||||
unsigned char brightness;
|
||||
unsigned char flags;
|
||||
unsigned char current_hour;
|
||||
unsigned char current_minute;
|
||||
unsigned char timer_minutes_hi;
|
||||
unsigned char timer_minutes_lo;
|
||||
} fp_standby_data_t;
|
||||
|
||||
typedef struct {
|
||||
unsigned char source;
|
||||
unsigned char time_minutes_hi;
|
||||
unsigned char time_minutes_lo;
|
||||
} fp_wakeup_data_t;
|
||||
|
||||
typedef enum {
|
||||
FP_LED_1_ON = 0x81,
|
||||
FP_LED_2_ON = 0x82,
|
||||
FP_LED_3_ON = 0x83,
|
||||
FP_LED_1_OFF = 0x01,
|
||||
FP_LED_2_OFF = 0x02,
|
||||
FP_LED_3_OFF = 0x03,
|
||||
} fp_led_ctrl_t;
|
||||
|
||||
typedef enum {
|
||||
FP_WAKEUP_SOURCE_TIMER = 0x01,
|
||||
FP_WAKEUP_SOURCE_BUTTON = 0x02,
|
||||
FP_WAKEUP_SOURCE_REMOTE = 0x04,
|
||||
FP_WAKEUP_SOURCE_PWLOST = 0x7F,
|
||||
FP_WAKEUP_SOURCE_POWER = 0xFF
|
||||
} fp_wakeup_source;
|
||||
|
||||
typedef struct {
|
||||
unsigned short addr;
|
||||
unsigned short cmd;
|
||||
} fp_standby_cmd_data_t;
|
||||
|
||||
#endif /* __DUCKBOX_VFD__ */
|
178
include/cs_vfd.h
Normal file
178
include/cs_vfd.h
Normal file
@@ -0,0 +1,178 @@
|
||||
#ifndef __DUCKBOX_VFD__
|
||||
#define __DUCKBOX_VFD__
|
||||
|
||||
#define VFDDISPLAYCHARS 0xc0425a00
|
||||
#define VFDWRITECGRAM 0x40425a01
|
||||
#define VFDBRIGHTNESS 0xc0425a03
|
||||
#define VFDPWRLED 0xc0425a04
|
||||
#define VFDDRIVERINIT 0xc0425a08
|
||||
#define VFDICONDISPLAYONOFF 0xc0425a0a
|
||||
#define VFDDISPLAYWRITEONOFF 0xc0425a05
|
||||
|
||||
#define VFDCLEARICONS 0xc0425af6
|
||||
#define VFDSETRF 0xc0425af7
|
||||
#define VFDSETFAN 0xc0425af8
|
||||
#define VFDGETWAKEUPMODE 0xc0425af9
|
||||
#define VFDGETTIME 0xc0425afa
|
||||
#define VFDSETTIME 0xc0425afb
|
||||
#define VFDSTANDBY 0xc0425afc
|
||||
#define VFDREBOOT 0xc0425afd
|
||||
#define VFDSETLED 0xc0425afe
|
||||
#define VFDSETMODE 0xc0425aff
|
||||
|
||||
#define VFDGETWAKEUPTIME 0xc0425b00
|
||||
#define VFDGETVERSION 0xc0425b01
|
||||
#define VFDSETDISPLAYTIME 0xc0425b02
|
||||
#define VFDSETTIMEMODE 0xc0425b03
|
||||
#define VFDDISPLAYCLR 0xc0425b00
|
||||
|
||||
typedef enum {
|
||||
#if defined(BOXMODEL_OCTAGON1008)
|
||||
ICON_DTS,
|
||||
ICON_VIDEO,
|
||||
ICON_AUDIO,
|
||||
ICON_LINK,
|
||||
ICON_HDD,
|
||||
ICON_DISC,
|
||||
ICON_DVB,
|
||||
VFD_ICON_USB = 0x27,
|
||||
VFD_ICON_HD = 0x27,
|
||||
VFD_ICON_HDD = ICON_HDD,
|
||||
VFD_ICON_LOCK = 0x27,
|
||||
VFD_ICON_BT = 0x27,
|
||||
VFD_ICON_MP3 = 0x27,
|
||||
VFD_ICON_MUSIC = 0x27,
|
||||
VFD_ICON_DD = 0x27,
|
||||
VFD_ICON_MAIL = 0x27,
|
||||
VFD_ICON_MUTE = 0x27,
|
||||
VFD_ICON_PLAY = 0x27,
|
||||
VFD_ICON_PAUSE = 0x27,
|
||||
VFD_ICON_FF = 0x27,
|
||||
VFD_ICON_FR = 0x27,
|
||||
VFD_ICON_REC = 0x27,
|
||||
VFD_ICON_CLOCK = 0x27,
|
||||
#elif defined(BOXMODEL_FORTIS_HDBOX)
|
||||
ICON_STANDBY = 0x10,
|
||||
ICON_SAT,
|
||||
ICON_REC,
|
||||
ICON_TIMESHIFT,
|
||||
ICON_TIMER,
|
||||
ICON_HD,
|
||||
ICON_USB,
|
||||
ICON_SCRAMBLED,
|
||||
ICON_DOLBY,
|
||||
ICON_MUTE,
|
||||
ICON_TUNER1,
|
||||
ICON_TUNER2,
|
||||
ICON_MP3,
|
||||
ICON_REPEAT,
|
||||
ICON_Play,
|
||||
VFD_ICON_PAUSE,
|
||||
ICON_TER,
|
||||
ICON_FILE,
|
||||
ICON_480i,
|
||||
ICON_480p,
|
||||
ICON_576i,
|
||||
ICON_576p,
|
||||
ICON_720p,
|
||||
ICON_1080i,
|
||||
ICON_1080p,
|
||||
ICON_Play_1,
|
||||
VFD_ICON_USB = ICON_USB,
|
||||
VFD_ICON_REC = ICON_REC,
|
||||
VFD_ICON_CLOCK = ICON_TIMER,
|
||||
VFD_ICON_HD = ICON_HD,
|
||||
VFD_ICON_LOCK = ICON_SCRAMBLED,
|
||||
VFD_ICON_DD = ICON_DOLBY,
|
||||
VFD_ICON_MUTE = ICON_MUTE,
|
||||
VFD_ICON_MP3 = ICON_MP3,
|
||||
VFD_ICON_PLAY = ICON_Play,
|
||||
VFD_ICON_HDD,
|
||||
VFD_ICON_MUSIC,
|
||||
VFD_ICON_MAIL,
|
||||
VFD_ICON_FF,
|
||||
VFD_ICON_FR,
|
||||
#elif defined(BOXMODEL_UFS910)
|
||||
VFD_ICON_USB = 0x10,
|
||||
VFD_ICON_HD,
|
||||
VFD_ICON_HDD,
|
||||
VFD_ICON_LOCK,
|
||||
VFD_ICON_BT,
|
||||
VFD_ICON_MP3,
|
||||
VFD_ICON_MUSIC,
|
||||
VFD_ICON_DD,
|
||||
VFD_ICON_MAIL,
|
||||
VFD_ICON_MUTE,
|
||||
VFD_ICON_PLAY,
|
||||
VFD_ICON_PAUSE,
|
||||
VFD_ICON_FF,
|
||||
VFD_ICON_FR,
|
||||
VFD_ICON_REC,
|
||||
VFD_ICON_CLOCK,
|
||||
#else
|
||||
VFD_ICON_USB = 0x10,
|
||||
VFD_ICON_HD,
|
||||
VFD_ICON_HDD,
|
||||
VFD_ICON_LOCK,
|
||||
VFD_ICON_BT,
|
||||
VFD_ICON_MP3,
|
||||
VFD_ICON_MUSIC,
|
||||
VFD_ICON_DD,
|
||||
VFD_ICON_MAIL,
|
||||
VFD_ICON_MUTE,
|
||||
VFD_ICON_PLAY,
|
||||
VFD_ICON_PAUSE,
|
||||
VFD_ICON_FF,
|
||||
VFD_ICON_FR,
|
||||
VFD_ICON_REC,
|
||||
VFD_ICON_CLOCK,
|
||||
#endif
|
||||
VFD_ICON_MAX
|
||||
} vfd_icon;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
VFD_FLAG_NONE = 0x00,
|
||||
VFD_FLAG_SCROLL_ON = 0x01, /* switch scrolling on */
|
||||
VFD_FLAG_SCROLL_LTR = 0x02, /* scroll from left to rightinstead of default right to left direction (i.e. for arabic text) */
|
||||
VFD_FLAG_SCROLL_SIO = 0x04, /* start/stop scrolling with empty screen (scroll in/out) */
|
||||
VFD_FLAG_SCROLL_DELAY = 0x08, /* delayed scroll start */
|
||||
VFD_FLAG_ALIGN_LEFT = 0x10, /* align the text in display from the left (default) */
|
||||
VFD_FLAG_ALIGN_RIGHT = 0x20, /* align the text in display from the right (arabic) */
|
||||
VFD_FLAG_UPDATE_SCROLL_POS = 0x40, /* update the current position for scrolling */
|
||||
} vfd_flag;
|
||||
|
||||
typedef struct {
|
||||
unsigned char brightness;
|
||||
unsigned char flags;
|
||||
unsigned char current_hour;
|
||||
unsigned char current_minute;
|
||||
unsigned char timer_minutes_hi;
|
||||
unsigned char timer_minutes_lo;
|
||||
} standby_data_t;
|
||||
|
||||
typedef struct {
|
||||
unsigned char source;
|
||||
unsigned char time_minutes_hi;
|
||||
unsigned char time_minutes_lo;
|
||||
} wakeup_data_t;
|
||||
|
||||
typedef enum {
|
||||
VFD_LED_1_ON = 0x81,
|
||||
VFD_LED_2_ON = 0x82,
|
||||
VFD_LED_3_ON = 0x83,
|
||||
VFD_LED_1_OFF = 0x01,
|
||||
VFD_LED_2_OFF = 0x02,
|
||||
VFD_LED_3_OFF = 0x03,
|
||||
} vfd_led_ctrl_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
WAKEUP_SOURCE_TIMER = 0x01,
|
||||
WAKEUP_SOURCE_BUTTON = 0x02,
|
||||
WAKEUP_SOURCE_REMOTE = 0x04,
|
||||
WAKEUP_SOURCE_PWLOST = 0x7F,
|
||||
WAKEUP_SOURCE_POWER = 0xFF
|
||||
} wakeup_source;
|
||||
|
||||
#endif /* __DUCKBOX_VFD__ */
|
@@ -1,6 +1,8 @@
|
||||
#include <config.h>
|
||||
#if HAVE_TRIPLEDRAGON
|
||||
#include "../libtriple/dmx_td.h"
|
||||
#elif HAVE_DUCKBOX_HARDWARE
|
||||
#include "../libduckbox/dmx_lib.h"
|
||||
#elif HAVE_SPARK_HARDWARE
|
||||
#include "../libspark/dmx_lib.h"
|
||||
#elif HAVE_AZBOX_HARDWARE
|
||||
|
@@ -36,6 +36,7 @@ typedef struct hw_caps
|
||||
char boxvendor[64];
|
||||
char boxname[64];
|
||||
int boxtype;
|
||||
int has_CI;
|
||||
} hw_caps_t;
|
||||
|
||||
hw_caps_t *get_hwcaps(void);
|
||||
|
@@ -1,8 +0,0 @@
|
||||
#include <config.h>
|
||||
#if HAVE_TRIPLEDRAGON
|
||||
#include "../libtriple/playback_td.h"
|
||||
#elif HAVE_SPARK_HARDWARE
|
||||
#include "../libspark/playback_lib.h"
|
||||
#else
|
||||
#error neither HAVE_TRIPLEDRAGON nor HAVE_SPARK_HARDWARE defined
|
||||
#endif
|
@@ -5,7 +5,30 @@
|
||||
#define MAX_MMI_TEXT_LEN 255
|
||||
#define MAX_MMI_CHOICE_TEXT_LEN 255
|
||||
|
||||
typedef enum {
|
||||
MMI_TOP_MENU_SUBS = 1,
|
||||
MMI_TOP_MENU_EVENTS,
|
||||
MMI_TOP_MENU_TOKENS,
|
||||
MMI_TOP_MENU_PIN,
|
||||
MMI_TOP_MENU_MATURE,
|
||||
MMI_TOP_MENU_ABOUT
|
||||
} MMI_MENU_CURRENT;
|
||||
|
||||
typedef enum {
|
||||
MMI_MENU_LEVEL_MAIN = 0,
|
||||
MMI_MENU_LEVEL_MATURE,
|
||||
MMI_MENU_LEVEL_ASK_PIN_MATURE
|
||||
} MMI_MENU_LEVEL;
|
||||
|
||||
typedef enum {
|
||||
MMI_PIN_LEVEL_ASK_OLD = 0,
|
||||
MMI_PIN_LEVEL_CHECK_CURRENT,
|
||||
MMI_PIN_LEVEL_ASK_REPEAT,
|
||||
MMI_PIN_LEVEL_CHECK_AND_CHANGE
|
||||
} MMI_PIN_LEVEL;
|
||||
|
||||
typedef struct {
|
||||
int slot;
|
||||
int choice_nb;
|
||||
char title[MAX_MMI_TEXT_LEN];
|
||||
char subtitle[MAX_MMI_TEXT_LEN];
|
||||
@@ -14,6 +37,7 @@ typedef struct {
|
||||
} MMI_MENU_LIST_INFO;
|
||||
|
||||
typedef struct {
|
||||
int slot;
|
||||
int blind;
|
||||
int answerlen;
|
||||
char enquiryText[MAX_MMI_TEXT_LEN];
|
||||
|
@@ -1,6 +1,8 @@
|
||||
#include <config.h>
|
||||
#if HAVE_TRIPLEDRAGON
|
||||
#include "../libtriple/playback_td.h"
|
||||
#elif HAVE_DUCKBOX_HARDWARE
|
||||
#include "../libduckbox/playback_libeplayer3.h"
|
||||
#elif HAVE_SPARK_HARDWARE
|
||||
#include "../libspark/playback_libeplayer3.h"
|
||||
#elif HAVE_AZBOX_HARDWARE
|
||||
@@ -9,8 +11,12 @@
|
||||
#if BOXMODEL_RASPI
|
||||
#include "../raspi/playback.h"
|
||||
#else
|
||||
#if ENABLE_GSTREAMER
|
||||
#include "../generic-pc/playback_gst.h"
|
||||
#else
|
||||
#include "../generic-pc/playback.h"
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#error neither HAVE_TRIPLEDRAGON nor HAVE_SPARK_HARDWARE defined
|
||||
#endif
|
||||
|
@@ -1,6 +1,8 @@
|
||||
#include <config.h>
|
||||
#if HAVE_TRIPLEDRAGON
|
||||
#include "../libtriple/pwrmngr.h"
|
||||
#elif HAVE_DUCKBOX_HARDWARE
|
||||
#include "../libduckbox/pwrmngr.h"
|
||||
#elif HAVE_SPARK_HARDWARE
|
||||
#include "../libspark/pwrmngr.h"
|
||||
#elif HAVE_AZBOX_HARDWARE
|
||||
|
@@ -1,6 +1,8 @@
|
||||
#include <config.h>
|
||||
#if HAVE_TRIPLEDRAGON
|
||||
#include "../libtriple/record_td.h"
|
||||
#elif HAVE_DUCKBOX_HARDWARE
|
||||
#include "../libduckbox/record_lib.h"
|
||||
#elif HAVE_SPARK_HARDWARE
|
||||
#include "../libspark/record_lib.h"
|
||||
#elif HAVE_AZBOX_HARDWARE
|
||||
|
@@ -1,6 +1,8 @@
|
||||
#include <config.h>
|
||||
#if HAVE_TRIPLEDRAGON
|
||||
#include "../libtriple/video_td.h"
|
||||
#elif HAVE_DUCKBOX_HARDWARE
|
||||
#include "../libduckbox/video_lib.h"
|
||||
#elif HAVE_SPARK_HARDWARE
|
||||
#include "../libspark/video_lib.h"
|
||||
#elif HAVE_AZBOX_HARDWARE
|
||||
|
26
libduckbox/Makefile.am
Normal file
26
libduckbox/Makefile.am
Normal file
@@ -0,0 +1,26 @@
|
||||
noinst_LTLIBRARIES = libduckbox.la
|
||||
|
||||
AM_CPPFLAGS = -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS
|
||||
AM_CPPFLAGS += \
|
||||
-I$(top_srcdir)/common \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/libeplayer3/include
|
||||
|
||||
AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing
|
||||
|
||||
AM_LDFLAGS = -lpthread -lasound -lass -lrt \
|
||||
@AVFORMAT_LIBS@ \
|
||||
@AVUTIL_LIBS@ \
|
||||
@AVCODEC_LIBS@ \
|
||||
@SWRESAMPLE_LIBS@
|
||||
|
||||
libduckbox_la_SOURCES = \
|
||||
hardware_caps.c \
|
||||
dmx.cpp \
|
||||
video.cpp \
|
||||
audio.cpp \
|
||||
audio_mixer.cpp \
|
||||
init.cpp \
|
||||
playback_libeplayer3.cpp \
|
||||
pwrmngr.cpp \
|
||||
record.cpp
|
1
libduckbox/audio.cpp
Symbolic link
1
libduckbox/audio.cpp
Symbolic link
@@ -0,0 +1 @@
|
||||
../libspark/audio.cpp
|
1
libduckbox/audio_lib.h
Symbolic link
1
libduckbox/audio_lib.h
Symbolic link
@@ -0,0 +1 @@
|
||||
../libspark/audio_lib.h
|
1
libduckbox/audio_mixer.cpp
Symbolic link
1
libduckbox/audio_mixer.cpp
Symbolic link
@@ -0,0 +1 @@
|
||||
../libspark/audio_mixer.cpp
|
1
libduckbox/audio_mixer.h
Symbolic link
1
libduckbox/audio_mixer.h
Symbolic link
@@ -0,0 +1 @@
|
||||
../libspark/audio_mixer.h
|
30
libduckbox/cs_api.h
Normal file
30
libduckbox/cs_api.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/* compatibility header for tripledragon. I'm lazy, so I just left it
|
||||
as "cs_api.h" so that I don't need too many ifdefs in the code */
|
||||
|
||||
#ifndef __CS_API_H_
|
||||
#define __CS_API_H_
|
||||
|
||||
#include "init_lib.h"
|
||||
typedef void (*cs_messenger) (unsigned int msg, unsigned int data);
|
||||
|
||||
inline void cs_api_init()
|
||||
{
|
||||
init_td_api();
|
||||
};
|
||||
|
||||
inline void cs_api_exit()
|
||||
{
|
||||
shutdown_td_api();
|
||||
};
|
||||
|
||||
#define cs_malloc_uncached malloc
|
||||
#define cs_free_uncached free
|
||||
|
||||
// Callback function helpers
|
||||
void cs_register_messenger(cs_messenger messenger);
|
||||
static inline void cs_deregister_messenger(void) { return; };
|
||||
|
||||
/* compat... HD1 seems to be version 6. everything newer ist > 6... */
|
||||
static inline unsigned int cs_get_revision(void) { return 1; };
|
||||
extern int cnxt_debug;
|
||||
#endif //__CS_API_H_
|
1
libduckbox/dmx.cpp
Symbolic link
1
libduckbox/dmx.cpp
Symbolic link
@@ -0,0 +1 @@
|
||||
../libspark/dmx.cpp
|
1
libduckbox/dmx_cs.h
Symbolic link
1
libduckbox/dmx_cs.h
Symbolic link
@@ -0,0 +1 @@
|
||||
../libspark/dmx_cs.h
|
1
libduckbox/dmx_lib.h
Symbolic link
1
libduckbox/dmx_lib.h
Symbolic link
@@ -0,0 +1 @@
|
||||
../libspark/dmx_lib.h
|
158
libduckbox/hardware_caps.c
Normal file
158
libduckbox/hardware_caps.c
Normal file
@@ -0,0 +1,158 @@
|
||||
/*
|
||||
* determine the capabilities of the hardware.
|
||||
* part of libstb-hal
|
||||
*
|
||||
* (C) 2010-2012 Stefan Seyfried
|
||||
*
|
||||
* License: GPL v2 or later
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <hardware_caps.h>
|
||||
|
||||
static int initialized = 0;
|
||||
static hw_caps_t caps;
|
||||
|
||||
hw_caps_t *get_hwcaps(void)
|
||||
{
|
||||
if (initialized)
|
||||
return ∩︀
|
||||
|
||||
memset(&caps, 0, sizeof(hw_caps_t));
|
||||
|
||||
initialized = 1;
|
||||
const char *tmp;
|
||||
char buf[64];
|
||||
int len = -1;
|
||||
int fd = open("/proc/stb/info/model", O_RDONLY);
|
||||
if (fd != -1) {
|
||||
len = read(fd, buf, sizeof(buf) - 1);
|
||||
close(fd);
|
||||
}
|
||||
if (len > 0) {
|
||||
buf[len] = 0;
|
||||
if (!strncmp(buf, "atevio7500", 10)) {
|
||||
strcpy(caps.boxvendor, "DUCKBOX");
|
||||
strcpy(caps.boxname, buf);
|
||||
caps.can_shutdown = 1;
|
||||
caps.has_HDMI = 1;
|
||||
caps.has_SCART = 1;
|
||||
caps.can_cec = 1;
|
||||
caps.has_fan = 0;
|
||||
caps.has_CI = 2;
|
||||
}
|
||||
else if (!strncmp(buf, "ufs912", 6)) {
|
||||
strcpy(caps.boxvendor, "DUCKBOX");
|
||||
strcpy(caps.boxname, buf);
|
||||
caps.can_shutdown = 1;
|
||||
caps.has_HDMI = 1;
|
||||
caps.has_SCART = 1;
|
||||
caps.can_cec = 1;
|
||||
caps.has_fan = 0;
|
||||
caps.has_CI = 2;
|
||||
}
|
||||
else if (!strncmp(buf, "ufs913", 6)) {
|
||||
strcpy(caps.boxvendor, "DUCKBOX");
|
||||
strcpy(caps.boxname, buf);
|
||||
caps.can_shutdown = 1;
|
||||
caps.has_HDMI = 1;
|
||||
caps.has_SCART = 1;
|
||||
caps.can_cec = 1;
|
||||
caps.has_fan = 0;
|
||||
caps.has_CI = 2;
|
||||
}
|
||||
else if (!strncmp(buf, "ufs922", 6)) {
|
||||
strcpy(caps.boxvendor, "DUCKBOX");
|
||||
strcpy(caps.boxname, buf);
|
||||
caps.can_shutdown = 1;
|
||||
caps.has_HDMI = 1;
|
||||
caps.has_SCART = 1;
|
||||
caps.can_cec = 0;
|
||||
caps.has_fan = 1;
|
||||
caps.has_CI = 2;
|
||||
}
|
||||
else if (!strncmp(buf, "ufs910", 6)) {
|
||||
strcpy(caps.boxvendor, "DUCKBOX");
|
||||
strcpy(caps.boxname, buf);
|
||||
caps.can_shutdown = 1;
|
||||
caps.has_HDMI = 1;
|
||||
caps.has_SCART = 1;
|
||||
caps.can_cec = 0;
|
||||
caps.has_fan = 0;
|
||||
caps.has_CI = 2;
|
||||
}
|
||||
else if (!strncmp(buf, "hdbox", 5)) {
|
||||
strcpy(caps.boxvendor, "DUCKBOX");
|
||||
strcpy(caps.boxname, buf);
|
||||
caps.can_shutdown = 1;
|
||||
caps.has_HDMI = 1;
|
||||
caps.has_SCART = 1;
|
||||
caps.can_cec = 0;
|
||||
caps.has_fan = 0;
|
||||
caps.has_CI = 2;
|
||||
}
|
||||
else if (!strncmp(buf, "octagon1008", 11)) {
|
||||
strcpy(caps.boxvendor, "DUCKBOX");
|
||||
strcpy(caps.boxname, buf);
|
||||
caps.can_shutdown = 1;
|
||||
caps.has_HDMI = 1;
|
||||
caps.has_SCART = 1;
|
||||
caps.can_cec = 0;
|
||||
caps.has_fan = 0;
|
||||
caps.has_CI = 2;
|
||||
}
|
||||
else if (!strncmp(buf, "cuberevo", 8)) {
|
||||
strcpy(caps.boxvendor, "DUCKBOX");
|
||||
strcpy(caps.boxname, buf);
|
||||
caps.can_shutdown = 1;
|
||||
caps.has_HDMI = 1;
|
||||
caps.has_SCART = 1;
|
||||
caps.can_cec = 0;
|
||||
caps.has_fan = 0;
|
||||
caps.has_CI = 2;
|
||||
}
|
||||
else if (!strncmp(buf, "cuberevo-mini2", 14)) {
|
||||
strcpy(caps.boxvendor, "DUCKBOX");
|
||||
strcpy(caps.boxname, buf);
|
||||
caps.can_shutdown = 1;
|
||||
caps.has_HDMI = 1;
|
||||
caps.has_SCART = 1;
|
||||
caps.can_cec = 0;
|
||||
caps.has_fan = 0;
|
||||
caps.has_CI = 2;
|
||||
}
|
||||
else if (!strncmp(buf, "cuberevo-2000hd", 15)) {
|
||||
strcpy(caps.boxvendor, "DUCKBOX");
|
||||
strcpy(caps.boxname, buf);
|
||||
caps.can_shutdown = 1;
|
||||
caps.has_HDMI = 1;
|
||||
caps.has_SCART = 1;
|
||||
caps.can_cec = 0;
|
||||
caps.has_fan = 0;
|
||||
caps.has_CI = 0;
|
||||
}
|
||||
else if (!strncmp(buf, "tf7700", 6)) {
|
||||
strcpy(caps.boxvendor, "DUCKBOX");
|
||||
strcpy(caps.boxname, buf);
|
||||
caps.can_shutdown = 1;
|
||||
caps.has_HDMI = 1;
|
||||
caps.has_SCART = 1;
|
||||
caps.can_cec = 0;
|
||||
caps.has_fan = 0;
|
||||
caps.has_CI = 2;
|
||||
}
|
||||
else {
|
||||
strcpy(caps.boxvendor, "unknown");
|
||||
strcpy(caps.boxname, "unknown model");
|
||||
}
|
||||
}
|
||||
else
|
||||
strcpy(caps.boxname, "(unknown model)");
|
||||
|
||||
return ∩︀
|
||||
}
|
55
libduckbox/init.cpp
Normal file
55
libduckbox/init.cpp
Normal file
@@ -0,0 +1,55 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "init_lib.h"
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <linux/dvb/dmx.h>
|
||||
|
||||
#include "pwrmngr.h"
|
||||
|
||||
#include "lt_debug.h"
|
||||
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_INIT, NULL, args)
|
||||
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_INIT, NULL, args)
|
||||
|
||||
static bool initialized = false;
|
||||
|
||||
void init_td_api()
|
||||
{
|
||||
if (!initialized)
|
||||
lt_debug_init();
|
||||
lt_info("%s begin, initialized=%d, debug=0x%02x\n", __FUNCTION__, (int)initialized, debuglevel);
|
||||
if (!initialized)
|
||||
{
|
||||
/* this is a strange hack: the drivers seem to only work correctly after
|
||||
* demux0 has been used once. After that, we can use demux1,2,... */
|
||||
struct dmx_pes_filter_params p;
|
||||
int dmx = open("/dev/dvb/adapter0/demux0", O_RDWR|O_CLOEXEC);
|
||||
if (dmx < 0)
|
||||
lt_info("%s: ERROR open /dev/dvb/adapter0/demux0 (%m)\n", __func__);
|
||||
else
|
||||
{
|
||||
memset(&p, 0, sizeof(p));
|
||||
p.output = DMX_OUT_DECODER;
|
||||
p.input = DMX_IN_FRONTEND;
|
||||
p.flags = DMX_IMMEDIATE_START;
|
||||
p.pes_type = DMX_PES_VIDEO;
|
||||
ioctl(dmx, DMX_SET_PES_FILTER, &p);
|
||||
ioctl(dmx, DMX_STOP);
|
||||
close(dmx);
|
||||
}
|
||||
}
|
||||
initialized = true;
|
||||
lt_info("%s end\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
void shutdown_td_api()
|
||||
{
|
||||
lt_info("%s, initialized = %d\n", __FUNCTION__, (int)initialized);
|
||||
initialized = false;
|
||||
}
|
1
libduckbox/init_cs.h
Symbolic link
1
libduckbox/init_cs.h
Symbolic link
@@ -0,0 +1 @@
|
||||
../libspark/init_cs.h
|
1
libduckbox/init_lib.h
Symbolic link
1
libduckbox/init_lib.h
Symbolic link
@@ -0,0 +1 @@
|
||||
../libspark/init_lib.h
|
1
libduckbox/playback_libeplayer3.cpp
Symbolic link
1
libduckbox/playback_libeplayer3.cpp
Symbolic link
@@ -0,0 +1 @@
|
||||
../libspark/playback_libeplayer3.cpp
|
1
libduckbox/playback_libeplayer3.h
Symbolic link
1
libduckbox/playback_libeplayer3.h
Symbolic link
@@ -0,0 +1 @@
|
||||
../libspark/playback_libeplayer3.h
|
1
libduckbox/pwrmngr.cpp
Symbolic link
1
libduckbox/pwrmngr.cpp
Symbolic link
@@ -0,0 +1 @@
|
||||
../libspark/pwrmngr.cpp
|
1
libduckbox/pwrmngr.h
Symbolic link
1
libduckbox/pwrmngr.h
Symbolic link
@@ -0,0 +1 @@
|
||||
../libspark/pwrmngr.h
|
1
libduckbox/record.cpp
Symbolic link
1
libduckbox/record.cpp
Symbolic link
@@ -0,0 +1 @@
|
||||
../libspark/record.cpp
|
1
libduckbox/record_lib.h
Symbolic link
1
libduckbox/record_lib.h
Symbolic link
@@ -0,0 +1 @@
|
||||
../libspark/record_lib.h
|
1
libduckbox/video.cpp
Symbolic link
1
libduckbox/video.cpp
Symbolic link
@@ -0,0 +1 @@
|
||||
../libspark/video.cpp
|
1
libduckbox/video_lib.h
Symbolic link
1
libduckbox/video_lib.h
Symbolic link
@@ -0,0 +1 @@
|
||||
../libspark/video_lib.h
|
17
libdvbci/Makefile.am
Normal file
17
libdvbci/Makefile.am
Normal file
@@ -0,0 +1,17 @@
|
||||
noinst_LTLIBRARIES = libdvbci.la
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/common \
|
||||
-I$(top_srcdir)/include
|
||||
|
||||
AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing
|
||||
AM_LDFLAGS = -lpthread
|
||||
|
||||
libdvbci_la_SOURCES = \
|
||||
dvbci_session.cpp \
|
||||
dvbci_mmi.cpp \
|
||||
dvbci_camgr.cpp \
|
||||
dvbci_appmgr.cpp \
|
||||
dvbci_datetimemgr.cpp \
|
||||
dvbci_resmgr.cpp
|
||||
|
632
libdvbci/Makefile.in
Normal file
632
libdvbci/Makefile.in
Normal file
@@ -0,0 +1,632 @@
|
||||
# Makefile.in generated by automake 1.14.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = libdvbci
|
||||
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
|
||||
$(top_srcdir)/depcomp
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
|
||||
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
|
||||
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
LTLIBRARIES = $(noinst_LTLIBRARIES)
|
||||
libdvbci_la_LIBADD =
|
||||
am_libdvbci_la_OBJECTS = dvbci_session.lo dvbci_mmi.lo dvbci_camgr.lo \
|
||||
dvbci_appmgr.lo dvbci_datetimemgr.lo dvbci_resmgr.lo
|
||||
libdvbci_la_OBJECTS = $(am_libdvbci_la_OBJECTS)
|
||||
AM_V_lt = $(am__v_lt_@AM_V@)
|
||||
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
||||
am__v_lt_0 = --silent
|
||||
am__v_lt_1 =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
am__mv = mv -f
|
||||
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
AM_V_CXX = $(am__v_CXX_@AM_V@)
|
||||
am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
|
||||
am__v_CXX_0 = @echo " CXX " $@;
|
||||
am__v_CXX_1 =
|
||||
CXXLD = $(CXX)
|
||||
CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
|
||||
$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
|
||||
am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
|
||||
am__v_CXXLD_0 = @echo " CXXLD " $@;
|
||||
am__v_CXXLD_1 =
|
||||
SOURCES = $(libdvbci_la_SOURCES)
|
||||
DIST_SOURCES = $(libdvbci_la_SOURCES)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
# *not* preserved.
|
||||
am__uniquify_input = $(AWK) '\
|
||||
BEGIN { nonempty = 0; } \
|
||||
{ items[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in items) print i; }; } \
|
||||
'
|
||||
# Make sure the list of sources is unique. This is necessary because,
|
||||
# e.g., the same source file might be shared among _SOURCES variables
|
||||
# for different programs/libraries.
|
||||
am__define_uniq_tagged_files = \
|
||||
list='$(am__tagged_files)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AVCODEC_CFLAGS = @AVCODEC_CFLAGS@
|
||||
AVCODEC_LIBS = @AVCODEC_LIBS@
|
||||
AVFORMAT_CFLAGS = @AVFORMAT_CFLAGS@
|
||||
AVFORMAT_LIBS = @AVFORMAT_LIBS@
|
||||
AVUTIL_CFLAGS = @AVUTIL_CFLAGS@
|
||||
AVUTIL_LIBS = @AVUTIL_LIBS@
|
||||
AWK = @AWK@
|
||||
BOXMODEL = @BOXMODEL@
|
||||
BOXTYPE = @BOXTYPE@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CONFIGDIR = @CONFIGDIR@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DATADIR = @DATADIR@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
|
||||
DIRECTFB_LIBS = @DIRECTFB_LIBS@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
FONTDIR = @FONTDIR@
|
||||
GAMESDIR = @GAMESDIR@
|
||||
GREP = @GREP@
|
||||
GSTREAMER_CFLAGS = @GSTREAMER_CFLAGS@
|
||||
GSTREAMER_INTERFACES_CFLAGS = @GSTREAMER_INTERFACES_CFLAGS@
|
||||
GSTREAMER_INTERFACES_LIBS = @GSTREAMER_INTERFACES_LIBS@
|
||||
GSTREAMER_LIBS = @GSTREAMER_LIBS@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBDIR = @LIBDIR@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
PLUGINDIR = @PLUGINDIR@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
SWRESAMPLE_CFLAGS = @SWRESAMPLE_CFLAGS@
|
||||
SWRESAMPLE_LIBS = @SWRESAMPLE_LIBS@
|
||||
SWSCALE_CFLAGS = @SWSCALE_CFLAGS@
|
||||
SWSCALE_LIBS = @SWSCALE_LIBS@
|
||||
TARGET_CONFIGDIR = @TARGET_CONFIGDIR@
|
||||
TARGET_DATADIR = @TARGET_DATADIR@
|
||||
TARGET_FONTDIR = @TARGET_FONTDIR@
|
||||
TARGET_GAMESDIR = @TARGET_GAMESDIR@
|
||||
TARGET_LIBDIR = @TARGET_LIBDIR@
|
||||
TARGET_PLUGINDIR = @TARGET_PLUGINDIR@
|
||||
TARGET_THEMESDIR = @TARGET_THEMESDIR@
|
||||
TARGET_UCODEDIR = @TARGET_UCODEDIR@
|
||||
THEMESDIR = @THEMESDIR@
|
||||
UCODEDIR = @UCODEDIR@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
noinst_LTLIBRARIES = libdvbci.la
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/common \
|
||||
-I$(top_srcdir)/include
|
||||
|
||||
AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing
|
||||
AM_LDFLAGS = -lpthread
|
||||
libdvbci_la_SOURCES = \
|
||||
dvbci_session.cpp \
|
||||
dvbci_mmi.cpp \
|
||||
dvbci_camgr.cpp \
|
||||
dvbci_appmgr.cpp \
|
||||
dvbci_datetimemgr.cpp \
|
||||
dvbci_resmgr.cpp
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .cpp .lo .o .obj
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libdvbci/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign libdvbci/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
clean-noinstLTLIBRARIES:
|
||||
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
|
||||
@list='$(noinst_LTLIBRARIES)'; \
|
||||
locs=`for p in $$list; do echo $$p; done | \
|
||||
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
|
||||
sort -u`; \
|
||||
test -z "$$locs" || { \
|
||||
echo rm -f $${locs}; \
|
||||
rm -f $${locs}; \
|
||||
}
|
||||
|
||||
libdvbci.la: $(libdvbci_la_OBJECTS) $(libdvbci_la_DEPENDENCIES) $(EXTRA_libdvbci_la_DEPENDENCIES)
|
||||
$(AM_V_CXXLD)$(CXXLINK) $(libdvbci_la_OBJECTS) $(libdvbci_la_LIBADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dvbci_appmgr.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dvbci_camgr.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dvbci_datetimemgr.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dvbci_mmi.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dvbci_resmgr.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dvbci_session.Plo@am__quote@
|
||||
|
||||
.cpp.o:
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
|
||||
|
||||
.cpp.obj:
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
.cpp.lo:
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-am
|
||||
TAGS: tags
|
||||
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
$(am__define_uniq_tagged_files); \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: ctags-am
|
||||
|
||||
CTAGS: ctags
|
||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
cscopelist: cscopelist-am
|
||||
|
||||
cscopelist-am: $(am__tagged_files)
|
||||
list='$(am__tagged_files)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LTLIBRARIES)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
|
||||
ctags-am distclean distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags tags-am uninstall uninstall-am
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
104
libdvbci/dvbci_appmgr.cpp
Normal file
104
libdvbci/dvbci_appmgr.cpp
Normal file
@@ -0,0 +1,104 @@
|
||||
/* DVB CI Application Manager */
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dvbci_appmgr.h"
|
||||
|
||||
static const char * FILENAME = "[dvbci_appmgr]";
|
||||
|
||||
eDVBCIApplicationManagerSession::eDVBCIApplicationManagerSession(tSlot *tslot)
|
||||
{
|
||||
slot = tslot;
|
||||
slot->hasAppManager = true;
|
||||
slot->appSession = this;
|
||||
}
|
||||
|
||||
eDVBCIApplicationManagerSession::~eDVBCIApplicationManagerSession()
|
||||
{
|
||||
slot->hasAppManager = false;
|
||||
slot->appSession = NULL;
|
||||
}
|
||||
|
||||
int eDVBCIApplicationManagerSession::receivedAPDU(const unsigned char *tag, const void *data, int len)
|
||||
{
|
||||
printf("SESSION(%d)/APP %02x %02x %02x: ", session_nb, tag[0], tag[1], tag[2]);
|
||||
for (int i = 0; i < len; i++)
|
||||
printf("%02x ", ((const unsigned char*)data)[i]);
|
||||
printf("\n");
|
||||
|
||||
if ((tag[0] == 0x9f) && (tag[1] == 0x80))
|
||||
{
|
||||
switch (tag[2])
|
||||
{
|
||||
case 0x21:
|
||||
{
|
||||
int dl;
|
||||
printf("application info:\n");
|
||||
printf(" len: %d\n", len);
|
||||
printf(" application_type: %d\n", ((unsigned char*)data)[0]);
|
||||
printf(" application_manufacturer: %02x %02x\n", ((unsigned char*)data)[2], ((unsigned char*)data)[1]);
|
||||
printf(" manufacturer_code: %02x %02x\n", ((unsigned char*)data)[4], ((unsigned char*)data)[3]);
|
||||
printf(" menu string: \n");
|
||||
dl = ((unsigned char*)data)[5];
|
||||
if ((dl + 6) > len)
|
||||
{
|
||||
printf("warning, invalid length (%d vs %d)\n", dl + 6, len);
|
||||
dl = len - 6;
|
||||
}
|
||||
char str[dl + 1];
|
||||
memcpy(str, ((char*)data) + 6, dl);
|
||||
str[dl] = '\0';
|
||||
for (int i = 0; i < dl; ++i)
|
||||
printf("%c", ((unsigned char*)data)[i + 6]);
|
||||
printf("\n");
|
||||
|
||||
strcpy(slot->name, str);
|
||||
printf("%s set cam name %s on slot %d, %p\n", FILENAME, slot->name, slot->slot, slot);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
printf("%s unknown APDU tag 9F 80 %02x\n", FILENAME, tag[2]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int eDVBCIApplicationManagerSession::doAction()
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case stateStarted:
|
||||
{
|
||||
const unsigned char tag[3] = {0x9F, 0x80, 0x20};
|
||||
sendAPDU(tag);
|
||||
state = stateFinal;
|
||||
return 1;
|
||||
}
|
||||
case stateFinal:
|
||||
printf("in final state.");
|
||||
wantmenu = 0;
|
||||
if (wantmenu)
|
||||
{
|
||||
printf("%s wantmenu: sending Tenter_menu\n", FILENAME);
|
||||
const unsigned char tag[3] = {0x9F, 0x80, 0x22};
|
||||
sendAPDU(tag);
|
||||
wantmenu = 0;
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int eDVBCIApplicationManagerSession::startMMI()
|
||||
{
|
||||
printf("%s -> %s\n", FILENAME, __func__);
|
||||
const unsigned char tag[3] = {0x9F, 0x80, 0x22};
|
||||
sendAPDU(tag);
|
||||
slot->mmiOpened = true;
|
||||
return 0;
|
||||
}
|
||||
|
24
libdvbci/dvbci_appmgr.h
Normal file
24
libdvbci/dvbci_appmgr.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef __dvbci_dvbci_appmgr_h
|
||||
#define __dvbci_dvbci_appmgr_h
|
||||
|
||||
#include "dvbci_session.h"
|
||||
|
||||
class eDVBCIApplicationManagerSession: public eDVBCISession
|
||||
{
|
||||
enum {
|
||||
stateFinal=statePrivate
|
||||
};
|
||||
|
||||
tSlot *slot;
|
||||
|
||||
int wantmenu;
|
||||
int receivedAPDU(const unsigned char *tag, const void *data, int len);
|
||||
int doAction();
|
||||
public:
|
||||
eDVBCIApplicationManagerSession(tSlot *tslot);
|
||||
~eDVBCIApplicationManagerSession();
|
||||
int enterMenu();
|
||||
int startMMI();
|
||||
};
|
||||
|
||||
#endif
|
81
libdvbci/dvbci_camgr.cpp
Normal file
81
libdvbci/dvbci_camgr.cpp
Normal file
@@ -0,0 +1,81 @@
|
||||
/* DVB CI CA Manager */
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "dvbci_camgr.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
eDVBCICAManagerSession::eDVBCICAManagerSession(tSlot *tslot)
|
||||
{
|
||||
slot = tslot;
|
||||
}
|
||||
|
||||
eDVBCICAManagerSession::~eDVBCICAManagerSession()
|
||||
{
|
||||
slot->hasCAManager = false;
|
||||
slot->camgrSession = NULL;
|
||||
}
|
||||
|
||||
int eDVBCICAManagerSession::receivedAPDU(const unsigned char *tag, const void *data, int len)
|
||||
{
|
||||
printf("SESSION(%d)/CA %02x %02x %02x: ", session_nb, tag[0], tag[1], tag[2]);
|
||||
for (int i = 0; i < len; i++)
|
||||
printf("%02x ", ((const unsigned char*)data)[i]);
|
||||
printf("\n");
|
||||
|
||||
if ((tag[0] == 0x9f) && (tag[1] == 0x80))
|
||||
{
|
||||
switch (tag[2])
|
||||
{
|
||||
case 0x31:
|
||||
{
|
||||
printf("ca info:\n");
|
||||
for (int i = 0; i < len; i += 2)
|
||||
{
|
||||
printf("%04x ", (((const unsigned char*)data)[i] << 8) | (((const unsigned char*)data)[i + 1]));
|
||||
caids.push_back((((const unsigned char*)data)[i] << 8) | (((const unsigned char*)data)[i + 1]));
|
||||
}
|
||||
sort(caids.begin(), caids.end());
|
||||
printf("\n");
|
||||
|
||||
slot->pollConnection = false;
|
||||
slot->hasCAManager = true;
|
||||
slot->camgrSession = this;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
printf("unknown APDU tag 9F 80 %02x\n", tag[2]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int eDVBCICAManagerSession::doAction()
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case stateStarted:
|
||||
{
|
||||
const unsigned char tag[3] = {0x9F, 0x80, 0x30}; // ca info enq
|
||||
sendAPDU(tag);
|
||||
state = stateFinal;
|
||||
return 0;
|
||||
}
|
||||
case stateFinal:
|
||||
printf("stateFinal und action! kann doch garnicht sein ;)\n");
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int eDVBCICAManagerSession::sendCAPMT(unsigned char *data, int len)
|
||||
{
|
||||
const unsigned char tag[3] = {0x9F, 0x80, 0x32}; // ca_pmt
|
||||
|
||||
sendAPDU(tag, data, len);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
24
libdvbci/dvbci_camgr.h
Normal file
24
libdvbci/dvbci_camgr.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef __dvbci_dvbci_camgr_h
|
||||
#define __dvbci_dvbci_camgr_h
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "dvbci_session.h"
|
||||
|
||||
class eDVBCICAManagerSession: public eDVBCISession
|
||||
{
|
||||
enum {
|
||||
stateFinal=statePrivate
|
||||
};
|
||||
std::vector<uint16_t> caids;
|
||||
int receivedAPDU(const unsigned char *tag, const void *data, int len);
|
||||
int doAction();
|
||||
public:
|
||||
eDVBCICAManagerSession(tSlot *tslot);
|
||||
~eDVBCICAManagerSession();
|
||||
|
||||
const std::vector<uint16_t> &getCAIDs() const { return caids; }
|
||||
int sendCAPMT(unsigned char *pmt, int len);
|
||||
};
|
||||
|
||||
#endif
|
59
libdvbci/dvbci_datetimemgr.cpp
Normal file
59
libdvbci/dvbci_datetimemgr.cpp
Normal file
@@ -0,0 +1,59 @@
|
||||
/* DVB CI DateTime Manager */
|
||||
#include <stdio.h>
|
||||
|
||||
#include "dvbci_datetimemgr.h"
|
||||
|
||||
eDVBCIDateTimeSession::eDVBCIDateTimeSession(tSlot *tslot)
|
||||
{
|
||||
slot = tslot;
|
||||
slot->hasDateTime = true;
|
||||
slot->pollConnection = true;
|
||||
}
|
||||
|
||||
eDVBCIDateTimeSession::~eDVBCIDateTimeSession()
|
||||
{
|
||||
slot->hasDateTime = false;
|
||||
}
|
||||
|
||||
int eDVBCIDateTimeSession::receivedAPDU(const unsigned char *tag, const void *data, int len)
|
||||
{
|
||||
printf("SESSION(%d)/DATETIME %02x %02x %02x: ", session_nb, tag[0], tag[1], tag[2]);
|
||||
for (int i = 0; i < len; i++)
|
||||
printf("%02x ", ((const unsigned char*)data)[i]);
|
||||
printf("\n");
|
||||
|
||||
if ((tag[0] == 0x9f) && (tag[1] == 0x84))
|
||||
{
|
||||
switch (tag[2])
|
||||
{
|
||||
case 0x40:
|
||||
state = stateSendDateTime;
|
||||
return 1;
|
||||
break;
|
||||
default:
|
||||
printf("unknown APDU tag 9F 84 %02x\n", tag[2]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int eDVBCIDateTimeSession::doAction()
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case stateStarted:
|
||||
return 0;
|
||||
case stateSendDateTime:
|
||||
{
|
||||
unsigned char tag[3] = {0x9f, 0x84, 0x41}; // date_time_response
|
||||
unsigned char msg[7] = {0, 0, 0, 0, 0, 0, 0};
|
||||
sendAPDU(tag, msg, 7);
|
||||
return 0;
|
||||
}
|
||||
case stateFinal:
|
||||
printf("stateFinal und action! kann doch garnicht sein ;)\n");
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
18
libdvbci/dvbci_datetimemgr.h
Normal file
18
libdvbci/dvbci_datetimemgr.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef __dvbci_dvbci_datetimemgr_h
|
||||
#define __dvbci_dvbci_datetimemgr_h
|
||||
|
||||
#include "dvbci_session.h"
|
||||
|
||||
class eDVBCIDateTimeSession: public eDVBCISession
|
||||
{
|
||||
enum {
|
||||
stateFinal=statePrivate, stateSendDateTime
|
||||
};
|
||||
int receivedAPDU(const unsigned char *tag, const void *data, int len);
|
||||
int doAction();
|
||||
public:
|
||||
eDVBCIDateTimeSession(tSlot *tslot);
|
||||
~eDVBCIDateTimeSession();
|
||||
};
|
||||
|
||||
#endif
|
282
libdvbci/dvbci_mmi.cpp
Normal file
282
libdvbci/dvbci_mmi.cpp
Normal file
@@ -0,0 +1,282 @@
|
||||
/* DVB CI MMI */
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <string>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "dvbci_mmi.h"
|
||||
#include <ca_cs.h>
|
||||
|
||||
static const char * FILENAME = "[dvbci_mmi]";
|
||||
|
||||
eDVBCIMMISession::eDVBCIMMISession(tSlot *tslot)
|
||||
{
|
||||
printf("%s:%s\n", FILENAME, __func__);
|
||||
slot = tslot;
|
||||
slot->hasMMIManager = true;
|
||||
slot->mmiSession = this;
|
||||
}
|
||||
|
||||
eDVBCIMMISession::~eDVBCIMMISession()
|
||||
{
|
||||
/* Send a message to Neutrino cam_menu handler */
|
||||
CA_MESSAGE* pMsg = (CA_MESSAGE*) malloc(sizeof(CA_MESSAGE));
|
||||
memset(pMsg, 0, sizeof(CA_MESSAGE));
|
||||
|
||||
pMsg->MsgId = CA_MESSAGE_MSG_MMI_CLOSE;
|
||||
pMsg->SlotType = CA_SLOT_TYPE_CI;
|
||||
pMsg->Slot = slot->slot;
|
||||
cCA::GetInstance()->SendMessage(pMsg);
|
||||
|
||||
slot->hasMMIManager = false;
|
||||
slot->mmiSession = NULL;
|
||||
slot->mmiOpened = false;
|
||||
}
|
||||
|
||||
int eDVBCIMMISession::receivedAPDU(const unsigned char *tag, const void *data, int len)
|
||||
{
|
||||
printf("SESSION(%d)/MMI %02x %02x %02x: ", session_nb, tag[0], tag[1], tag[2]);
|
||||
for (int i = 0; i < len; i++)
|
||||
printf("%02x ", ((const unsigned char*)data)[i]);
|
||||
printf("\n");
|
||||
|
||||
if ((tag[0] == 0x9f) && (tag[1] == 0x88))
|
||||
{
|
||||
/* from e2 mmi_ui.cpp */
|
||||
switch (tag[2])
|
||||
{
|
||||
case 0x00: /* close */
|
||||
{
|
||||
/* Send a message to Neutrino cam_menu handler */
|
||||
CA_MESSAGE* pMsg = (CA_MESSAGE*) malloc(sizeof(CA_MESSAGE));
|
||||
memset(pMsg, 0, sizeof(CA_MESSAGE));
|
||||
|
||||
pMsg->MsgId = CA_MESSAGE_MSG_MMI_CLOSE;
|
||||
pMsg->SlotType = CA_SLOT_TYPE_CI;
|
||||
pMsg->Slot = slot->slot;
|
||||
cCA::GetInstance()->SendMessage(pMsg);
|
||||
}
|
||||
break;
|
||||
case 0x01: /* display control */
|
||||
state = stateDisplayReply;
|
||||
return 1;
|
||||
break;
|
||||
case 0x07: /* menu enq */
|
||||
{
|
||||
MMI_ENQUIRY_INFO* enquiry = (MMI_ENQUIRY_INFO*) malloc(sizeof(MMI_ENQUIRY_INFO));
|
||||
memset(enquiry, 0, sizeof(MMI_ENQUIRY_INFO));
|
||||
unsigned char *d = (unsigned char*)data;
|
||||
unsigned char *max = ((unsigned char*)d) + len;
|
||||
|
||||
int textlen = len - 2;
|
||||
if ((d + 2) > max)
|
||||
break;
|
||||
|
||||
int blind = *d++ & 1;
|
||||
int alen = *d++;
|
||||
printf("%d bytes text\n", textlen);
|
||||
if ((d + textlen) > max)
|
||||
break;
|
||||
|
||||
char str[textlen + 1];
|
||||
memcpy(str, ((char*)d), textlen);
|
||||
str[textlen] = '\0';
|
||||
printf("enq-text: %s", str);
|
||||
enquiry->slot = slot->slot;
|
||||
enquiry->blind = blind;
|
||||
enquiry->answerlen = alen;
|
||||
strcpy(enquiry->enquiryText, str);
|
||||
|
||||
/* Send a message to Neutrino cam_menu handler */
|
||||
CA_MESSAGE* pMsg = (CA_MESSAGE*) malloc(sizeof(CA_MESSAGE));
|
||||
memset(pMsg, 0, sizeof(CA_MESSAGE));
|
||||
|
||||
pMsg->MsgId = CA_MESSAGE_MSG_MMI_REQ_INPUT;
|
||||
pMsg->SlotType = CA_SLOT_TYPE_CI;
|
||||
pMsg->Slot = slot->slot;
|
||||
pMsg->Flags = CA_MESSAGE_HAS_PARAM1_DATA;
|
||||
pMsg->Msg.Data[0] = (uint8_t*)enquiry;
|
||||
cCA::GetInstance()->SendMessage(pMsg);
|
||||
|
||||
slot->mmiOpened = true;
|
||||
}
|
||||
break;
|
||||
case 0x09: /* menu last */
|
||||
case 0x0c: /* list last */
|
||||
{
|
||||
MMI_MENU_LIST_INFO* listInfo = (MMI_MENU_LIST_INFO*) malloc(sizeof(MMI_MENU_LIST_INFO));
|
||||
memset(listInfo, 0, sizeof(MMI_MENU_LIST_INFO));
|
||||
|
||||
listInfo->slot = slot->slot;
|
||||
listInfo->choice_nb = 0;
|
||||
|
||||
unsigned char *d = (unsigned char*)data;
|
||||
unsigned char *max = ((unsigned char*)d) + len;
|
||||
int pos = 0;
|
||||
|
||||
if (tag[2] == 0x09)
|
||||
printf("menu_last\n");
|
||||
else
|
||||
printf("list_last\n");
|
||||
|
||||
if (d > max)
|
||||
break;
|
||||
|
||||
int n = *d++;
|
||||
|
||||
if (n == 0xFF)
|
||||
n = 0;
|
||||
else
|
||||
n++;
|
||||
|
||||
for (int i = 0; i < (n + 3); ++i)
|
||||
{
|
||||
int textlen;
|
||||
if ((d + 3) > max)
|
||||
break;
|
||||
|
||||
printf("text tag: %02x %02x %02x\n", d[0], d[1], d[2]);
|
||||
d += 3;
|
||||
d += eDVBCISession::parseLengthField(d, textlen);
|
||||
|
||||
printf("%d bytes text", textlen);
|
||||
if ((d + textlen) > max)
|
||||
break;
|
||||
|
||||
char str[textlen + 1];
|
||||
memcpy(str, ((char*)d), textlen);
|
||||
str[textlen] = '\0';
|
||||
|
||||
int type = pos++;
|
||||
|
||||
if (type == 0) /* title */
|
||||
strcpy(listInfo->title, str);
|
||||
else if (type == 1) /* subtitle */
|
||||
strcpy(listInfo->subtitle, str);
|
||||
else if (type == 2) /* bottom */
|
||||
strcpy(listInfo->bottom, str);
|
||||
else /* text */
|
||||
{
|
||||
strcpy(listInfo->choice_item[listInfo->choice_nb], str);
|
||||
listInfo->choice_nb++;
|
||||
printf("%d. %s\n", listInfo->choice_nb, listInfo->choice_item[listInfo->choice_nb - 1]);
|
||||
}
|
||||
while (textlen--)
|
||||
printf("%c", *d++);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
if (tag[2] == 0x09)
|
||||
{
|
||||
/* Send a message to Neutrino cam_menu handler */
|
||||
CA_MESSAGE* pMsg = (CA_MESSAGE*) malloc(sizeof(CA_MESSAGE));
|
||||
memset(pMsg, 0, sizeof(CA_MESSAGE));
|
||||
|
||||
pMsg->MsgId = CA_MESSAGE_MSG_MMI_MENU;
|
||||
pMsg->SlotType = CA_SLOT_TYPE_CI;
|
||||
pMsg->Slot = slot->slot;
|
||||
pMsg->Flags = CA_MESSAGE_HAS_PARAM1_DATA;
|
||||
pMsg->Msg.Data[0] = (uint8_t*)listInfo;
|
||||
cCA::GetInstance()->SendMessage(pMsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Send a message to Neutrino cam_menu handler */
|
||||
CA_MESSAGE* pMsg = (CA_MESSAGE*) malloc(sizeof(CA_MESSAGE));
|
||||
memset(pMsg, 0, sizeof(CA_MESSAGE));
|
||||
|
||||
pMsg->MsgId = CA_MESSAGE_MSG_MMI_LIST;
|
||||
pMsg->SlotType = CA_SLOT_TYPE_CI;
|
||||
pMsg->Slot = slot->slot;
|
||||
pMsg->Flags = CA_MESSAGE_HAS_PARAM1_DATA;
|
||||
pMsg->Msg.Data[0] = (uint8_t*)listInfo;
|
||||
cCA::GetInstance()->SendMessage(pMsg);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int eDVBCIMMISession::doAction()
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case stateStarted:
|
||||
state = stateIdle;
|
||||
break;
|
||||
case stateDisplayReply:
|
||||
{
|
||||
unsigned char tag[] = {0x9f, 0x88, 0x02};
|
||||
unsigned char data[] = {0x01, 0x01};
|
||||
sendAPDU(tag, data, 2);
|
||||
state = stateIdle;
|
||||
break;
|
||||
}
|
||||
case stateFakeOK:
|
||||
{
|
||||
unsigned char tag[] = {0x9f, 0x88, 0x0b};
|
||||
unsigned char data[] = {5};
|
||||
sendAPDU(tag, data, 1);
|
||||
state = stateIdle;
|
||||
break;
|
||||
}
|
||||
case stateIdle:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int eDVBCIMMISession::stopMMI()
|
||||
{
|
||||
unsigned char tag[] = {0x9f, 0x88, 0x00};
|
||||
unsigned char data[] = {0x00};
|
||||
sendAPDU(tag, data, 1);
|
||||
|
||||
slot->mmiOpened = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int eDVBCIMMISession::answerText(int answer)
|
||||
{
|
||||
printf("eDVBCIMMISession::answerText(%d)\n", answer);
|
||||
|
||||
unsigned char tag[] = {0x9f, 0x88, 0x0B};
|
||||
unsigned char data[] = {0x00};
|
||||
data[0] = answer & 0xff;
|
||||
sendAPDU(tag, data, 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int eDVBCIMMISession::answerEnq(char * answer, int len)
|
||||
{
|
||||
printf("eDVBCIMMISession::answerEnq(%d bytes)\n", len);
|
||||
|
||||
unsigned char data[len + 1];
|
||||
data[0] = 0x01; // answer ok
|
||||
memcpy(data + 1, answer, len);
|
||||
|
||||
unsigned char tag[] = {0x9f, 0x88, 0x08};
|
||||
sendAPDU(tag, data, len + 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int eDVBCIMMISession::cancelEnq()
|
||||
{
|
||||
printf("eDVBCIMMISession::cancelEnq()\n");
|
||||
|
||||
unsigned char tag[] = {0x9f, 0x88, 0x08};
|
||||
unsigned char data[] = {0x00}; // canceled
|
||||
sendAPDU(tag, data, 1);
|
||||
slot->mmiOpened = false;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
24
libdvbci/dvbci_mmi.h
Normal file
24
libdvbci/dvbci_mmi.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef __dvbci_dvbci_mmi_h
|
||||
#define __dvbci_dvbci_mmi_h
|
||||
|
||||
#include "dvbci_session.h"
|
||||
|
||||
class eDVBCIMMISession: public eDVBCISession
|
||||
{
|
||||
enum {
|
||||
stateDisplayReply=statePrivate, stateFakeOK, stateIdle
|
||||
};
|
||||
|
||||
int receivedAPDU(const unsigned char *tag, const void *data, int len);
|
||||
int doAction();
|
||||
tSlot *slot;
|
||||
public:
|
||||
eDVBCIMMISession(tSlot *tslot);
|
||||
~eDVBCIMMISession();
|
||||
int stopMMI();
|
||||
int answerText(int answer);
|
||||
int answerEnq(char *answer, int len);
|
||||
int cancelEnq();
|
||||
};
|
||||
|
||||
#endif
|
91
libdvbci/dvbci_resmgr.cpp
Normal file
91
libdvbci/dvbci_resmgr.cpp
Normal file
@@ -0,0 +1,91 @@
|
||||
/* DVB CI Resource Manager */
|
||||
#include <stdio.h>
|
||||
#include "dvbci_resmgr.h"
|
||||
|
||||
static const char * FILENAME = "[dvbci_resmgr]";
|
||||
|
||||
int eDVBCIResourceManagerSession::receivedAPDU(const unsigned char *tag, const void *data, int len)
|
||||
{
|
||||
printf("SESSION(%d) %02x %02x %02x (len = %d): \n", session_nb, tag[0], tag[1], tag[2], len);
|
||||
for (int i = 0; i < len; i++)
|
||||
printf("%02x ", ((const unsigned char*)data)[i]);
|
||||
printf("\n");
|
||||
if ((tag[0] == 0x9f) && (tag[1] == 0x80))
|
||||
{
|
||||
switch (tag[2])
|
||||
{
|
||||
case 0x10: // profile enquiry
|
||||
printf("cam fragt was ich kann.");
|
||||
state = stateProfileEnquiry;
|
||||
return 1;
|
||||
break;
|
||||
case 0x11: // Tprofile
|
||||
printf("mein cam kann: ");
|
||||
if (!len)
|
||||
printf("nichts\n");
|
||||
else
|
||||
for (int i = 0; i < len; i++)
|
||||
printf("%02x ", ((const unsigned char*)data)[i]);
|
||||
printf("\n");
|
||||
|
||||
if (state == stateFirstProfileEnquiry)
|
||||
{
|
||||
// profile change
|
||||
return 1;
|
||||
}
|
||||
state = stateFinal;
|
||||
break;
|
||||
default:
|
||||
printf("%s %s unknown APDU tag 9F 80 %02x\n", tag[2], FILENAME, __FUNCTION__);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int eDVBCIResourceManagerSession::doAction()
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case stateStarted:
|
||||
{
|
||||
const unsigned char tag[3] = {0x9F, 0x80, 0x10}; // profile enquiry
|
||||
sendAPDU(tag);
|
||||
state = stateFirstProfileEnquiry;
|
||||
return 0;
|
||||
}
|
||||
case stateFirstProfileEnquiry:
|
||||
{
|
||||
const unsigned char tag[3] = {0x9F, 0x80, 0x12}; // profile change
|
||||
sendAPDU(tag);
|
||||
state = stateProfileChange;
|
||||
return 0;
|
||||
}
|
||||
case stateProfileChange:
|
||||
{
|
||||
printf("bla kaputt\n");
|
||||
break;
|
||||
}
|
||||
case stateProfileEnquiry:
|
||||
{
|
||||
const unsigned char tag[3] = {0x9F, 0x80, 0x11};
|
||||
const unsigned char data[][4] =
|
||||
{
|
||||
{0x00, 0x01, 0x00, 0x41},
|
||||
{0x00, 0x02, 0x00, 0x41},
|
||||
{0x00, 0x03, 0x00, 0x41},
|
||||
// {0x00, 0x20, 0x00, 0x41}, // host control
|
||||
{0x00, 0x40, 0x00, 0x41},
|
||||
{0x00, 0x24, 0x00, 0x41}
|
||||
// {0x00, 0x10, 0x00, 0x41} // auth.
|
||||
};
|
||||
sendAPDU(tag, data, sizeof(data));
|
||||
state = stateFinal;
|
||||
return 0;
|
||||
}
|
||||
case stateFinal:
|
||||
printf("stateFinal und action! kann doch garnicht sein ;)\n");
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
20
libdvbci/dvbci_resmgr.h
Normal file
20
libdvbci/dvbci_resmgr.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef __dvbci_dvbci_resmgr_h
|
||||
#define __dvbci_dvbci_resmgr_h
|
||||
|
||||
#include "dvbci_session.h"
|
||||
|
||||
class eDVBCIResourceManagerSession: public eDVBCISession
|
||||
{
|
||||
enum {
|
||||
stateFirstProfileEnquiry=statePrivate,
|
||||
stateProfileChange,
|
||||
stateProfileEnquiry,
|
||||
stateFinal
|
||||
};
|
||||
int receivedAPDU(const unsigned char *tag, const void *data, int len);
|
||||
int doAction();
|
||||
public:
|
||||
|
||||
};
|
||||
|
||||
#endif
|
348
libdvbci/dvbci_session.cpp
Normal file
348
libdvbci/dvbci_session.cpp
Normal file
@@ -0,0 +1,348 @@
|
||||
/* DVB CI Transport Connection */
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "dvbci_session.h"
|
||||
#include "dvbci_resmgr.h"
|
||||
#include "dvbci_appmgr.h"
|
||||
#include "dvbci_camgr.h"
|
||||
#include "dvbci_datetimemgr.h"
|
||||
#include "dvbci_mmi.h"
|
||||
|
||||
static const char * FILENAME = "[dvbci_session]";
|
||||
|
||||
eDVBCISession* eDVBCISession::sessions[SLMS];
|
||||
|
||||
int eDVBCISession::buildLengthField(unsigned char *pkt, int len)
|
||||
{
|
||||
if (len < 127)
|
||||
{
|
||||
*pkt++ = len;
|
||||
return 1;
|
||||
}
|
||||
else if (len < 256)
|
||||
{
|
||||
*pkt++ = 0x81;
|
||||
*pkt++ = len;
|
||||
return 2;
|
||||
}
|
||||
else if (len < 65535)
|
||||
{
|
||||
*pkt++ = 0x82;
|
||||
*pkt++ = len >> 8;
|
||||
*pkt++ = len;
|
||||
return 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("too big length\n");
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
int eDVBCISession::parseLengthField(const unsigned char *pkt, int &len)
|
||||
{
|
||||
len = 0;
|
||||
if (!(*pkt & 0x80))
|
||||
{
|
||||
len = *pkt;
|
||||
return 1;
|
||||
}
|
||||
for (int i = 0; i < (pkt[0] & 0x7F); ++i)
|
||||
{
|
||||
len <<= 8;
|
||||
len |= pkt[i + 1];
|
||||
}
|
||||
return (pkt[0] & 0x7F) + 1;
|
||||
}
|
||||
|
||||
void eDVBCISession::sendAPDU(const unsigned char *tag, const void *data, int len)
|
||||
{
|
||||
unsigned char pkt[len + 3 + 4];
|
||||
int l;
|
||||
memcpy(pkt, tag, 3);
|
||||
l = buildLengthField(pkt + 3, len);
|
||||
if (data)
|
||||
memcpy(pkt + 3 + l, data, len);
|
||||
sendSPDU(0x90, 0, 0, pkt, len + 3 + l);
|
||||
}
|
||||
|
||||
void eDVBCISession::sendSPDU(unsigned char tag, const void *data, int len, const void *apdu, int alen)
|
||||
{
|
||||
sendSPDU(slot, tag, data, len, session_nb, apdu, alen);
|
||||
}
|
||||
|
||||
void eDVBCISession::sendSPDU(tSlot *slot, unsigned char tag, const void *data, int len, unsigned short session_nb, const void *apdu, int alen)
|
||||
{
|
||||
unsigned char pkt[4096];
|
||||
unsigned char *ptr = pkt;
|
||||
|
||||
*ptr++ = tag;
|
||||
ptr += buildLengthField(ptr, len + 2);
|
||||
if (data)
|
||||
memcpy(ptr, data, len);
|
||||
ptr += len;
|
||||
*ptr++ = session_nb >> 8;
|
||||
*ptr++ = session_nb;
|
||||
|
||||
if (apdu)
|
||||
memcpy(ptr, apdu, alen);
|
||||
ptr += alen;
|
||||
sendData(slot, pkt, ptr - pkt);
|
||||
}
|
||||
|
||||
void eDVBCISession::sendOpenSessionResponse(tSlot *slot, unsigned char session_status, const unsigned char *resource_identifier, unsigned short session_nb)
|
||||
{
|
||||
char pkt[6];
|
||||
pkt[0] = session_status;
|
||||
memcpy(pkt + 1, resource_identifier, 4);
|
||||
sendSPDU(slot, 0x92, pkt, 5, session_nb);
|
||||
}
|
||||
|
||||
void eDVBCISession::recvCreateSessionResponse(const unsigned char *data)
|
||||
{
|
||||
status = data[0];
|
||||
state = stateStarted;
|
||||
action = 1;
|
||||
printf("create Session Response, status %x\n", status);
|
||||
}
|
||||
|
||||
void eDVBCISession::recvCloseSessionRequest(const unsigned char *data)
|
||||
{
|
||||
state = stateInDeletion;
|
||||
action = 1;
|
||||
printf("close Session Request\n");
|
||||
}
|
||||
|
||||
void eDVBCISession::deleteSessions(const tSlot *slot)
|
||||
{
|
||||
for (unsigned short session_nb = 0; session_nb < SLMS; ++session_nb)
|
||||
{
|
||||
if (sessions[session_nb] && sessions[session_nb]->slot == slot)
|
||||
sessions[session_nb] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
eDVBCISession* eDVBCISession::createSession(tSlot *slot, const unsigned char *resource_identifier, unsigned char &status)
|
||||
{
|
||||
unsigned long tag;
|
||||
unsigned short session_nb;
|
||||
|
||||
for (session_nb = 1; session_nb < SLMS; ++session_nb)
|
||||
if (!sessions[session_nb - 1])
|
||||
break;
|
||||
|
||||
printf("use session_nb = %d\n", session_nb);
|
||||
if (session_nb == SLMS)
|
||||
{
|
||||
status = 0xF3;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
tag = resource_identifier[0] << 24;
|
||||
tag |= resource_identifier[1] << 16;
|
||||
tag |= resource_identifier[2] << 8;
|
||||
tag |= resource_identifier[3];
|
||||
|
||||
printf("Tag: %08X\n", tag);
|
||||
|
||||
switch (tag)
|
||||
{
|
||||
case 0x00010041:
|
||||
sessions[session_nb - 1] = new eDVBCIResourceManagerSession;
|
||||
printf("RESOURCE MANAGER\n");
|
||||
break;
|
||||
case 0x00020041:
|
||||
sessions[session_nb - 1] = new eDVBCIApplicationManagerSession(slot);
|
||||
printf("APPLICATION MANAGER\n");
|
||||
break;
|
||||
case 0x00030041:
|
||||
sessions[session_nb - 1] = new eDVBCICAManagerSession(slot);
|
||||
printf("CA MANAGER\n");
|
||||
break;
|
||||
case 0x00240041:
|
||||
sessions[session_nb - 1] = new eDVBCIDateTimeSession(slot);
|
||||
printf("DATE-TIME\n");
|
||||
break;
|
||||
case 0x00400041:
|
||||
sessions[session_nb - 1] = new eDVBCIMMISession(slot);
|
||||
printf("MMI - create session\n");
|
||||
break;
|
||||
case 0x00100041:
|
||||
// session=new eDVBCIAuthSession;
|
||||
printf("AuthSession\n");
|
||||
// break;
|
||||
case 0x00200041:
|
||||
default:
|
||||
printf("unknown resource type %02x %02x %02x %02x\n", resource_identifier[0], resource_identifier[1], resource_identifier[2], resource_identifier[3]);
|
||||
sessions[session_nb - 1] = 0;
|
||||
status = 0xF0;
|
||||
}
|
||||
|
||||
if (!sessions[session_nb - 1])
|
||||
{
|
||||
printf("unknown session.. expect crash\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
printf("new session nb %d %p\n", session_nb, sessions[session_nb - 1]);
|
||||
sessions[session_nb - 1]->session_nb = session_nb;
|
||||
|
||||
if (sessions[session_nb - 1])
|
||||
{
|
||||
sessions[session_nb - 1]->slot = slot;
|
||||
status = 0;
|
||||
}
|
||||
sessions[session_nb - 1]->state = stateInCreation;
|
||||
return sessions[session_nb - 1];
|
||||
}
|
||||
|
||||
void eDVBCISession::handleClose()
|
||||
{
|
||||
printf("%s %s\n", FILENAME, __FUNCTION__);
|
||||
|
||||
unsigned char data[1] = {0x00};
|
||||
sendSPDU(0x96, data, 1, 0, 0);
|
||||
}
|
||||
|
||||
int eDVBCISession::pollAll()
|
||||
{
|
||||
for (int session_nb = 1; session_nb < SLMS; ++session_nb)
|
||||
{
|
||||
if (sessions[session_nb - 1])
|
||||
{
|
||||
int r;
|
||||
if (sessions[session_nb - 1]->state == stateInDeletion)
|
||||
{
|
||||
sessions[session_nb - 1]->handleClose();
|
||||
sessions[session_nb - 1] = 0;
|
||||
r = 1;
|
||||
}
|
||||
else
|
||||
r = sessions[session_nb - 1]->poll();
|
||||
|
||||
if (r)
|
||||
{
|
||||
printf("%s <\n", __func__);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void eDVBCISession::receiveData(tSlot *slot, const unsigned char *ptr, size_t len)
|
||||
{
|
||||
printf("slot: %p\n", slot);
|
||||
|
||||
for(unsigned int i = 0; i < len; i++)
|
||||
printf("%02x ", ptr[i]);
|
||||
printf("\n");
|
||||
|
||||
if ((ptr[0] == 0x90 || ptr[0] == 0x95) && (ptr[3] == 0 ))
|
||||
{
|
||||
printf("****Mist: %02x %02x %02x %02x\n", ptr[0], ptr[1], ptr[2], ptr[3]);
|
||||
}
|
||||
const unsigned char *pkt = (const unsigned char*)ptr;
|
||||
unsigned char tag = *pkt++;
|
||||
int llen, hlen;
|
||||
|
||||
|
||||
llen = parseLengthField(pkt, hlen);
|
||||
pkt += llen;
|
||||
|
||||
eDVBCISession* session = NULL;
|
||||
|
||||
if(tag == 0x91)
|
||||
{
|
||||
unsigned char status;
|
||||
|
||||
session = createSession(slot, pkt, status);
|
||||
sendOpenSessionResponse(slot, status, pkt, session ? session->session_nb : 0);
|
||||
|
||||
if (session)
|
||||
{
|
||||
session->state = stateStarted;
|
||||
session->action = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned session_nb;
|
||||
printf("hlen = %d, %d, %d\n", hlen, pkt[hlen - 2], pkt[hlen - 1]);
|
||||
session_nb = pkt[hlen - 2] << 8;
|
||||
session_nb |= pkt[hlen - 1] & 0xFF;
|
||||
|
||||
if ((!session_nb) || (session_nb >= SLMS))
|
||||
{
|
||||
printf("PROTOCOL: illegal session number %x\n", session_nb);
|
||||
return;
|
||||
}
|
||||
|
||||
session = sessions[session_nb - 1];
|
||||
if (!session)
|
||||
{
|
||||
printf("PROTOCOL: data on closed session %x\n", session_nb);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (tag)
|
||||
{
|
||||
case 0x90:
|
||||
break;
|
||||
case 0x94:
|
||||
session->recvCreateSessionResponse(pkt);
|
||||
break;
|
||||
case 0x95:
|
||||
session->recvCloseSessionRequest(pkt);
|
||||
break;
|
||||
default:
|
||||
printf("INTERNAL: nyi, tag %02x.\n", tag);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
hlen += llen + 1; // lengthfield and tag
|
||||
|
||||
pkt = ((const unsigned char*)ptr) + hlen;
|
||||
len -= hlen;
|
||||
|
||||
if (session)
|
||||
{
|
||||
printf("len %d\n", len);
|
||||
while (len > 0)
|
||||
{
|
||||
int alen;
|
||||
const unsigned char *tag = pkt;
|
||||
pkt += 3; // tag
|
||||
len -= 3;
|
||||
hlen = parseLengthField(pkt, alen);
|
||||
pkt += hlen;
|
||||
len -= hlen;
|
||||
|
||||
printf("len = %d, hlen = %d, alen = %d\n", len, hlen, alen);
|
||||
|
||||
if (((len - alen) > 0) && ((len - alen) < 3))
|
||||
{
|
||||
printf("WORKAROUND: applying work around MagicAPDULength\n");
|
||||
alen = len;
|
||||
}
|
||||
|
||||
printf("1. Call receivedAPDU tag = 0x%2x, len = %d\n", (int) tag, alen);
|
||||
|
||||
if (session->receivedAPDU(tag, pkt, alen))
|
||||
session->action = 1;
|
||||
pkt += alen;
|
||||
len -= alen;
|
||||
}
|
||||
}
|
||||
if (len)
|
||||
printf("PROTOCOL: warning, TL-Data has invalid length\n");
|
||||
}
|
||||
|
||||
eDVBCISession::~eDVBCISession()
|
||||
{
|
||||
// printf("destroy %p", this);
|
||||
}
|
||||
|
46
libdvbci/dvbci_session.h
Normal file
46
libdvbci/dvbci_session.h
Normal file
@@ -0,0 +1,46 @@
|
||||
#ifndef __dvbci_dvbci_tc_h
|
||||
#define __dvbci_dvbci_tc_h
|
||||
|
||||
#include <ca_ci.h>
|
||||
|
||||
#define SLMS 256
|
||||
|
||||
class eDVBCISession
|
||||
{
|
||||
static eDVBCISession* sessions[SLMS];
|
||||
static eDVBCISession* createSession(tSlot *slot, const unsigned char *resource_identifier, unsigned char &status);
|
||||
static void sendSPDU(tSlot *slot, unsigned char tag,const void *data, int len, unsigned short session_nb, const void *apdu = 0, int alen = 0);
|
||||
static void sendOpenSessionResponse(tSlot *slot,unsigned char session_status, const unsigned char *resource_identifier, unsigned short session_nb);
|
||||
void recvCreateSessionResponse(const unsigned char *data);
|
||||
void recvCloseSessionRequest(const unsigned char *data);
|
||||
protected:
|
||||
int state;
|
||||
int status;
|
||||
int action;
|
||||
tSlot *slot;
|
||||
unsigned short session_nb;
|
||||
virtual int receivedAPDU(const unsigned char *tag, const void *data, int len) = 0;
|
||||
void sendAPDU(const unsigned char *tag, const void *data=0,int len=0);
|
||||
virtual int doAction() = 0;
|
||||
void handleClose();
|
||||
public:
|
||||
virtual ~eDVBCISession();
|
||||
|
||||
static void deleteSessions(const tSlot *slot);
|
||||
void sendSPDU(unsigned char tag, const void *data, int len, const void *apdu = 0, int alen = 0);
|
||||
|
||||
int poll() { if (action) { action=doAction(); return 1; } return 0; }
|
||||
enum { stateInCreation, stateBusy, stateInDeletion, stateStarted, statePrivate};
|
||||
|
||||
static int parseLengthField(const unsigned char *pkt, int &len);
|
||||
static int buildLengthField(unsigned char *pkt, int len);
|
||||
|
||||
static void receiveData(tSlot *slot, const unsigned char *ptr, size_t len);
|
||||
|
||||
int getState() { return state; }
|
||||
int getStatus() { return status; }
|
||||
|
||||
static int pollAll();
|
||||
};
|
||||
|
||||
#endif
|
@@ -24,4 +24,4 @@ libspark_la_SOURCES = \
|
||||
pwrmngr.cpp \
|
||||
record.cpp
|
||||
|
||||
#AM_CPPFLAGS = -DF_INTERRUPTS=20000 -DIRMP_EMBED -DLIRC_IRMP
|
||||
#AM_CPPFLAGS += -DF_INTERRUPTS=20000 -DIRMP_EMBED -DLIRC_IRMP
|
||||
|
@@ -30,6 +30,7 @@ hw_caps_t *get_hwcaps(void)
|
||||
memset(&caps, 0, sizeof(hw_caps_t));
|
||||
|
||||
initialized = 1;
|
||||
caps.has_CI = 0;
|
||||
caps.can_cec = 1;
|
||||
caps.can_shutdown = 1;
|
||||
caps.display_type = HW_DISPLAY_LED_NUM;
|
||||
|
@@ -1,23 +0,0 @@
|
||||
#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_
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,125 +0,0 @@
|
||||
#ifndef __PLAYBACK_TD_H
|
||||
#define __PLAYBACK_TD_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
/* almost 256kB */
|
||||
#define INBUF_SIZE (1394 * 188)
|
||||
#define PESBUF_SIZE (128 * 1024)
|
||||
|
||||
typedef enum {
|
||||
PLAYMODE_TS = 0,
|
||||
PLAYMODE_FILE,
|
||||
} playmode_t;
|
||||
|
||||
typedef enum {
|
||||
FILETYPE_UNKNOWN,
|
||||
FILETYPE_TS,
|
||||
FILETYPE_MPG,
|
||||
FILETYPE_VDR
|
||||
} filetype_t;
|
||||
|
||||
typedef enum {
|
||||
STATE_STOP,
|
||||
STATE_PLAY,
|
||||
STATE_PAUSE,
|
||||
STATE_FF,
|
||||
STATE_REW,
|
||||
STATE_INIT
|
||||
} playstate_t;
|
||||
|
||||
typedef struct {
|
||||
std::string Name;
|
||||
off_t Size;
|
||||
} filelist_t;
|
||||
|
||||
class cPlayback
|
||||
{
|
||||
private:
|
||||
uint8_t *inbuf;
|
||||
ssize_t inbuf_pos;
|
||||
ssize_t inbuf_sync;
|
||||
uint8_t *pesbuf;
|
||||
ssize_t pesbuf_pos;
|
||||
ssize_t inbuf_read(void);
|
||||
ssize_t read_ts(void);
|
||||
ssize_t read_mpeg(void);
|
||||
|
||||
uint8_t cc[256];
|
||||
|
||||
int in_fd;
|
||||
|
||||
int video_type;
|
||||
int playback_speed;
|
||||
int mSpeed;
|
||||
playmode_t playMode;
|
||||
std::vector<filelist_t> filelist; /* for multi-file playback */
|
||||
|
||||
bool filelist_auto_add(void);
|
||||
int mf_open(int fileno);
|
||||
int mf_close(void);
|
||||
off_t mf_lseek(off_t pos);
|
||||
off_t mf_getsize(void);
|
||||
int curr_fileno;
|
||||
off_t curr_pos;
|
||||
off_t last_size;
|
||||
off_t bytes_per_second;
|
||||
|
||||
uint16_t vpid;
|
||||
uint16_t apid;
|
||||
bool ac3;
|
||||
struct AStream {
|
||||
// uint16_t pid;
|
||||
bool ac3;
|
||||
std::string lang; /* not yet really used */
|
||||
};
|
||||
std::map<uint16_t, AStream> astreams; /* stores AStream sorted by pid */
|
||||
|
||||
int64_t pts_start;
|
||||
int64_t pts_end;
|
||||
int64_t _pts_end; /* last good endpts */
|
||||
int64_t pts_curr;
|
||||
int64_t get_pts(uint8_t *p, bool pes, int bufsize);
|
||||
|
||||
filetype_t filetype;
|
||||
playstate_t playstate;
|
||||
|
||||
off_t seek_to_pts(int64_t pts);
|
||||
off_t mp_seekSync(off_t pos);
|
||||
int64_t get_PES_PTS(uint8_t *buf, int len, bool until_eof);
|
||||
|
||||
pthread_t thread;
|
||||
bool thread_started;
|
||||
public:
|
||||
cPlayback(int num = 0);
|
||||
~cPlayback();
|
||||
|
||||
void playthread();
|
||||
|
||||
bool Open(playmode_t PlayMode);
|
||||
void Close(void);
|
||||
bool Start(char *filename, unsigned short vpid, int vtype, unsigned short apid,
|
||||
int ac3, unsigned int duration);
|
||||
bool SetAPid(unsigned short pid, int ac3);
|
||||
bool SetSpeed(int speed);
|
||||
bool GetSpeed(int &speed) const;
|
||||
bool GetPosition(int &position, int &duration); /* pos: current time in ms, dur: file length in ms */
|
||||
bool SetPosition(int position, bool absolute = false); /* position: jump in ms */
|
||||
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language);
|
||||
#if 0
|
||||
// Functions that are not used by movieplayer.cpp:
|
||||
bool Stop(void);
|
||||
bool GetOffset(off64_t &offset);
|
||||
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 PlaybackNotify (int Event, void *pData, void *pTag);
|
||||
void DMNotify(int Event, void *pTsBuf, void *Tag);
|
||||
#endif
|
||||
};
|
||||
#endif
|
@@ -307,6 +307,28 @@ int cPlayback::GetFirstTeletextPid(void)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* dummy functions for subtitles */
|
||||
void cPlayback::FindAllSubs(uint16_t * /*pids*/, unsigned short * /*supp*/, uint16_t *num, std::string * /*lang*/)
|
||||
{
|
||||
*num = 0;
|
||||
}
|
||||
|
||||
bool cPlayback::SelectSubtitles(int pid)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void cPlayback::GetTitles(std::vector<int> &playlists, std::vector<std::string> &titles, int ¤t)
|
||||
{
|
||||
playlists.clear();
|
||||
titles.clear();
|
||||
current = 0;
|
||||
}
|
||||
|
||||
void cPlayback::SetTitle(int /*title*/)
|
||||
{
|
||||
}
|
||||
|
||||
void cPlayback::GetChapters(std::vector<int> &positions, std::vector<std::string> &titles)
|
||||
{
|
||||
player->GetChapters(positions, titles);
|
||||
|
@@ -52,10 +52,10 @@ class cPlayback
|
||||
void RequestAbort(void);
|
||||
bool IsPlaying(void);
|
||||
uint64_t GetReadCount(void);
|
||||
#if 0
|
||||
void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language);
|
||||
bool SelectSubtitles(int pid);
|
||||
#endif
|
||||
void GetTitles(std::vector<int> &playlists, std::vector<std::string> &titles, int ¤t);
|
||||
void SetTitle(int title);
|
||||
void GetChapters(std::vector<int> &positions, std::vector<std::string> &titles);
|
||||
void GetMetadata(std::vector<std::string> &keys, std::vector<std::string> &values);
|
||||
#if 0
|
||||
|
@@ -14,7 +14,7 @@ void cCpuFreqManager::Down(void) { lt_debug("%s\n", __FUNCTION__); }
|
||||
void cCpuFreqManager::Reset(void) { lt_debug("%s\n", __FUNCTION__); }
|
||||
/* those function dummies return true or "harmless" values */
|
||||
bool cCpuFreqManager::SetDelta(unsigned long) { lt_debug("%s\n", __FUNCTION__); return true; }
|
||||
#if HAVE_SPARK_HARDWARE
|
||||
#if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE
|
||||
unsigned long cCpuFreqManager::GetCpuFreq(void) {
|
||||
int freq = 0;
|
||||
if (FILE *pll0 = fopen("/proc/cpu_frequ/pll0_ndiv_mdiv", "r")) {
|
||||
@@ -48,7 +48,7 @@ bool cPowerManager::SetStandby(bool Active, bool Passive)
|
||||
|
||||
bool cCpuFreqManager::SetCpuFreq(unsigned long f)
|
||||
{
|
||||
#if HAVE_SPARK_HARDWARE
|
||||
#if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE
|
||||
if (f) {
|
||||
FILE *pll0 = fopen ("/proc/cpu_frequ/pll0_ndiv_mdiv", "w");
|
||||
if (pll0) {
|
||||
|
@@ -183,11 +183,13 @@ void cRecord::RecordThread()
|
||||
prctl (PR_SET_NAME, (unsigned long)&threadname);
|
||||
int readsize = bufsize/16;
|
||||
int buf_pos = 0;
|
||||
int count = 0;
|
||||
int queued = 0;
|
||||
uint8_t *buf;
|
||||
struct aiocb a;
|
||||
|
||||
buf = (uint8_t *)malloc(bufsize);
|
||||
lt_info("BUFSIZE=0x%x READSIZE=0x%x\n", bufsize, readsize);
|
||||
if (!buf)
|
||||
{
|
||||
exit_flag = RECORD_FAILED_MEMORY;
|
||||
@@ -237,6 +239,15 @@ void cRecord::RecordThread()
|
||||
{
|
||||
overflow = false;
|
||||
buf_pos += s;
|
||||
if (count > 100)
|
||||
{
|
||||
if (buf_pos < bufsize / 2)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* compatibility stuff for Tripledragon audio API
|
||||
*
|
||||
* (C) 2009 Stefan Seyfried
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __td_audio_compat_h__
|
||||
#define __td_audio_compat_h__
|
||||
|
||||
#include <aud/aud_inf.h>
|
||||
// types
|
||||
typedef enum {
|
||||
AUDIO_SOURCE_DEMUX = AUD_SOURCE_DEMUX,
|
||||
AUDIO_SOURCE_MEMORY = AUD_SOURCE_MEMORY
|
||||
} audio_stream_source_t;
|
||||
#define audio_channel_select_t audChannel_t
|
||||
// ioctls
|
||||
#define AUDIO_CHANNEL_SELECT MPEG_AUD_SELECT_CHANNEL
|
||||
#define AUDIO_SELECT_SOURCE MPEG_AUD_SELECT_SOURCE
|
||||
#define AUDIO_PLAY MPEG_AUD_PLAY
|
||||
#define AUDIO_STOP MPEG_AUD_STOP
|
||||
#define AUDIO_SET_MUTE MPEG_AUD_SET_MUTE
|
||||
|
||||
#endif /* __td_audio_compat_h__ */
|
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* compatibility stuff for Tripledragon demux API
|
||||
*
|
||||
* (C) 2009 Stefan Seyfried
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __td_demux_compat_h__
|
||||
#define __td_demux_compat_h__
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <xp/xp_osd_user.h>
|
||||
// types
|
||||
#define dmx_output_t OutDevice
|
||||
#define dmx_pes_type_t PesType
|
||||
#define dmx_sct_filter_params demux_filter_para
|
||||
#define dmx_pes_filter_params demux_pes_para
|
||||
#define pes_type pesType
|
||||
// defines
|
||||
#define DMX_FILTER_SIZE FILTER_LENGTH
|
||||
#define DMX_ONESHOT XPDF_ONESHOT
|
||||
#define DMX_CHECK_CRC 0 // TD checks CRC by default
|
||||
#define DMX_IMMEDIATE_START XPDF_IMMEDIATE_START
|
||||
#define DMX_OUT_DECODER OUT_DECODER
|
||||
// ioctls
|
||||
#define DMX_SET_FILTER DEMUX_FILTER_SET
|
||||
#define DMX_SET_PES_FILTER DEMUX_FILTER_PES_SET
|
||||
#define DMX_START DEMUX_START
|
||||
#define DMX_STOP DEMUX_STOP
|
||||
#define DMX_SET_BUFFER_SIZE DEMUX_SET_BUFFER_SIZE
|
||||
|
||||
#endif /* __td_demux_compat_h__ */
|
@@ -1,120 +0,0 @@
|
||||
/*
|
||||
* compatibility stuff for Tripledragon frontend API
|
||||
*
|
||||
* (C) 2009 Stefan Seyfried
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __td_frontend_compat_h__
|
||||
#define __td_frontend_compat_h__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include <tdtuner/tuner_inf.h>
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* I know that those are different. But functions that get a
|
||||
dvb_frontend_parameters struct passed on dbox/dreambox will most likely
|
||||
get a tunersetup struct on TD, so it keeps the differences in headers
|
||||
and function prototypes small. Of course, the functions itself will have
|
||||
#ifdef TRIPLEDRAGON or similar... */
|
||||
#define dvb_frontend_parameters tunersetup
|
||||
|
||||
/* compat stuff for settings.cpp */
|
||||
enum {
|
||||
INVERSION_OFF,
|
||||
INVERSION_ON,
|
||||
INVERSION_AUTO
|
||||
};
|
||||
typedef enum fe_code_rate {
|
||||
FEC_NONE = 0,
|
||||
FEC_1_2,
|
||||
FEC_2_3,
|
||||
FEC_3_4,
|
||||
FEC_4_5,
|
||||
FEC_5_6,
|
||||
FEC_6_7,
|
||||
FEC_7_8,
|
||||
FEC_8_9,
|
||||
FEC_AUTO
|
||||
} fe_code_rate_t;
|
||||
|
||||
enum td_code_rate {
|
||||
TD_FEC_AUTO = 0,
|
||||
TD_FEC_1_2,
|
||||
TD_FEC_2_3,
|
||||
TD_FEC_3_4,
|
||||
TD_FEC_5_6,
|
||||
TD_FEC_7_8
|
||||
};
|
||||
|
||||
typedef enum fe_sec_tone_mode {
|
||||
SEC_TONE_ON,
|
||||
SEC_TONE_OFF
|
||||
} fe_sec_tone_mode_t;
|
||||
|
||||
typedef enum fe_sec_voltage {
|
||||
SEC_VOLTAGE_13,
|
||||
SEC_VOLTAGE_18,
|
||||
SEC_VOLTAGE_OFF
|
||||
} fe_sec_voltage_t;
|
||||
|
||||
typedef enum fe_sec_mini_cmd {
|
||||
SEC_MINI_A,
|
||||
SEC_MINI_B
|
||||
} fe_sec_mini_cmd_t;
|
||||
|
||||
struct dvb_diseqc_master_cmd {
|
||||
unsigned char msg [6]; /* { framing, address, command, data [3] } */
|
||||
unsigned char msg_len; /* valid values are 3...6 */
|
||||
};
|
||||
|
||||
typedef enum fe_type {
|
||||
FE_QPSK,
|
||||
FE_QAM,
|
||||
FE_OFDM,
|
||||
FE_ATSC
|
||||
} fe_type_t;
|
||||
|
||||
struct dvb_frontend_info {
|
||||
// char name[128];
|
||||
fe_type_t type;
|
||||
#if 0
|
||||
__u32 frequency_min;
|
||||
__u32 frequency_max;
|
||||
__u32 frequency_stepsize;
|
||||
__u32 frequency_tolerance;
|
||||
__u32 symbol_rate_min;
|
||||
__u32 symbol_rate_max;
|
||||
__u32 symbol_rate_tolerance; /* ppm */
|
||||
__u32 notifier_delay; /* DEPRECATED */
|
||||
fe_caps_t caps;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct dvb_frontend_event {
|
||||
fe_status_t status;
|
||||
tunersetup parameters;
|
||||
};
|
||||
|
||||
#ifdef _DVBFRONTEND_H_
|
||||
#error _DVBFRONTEND_H_ included
|
||||
#endif
|
||||
|
||||
#endif /* __td_frontend_compat_h__ */
|
@@ -1,93 +0,0 @@
|
||||
/*
|
||||
* compatibility stuff for conversion of Tripledragon API values to DVB API
|
||||
* and vice versa
|
||||
*
|
||||
* (C) 2009 Stefan Seyfried
|
||||
*
|
||||
* Released under the GPL V2.
|
||||
*/
|
||||
|
||||
#ifndef _td_value_compat_
|
||||
#define _td_value_compat_
|
||||
|
||||
#undef FE_GET_INFO
|
||||
#undef FE_READ_BER
|
||||
#undef FE_READ_SIGNAL_STRENGTH
|
||||
#undef FE_READ_SNR
|
||||
#undef FE_READ_UNCORRECTED_BLOCKS
|
||||
#undef FE_GET_EVENT
|
||||
#undef FE_READ_STATUS
|
||||
#undef FE_SET_PROPERTY
|
||||
#undef FE_GET_EVENT
|
||||
#undef FE_GET_EVENT
|
||||
#undef FE_SET_PROPERTY
|
||||
#undef FE_SET_TONE
|
||||
#undef FE_ENABLE_HIGH_LNB_VOLTAGE
|
||||
#undef FE_SET_VOLTAGE
|
||||
#undef FE_DISEQC_SEND_MASTER_CMD
|
||||
#undef FE_DISEQC_SEND_BURST
|
||||
/* hack, linux/dvb/frontend.h already defines fe_status */
|
||||
#define fe_status td_fe_status
|
||||
#define fe_status_t td_fe_status_t
|
||||
#define FE_HAS_SIGNAL TD_FE_HAS_SIGNAL
|
||||
#define FE_HAS_CARRIER TD_FE_HAS_CARRIER
|
||||
#define FE_HAS_VITERBI TD_FE_HAS_VITERBI
|
||||
#define FE_HAS_SYNC TD_FE_HAS_SYNC
|
||||
#define FE_HAS_LOCK TD_FE_HAS_LOCK
|
||||
#define FE_TIMEDOUT TD_FE_TIMEDOUT
|
||||
#define FE_REINIT TD_FE_REINIT
|
||||
#include <tdtuner/tuner_inf.h>
|
||||
#undef fe_status
|
||||
#undef fe_status_t
|
||||
#undef FE_HAS_SIGNAL
|
||||
#undef FE_HAS_CARRIER
|
||||
#undef FE_HAS_VITERBI
|
||||
#undef FE_HAS_SYNC
|
||||
#undef FE_HAS_LOCK
|
||||
#undef FE_TIMEDOUT
|
||||
#undef FE_REINIT
|
||||
enum td_code_rate {
|
||||
TD_FEC_AUTO = 0,
|
||||
TD_FEC_1_2,
|
||||
TD_FEC_2_3,
|
||||
TD_FEC_3_4,
|
||||
TD_FEC_5_6,
|
||||
TD_FEC_7_8
|
||||
};
|
||||
|
||||
static inline unsigned int dvbfec2tdfec(fe_code_rate_t fec)
|
||||
{
|
||||
switch (fec) {
|
||||
case FEC_1_2: // FEC_1_2 ... FEC_3_4 are equal to TD_FEC_1_2 ... TD_FEC_3_4
|
||||
case FEC_2_3:
|
||||
case FEC_3_4:
|
||||
return (unsigned int)fec;
|
||||
case FEC_5_6:
|
||||
return TD_FEC_5_6;
|
||||
case FEC_7_8:
|
||||
return TD_FEC_7_8;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return TD_FEC_AUTO;
|
||||
}
|
||||
|
||||
static inline fe_code_rate_t tdfec2dvbfec(unsigned int tdfec)
|
||||
{
|
||||
switch (tdfec)
|
||||
{
|
||||
case TD_FEC_1_2:
|
||||
case TD_FEC_2_3:
|
||||
case TD_FEC_3_4:
|
||||
return (fe_code_rate_t)tdfec;
|
||||
case TD_FEC_5_6:
|
||||
return FEC_5_6;
|
||||
case TD_FEC_7_8:
|
||||
return FEC_7_8;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return FEC_AUTO;
|
||||
}
|
||||
|
||||
#endif /* _td_value_compat_ */
|
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* compatibility stuff for Tripledragon video API
|
||||
*
|
||||
* (C) 2009 Stefan Seyfried
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef __td_video_compat_h__
|
||||
#define __td_video_compat_h__
|
||||
|
||||
#include <vid/vid_inf.h>
|
||||
// types
|
||||
#define video_format_t vidDispSize_t
|
||||
#define video_displayformat_t vidDispMode_t
|
||||
typedef enum {
|
||||
VIDEO_SOURCE_DEMUX = VID_SOURCE_DEMUX,
|
||||
VIDEO_SOURCE_MEMORY = VID_SOURCE_MEMORY
|
||||
} video_stream_source_t;
|
||||
typedef enum {
|
||||
VIDEO_STOPPED, /* Video is stopped */
|
||||
VIDEO_PLAYING, /* Video is currently playing */
|
||||
VIDEO_FREEZED /* Video is freezed */
|
||||
} video_play_state_t;
|
||||
//#define video_play_state_t vidState_t
|
||||
// ioctls
|
||||
#define VIDEO_SET_SYSTEM MPEG_VID_SET_DISPFMT
|
||||
#define VIDEO_SET_FORMAT MPEG_VID_SET_DISPSIZE
|
||||
#define VIDEO_SET_DISPLAY_FORMAT MPEG_VID_SET_DISPMODE
|
||||
#define VIDEO_SELECT_SOURCE MPEG_VID_SELECT_SOURCE
|
||||
#define VIDEO_PLAY MPEG_VID_PLAY
|
||||
#define VIDEO_STOP MPEG_VID_STOP
|
||||
#define VIDEO_SET_BLANK MPEG_VID_SET_BLANK
|
||||
|
||||
#endif /* __td_video_compat_h__ */
|
@@ -426,6 +426,8 @@ void cVideo::SetVideoMode(analog_mode_t mode)
|
||||
void cVideo::ShowPicture(const char * fname, const char *_destname)
|
||||
{
|
||||
lt_debug("%s(%s)\n", __func__, fname);
|
||||
static const unsigned char pes_header[] = { 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x80, 0x00, 0x00 };
|
||||
static const unsigned char seq_end[] = { 0x00, 0x00, 0x01, 0xB7 };
|
||||
char destname[512];
|
||||
char cmd[512];
|
||||
char *p;
|
||||
@@ -444,7 +446,7 @@ void cVideo::ShowPicture(const char * fname, const char *_destname)
|
||||
if (_destname)
|
||||
strncpy(destname, _destname, sizeof(destname));
|
||||
else {
|
||||
strcpy(destname, "/var/cache");
|
||||
strcpy(destname, "/tmp/cache");
|
||||
if (stat(fname, &st2))
|
||||
{
|
||||
lt_info("%s: could not stat %s (%m)\n", __func__, fname);
|
||||
@@ -456,7 +458,7 @@ void cVideo::ShowPicture(const char * fname, const char *_destname)
|
||||
build that filename first...
|
||||
TODO: this could cause name clashes, use a hashing function instead... */
|
||||
strcat(destname, fname);
|
||||
p = &destname[strlen("/var/cache/")];
|
||||
p = &destname[strlen("/tmp/cache/")];
|
||||
while ((p = strchr(p, '/')) != NULL)
|
||||
*p = '.';
|
||||
strcat(destname, ".m2v");
|
||||
@@ -468,7 +470,7 @@ void cVideo::ShowPicture(const char * fname, const char *_destname)
|
||||
u.actime = time(NULL);
|
||||
u.modtime = st2.st_mtime;
|
||||
/* it does not exist or has a different date, so call ffmpeg... */
|
||||
sprintf(cmd, "ffmpeg -y -f mjpeg -i '%s' -s 1280x720 '%s' </dev/null",
|
||||
sprintf(cmd, "ffmpeg -y -f mjpeg -i '%s' -s 1280x720 -aspect 16:9 '%s' </dev/null",
|
||||
fname, destname);
|
||||
system(cmd); /* TODO: use libavcodec to directly convert it */
|
||||
utime(destname, &u);
|
||||
@@ -491,17 +493,30 @@ void cVideo::ShowPicture(const char * fname, const char *_destname)
|
||||
|
||||
if (ioctl(fd, VIDEO_SET_FORMAT, VIDEO_FORMAT_16_9) < 0)
|
||||
lt_info("%s: VIDEO_SET_FORMAT failed (%m)\n", __func__);
|
||||
char *iframe = (char *)malloc(st.st_size);
|
||||
bool seq_end_avail = false;
|
||||
size_t pos=0;
|
||||
unsigned char *iframe = (unsigned char *)malloc((st.st_size < 8192) ? 8192 : st.st_size);
|
||||
if (! iframe)
|
||||
{
|
||||
lt_info("%s: malloc failed (%m)\n", __func__);
|
||||
goto out;
|
||||
}
|
||||
read(mfd, iframe, st.st_size);
|
||||
fop(ioctl, VIDEO_PLAY);
|
||||
fop(ioctl, VIDEO_CONTINUE);
|
||||
video_still_picture sp = { iframe, st.st_size };
|
||||
fop(ioctl, VIDEO_STILLPICTURE, &sp);
|
||||
ioctl(fd, VIDEO_SELECT_SOURCE, VIDEO_SOURCE_MEMORY);
|
||||
ioctl(fd, VIDEO_PLAY);
|
||||
ioctl(fd, VIDEO_CONTINUE);
|
||||
ioctl(fd, VIDEO_CLEAR_BUFFER);
|
||||
while (pos <= (st.st_size-4) && !(seq_end_avail = (!iframe[pos] && !iframe[pos+1] && iframe[pos+2] == 1 && iframe[pos+3] == 0xB7)))
|
||||
++pos;
|
||||
|
||||
if ((iframe[3] >> 4) != 0xE) // no pes header
|
||||
write(fd, pes_header, sizeof(pes_header));
|
||||
write(fd, iframe, st.st_size);
|
||||
if (!seq_end_avail)
|
||||
write(fd, seq_end, sizeof(seq_end));
|
||||
memset(iframe, 0, 8192);
|
||||
write(fd, iframe, 8192);
|
||||
ioctl(fd, VIDEO_SELECT_SOURCE, VIDEO_SOURCE_DEMUX);
|
||||
free(iframe);
|
||||
}
|
||||
out:
|
||||
|
@@ -63,7 +63,7 @@ typedef enum {
|
||||
DISPLAY_AR_14_9,
|
||||
DISPLAY_AR_16_9,
|
||||
DISPLAY_AR_20_9,
|
||||
DISPLAY_AR_RAW,
|
||||
DISPLAY_AR_RAW
|
||||
} DISPLAY_AR;
|
||||
|
||||
typedef enum {
|
||||
|
@@ -6,6 +6,7 @@ AM_CPPFLAGS = \
|
||||
|
||||
AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing
|
||||
AM_LDFLAGS = \
|
||||
-lrt \
|
||||
@DIRECTFB_LIBS@
|
||||
|
||||
libtriple_la_SOURCES = \
|
||||
|
@@ -1,23 +0,0 @@
|
||||
#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_
|
||||
|
Reference in New Issue
Block a user