neutrino-apollo: changes for apollo uclibc.

This commit is contained in:
[CST] Bas
2012-07-09 11:58:15 +08:00
parent 6b6a9e37fb
commit cf878686ba
5 changed files with 46 additions and 22 deletions

View File

@@ -71,7 +71,7 @@ typedef struct cs_audio_caps {
class cAudio { class cAudio {
private: private:
CS_AUDIO_PDATA *privateData; CS_AUDIO_PDATA *privateData;
unsigned int cEncodedDataOnSPDIF, cEncodedDataOnHDMI; //unsigned int cEncodedDataOnSPDIF, cEncodedDataOnHDMI;
bool muted; bool muted;
AUDIO_FORMAT streamType; AUDIO_FORMAT streamType;
@@ -148,6 +148,7 @@ public:
bool GetHdmiAudioCaps(cs_audio_caps_t &caps); bool GetHdmiAudioCaps(cs_audio_caps_t &caps);
bool IsHdmiAudioFormatSupported(HDMI_AUDIO_FORMAT format); bool IsHdmiAudioFormatSupported(HDMI_AUDIO_FORMAT format);
void SetHdmiDD(HDMI_ENCODED_MODE type); void SetHdmiDD(HDMI_ENCODED_MODE type);
bool IsHdmiDTSSupported(void);
}; };
#endif //__AUDIO_CS_H_ #endif //__AUDIO_CS_H_

View File

@@ -5,6 +5,7 @@
/* */ /* */
/* (C) 2010 CoolStream International */ /* (C) 2010 CoolStream International */
/* */ /* */
/* $Id:: $ */
/*******************************************************************************/ /*******************************************************************************/
#ifndef __CS_API_H_ #ifndef __CS_API_H_
#define __CS_API_H_ #define __CS_API_H_
@@ -30,7 +31,7 @@ enum CS_LOG_MODULE {
CS_LOG_POWER_CLK, CS_LOG_POWER_CLK,
CS_LOG_MEM, CS_LOG_MEM,
CS_LOG_API, CS_LOG_API,
CS_LOG_CA CS_LOG_CA,
}; };
// Initialization // Initialization
@@ -58,6 +59,8 @@ void cs_log_module_message(enum CS_LOG_MODULE module, const char *fmt, ...);
// TS Routing // TS Routing
unsigned int cs_get_ts_output(void); unsigned int cs_get_ts_output(void);
int cs_set_ts_output(unsigned int port); int cs_set_ts_output(unsigned int port);
int cs_set_ts_ci_clock(unsigned int speed);
int cs_get_ts_ci_clock(unsigned int *speed);
int cs_set_ts_config(unsigned int port, tsrouter_hsdp_config_t *hsdp_config); int cs_set_ts_config(unsigned int port, tsrouter_hsdp_config_t *hsdp_config);
int cs_get_ts_config(unsigned int port, tsrouter_hsdp_config_t *hsdp_config); int cs_get_ts_config(unsigned int port, tsrouter_hsdp_config_t *hsdp_config);

View File

@@ -11,6 +11,8 @@
#define __DEMUX_CS_H_ #define __DEMUX_CS_H_
#include <string> #include <string>
#include <video_cs.h>
#include "cs_types.h" #include "cs_types.h"
#define DEMUX_POLL_TIMEOUT 0 // timeout in ms #define DEMUX_POLL_TIMEOUT 0 // timeout in ms
@@ -54,6 +56,8 @@ public:
bool Start(bool record = false); bool Start(bool record = false);
bool Stop(void); bool Stop(void);
int Read(unsigned char *buff, int len, int Timeout = 0); int Read(unsigned char *buff, int len, int Timeout = 0);
bool SetVideoFormat(VIDEO_FORMAT VideoFormat);
bool SetSource(int source); bool SetSource(int source);
bool sectionFilter(unsigned short Pid, const unsigned char * const Tid, const unsigned char * const Mask, int len, int Timeout = DEMUX_POLL_TIMEOUT, const unsigned char * const nMask = NULL); bool sectionFilter(unsigned short Pid, const unsigned char * const Tid, const unsigned char * const Mask, int len, int Timeout = DEMUX_POLL_TIMEOUT, const unsigned char * const nMask = NULL);
@@ -64,7 +68,7 @@ public:
void SetSyncMode(AVSYNC_TYPE SyncMode); void SetSyncMode(AVSYNC_TYPE SyncMode);
void *getBuffer(void); void *getBuffer(void);
void *getChannel(void); void *getChannel(void);
void getSTC(int64_t *STC); void getSTC(s64 *STC);
DMX_CHANNEL_TYPE getChannelType(void) { return type; }; DMX_CHANNEL_TYPE getChannelType(void) { return type; };
int getUnit(void) { return unit; }; int getUnit(void) { return unit; };

View File

@@ -5,6 +5,7 @@
/* */ /* */
/* (C) 2008 CoolStream International */ /* (C) 2008 CoolStream International */
/* */ /* */
/* $Id:: $ */
/*******************************************************************************/ /*******************************************************************************/
#ifndef __VIDEO_CS_H_ #ifndef __VIDEO_CS_H_
#define __VIDEO_CS_H_ #define __VIDEO_CS_H_
@@ -30,13 +31,28 @@ typedef enum {
ANALOG_SCART_MASK = 0x10 ANALOG_SCART_MASK = 0x10
} analog_mode_t; } analog_mode_t;
typedef enum { typedef enum
VIDEO_FORMAT_MPEG2 = 0, {
VIDEO_FORMAT_MPEG4, VIDEO_FORMAT_MPEG2 = 0,
VIDEO_FORMAT_VC1, VIDEO_FORMAT_MPEG4, /* H264 */
VIDEO_FORMAT_JPEG, VIDEO_FORMAT_VC1,
VIDEO_FORMAT_GIF, VIDEO_FORMAT_JPEG,
VIDEO_FORMAT_PNG VIDEO_FORMAT_GIF,
VIDEO_FORMAT_PNG,
VIDEO_FORMAT_DIVX,/* DIVX 3.11 */
VIDEO_FORMAT_MPEG4PART2,/* MPEG4 SVH, MPEG4 SP, MPEG4 ASP, DIVX4,5,6 */
VIDEO_FORMAT_REALVIDEO8,
VIDEO_FORMAT_REALVIDEO9,
VIDEO_FORMAT_ON2_VP6,
VIDEO_FORMAT_ON2_VP8,
VIDEO_FORMAT_SORENSON_SPARK,
VIDEO_FORMAT_H263,
VIDEO_FORMAT_H263_ENCODER,
VIDEO_FORMAT_H264_ENCODER,
VIDEO_FORMAT_MPEG4PART2_ENCODER,
VIDEO_FORMAT_AVS,
VIDEO_FORMAT_VIP656,
VIDEO_FORMAT_UNSUPPORTED
} VIDEO_FORMAT; } VIDEO_FORMAT;
typedef enum { typedef enum {
@@ -125,7 +141,7 @@ typedef enum
class cVideo { class cVideo {
private: private:
CS_VIDEO_PDATA *privateData; CS_VIDEO_PDATA *privateData;
VIDEO_FORMAT StreamType; u32 streamType;
VIDEO_DEFINITION VideoDefinition; VIDEO_DEFINITION VideoDefinition;
DISPLAY_AR DisplayAR; DISPLAY_AR DisplayAR;
VIDEO_PLAY_MODE playMode; VIDEO_PLAY_MODE playMode;
@@ -136,7 +152,7 @@ private:
VIDEO_FRAME_RATE FrameRate; VIDEO_FRAME_RATE FrameRate;
VIDEO_HDMI_CEC_MODE hdmiCECMode; VIDEO_HDMI_CEC_MODE hdmiCECMode;
bool Interlaced; bool Interlaced;
unsigned int uDRMDisplayDelay; unsigned int uVPPDisplayDelay;
unsigned int uVideoPTSDelay; unsigned int uVideoPTSDelay;
int StcPts; int StcPts;
bool started; bool started;
@@ -146,7 +162,7 @@ private:
bool auto_format; bool auto_format;
int uFormatIndex; int uFormatIndex;
bool vbi_started; bool vbi_started;
bool receivedDRMDelay; bool receivedVPPDelay;
bool receivedVideoDelay; bool receivedVideoDelay;
int cfd; // control driver fd int cfd; // control driver fd
analog_mode_t analog_mode_cinch; analog_mode_t analog_mode_cinch;
@@ -160,7 +176,7 @@ public:
cVideo(int mode, void * hChannel, void * hBuffer); cVideo(int mode, void * hChannel, void * hBuffer);
~cVideo(void); ~cVideo(void);
void * GetDRM(void); void * GetVPP(void);
void * GetTVEnc(); void * GetTVEnc();
void * GetTVEncSD(); void * GetTVEncSD();
void * GetHandle(); void * GetHandle();
@@ -178,7 +194,7 @@ public:
/* stream source */ /* stream source */
int getSource(void); int getSource(void);
int setSource(void); int setSource(void);
int GetStreamType(void) { return StreamType; }; int GetStreamType(void);
/* blank on freeze */ /* blank on freeze */
int getBlank(void); int getBlank(void);
@@ -186,10 +202,10 @@ public:
/* get play state */ /* get play state */
int getPlayState(void); int getPlayState(void);
void SetDRMDelay(unsigned int delay) { uDRMDisplayDelay = delay;}; void SetVPPDelay(unsigned int delay) { uVPPDisplayDelay = delay;};
void SetVideoDelay(unsigned int delay) { uVideoPTSDelay = delay;}; void SetVideoDelay(unsigned int delay) { uVideoPTSDelay = delay;};
/* Notification handlers */ /* Notification handlers */
void HandleDRMMessage(int Event, void *pData); void HandleVPPMessage(int Event, void *pData);
void HandleVideoMessage(void * hHandle, int Event, void *pData); void HandleVideoMessage(void * hHandle, int Event, void *pData);
void HandleEncoderMessage(void *hHandle, int Event, void *pData); void HandleEncoderMessage(void *hHandle, int Event, void *pData);
VIDEO_DEFINITION GetVideoDef(void) { return VideoDefinition; } VIDEO_DEFINITION GetVideoDef(void) { return VideoDefinition; }
@@ -216,9 +232,9 @@ public:
void Standby(bool bOn); void Standby(bool bOn);
void Pig(int x, int y, int w, int h, int osd_w = 1064, int osd_h = 600); void Pig(int x, int y, int w, int h, int osd_w = 1064, int osd_h = 600);
void SetControl(int num, int val); void SetControl(int num, int val);
bool ReceivedDRMDelay(void) { return receivedDRMDelay; } bool ReceivedVPPDelay(void) { return receivedVPPDelay; }
bool ReceivedVideoDelay(void) { return receivedVideoDelay; } bool ReceivedVideoDelay(void) { return receivedVideoDelay; }
void SetReceivedDRMDelay(bool Received) { receivedDRMDelay = Received; } void SetReceivedVPPDelay(bool Received) { receivedVPPDelay = Received; }
void SetReceivedVideoDelay(bool Received) { receivedVideoDelay = Received; } void SetReceivedVideoDelay(bool Received) { receivedVideoDelay = Received; }
void SetFastBlank(bool onoff); void SetFastBlank(bool onoff);
void SetTVAV(bool onoff); void SetTVAV(bool onoff);

View File

@@ -997,7 +997,7 @@ static void commandDumpStatusInformation(int /*connfd*/, char* /*data*/, const u
// resourceUsage.ru_maxrss, resourceUsage.ru_ixrss, resourceUsage.ru_idrss, resourceUsage.ru_isrss, // resourceUsage.ru_maxrss, resourceUsage.ru_ixrss, resourceUsage.ru_idrss, resourceUsage.ru_isrss,
); );
printf("%s\n", stati); printf("%s\n", stati);
malloc_stats(); malloc_stats(NULL);
return ; return ;
} }
@@ -1123,7 +1123,7 @@ static void FreeMemory()
unlockEvents(); unlockEvents();
malloc_stats(); malloc_stats(NULL);
xprintf("[sectionsd] free memory done\n"); xprintf("[sectionsd] free memory done\n");
//wakeupAll(); //FIXME should we re-start eit here ? //wakeupAll(); //FIXME should we re-start eit here ?
} }
@@ -1907,7 +1907,7 @@ static void print_meminfo(void)
if (!sections_debug) if (!sections_debug)
return; return;
malloc_stats(); malloc_stats(NULL);
} }
//--------------------------------------------------------------------- //---------------------------------------------------------------------