mid_tablescan.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /*! \addtogroup analog table scan
  2. * @{
  3. */
  4. /******************************************************************************/
  5. /**
  6. *
  7. * \file mid_tablescan.h
  8. *
  9. * \brief middle-ware of analog TV table scan.
  10. *
  11. *
  12. * \note Copyright (c) 2012 Sunplus Technology Co., Ltd. \n
  13. * All rights reserved.
  14. *
  15. * \author
  16. * Ray Wu, create
  17. * Hsunying, 2012/04/31 modify, remove unused variables
  18. * Hsunying, 2012/04/31 modify, the structures and enums
  19. *
  20. ******************************************************************************/
  21. #ifndef _MID_ATV_TABLESCAN_H_
  22. #define _MID_ATV_TABLESCAN_H_
  23. /*******************************************************************************
  24. * Header include
  25. ******************************************************************************/
  26. #include "types.h"
  27. /*******************************************************************************
  28. * Marco
  29. ******************************************************************************/
  30. /*******************************************************************************
  31. * Structure
  32. ******************************************************************************/
  33. /*******************************************************************************
  34. * Constant
  35. ******************************************************************************/
  36. /*******************************************************************************
  37. * enumeration
  38. ******************************************************************************/
  39. typedef enum
  40. {
  41. MID_TABLE_SCAN_VIDEO_FORMAT_AUTO = 0x00,
  42. MID_TABLE_SCAN_VIDEO_FORMAT_NTSC358 = (1 << 0),
  43. MID_TABLE_SCAN_VIDEO_FORMAT_NTSC443 = (1 << 1),
  44. MID_TABLE_SCAN_VIDEO_FORMAT_PAL = (1 << 2),
  45. MID_TABLE_SCAN_VIDEO_FORMAT_PALM = (1 << 3),
  46. MID_TABLE_SCAN_VIDEO_FORMAT_PALCN = (1 << 4),
  47. MID_TABLE_SCAN_VIDEO_FORMAT_PAL60 = (1 << 5),
  48. MID_TABLE_SCAN_VIDEO_FORMAT_SECAM = (1 << 6),
  49. MID_TABLE_SCAN_VIDEO_FORMAT_SECAML = (1 << 7),
  50. }Mid_TableScan_VideoFormat_t;
  51. typedef enum {
  52. MID_TABLE_SCAN_AUDIO_STD_A2BG = 0,
  53. MID_TABLE_SCAN_AUDIO_STD_NICAMBG,
  54. MID_TABLE_SCAN_AUDIO_STD_NICAML,
  55. MID_TABLE_SCAN_AUDIO_STD_NICAMI,
  56. MID_TABLE_SCAN_AUDIO_STD_A2DK1,
  57. MID_TABLE_SCAN_AUDIO_STD_A2DK2,
  58. MID_TABLE_SCAN_AUDIO_STD_A2DK3,
  59. MID_TABLE_SCAN_AUDIO_STD_NICAMDK,
  60. MID_TABLE_SCAN_AUDIO_STD_A2MN,
  61. MID_TABLE_SCAN_AUDIO_STD_EIAJ,
  62. MID_TABLE_SCAN_AUDIO_STD_BTSC,
  63. MID_TABLE_SCAN_AUDIO_STD_NICAML1,
  64. MID_TABLE_SCAN_AUDIO_STD_ERR,
  65. } Mid_TableScan_SaveScanAudioStd_t;
  66. /**
  67. * \brief Callback type
  68. */
  69. typedef enum _mid_TableScanCallbackType_e
  70. {
  71. MID_TABLE_SCAN_CALLBK_TYPE_REQUEST_NEXT_CH = 0, ///> request ap layer give the next TP parameter : pParam is point to the structure MID_ScanParam_t
  72. MID_TABLE_SCAN_CALLBK_TYPE_LOCKED_CH, ///> TP lock ok or failed? (*pParam) is a value of DRV_Status_t
  73. MID_TABLE_SCAN_CALLBK_TYPE_EXCEED_TRUNER,
  74. MID_TABLE_SCAN_CALLBK_TYPE_RESERVED,
  75. }Mid_TableScan_ScanCallbkType_e;
  76. /*******************************************************************************
  77. * Structure
  78. ******************************************************************************/
  79. typedef struct _mid_tablescan_inputinfo_t
  80. {
  81. Mid_TableScan_VideoFormat_t eVideoFormat_Supported;
  82. } Mid_TableScan_ScanInputInfo_t;
  83. typedef struct _mid_tablescan_outputinfo_t
  84. {
  85. UINT32 dCurrentFreq;
  86. Mid_TableScan_VideoFormat_t eVideoFormat_Result;
  87. Mid_TableScan_SaveScanAudioStd_t eAudioFormat_Result;
  88. } Mid_TableScan_ScanOutputInfo_t;
  89. /**
  90. * brief Scan parameter structure
  91. */
  92. typedef struct
  93. {
  94. // external parameters
  95. UINT32 dFreq;
  96. } Mid_TableScan_Param_t;
  97. /*******************************************************************************
  98. * APIs
  99. ******************************************************************************/
  100. /**
  101. * \brief a callback function to obtain the next Ch scan parameter
  102. *
  103. * return 0 means successful getting the next CH scan parameter
  104. * other return values means no next CH scan parameter, and the scan processer will auto terminate
  105. */
  106. typedef int (*MidTableScanCallback)(Mid_TableScan_ScanCallbkType_e eCallbkType, void* pParam);
  107. /*************************************************************************************
  108. * Definition of SCAN module interfaces
  109. *************************************************************************************/
  110. /** \addtogroup DTV_scan DTV Scan
  111. * \brief Interfaces of DTV scan middle-ware.
  112. * @{ */
  113. /*******************************************************************************************/
  114. /**
  115. * \fn DRV_Status_t MID_ScanStart(UINT32 u32ScanCapabilities, iMidScanCallback pfGetScanParamCallbk)
  116. *
  117. * \param u32ScanCapabilities : The scan capabilities combined by MID_SCAN_CAPS_xxxxx
  118. * \param pfGetScanParamCallbk : a callback function to obtain the next TP scan parameter
  119. * callback function return 0 by ap layer means successful getting the next TP scan parameter
  120. * and other return values means no next TP scan parameter, and the scan processer will auto terminate.
  121. *
  122. * \return MID_SUCCESS if successful, warning or error code if function failed
  123. *
  124. * \note Description : To trigger a thread for scan the programs of digital signal.
  125. *
  126. * \note Restrictions:
  127. *
  128. ********************************************************************************************/
  129. BOOLEAN MID_TableScanStart(Mid_TableScan_ScanInputInfo_t *InitParam, MidTableScanCallback pfGetScanParamCallbk);
  130. /*******************************************************************************************/
  131. /**
  132. * \fn DRV_Status_t MID_ScanStop(void)
  133. *
  134. * \param none.
  135. *
  136. * \return DRV_SUCCESS if successful, warning or error code if function failed
  137. *
  138. * \note Description : To stop the scan processer while scanning.
  139. *
  140. * \note Restrictions:Once the module has been stop, calling this API a second time will
  141. * do nothing and will simply return a warning.
  142. ********************************************************************************************/
  143. BOOLEAN MID_TableScanStop(void);
  144. BOOLEAN MID_TableScanPause(void);
  145. BOOLEAN MID_TableScanResume(void);
  146. #endif // #ifndef _MID_ATV_TABLESCAN_H_