mid_display.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. /*! \addtogroup display_mid Display Middleware
  2. * @{
  3. */
  4. /******************************************************************************/
  5. /**
  6. *
  7. * @file mid_display.h
  8. *
  9. * @brief This file specifies the APIs provided to control display middleware
  10. *
  11. * @note Copyright (c) 2009 Sunplus Technology Co., Ltd. \n
  12. * All rights reserved.
  13. *
  14. * @author
  15. *
  16. ******************************************************************************/
  17. #ifndef __MID_DISPLAY_H
  18. #define __MID_DISPLAY_H
  19. /*******************************************************************************
  20. * Header include
  21. ******************************************************************************/
  22. //#include "gl_types.h"
  23. #include "drv_vip_external.h"
  24. #ifdef MIDDISP_EXTERN_HERE
  25. #define MIDDISP_EXTERN ///< color attribute
  26. #else
  27. #define MIDDISP_EXTERN extern ///< color attribute
  28. #endif
  29. #define DAR_FORBIDDEN 0 ///< active format is the same as the coded frame
  30. #define DAR_SQUARE 1 ///< active format is the same as the coded frame
  31. #define DAR_4_3 2 ///< active format is the same as the coded frame
  32. #define DAR_16_9 3 ///< active format is the same as the coded frame
  33. #define DAR_221_1 4 ///< active format is the same as the coded frame
  34. #define DAR_14_9 5 ///< active format is the same as the coded frame
  35. /*******************************************************************************
  36. * Enumerator
  37. ******************************************************************************/
  38. /**
  39. *@brief Aspect ratio spanning mode select
  40. */
  41. typedef enum
  42. {
  43. SPAN_NONE,
  44. SPAN_LETTERBOX,
  45. SPAN_PANSCAN,
  46. SPAN_AFD_FULL,
  47. } MID_DISP_SpanMode_e;
  48. /**
  49. *@brief Control status enum
  50. */
  51. typedef enum
  52. {
  53. MIDDISP_SUCCESS, // successful outcome
  54. MIDDISP_ERR_FAILURE, // operation failed
  55. MIDDISP_ERR_DIV_ZERO, // divide by zero
  56. MIDDISP_ERR_IDX_OVERFLOW, // index overflow
  57. MIDDISP_ERR_IDX_MISMATCH, // index mismatch
  58. MIDDISP_ERR_NULL_PARAM, // null parameter
  59. MIDDISP_ERR_UNSUPPORT_FMT, // unsupport format
  60. } MID_DISP_Status_e;
  61. typedef enum e_stb_av_aspect_mode
  62. {
  63. ASPECT_MODE_IGNORE = 0,
  64. ASPECT_MODE_LETTERBOX = 1,
  65. ASPECT_MODE_PANSCAN = 2,
  66. ASPECT_MODE_COMBINED = 3,
  67. ASPECT_MODE_FORCED_LETTERBOX = 4,
  68. ASPECT_MODE_FORCED_PANSCAN = 5
  69. }E_STB_AV_ASPECT_MODE;
  70. typedef enum e_stb_av_aspect_ratio
  71. {
  72. ASPECT_RATIO_4_3 = 0,
  73. ASPECT_RATIO_16_9 = 1,
  74. ASPECT_RATIO_221_1 = 2,
  75. ASPECT_RATIO_1_1 = 3,
  76. ASPECT_RATIO_14_9,
  77. ASPECT_RATIO_4_3_PROTECT_14_9_CENTRE
  78. }E_STB_AV_ASPECT_RATIO; //use in tv type & tv aspect ratio
  79. /*******************************************************************************
  80. * Define
  81. ******************************************************************************/
  82. /*******************************************************************************
  83. * Structure
  84. ******************************************************************************/
  85. typedef struct
  86. {
  87. INT32 sdHstart; ///< h start
  88. INT32 sdVstart; ///< v start
  89. UINT32 dHsize; ///< h size
  90. UINT32 dVsize; ///< v size
  91. } DISP_Win_t;
  92. typedef struct
  93. {
  94. UINT16 wHsize; ///< h size
  95. UINT16 wVsize; ///< v size
  96. } DISP_Plane_t;
  97. /*******************************************************************************
  98. * Variables
  99. ******************************************************************************/
  100. typedef void (*iCbFunc2) (UINT32); ///< for free picture memory callback, (joeypan, 2010/01/15)
  101. typedef void* DRV_OsdRegionHandle_t;
  102. /*******************************************************************************
  103. * Program
  104. ******************************************************************************/
  105. MID_DISP_Status_e MID_DISP_SetMh5En(BOOL fEn);
  106. MID_DISP_Status_e MID_DISP_SetSceneAspectRatio(VIP_MHEG5_SceneAspectRatio eSceneAR, bool fMheg5Active, UINT8 bInfo);
  107. MID_DISP_Status_e MID_DISP_SetWideAlignment(VIP_MHEG5_WideAignment eSceneAR, bool fMheg5Active, UINT8 bInfo);
  108. MID_DISP_Status_e MID_DISP_UpdateVIP(bool fMheg5En, UINT8 bInfo);
  109. MID_DISP_Status_e MID_DISP_GetDecFC(VIP_MHEG5_DecFC *eDecFC);
  110. /******************************************************************************/
  111. /**
  112. * @brief Set mheg5 window position and size
  113. *
  114. * @param sdHstart \n
  115. * Describe mheg5 window horizontal start.\n
  116. * @param sdVstart \n
  117. * Describe mheg5 window vertical start.\n
  118. * @param dHsize \n
  119. * Describe mheg5 window horizontal size.\n
  120. * @param dVsize \n
  121. * Describe mheg5 window vertical size.\n
  122. *
  123. * @return MIDDISP_SUCCESS: when setup is success.\n
  124. * MIDDISP_ERR_FAILURE: if any of the parameters is invalid.\n
  125. *
  126. * @note Description: MHEG5 is an international standard for platform sharing data and content in digital tv system, such as set-top-box.
  127. * It defines the mheg5 plane and window above it for video content description. For any different resolution
  128. * content, we must transform to the mheg5 plane based coordination. Then based on the mheg5 window
  129. * description, we could get the uniform standard video content display for any different plaform. It's the goal
  130. * of what mheg5 standard want to be. So based on this concept, we provide the mheg5 plane, window position,
  131. * and size to achieve mheg5's requirement.\n
  132. *
  133. * @note Restrictions: It's implemented by same structure in zoom. So it's execulsive for zoom application.
  134. *******************************************************************************/
  135. MIDDISP_EXTERN MID_DISP_Status_e MID_DISP_SetMh5WinPositionAndSize(INT32 sdHstart, INT32 sdVstart, UINT32 dHsize, UINT32 dVsize, bool fMheg5Active, bool bInfo);
  136. /******************************************************************************/
  137. /**
  138. * @brief Get mheg5 window
  139. *
  140. * @param *stMh5Win \n
  141. * sdHstart: Describe mheg5 window horizontal start position.\n
  142. * sdVstart: Describe mheg5 window vertical start position.\n
  143. * dHsize: Describe mheg5 window horizontal total size.\n
  144. * dVsize: Describe mheg5 window vertical total size.\n
  145. *
  146. * @return MIDDISP_SUCCESS: when setup is success.\n
  147. * MIDDISP_ERR_FAILURE: if any of the parameters is invalid.\n
  148. *
  149. * @note Description: MHEG5 is an international standard for platform sharing data and content in digital tv system, such as set-top-box.
  150. * It defines the mheg5 plane and window above it for video content description. For any different resolution
  151. * content, we must transform to the mheg5 plane based coordination. Then based on the mheg5 window
  152. * description, we could get the uniform standard video content display for any different plaform. It's the goal
  153. * of what mheg5 standard want to be. So based on this concept, we provide the mheg5 plane, window position,
  154. * and size to achieve mheg5's requirement.\n
  155. *
  156. * @note Restrictions: It's implemented by same structure in zoom. So it's execulsive for zoom application.
  157. *******************************************************************************/
  158. MIDDISP_EXTERN MID_DISP_Status_e MID_DISP_GetMh5Win(DISP_Win_t* stMh5Win);
  159. MIDDISP_EXTERN MID_DISP_Status_e MID_DISP_ClearAllDispFrameBuffer(void);
  160. #endif //__MID_DISPLAY_H
  161. /*! @} end of addtogroup display_mid*/