From 823c0063566497d560ca26eea8e899346ca369c4 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 28 Jul 2012 22:51:29 +0200 Subject: [PATCH 1/3] correctly declare AVSYNC_TYPE Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/84ee47fd7f6c146a676bd5ee02ae29936a80f216 Author: Stefan Seyfried Date: 2012-07-28 (Sat, 28 Jul 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- azbox/audio_lib.h | 3 ++- azbox/dmx_lib.h | 2 +- azbox/video_lib.h | 2 +- common/cs_types.h | 23 +++++++++++++++++++++++ libspark/audio_lib.h | 2 +- libspark/dmx_lib.h | 2 +- libspark/video_lib.h | 2 +- libtriple/audio_td.h | 2 +- libtriple/dmx_td.h | 2 +- libtriple/video_td.h | 3 +-- 10 files changed, 33 insertions(+), 10 deletions(-) create mode 100644 common/cs_types.h diff --git a/azbox/audio_lib.h b/azbox/audio_lib.h index de27f60..871060d 100644 --- a/azbox/audio_lib.h +++ b/azbox/audio_lib.h @@ -3,6 +3,8 @@ #ifndef _AUDIO_LIB_H_ #define _AUDIO_LIB_H_ +#include "../common/cs_types.h" + typedef enum { AUDIO_SYNC_WITH_PTS, @@ -76,7 +78,6 @@ class cAudio int Stop(void); bool Pause(bool Pcm = true); void SetStreamType(AUDIO_FORMAT type); -#define AVSYNC_TYPE int void SetSyncMode(AVSYNC_TYPE Mode); /* select channels */ diff --git a/azbox/dmx_lib.h b/azbox/dmx_lib.h index 12f5206..4c32d6c 100644 --- a/azbox/dmx_lib.h +++ b/azbox/dmx_lib.h @@ -6,6 +6,7 @@ #include #include #include +#include "../common/cs_types.h" typedef enum { @@ -46,7 +47,6 @@ class cDemux int Read(unsigned char *buff, int len, int Timeout = 0); bool sectionFilter(unsigned short pid, const unsigned char * const filter, const unsigned char * const mask, int len, int Timeout = 0, const unsigned char * const negmask = NULL); bool pesFilter(const unsigned short pid); -#define AVSYNC_TYPE int void SetSyncMode(AVSYNC_TYPE mode); void * getBuffer(); void * getChannel(); diff --git a/azbox/video_lib.h b/azbox/video_lib.h index cd088f0..9a44aae 100644 --- a/azbox/video_lib.h +++ b/azbox/video_lib.h @@ -2,6 +2,7 @@ #define _VIDEO_TD_H #include +#include "../common/cs_types.h" typedef enum { ANALOG_SD_RGB_CINCH = 0x00, @@ -169,7 +170,6 @@ class cVideo /* set video_system */ int SetVideoSystem(int video_system, bool remember = true); int SetStreamType(VIDEO_FORMAT type); -#define AVSYNC_TYPE int void SetSyncMode(AVSYNC_TYPE mode); bool SetCECMode(VIDEO_HDMI_CEC_MODE) { return true; }; void SetCECAutoView(bool) { return; }; diff --git a/common/cs_types.h b/common/cs_types.h new file mode 100644 index 0000000..d044475 --- /dev/null +++ b/common/cs_types.h @@ -0,0 +1,23 @@ +/* pretty useless, but we don't need to work around this if + * we just copy it over... */ + +#ifndef __CS_TYPES_H_ +#define __CS_TYPES_H_ + +typedef enum +{ + AVSYNC_DISABLED, + AVSYNC_ENABLED, + AVSYNC_AUDIO_IS_MASTER +} AVSYNC_TYPE; + +typedef unsigned long long u64; +typedef unsigned int u32; +typedef unsigned short u16; +typedef unsigned char u8; +typedef signed long long s64; +typedef signed int s32; +typedef signed short s16; +typedef signed char s8; + +#endif // __CS_TYPES_H_ diff --git a/libspark/audio_lib.h b/libspark/audio_lib.h index 74dce1a..a8b5362 100644 --- a/libspark/audio_lib.h +++ b/libspark/audio_lib.h @@ -2,6 +2,7 @@ #ifndef _AUDIO_TD_H_ #define _AUDIO_TD_H_ +#include "../common/cs_types.h" typedef enum { @@ -76,7 +77,6 @@ class cAudio int Stop(void); bool Pause(bool Pcm = true); void SetStreamType(AUDIO_FORMAT type); -#define AVSYNC_TYPE int void SetSyncMode(AVSYNC_TYPE Mode); /* select channels */ diff --git a/libspark/dmx_lib.h b/libspark/dmx_lib.h index 12f5206..4c32d6c 100644 --- a/libspark/dmx_lib.h +++ b/libspark/dmx_lib.h @@ -6,6 +6,7 @@ #include #include #include +#include "../common/cs_types.h" typedef enum { @@ -46,7 +47,6 @@ class cDemux int Read(unsigned char *buff, int len, int Timeout = 0); bool sectionFilter(unsigned short pid, const unsigned char * const filter, const unsigned char * const mask, int len, int Timeout = 0, const unsigned char * const negmask = NULL); bool pesFilter(const unsigned short pid); -#define AVSYNC_TYPE int void SetSyncMode(AVSYNC_TYPE mode); void * getBuffer(); void * getChannel(); diff --git a/libspark/video_lib.h b/libspark/video_lib.h index cd088f0..9a44aae 100644 --- a/libspark/video_lib.h +++ b/libspark/video_lib.h @@ -2,6 +2,7 @@ #define _VIDEO_TD_H #include +#include "../common/cs_types.h" typedef enum { ANALOG_SD_RGB_CINCH = 0x00, @@ -169,7 +170,6 @@ class cVideo /* set video_system */ int SetVideoSystem(int video_system, bool remember = true); int SetStreamType(VIDEO_FORMAT type); -#define AVSYNC_TYPE int void SetSyncMode(AVSYNC_TYPE mode); bool SetCECMode(VIDEO_HDMI_CEC_MODE) { return true; }; void SetCECAutoView(bool) { return; }; diff --git a/libtriple/audio_td.h b/libtriple/audio_td.h index c38afef..bc320f1 100644 --- a/libtriple/audio_td.h +++ b/libtriple/audio_td.h @@ -4,6 +4,7 @@ #define _AUDIO_TD_H_ #include +#include "../common/cs_types.h" typedef enum { @@ -78,7 +79,6 @@ class cAudio int Stop(void); bool Pause(bool Pcm = true); void SetStreamType(AUDIO_FORMAT type); -#define AVSYNC_TYPE int void SetSyncMode(AVSYNC_TYPE Mode); /* select channels */ diff --git a/libtriple/dmx_td.h b/libtriple/dmx_td.h index 1eb9ba1..d2d02bd 100644 --- a/libtriple/dmx_td.h +++ b/libtriple/dmx_td.h @@ -8,6 +8,7 @@ extern "C" { #include #include } +#include "../common/cs_types.h" #if defined DMX_FILTER_SIZE #undef DMX_FILTER_SIZE #endif @@ -52,7 +53,6 @@ class cDemux int Read(unsigned char *buff, int len, int Timeout = 0); bool sectionFilter(unsigned short pid, const unsigned char * const filter, const unsigned char * const mask, int len, int Timeout = 0, const unsigned char * const negmask = NULL); bool pesFilter(const unsigned short pid); -#define AVSYNC_TYPE int void SetSyncMode(AVSYNC_TYPE mode); void * getBuffer(); void * getChannel(); diff --git a/libtriple/video_td.h b/libtriple/video_td.h index 0493880..831dc93 100644 --- a/libtriple/video_td.h +++ b/libtriple/video_td.h @@ -4,7 +4,7 @@ #include #define video_format_t vidDispSize_t //#define video_displayformat_t vidDispMode_t - +#include "../common/cs_types.h" typedef enum { ANALOG_SD_RGB_SCART = 0x00, @@ -165,7 +165,6 @@ class cVideo /* set video_system */ int SetVideoSystem(int video_system, bool remember = true); int SetStreamType(VIDEO_FORMAT type); -#define AVSYNC_TYPE int void SetSyncMode(AVSYNC_TYPE mode); bool SetCECMode(VIDEO_HDMI_CEC_MODE) { return true; }; void SetCECAutoView(bool) { return; }; From f29902e7e42ba8b6a92fa76ee1d123dffe9fca01 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 29 Jul 2012 13:06:21 +0200 Subject: [PATCH 2/3] ca.h: add dummy functions to sync up with libcoolstream libcoolstream has added the functions SendCAPMT(), GetCAIDS() and SetTSClock(). Add stubs to get compatibility. Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/3396316b8cecf7c7cae18c9d6dd7c731ea4c9c44 Author: Stefan Seyfried Date: 2012-07-29 (Sun, 29 Jul 2012) ------------------ This commit was generated by Migit --- common/ca.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/common/ca.h b/common/ca.h index 8a29e56..2c4b85f 100644 --- a/common/ca.h +++ b/common/ca.h @@ -5,8 +5,11 @@ #define __CA_LIBTRIPLE_H_ #include -/* used in cam_menu.cpp */ -typedef uint32_t u32; +#include "cs_types.h" +#include +typedef std::vector CaIdVector; +typedef std::vector::iterator CaIdVectorIterator; +typedef std::vector::const_iterator CaIdVectorConstIterator; enum CA_INIT_MASK { CA_INIT_SC = 1, @@ -79,8 +82,10 @@ 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 SendMessage(const CA_MESSAGE *Msg); void SetInitMask(enum CA_INIT_MASK InitMask); + int GetCAIDS(CaIdVector & /*Caids*/) { return 0; }; bool Start(void); void Stop(void); void Ready(bool Set); @@ -91,6 +96,7 @@ public: void MenuAnswer(enum CA_SLOT_TYPE, uint32_t Slot, uint32_t choice); void InputAnswer(enum CA_SLOT_TYPE, uint32_t Slot, uint8_t * Data, int Len); void MenuClose(enum CA_SLOT_TYPE, uint32_t Slot); + void SetTSClock(u32 /*Speed*/) { return; }; virtual ~cCA(); }; From 791c592fe18080ab9b7fb2f1b7f610e65165625b Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 29 Jul 2012 13:26:31 +0200 Subject: [PATCH 3/3] cDemux: add dummy SetSource() for coolstream compatibiliy Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/1df3d2e9461c6a9d1af4335a9ddb7c81e6d213e3 Author: Stefan Seyfried Date: 2012-07-29 (Sun, 29 Jul 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- azbox/dmx.cpp | 7 +++++++ azbox/dmx_lib.h | 1 + libspark/dmx.cpp | 7 +++++++ libspark/dmx_lib.h | 1 + libtriple/dmx_td.h | 2 ++ 5 files changed, 18 insertions(+) diff --git a/azbox/dmx.cpp b/azbox/dmx.cpp index 80d500a..5d05b2a 100644 --- a/azbox/dmx.cpp +++ b/azbox/dmx.cpp @@ -18,6 +18,7 @@ extern cVideo *videoDecoder; #define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_DEMUX, this, args) #define lt_info(args...) _lt_info(TRIPLE_DEBUG_DEMUX, this, args) +#define lt_info_c(args...) _lt_info(TRIPLE_DEBUG_DEMUX, NULL, args) #define dmx_err(_errfmt, _errstr, _revents) do { \ uint16_t _pid = (uint16_t)-1; uint16_t _f = 0;\ @@ -492,3 +493,9 @@ int cDemux::getUnit(void) anyway */ return num; } + +bool cDemux::SetSource(int unit, int source) +{ + lt_info_c("%s(%d, %d): not implemented yet\n", __func__, unit, source); + return true; +} diff --git a/azbox/dmx_lib.h b/azbox/dmx_lib.h index 4c32d6c..ffd293e 100644 --- a/azbox/dmx_lib.h +++ b/azbox/dmx_lib.h @@ -54,6 +54,7 @@ class cDemux bool addPid(unsigned short pid); void getSTC(int64_t * STC); int getUnit(void); + static bool SetSource(int unit, int source); // TD only functions int getFD(void) { return fd; }; /* needed by cPlayback class */ void removePid(unsigned short Pid); /* needed by cRecord class */ diff --git a/libspark/dmx.cpp b/libspark/dmx.cpp index bc5c0c2..7842236 100644 --- a/libspark/dmx.cpp +++ b/libspark/dmx.cpp @@ -17,6 +17,7 @@ extern cVideo *videoDecoder; #define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_DEMUX, this, args) #define lt_info(args...) _lt_info(TRIPLE_DEBUG_DEMUX, this, args) +#define lt_info_c(args...) _lt_info(TRIPLE_DEBUG_DEMUX, NULL, args) #define dmx_err(_errfmt, _errstr, _revents) do { \ uint16_t _pid = (uint16_t)-1; uint16_t _f = 0;\ @@ -549,3 +550,9 @@ int cDemux::getUnit(void) anyway */ return num; } + +bool cDemux::SetSource(int unit, int source) +{ + lt_info_c("%s(%d, %d): not implemented yet\n", __func__, unit, source); + return true; +} diff --git a/libspark/dmx_lib.h b/libspark/dmx_lib.h index 4c32d6c..ffd293e 100644 --- a/libspark/dmx_lib.h +++ b/libspark/dmx_lib.h @@ -54,6 +54,7 @@ class cDemux bool addPid(unsigned short pid); void getSTC(int64_t * STC); int getUnit(void); + static bool SetSource(int unit, int source); // TD only functions int getFD(void) { return fd; }; /* needed by cPlayback class */ void removePid(unsigned short Pid); /* needed by cRecord class */ diff --git a/libtriple/dmx_td.h b/libtriple/dmx_td.h index d2d02bd..2656ca9 100644 --- a/libtriple/dmx_td.h +++ b/libtriple/dmx_td.h @@ -60,6 +60,8 @@ class cDemux bool addPid(unsigned short pid); void getSTC(int64_t * STC); int getUnit(void); + /* tripledragon is unlikely to get a second tuner, so stub it out right here */ + static bool SetSource(int /*unit*/, int /*source*/) { return true; }; // TD only functions int getFD(void) { return fd; }; /* needed by cPlayback class */ void removePid(unsigned short Pid); /* needed by cRecord class */