mid_dvbmon.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /******************************************************************************/
  2. /**
  3. *
  4. * \file mid_dvbmon.h
  5. *
  6. * \brief Dvb monitoring controll
  7. *
  8. * \note Copyright (c) 2008 Sunplus Technology Co., Ltd. \n
  9. * All rights reserved.
  10. *
  11. * \author Unknow
  12. *
  13. ******************************************************************************/
  14. #ifndef _DVBMONITOR_H
  15. #define _DVBMONITOR_H
  16. #include <types.h>
  17. #include "mid_common.h"
  18. //BRAD090113 : command for global data
  19. #define DVB_MON_CMD_RESET_COUNTER 1 ///<monitor command reset counter
  20. #define MID_DVBMON_THREAD_PERIOD_IDLE 100 ///< 100ms //JennyLee 20100414 move here
  21. /**
  22. * \brief Signal state enumeration
  23. */
  24. typedef enum {
  25. SIGNAL_BAD = 1<<0, ///<express the signal is bad
  26. SIGNAL_GOOD = 1<<1, ///<express the signal is good
  27. SIGNAL_RECONNECT = 1<<2,
  28. SIGNAL_BAD_CHECKING = 1<<3,
  29. SIGNAL_GOOD_CHECKING = 1<<4,
  30. SIGNAL_DEMUX_HAS_DATA = 1<<5,
  31. SIGNAL_DEMUX_NO_DATA = 1<<6,
  32. SIGNAL_DEMUX_INVALID_DATA = 1<<7,
  33. SIGNAL_SERVICE_NOT_AVAILABLE= 1<<8,
  34. SIGNAL_MONITOR_RESET = 1<<9,
  35. SIGNAL_DEMUX_UNSUPPORT_DATA = 1<<10,
  36. SIGNAL_STATUS_INVALID = 1<<11,
  37. }SINGAL_STATE;
  38. /**
  39. * \brief Scart I/O state enumeration
  40. */
  41. typedef enum { //maolin.yang 2010-2-24
  42. SCART_IN, ///<express the scart is in
  43. SCART_OUT, ///<express the scart is out
  44. }SCART_STATE;
  45. /**
  46. * \brief monitor callback function pointer
  47. */
  48. typedef int (*iDvbMonCallBack)(void *data);
  49. /**
  50. * \brief monitor listener callback function
  51. */
  52. typedef struct _mid_dvbmon_callbacks
  53. {
  54. iDvbMonCallBack pfMonSignalCallbk; ///<signal callback function
  55. iDvbMonCallBack pfMonProgStateCallbk; ///<program state callback function
  56. }Mid_DvbMonCallbks_t; ///<callback function
  57. /**
  58. * \fn DRV_Status_t MID_DvbMonInit(Mid_DvbMonCallbks_t *pstDvbMonCallbks);
  59. * \brief Create semaphore. initiate signal, program state, and scartm loop monitoring listener.
  60. * \param *pstDvbMonCallbks : callback function for initiate signal, program state, and scartm loop monitoring listener.
  61. * \return DRV_SUCCESS if initiated success.\n
  62. * DRV_WARN_INITED if already initiated.\n
  63. * Other states if initiated fail.
  64. */
  65. MID_Status_t MID_DvbMonInit(Mid_DvbMonCallbks_t * pstDvbMonCallbks);
  66. /**
  67. * \fn void MID_DvbMonUninit(void);
  68. * \brief Release semaphore and memory.
  69. */
  70. void MID_DvbMonUninit(void);
  71. /**
  72. * \fn DRV_Status_t MID_DvbMonStartEx(LIVE_INPUT_UNIT InputUnit);
  73. * \brief Start monitor thread according Monitor Unit.
  74. * \param InputUnit : monitor unit.
  75. * \return DRV_SUCCESS if monitor start success.\n
  76. * DRV_ERR_FAILURE if monitor was not initiated or thread was activated failure.
  77. */
  78. MID_Status_t MID_DvbMonStart(void);
  79. MID_Status_t MID_DvbMonStartEx(LIVE_INPUT_UNIT InputUnit);
  80. /**
  81. * \fn DRV_Status_t MID_DvbMonStop(Boolean bExit);
  82. * \brief Stop monitor thread.
  83. * \param bExit : thread will exit if true, idle on the contrary.
  84. * \return DRV_SUCCESS if monitor stop success.\n
  85. * DRV_ERR_FAILURE if monitor was not initiated.\n
  86. * DRV_WARN_NO_ACTION if thread was not existed.
  87. */
  88. MID_Status_t MID_DvbMonStop(bool bExit);
  89. /**
  90. * \fn DRV_Status_t MID_DvbMonStopEx(LIVE_INPUT_UNIT InputUnit, Boolean bExit);
  91. * \brief Stop monitor thread according Monitor Unit.
  92. * \param InputUnit : monitor unit.
  93. * \param bExit : thread will exit if true, idle on the contrary.
  94. * \return DRV_SUCCESS if monitor stop success.\n
  95. * DRV_ERR_FAILURE if monitor was not initiated.\n
  96. * DRV_WARN_NO_ACTION if thread was not existed.
  97. */
  98. MID_Status_t MID_DvbMonStopEx(LIVE_INPUT_UNIT InputUnit, bool bExit);
  99. /**
  100. * \fn Boolean MID_DvbMonReceiveStopCmd(void);
  101. * \brief Verify monitor thread command.
  102. * \return FALSE if thread command is DVB_MONITOR_THREAD_CMD_NONE.\n
  103. * TRUE if thread command is the other type.
  104. */
  105. bool MID_DvbMonReceiveStopCmd(void);
  106. bool MID_DvbMonIsRunning(void);
  107. INT32 MID_DvbMonAddListeners(LIVE_INPUT_UNIT InputUnit, Mid_DvbMonCallbks_t * pstDvbMonCallbks);
  108. INT32 MID_DvbMonRemoveListeners(void);
  109. #endif // #ifndef _DVBMONITOR_H