123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- /******************************************************************************/
- /**
- *
- * \file mid_dvbmon.h
- *
- * \brief Dvb monitoring controll
- *
- * \note Copyright (c) 2008 Sunplus Technology Co., Ltd. \n
- * All rights reserved.
- *
- * \author Unknow
- *
- ******************************************************************************/
- #ifndef _DVBMONITOR_H
- #define _DVBMONITOR_H
- #include <types.h>
- #include "mid_common.h"
- //BRAD090113 : command for global data
- #define DVB_MON_CMD_RESET_COUNTER 1 ///<monitor command reset counter
- #define MID_DVBMON_THREAD_PERIOD_IDLE 100 ///< 100ms //JennyLee 20100414 move here
- /**
- * \brief Signal state enumeration
- */
- typedef enum {
- SIGNAL_BAD = 1<<0, ///<express the signal is bad
- SIGNAL_GOOD = 1<<1, ///<express the signal is good
- SIGNAL_RECONNECT = 1<<2,
- SIGNAL_BAD_CHECKING = 1<<3,
- SIGNAL_GOOD_CHECKING = 1<<4,
- SIGNAL_DEMUX_HAS_DATA = 1<<5,
- SIGNAL_DEMUX_NO_DATA = 1<<6,
- SIGNAL_DEMUX_INVALID_DATA = 1<<7,
- SIGNAL_SERVICE_NOT_AVAILABLE= 1<<8,
- SIGNAL_MONITOR_RESET = 1<<9,
- SIGNAL_DEMUX_UNSUPPORT_DATA = 1<<10,
- SIGNAL_STATUS_INVALID = 1<<11,
- }SINGAL_STATE;
- /**
- * \brief Scart I/O state enumeration
- */
- typedef enum { //maolin.yang 2010-2-24
- SCART_IN, ///<express the scart is in
- SCART_OUT, ///<express the scart is out
- }SCART_STATE;
- /**
- * \brief monitor callback function pointer
- */
- typedef int (*iDvbMonCallBack)(void *data);
- /**
- * \brief monitor listener callback function
- */
- typedef struct _mid_dvbmon_callbacks
- {
- iDvbMonCallBack pfMonSignalCallbk; ///<signal callback function
- iDvbMonCallBack pfMonProgStateCallbk; ///<program state callback function
- }Mid_DvbMonCallbks_t; ///<callback function
- /**
- * \fn DRV_Status_t MID_DvbMonInit(Mid_DvbMonCallbks_t *pstDvbMonCallbks);
- * \brief Create semaphore. initiate signal, program state, and scartm loop monitoring listener.
- * \param *pstDvbMonCallbks : callback function for initiate signal, program state, and scartm loop monitoring listener.
- * \return DRV_SUCCESS if initiated success.\n
- * DRV_WARN_INITED if already initiated.\n
- * Other states if initiated fail.
- */
- MID_Status_t MID_DvbMonInit(Mid_DvbMonCallbks_t * pstDvbMonCallbks);
- /**
- * \fn void MID_DvbMonUninit(void);
- * \brief Release semaphore and memory.
- */
- void MID_DvbMonUninit(void);
- /**
- * \fn DRV_Status_t MID_DvbMonStartEx(LIVE_INPUT_UNIT InputUnit);
- * \brief Start monitor thread according Monitor Unit.
- * \param InputUnit : monitor unit.
- * \return DRV_SUCCESS if monitor start success.\n
- * DRV_ERR_FAILURE if monitor was not initiated or thread was activated failure.
- */
- MID_Status_t MID_DvbMonStart(void);
- MID_Status_t MID_DvbMonStartEx(LIVE_INPUT_UNIT InputUnit);
- /**
- * \fn DRV_Status_t MID_DvbMonStop(Boolean bExit);
- * \brief Stop monitor thread.
- * \param bExit : thread will exit if true, idle on the contrary.
- * \return DRV_SUCCESS if monitor stop success.\n
- * DRV_ERR_FAILURE if monitor was not initiated.\n
- * DRV_WARN_NO_ACTION if thread was not existed.
- */
- MID_Status_t MID_DvbMonStop(bool bExit);
- /**
- * \fn DRV_Status_t MID_DvbMonStopEx(LIVE_INPUT_UNIT InputUnit, Boolean bExit);
- * \brief Stop monitor thread according Monitor Unit.
- * \param InputUnit : monitor unit.
- * \param bExit : thread will exit if true, idle on the contrary.
- * \return DRV_SUCCESS if monitor stop success.\n
- * DRV_ERR_FAILURE if monitor was not initiated.\n
- * DRV_WARN_NO_ACTION if thread was not existed.
- */
- MID_Status_t MID_DvbMonStopEx(LIVE_INPUT_UNIT InputUnit, bool bExit);
- /**
- * \fn Boolean MID_DvbMonReceiveStopCmd(void);
- * \brief Verify monitor thread command.
- * \return FALSE if thread command is DVB_MONITOR_THREAD_CMD_NONE.\n
- * TRUE if thread command is the other type.
- */
- bool MID_DvbMonReceiveStopCmd(void);
- bool MID_DvbMonIsRunning(void);
- INT32 MID_DvbMonAddListeners(LIVE_INPUT_UNIT InputUnit, Mid_DvbMonCallbks_t * pstDvbMonCallbks);
- INT32 MID_DvbMonRemoveListeners(void);
- #endif // #ifndef _DVBMONITOR_H
|