OsdConfig.h 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. #ifndef _OSDCONFIG_H
  2. #define _OSDCONFIG_H
  3. #define HV_PROJECT_CONFIG_OSD_SCALER HV_CONFIG_OFF
  4. #define HV_PROJECT_CONFIG_OSD_GRAPHIC HV_CONFIG_OFF
  5. #define HV_PROJECT_CONFIG_OSD_DDRPATH HV_CONFIG_OFF
  6. #define HV_PROJECT_CONFIG_OSD_ROTATION HV_CONFIG_ON
  7. #define HV_PROJECT_CONFIG_OSD_LOGO_ROTATION HV_CONFIG_OFF
  8. #define HV_PROJECT_CONFIG_OSD_KEY_ROTATION HV_CONFIG_OFF
  9. #define HV_PROJECT_CONFIG_OSD_FORCE_REDRAW_ALL HV_CONFIG_OFF
  10. #define HV_PROJECT_CONFIG_OSD_FORCE_MULTIFRAME_DRAW HV_CONFIG_OFF
  11. #define HV_PROJECT_CONFIG_OSD_ANIMITION_SUPPORT HV_CONFIG_OFF
  12. #define HV_PROJECT_CONFIG_OSD_LOGO_INCODE HV_CONFIG_OFF
  13. #define HV_PROJECT_CONFIG_OSD_LOGO_EFFECT HV_CONFIG_ON
  14. #define HV_PROJECT_CONFIG_OSD_LOGO_USE_SCENE HV_CONFIG_OFF
  15. #define HV_PROJECT_CONFIG_OSD_CUSTOM_GROUP_SUPPORT HV_CONFIG_OFF
  16. #define HV_PROJECT_CONFIG_OSD_CPU_CANVAS_SUPPORT HV_CONFIG_ON
  17. #define HV_PROJECT_CONFIG_OSD_BIGFONT_SUPPORT HV_CONFIG_ON
  18. #if (HV_PROJECT_CONFIG_OSD_CPU_CANVAS_SUPPORT == HV_CONFIG_ON)
  19. #define OSD_CANVAS_WAVE_POINT_CNT (110)
  20. #define OSD_CANVAS_WAVE_FRAMERATE_MIN (30)
  21. #define OSD_CANVAS_WAVE_FRAMERATE_MAX (180)
  22. #endif
  23. /* Rotate type define */
  24. #define OSD_ROTATE_FOLLOW_SCREEN (0)
  25. #define OSD_ROTATE_MENU_IN_PLACE (1)
  26. #define OSD_ROTATE_IN_PLACE_ALL (2)
  27. #define HV_PROJECT_CONFIG_OSD_ROTATION_TYPE OSD_ROTATE_FOLLOW_SCREEN
  28. /* Enable wrap text */
  29. #define HV_PROJECT_CONFIG_OSD_TEXT_WRAPPING HV_CONFIG_OFF
  30. #if (HV_PROJECT_CONFIG_OSD_TEXT_WRAPPING == HV_CONFIG_ON)
  31. #define HV_OSD_CONFIG_WRAP_SPLIT_WORD HV_CONFIG_OFF
  32. #endif
  33. /* Enable of marquee */
  34. #define HV_PROJECT_CONFIG_OSD_MARQUEE HV_CONFIG_OFF
  35. #if (HV_PROJECT_CONFIG_OSD_MARQUEE == HV_CONFIG_ON)
  36. /* determine whether marquee excessed component by default */
  37. #define HV_OSD_CONFIG_MARQUEE_AUTO_CHECK_EXCESS HV_CONFIG_OFF
  38. /* 1: Cyclying left 2: Cyclying right 3: Scrolling left 4: Scrolling right 5: sliding left 6: sliding right 7: sliding next */
  39. #define HV_OSD_CONFIG_DEFAULT_MARQUEE_TYPE (5)
  40. /* gap between head & tail */
  41. #define HV_OSD_CONFIG_MARQUEE_GAP 6
  42. #define HV_OSD_CONFIG_MARQUEE_STEP 1
  43. #undef HV_PROJECT_CONFIG_OSD_ANIMITION_SUPPORT
  44. #define HV_PROJECT_CONFIG_OSD_ANIMITION_SUPPORT HV_CONFIG_ON
  45. #endif
  46. #if ((HV_PROJECT_CONFIG_OSD_ROTATION == HV_CONFIG_ON) || (HV_PROJECT_CONFIG_OSD_FORCE_MULTIFRAME_DRAW == HV_CONFIG_ON))
  47. #undef HV_PROJECT_CONFIG_OSD_DDRPATH
  48. #define HV_PROJECT_CONFIG_OSD_DDRPATH HV_CONFIG_ON
  49. #endif
  50. #if (HV_PROJECT_CONFIG_OSD_LOGO_ROTATION == HV_CONFIG_ON)
  51. #undef HV_PROJECT_CONFIG_OSD_LOGO_EFFECT
  52. #define HV_PROJECT_CONFIG_OSD_LOGO_EFFECT HV_CONFIG_OFF
  53. #endif
  54. #ifdef CONFIG_USER_TJPG_ON
  55. #undef HV_PROJECT_CONFIG_OSD_GRAPHIC
  56. #define HV_PROJECT_CONFIG_OSD_GRAPHIC HV_CONFIG_ON
  57. #endif
  58. #ifdef CONFIG_USER_PANEL_RESOLUTION_TYPE_UHD
  59. #if (HV_PROJECT_CONFIG_OSD_DDRPATH == HV_CONFIG_ON)
  60. /* 由于OSD DDR画布大小限制(最大支持2560*1440),所以UHD下OSD过DDR绘制,则必须开启OSD SCALER */
  61. #undef HV_PROJECT_CONFIG_OSD_SCALER
  62. #define HV_PROJECT_CONFIG_OSD_SCALER HV_CONFIG_ON
  63. #endif
  64. #endif
  65. #define OSD_DEBUG_PRINT_NAME
  66. /* 定义该宏表示:允许item禁用时自动隐藏,且item list自动对齐,注意:需要将item的disable hide检查放在
  67. Hv_App_Cb_ItemCheckDisableHide接口中,且此item之后(Next)的所有的item(同一个item list内)
  68. 都需在OSD Tool侧打开 DYN_POS 开关 */
  69. #define OSD_CHECK_DISABLE_HIDE_AND_ITEMLIST_AUTO_ALIGN
  70. /* 定义该宏表示:显示item时将自动进行disable检查,已经显示的item需调用Refresh相关接口进行刷新
  71. 关闭该宏则需每次操作后调用Hv_App_CheckItemDisableState更新界面 */
  72. #define OSD_CHECK_DISABLE_BY_EACH_ITEM
  73. #ifndef OSD_CHECK_DISABLE_BY_EACH_ITEM
  74. /* Item最大禁用个数 */
  75. #define OSD_DISABLE_ITEM_NUM_MAX (64)
  76. #endif
  77. /* 通过OSDdesign工具完成item与userdata的绑定 */
  78. #define OSD_ITEM_BIND_USERDATA_BY_TOOL
  79. /* OSD界面单个window的最大行数(Y) */
  80. #define OSD_FONT_Y_NUM_MAX (48)
  81. /* AsciiString组件的字符串最大长度 */
  82. #define OSD_ASCII_STRING_LENGTH_MAX (48)
  83. /* 同一级菜单所显示的最大item数量 */
  84. #define OSD_MENU_SHOW_ITEM_NUM_MAX (8)
  85. /* LOGO显示时间 */
  86. #define HV_PROJECT_CONFIG_OSD_LOGO_SHOW_TIME (3)
  87. /* 弹窗提示显示时间 */
  88. #define HV_PROJECT_CONFIG_OSD_DIALOG_SHOW_TIME (3)
  89. /* 自动刷新默认频率 */
  90. #define HV_PROJECT_CONFIG_OSD_DEFAULT_REFRESH_PERIOD_MS (250)
  91. #if (HV_PROJECT_CONFIG_OSD_DDRPATH == HV_CONFIG_ON)
  92. #define HV_OSD_CONFIG_DDR_TOP_MARGIN (30)
  93. /* 画到DDR中的像素格式
  94. * FORMAT Bytes
  95. * 0: RGBA8888 4
  96. * 1: RGBA4444 2
  97. * 2: RGB565 2
  98. * 5: RGB888 3
  99. */
  100. #define HV_OSD_CONFIG_DDR_FORMAT 2
  101. #if (HV_OSD_CONFIG_DDR_FORMAT == 0)
  102. #define HV_OSD_CONFIG_DDR_PIXEL_BYTES 4
  103. #elif (HV_OSD_CONFIG_DDR_FORMAT == 1)
  104. #define HV_OSD_CONFIG_DDR_PIXEL_BYTES 2
  105. #elif (HV_OSD_CONFIG_DDR_FORMAT == 2)
  106. #define HV_OSD_CONFIG_DDR_PIXEL_BYTES 2
  107. #elif (HV_OSD_CONFIG_DDR_FORMAT == 5)
  108. #define HV_OSD_CONFIG_DDR_PIXEL_BYTES 3
  109. #else
  110. #error "OSD DDR format not supported"
  111. #endif
  112. #define HV_OSD_CONFIG_FRAMERATE_MIN 60
  113. #define HV_OSD_CONFIG_REAL_DDR_CANVAS (HV_CONFIG_OFF)
  114. #if (HV_OSD_CONFIG_REAL_DDR_CANVAS == HV_CONFIG_ON)
  115. #define HV_OSD_CONFIG_EXTRA_DDR_BUFFER (HV_CONFIG_ON)
  116. #else
  117. #define HV_OSD_CONFIG_EXTRA_DDR_BUFFER (HV_CONFIG_OFF)
  118. #endif
  119. #if (HV_OSD_CONFIG_EXTRA_DDR_BUFFER == HV_CONFIG_ON)
  120. #define HV_OSD_CONFIG_EXTRA_BUFFER_HACTIVE (2560)
  121. #define HV_OSD_CONFIG_EXTRA_BUFFER_VACTIVE (1440)
  122. #endif
  123. #endif
  124. /* graphic中存储的像素格式
  125. * FORMAT Bytes
  126. * 0: RGBA8888 4
  127. * 1: RGBA4444 2
  128. * 2: RGB565 2
  129. * 5: RGB888 3
  130. */
  131. #define HV_OSD_CONFIG_GRAPHIC_FORMAT 2
  132. #define HV_OSD_CONFIG_FONT_AS_BACKGROUND HV_CONFIG_ON
  133. /* dynamic load resource */
  134. #define HV_OSD_CONFIG_DYNAMIC_BANK_COUNT 15
  135. /* column最小宽度 */
  136. #define HV_OSD_CONFIG_COLUMN_MINWIDTH 5
  137. #define HV_OSD_CONFIG_RESERVE_SLOTS_BYROW (HV_CONFIG_OFF)
  138. #if (HV_OSD_CONFIG_RESERVE_SLOTS_BYROW == HV_CONFIG_OFF)
  139. /* update区域不够的时候,一次扩充增加的格子个数 */
  140. #define HV_OSD_CONFIG_SLOTS_EXPAND (32)
  141. /* update区域不够的时候,一次扩充增加的最大字节数*/
  142. #define HV_OSD_CONFIG_EXPAND_REGION_MAX (3 * 1024)
  143. #else
  144. #define HV_OSD_CONFIG_ROW_RESOURCE_THRESHOLD 0.5
  145. /* 每行资源占用的格子数 / 每行index格子数的占比 */
  146. #define HV_OSD_CONFIG_ROW_RESOURCE_COUNT_RATIO 1
  147. #endif
  148. #define HV_OSD_CONFIG_BLANK_COLUMN_MARGIN 4
  149. /*
  150. * 绘制字符的最大的行数
  151. *
  152. * osd driver记录每一行绘制的component信息
  153. * 在OsdRowInfo结构体中,osd初始化的时候会
  154. * 静态分配OSD_MAX_ROW_COUNT个OsdRowInfo
  155. * 结构体,可以调整这个宏的值来减少内存占用
  156. */
  157. #define OSD_MAX_ROW_COUNT 128
  158. /*
  159. * 每行row最大可能画的component个数
  160. *
  161. * 在OsdRowInfo结构体中存放component*的数组,
  162. * 数组长度为OSD_ROW_MAX_COMPONENTS,可以调整
  163. * 这个宏的值来减少内存占用
  164. */
  165. #define OSD_ROW_MAX_COMPONENTS 16
  166. /* colorkey */
  167. #define HV_OSD_CONFIG_COLORKEY HV_CONFIG_ON
  168. #if (HV_OSD_CONFIG_COLORKEY == HV_CONFIG_ON)
  169. #define HV_OSD_CONFIG_COLORKEY_VALUE 0xabcdef
  170. #endif /* HV_OSD_CONFIG_COLORKEY */
  171. /* keep OFF, this is only for debug */
  172. #define HV_OSD_CONFIG_TRANSFER_USING_MEMCPY HV_CONFIG_OFF
  173. #define HV_OSD_CONFIG_DOUBLE_BUFFER_USING_MEMCPY HV_CONFIG_OFF
  174. #define HV_OSD_CONFIG_AUTO_TEST HV_CONFIG_OFF
  175. #endif