1#ifndef ATSC_PLF_FRONTEND_HWCONTROL_H_
2#define ATSC_PLF_FRONTEND_HWCONTROL_H_
24#define FRONTEND_MODE_ATSC_10 0
29#define FRONTEND_MODE_ATSC_30 1
34#define FRONTEND_MAX_DEVICES 2
39typedef void(*DataCallback)(
void *pParentInst,int32_t iPacketType,
40 int32_t iPlpID,uint8_t *pData,
41 int32_t iLen, uint32_t iHdrLen);
89 int32_t SetCallback(
void *pParent,DataCallback dataCB);
97 int32_t GetStatus(int32_t *pSnr,int32_t *pRssi, int32_t *pEas,int32_t *pLock);
105 int32_t SetProperties(int32_t iMode,uint32_t iFreq,int32_t iBandwidth, int32_t iPlp);
113 int32_t GetProperty(int32_t *pMode,uint32_t *pFreq,
int *pBandwidth, int32_t *pPlp);
120#define FRONTEND_TRANS_SIZE (65536)
125#define FRONTEND_ARRAY_SIZE 128
130#define FRONTEND_MAX_ALP_DATA_SIZE 2048
135#define FRONTEND_DATA_BUFFER_SIZE (188*170)
347int32_t
ProcessTS(
unsigned char * pDataBuf, int32_t iLen);
Definition atsc_plf_frontend_hwcontrol.h:49
pthread_mutex_t mCaptureMutex
Definition atsc_plf_frontend_hwcontrol.h:138
int32_t m_CurPlp
Definition atsc_plf_frontend_hwcontrol.h:178
uint8_t * m_pAlpData
Definition atsc_plf_frontend_hwcontrol.h:187
static void * DataReadInput(void *a_pParam)
To get the data from driver frontend via CaptureThreadHandler().
int32_t m_BitCount
Definition atsc_plf_frontend_hwcontrol.h:179
int32_t StopInput(void)
To Stop the demux.
int32_t SendData(sFeHw_t *pHan)
Read the data from driver frontend and provide the data for formation of TS,ALP.
int32_t mAvgBitrate
Definition atsc_plf_frontend_hwcontrol.h:193
int32_t ProcessInput(unsigned char *pTsData)
Process the received input data of TS and provide the data for ALP via ProcessALP() by calculating th...
int32_t m_RecvState
Definition atsc_plf_frontend_hwcontrol.h:182
~CFeHwCtrl()
Stop the demux and close frontend. And free the allocated memory for ALP,Frontend.
int32_t m_Mode
Definition atsc_plf_frontend_hwcontrol.h:176
void SetByteAlign(void)
To adjust the m_BitCount member to ensure it is aligned to the nearest byte boundary.
int32_t SetFrontendParams(sFeHw_t *pHan)
To set the properties for frontend to driver.
uint8_t * m_pRemainData
Definition atsc_plf_frontend_hwcontrol.h:190
int32_t StopDemux(sFeHw_t *pHan)
To stop the PES filter demux.
int32_t mBitrate
Definition atsc_plf_frontend_hwcontrol.h:192
int32_t m_SyncPoint
Definition atsc_plf_frontend_hwcontrol.h:183
int32_t CloseFrontend(sFeHw_t *pHan)
To close the frontend and demux handle.
sFeHw_t hDevice
Definition atsc_plf_frontend_hwcontrol.h:171
void DataInit(unsigned char *pData)
Assign the INIT ALP data to the param m_pData.
void ThreadCleanUp(void *pCleanHandle)
To close the Frontend.
uint8_t * m_pInputBuf
Definition atsc_plf_frontend_hwcontrol.h:189
int32_t ProcessTS(unsigned char *pDataBuf, int32_t iLen)
Process the sync byte of TS data and passed the data as remaining data for ALP formation via ProcessI...
uint32_t GetData(int32_t iBitSize)
Calculated and return the data length represented in bit calc.
void * CaptureThreadHandler(void)
To get the data from driver frontend via SendData().
DataCallback pCallbackHandler
Definition atsc_plf_frontend_hwcontrol.h:174
uint8_t * m_pResData
Definition atsc_plf_frontend_hwcontrol.h:188
void SkipData(int iBitCount)
Skip the data based on m_BitCount which is used in GetData().
int32_t m_TSRemain
Definition atsc_plf_frontend_hwcontrol.h:181
pthread_t mCaptureThread
Definition atsc_plf_frontend_hwcontrol.h:137
void * mpParent
Definition atsc_plf_frontend_hwcontrol.h:172
int32_t StartInput(void)
To Start the demux for collecting the data.
int32_t m_State
Definition atsc_plf_frontend_hwcontrol.h:177
int32_t StartDemux(sFeHw_t *pHan)
To start the PES filter with immediate start to collect the data after tuner lock.
int32_t ProcessAlpData(unsigned char *pDataBuf, int32_t iLen)
Parsed the ALP data based on the header formation and passed the data via callback(pCallbackHandler).
void CancelReaderThread(sFeHw_t *pHan)
To close the Frontend.
int32_t InitFrontend(sFeHw_t *pHan)
To Open the driver API - Frontend.
int32_t m_CurIndex
Definition atsc_plf_frontend_hwcontrol.h:180
int32_t m_AlpRemain
Definition atsc_plf_frontend_hwcontrol.h:184
uint8_t * m_pData
Definition atsc_plf_frontend_hwcontrol.h:186
void DataDeInit(void)
Set the m_BitCount as 0.
uint32_t GetBitCount(void)
Get the m_BitCount value for process the get/skip data.
void ProcessALP(unsigned char *pDataBuf, int32_t iLen)
Passed the data for ALP via ProcessAlpData() for the received length.
int32_t CheckFrontend(sFeHw_t *pHan, sFeHwStatus_t *pTunerProp)
To check the frontend status such as Signal strength,Frequency, Lock status,SNR,Bitrate.
Definition atsc_plf_frontend_hwcontrol.h:145
int32_t iRssi
Definition atsc_plf_frontend_hwcontrol.h:148
bool bLock
Definition atsc_plf_frontend_hwcontrol.h:146
int32_t iSnr
Definition atsc_plf_frontend_hwcontrol.h:147
int32_t iEas
Definition atsc_plf_frontend_hwcontrol.h:149
Definition atsc_plf_frontend_hwcontrol.h:156
int32_t iIsInitialised
Definition atsc_plf_frontend_hwcontrol.h:167
int32_t iIsRunning
Definition atsc_plf_frontend_hwcontrol.h:166
pollfd stPfd
Definition atsc_plf_frontend_hwcontrol.h:168
int32_t iSystem
Definition atsc_plf_frontend_hwcontrol.h:161
int32_t iFreq
Definition atsc_plf_frontend_hwcontrol.h:158
int32_t iDemuxFd
Definition atsc_plf_frontend_hwcontrol.h:162
int32_t iIsLocked
Definition atsc_plf_frontend_hwcontrol.h:163
int32_t iDevId
Definition atsc_plf_frontend_hwcontrol.h:160
int32_t iPlpid
Definition atsc_plf_frontend_hwcontrol.h:159
int32_t iBandwidth
Definition atsc_plf_frontend_hwcontrol.h:165
int32_t iFd
Definition atsc_plf_frontend_hwcontrol.h:157
int32_t iIsOpened
Definition atsc_plf_frontend_hwcontrol.h:164