photoplayer_if.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. /*******************************************************************/
  2. /**
  3. *
  4. * \file photoplayer_if.h
  5. *
  6. * \brief This file provides photo player external api implements . \n
  7. *
  8. * \note Copyright (c) 2008 Sunplus Technology Co., Ltd. \n
  9. * All rights reserved.
  10. *
  11. * \author gbm.youjin@sunmedia.com.cn
  12. *
  13. ** Date Author Modification
  14. ** 2011/05/18 gbm.youjin create
  15. *********************************************************************/
  16. #ifndef _PHOTO_PLAYER_IF_H_
  17. #define _PHOTO_PLAYER_IF_H_
  18. #ifdef PHOTO_PLAYER_IF_IMPLEMENTATION
  19. #define PHOTO_PLAYER_IF_EXTERN
  20. #else
  21. #define PHOTO_PLAYER_IF_EXTERN extern
  22. #endif
  23. #include <stdlib.h>
  24. //#include "drivers/eff_if.h"
  25. //#include "mw_logo.h"
  26. #include "pic_if.h"
  27. #include "types.h"
  28. /*!
  29. * \brief callback message
  30. */
  31. typedef enum
  32. {
  33. PHOTO_PLAYER_CALLBACK_PLAYBACK_DECODE_PIC_DONE = 0,
  34. PHOTO_PLAYER_CALLBACK_PLAYBACK_DRAW_LARGE_PIC_READY,
  35. PHOTO_PLAYER_CALLBACK_PLAYBACK_DRAW_LARGE_PIC_ERROR= 9,
  36. PHOTO_PLAYER_CALLBACK_PLAYBACK_DRAW_LARGE_PIC_DONE = 10,
  37. PHOTO_PLAYER_CALLBACK_PLAYBACK_DRAW_THUMBNAIL_DONE = 17,
  38. PHOTO_PLAYER_CALLBACK_PLAYBACK_DRAW_THUMBNAIL_ERROR = 18,
  39. PHOTO_PLAYER_CALLBACK_PLAYBACK_SLIDESHOW_NEXT = 19,
  40. PHOTO_PLAYER_CALLBACK_MAX /*<! Maximum Event Tag */
  41. } PHOTO_PLAYER_CallbackType_e;
  42. //typedef int (*PhotoPlayerCallbackFunc)(PHOTO_PLAYER_CallbackType_e dCallbackType, UINT32 dparam);
  43. typedef int (*PhotoPlayerCallbackFunc)(UINT32 dCallbackType, UINT32 dparam);
  44. #define PHOTO_PLAYER_IF_WARNING_SYSTEM_UO_BUSY (1)/*!< Warnning for middleware is busy,it means middleware is processing some routine */
  45. #define PHOTO_PLAYER_IF_SUCCESSFUL (0)
  46. #define PHOTO_PLAYER_IF_FAILED (-1)
  47. #define PHOTO_PLAYER_IF_ERROR_INITIALIZED (-2)/*!< error for middleware initialize twice*/
  48. #define PHOTO_PLAYER_IF_ERROR_UNINITIALIZED (-3)/*!< error for middleware not initialize,should call ETMW_IF_Initialize() first*/
  49. #define PHOTO_PLAYER_IF_ERROR_PARAMETER (-4)/*!< error for the input paramenter is illegal */
  50. #define PHOTO_PLAYER_IF_ERROR_RESOURCE_ALLOCATION (-5)
  51. #define PHOTO_PLAYER_IF_ERROR_QUEUE (-6)
  52. #define PHOTO_PLAYER_IF_ERROR_G2D_INVALID (-24)
  53. #define PHOTO_PLAYER_IF_ERROR_ZOOM_OUT_NOT_MOVE (-31)
  54. #define PHOTO_PLAYER_IF_ERROR_UNREASONABLE_ZOOM_FACTOR (-32)
  55. #define PHOTO_PLAYER_IF_ERROR_MID_DISP (-17)
  56. /**
  57. * \brief Define picture Zoom In factor
  58. */
  59. typedef enum _PhotoPlayerZoomInFactor_t
  60. {
  61. PHOTO_PLAYER_ZOOMIN_NONE=1, /*!< Zoom In factor none*/
  62. PHOTO_PLAYER_ZOOMIN_2, /*!< Zoom In factor 2*/
  63. PHOTO_PLAYER_ZOOMIN_3, /*!< Zoom In factor 3*/
  64. PHOTO_PLAYER_ZOOMIN_4, /*!< Zoom In factor 4*/
  65. PHOTO_PLAYER_ZOOMIN_MAX, /*!< Zoom In factor max*/
  66. } PhotoPlayerZoomInFactor_t;
  67. /**
  68. * \brief Define picture Zoom Move factor
  69. */
  70. typedef enum _PhotoPlayerZoomMoveFactor_t
  71. {
  72. PHOTO_PLAYER_ZOOMMOVE_LEFT=1, /*!< Zoom Move to Left*/
  73. PHOTO_PLAYER_ZOOMMOVE_RIGHT, /*!< Zoom Move to Left*/
  74. PHOTO_PLAYER_ZOOMMOVE_UP, /*!< Zoom Move to Left*/
  75. PHOTO_PLAYER_ZOOMMOVE_DOWN, /*!< Zoom Move to Left*/
  76. PHOTO_PLAYER_ZOOMMOVE_MAX, /*!< Zoom Move max*/
  77. } PhotoPlayerZoomMoveFactor_t;
  78. /**
  79. * \brief picture slideshow switch.
  80. */
  81. typedef enum _PhotoPlayerSlideShowSwitch
  82. {
  83. PHOTO_PLAYER_SLIDESHOW_OFF = 0,
  84. PHOTO_PLAYER_SLIDESHOW_1 = 3000,
  85. PHOTO_PLAYER_SLIDESHOW_2 = 5000,
  86. PHOTO_PLAYER_SLIDESHOW_3 = 10000,
  87. PHOTO_PLAYER_SLIDESHOW_MAX = 20000,
  88. } PhotoPlayerSlideShowSwitch_e;
  89. /* johnson: test */
  90. typedef enum _PhotoEffectType_
  91. {
  92. NET_PHOTO_EFFECT_NONE = 0,
  93. NET_PHOTO_EFFECT_RANDOM,
  94. NET_PHOTO_EFFECT_SLIDE,
  95. NET_PHOTO_EFFECT_DOOR,
  96. NET_PHOTO_EFFECT_LATTICE,
  97. NET_PHOTO_EFFECT_MAX,
  98. } PhotoEffectType_e;
  99. /******************************************************************************************/
  100. /*!
  101. * \fn INT32 PhotoPlayer_IF_Initialize(PHotoPlayCallbackFunc pfNetPhotoMWCallBack)
  102. *
  103. * \brief Initialize the photo play MiddleWare thread , data Structure and various
  104. *
  105. * \param pfNetPhotoMWCallBack[PHotoPlayCallbackFunc]: Function pointer to Callback Function for event reporting
  106. *
  107. * \return \e NETPHOTOMW_IF_PIC_SUCCESSFUL on success.
  108. * \e NETPHOTOMW_IF_PIC_FAILED on failed.
  109. * \e NETPHOTOMW_IF_PIC_RESOURCE_ALLOCATION_ERROR if malloc fail or cannot get enough resources from System.
  110. * \e NETPHOTOMW_IF_PIC_ERROR_PARAMETER_ERROR if the parameters are not the valid values.
  111. *
  112. ******************************************************************************************/
  113. PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_Initialize(PhotoPlayerCallbackFunc pfPhotoPlayerCallBack);
  114. /******************************************************************************************/
  115. /*!
  116. * \fn INT32 PhotoPlayer_IF_Finalize(void)
  117. *
  118. * \brief Finalize the photo play middleWare thread, free the Data Structure.
  119. *
  120. * \return \e NETPHOTOMW_IF_PIC_SUCCESSFUL on success.
  121. * \e NETPHOTOMW_IF_PIC_ERROR_QUEUE_ERROR Send shutdown message to queue failed.
  122. *
  123. ******************************************************************************************/
  124. PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_Finalize(void);
  125. /******************************************************************************************/
  126. /*!
  127. * \fn INT32 PhotoPlayer_IF_MemInit(UINT8* pExtMemory , UINT32 dSize)
  128. *
  129. * \brief Finalize the photo play middleWare thread, free the Data Structure.
  130. *
  131. * \param pExtMemory[UINT8*]: The point of extra memory to be use larger photo effect.
  132. * dSize[UINT32]: The size of the extra memory.
  133. *
  134. * \return \e NETPHOTOMW_IF_PIC_SUCCESSFUL on success.
  135. * \e NETPHOTOMW_IF_PIC_FAILED on failed.
  136. *
  137. ******************************************************************************************/
  138. PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_MemInit(UINT8* pExtMemory, UINT32 dSize);
  139. /******************************************************************************************/
  140. /*!
  141. * \fn INT32 PhotoPlayer_IF_Rotate(enum effect_mode_t eRotation)
  142. *
  143. * \brief Rotate current photo,threre is five rotate mode(Left,180,Right, L_R_Reverse, UP_DOWN_Reverse).
  144. *
  145. * \param eRotation[effect_mode_t]: The mode of rotation.
  146. *
  147. * \return \e NETPHOTOMW_IF_PIC_SUCCESSFUL on success.
  148. * \e NETPHOTOMW_IF_PIC_FAILED on failed.
  149. *
  150. ******************************************************************************************/
  151. PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_Rotate(enum effect_mode_t eRotation);
  152. /******************************************************************************************/
  153. /*!
  154. * \fn INT32 PhotoPlayer_IF_ZoomIn(PhotoZoomInFactor_t eZoomFactor)
  155. *
  156. * \brief Zoom in current photo,threre is three zoom in factors.
  157. *
  158. * \param eZoomFactor[PhotoZoomInFactor_t]: The factor of zoom in.
  159. *
  160. * \return \e NETPHOTOMW_IF_PIC_SUCCESSFUL on success.
  161. * \e NETPHOTOMW_IF_PIC_FAILED on failed.
  162. *
  163. ******************************************************************************************/
  164. PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_ZoomIn(PhotoPlayerZoomInFactor_t eZoomFactor);
  165. /******************************************************************************************/
  166. /*!
  167. * \fn INT32 PhotoPlayer_IF_ZoomMove(PhotoZoomMoveFactor_t eDirect, UINT16 wDistStep, UINT16 wDistance)
  168. *
  169. * \brief Zoom in current photo,threre is three zoom in factors.
  170. *
  171. * \param eDirect[PhotoZoomMoveFactor_t]: The direction of zoom move. \n
  172. * wDistStep[UINT16]: The step of move distance. \n
  173. * wDistance[UINT16]: The distance value.
  174. *
  175. * \return \e NETPHOTOMW_IF_PIC_SUCCESSFUL on success.
  176. * \e NETPHOTOMW_IF_PIC_FAILED on failed.
  177. * \e NETPHOTOMW_IF_PIC_WARNING_ZOOM_OUT_NOT_MOVE Display window size > Plane size
  178. * \e NETPHOTOMW_IF_PIC_ERROR_UNREASONABLE_ZOOM_FACTOR unreasonable zoom factor
  179. * \e NETPHOTOMW_IF_PIC_ERROR_MID_DISP_ERROR Call middleware display function to zoom move failed.
  180. *
  181. ******************************************************************************************/
  182. PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_ZoomMove(PhotoPlayerZoomMoveFactor_t eDirect, UINT16 wDistStep, UINT16 wDistance);
  183. /******************************************************************************************/
  184. /*!
  185. * \fn void PhotoPlayer_IF_DisableEffect(void)
  186. *
  187. * \brief Disable photo effect.
  188. *
  189. * \param none
  190. *
  191. * \return none
  192. *
  193. ******************************************************************************************/
  194. PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_DisableEffect(void);
  195. /******************************************************************************************/
  196. /*!
  197. * \fn void PhotoPlayer_IF_EnableEffect(void)
  198. *
  199. * \brief Enable photo effect.
  200. *
  201. * \param none
  202. *
  203. * \return none
  204. *
  205. ******************************************************************************************/
  206. PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_EnableEffect(void);
  207. /******************************************************************************************/
  208. /*!
  209. * \fn void PhotoPlayer_IF_Stop(void)
  210. *
  211. * \brief Stop photo effect.
  212. *
  213. * \param none
  214. *
  215. * \return none
  216. *
  217. ******************************************************************************************/
  218. PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_Stop(void);
  219. /******************************************************************************************/
  220. /*!
  221. * \fn INT32 PhotoPlayer_IF_GetPICInfoOnDispFrame(UINT32 *pX, UINT32 *pY, UINT32 *pWidth, UINT32 *pHeight)
  222. *
  223. * \brief Get display frame information.
  224. *
  225. * \param pX[UINT32 *][out]: The x pos of display frame. \n
  226. * pY[UINT32 *][out]: The y pos of display frame. \n
  227. * pWidth[UINT32 *][out]: The width of display frame. \n
  228. * pHeight[UINT32 *][out]: The height of display frame.
  229. *
  230. * \return \e NETPHOTOMW_IF_PIC_SUCCESSFUL on success.
  231. * \e NETPHOTOMW_IF_PIC_FAILED on failed.
  232. *
  233. ******************************************************************************************/
  234. PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_GetPICInfoOnDispFrame(UINT32 *pX, UINT32 *pY, UINT32 *pWidth, UINT32 *pHeight);
  235. /******************************************************************************************/
  236. /*!
  237. * \fn INT32 PhotoPlayer_IF_ClearDispFrameBuffer(int index)
  238. *
  239. * \brief Get display frame information.
  240. *
  241. * \param index[int]: 0:black, 5: TRANSPARENT
  242. *
  243. * \return \e NETPHOTOMW_IF_PIC_SUCCESSFUL on success.
  244. * \e NETPHOTOMW_IF_PIC_FAILED on failed.
  245. *
  246. ******************************************************************************************/
  247. PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_ClearDispFrameBuffer(int index);
  248. /******************************************************************************************/
  249. /*!
  250. * \fn void PhotoPlayer_IF_SetSlideShowTime(PhotoSlideShowSwitch_e eSlideShowTime)
  251. *
  252. * \brief Set Slide show time.
  253. *
  254. * \param eSlideShowTime[PhotoSlideShowSwitch_e]:
  255. * PHOTO_INTER_STATE_OFF = 0, \n
  256. * PHOTO_INTER_STATE_1 = 3000, \n
  257. * PHOTO_INTER_STATE_2 = 5000, \n
  258. * PHOTO_INTER_STATE_3 = 10000, \n
  259. * PHOTO_INTER_STATE_MAX = 20000, \n
  260. *
  261. * \return none
  262. *
  263. ******************************************************************************************/
  264. PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_SetSlideShowTime(PhotoPlayerSlideShowSwitch_e eSlideShowTime);
  265. /******************************************************************************************/
  266. /*!
  267. * \fn void NetPhotoMw_IF_EnableSlideTimer(PhotoSlideShowSwitch_e eSlideShowTime)
  268. *
  269. * \brief Enable slide show timer.
  270. *
  271. * \param eSlideShowTime[PhotoSlideShowSwitch_e]:
  272. * PHOTO_INTER_STATE_OFF = 0, \n
  273. * PHOTO_INTER_STATE_1 = 3000, \n
  274. * PHOTO_INTER_STATE_2 = 5000, \n
  275. * PHOTO_INTER_STATE_3 = 10000, \n
  276. * PHOTO_INTER_STATE_MAX = 20000, \n
  277. *
  278. * \return none
  279. *
  280. ******************************************************************************************/
  281. PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_EnableSlideTimer(PhotoPlayerSlideShowSwitch_e eSlideShowTime);
  282. /******************************************************************************************/
  283. /*!
  284. * \fn void NetPhotoMw_IF_DisableSlideTimer(PhotoSlideShowSwitch_e eSlideShowTime)
  285. *
  286. * \brief Enable slide show timer.
  287. *
  288. * \param none
  289. *
  290. * \return none
  291. *
  292. ******************************************************************************************/
  293. PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_DisableSlideTimer(void);
  294. /******************************************************************************************/
  295. /*!
  296. * \fn void PhotoPlayer_IF_DrawLargePhoto(UINT8* pBuf, UINT32 dSize, UINT32 dPhotoIdx)
  297. *
  298. * \brief Enable slide show timer.
  299. *
  300. * \param none
  301. *
  302. * \return none
  303. *
  304. ******************************************************************************************/
  305. PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_DrawLargePhoto(UINT8* pBuf, UINT32 dSize, UINT32 dPhotoIdx);
  306. /******************************************************************************************/
  307. /*!
  308. * \fn void PhotoPlayer_IF_DrawLargePhotoStream(UINT8* pBuf, UINT32 dSize, UINT32 dPhotoIdx,
  309. int handle, void *ReadFunc, void *SeekFunc)
  310. *
  311. * \brief Draw large photo with stream method.
  312. *
  313. * \param none
  314. *
  315. * \return none
  316. *
  317. ******************************************************************************************/
  318. PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_DrawLargePhotoStream(UINT8* pBuf, UINT32 dSize, UINT32 dPhotoIdx,
  319. int handle, void *ReadFunc, void *SeekFunc);
  320. /******************************************************************************************/
  321. /*!
  322. * \fn void PhotoPlayer_IF_DrawThumbnailPhoto(UINT32 dPosX, UINT32 dPosY,
  323. UINT32 dRectW,UINT32 dRectH,
  324. UINT32 dPicW, UINT32 dPicH,
  325. UINT8* pBuf, UINT32 dSize)
  326. *
  327. * \brief Enable slide show timer.
  328. *
  329. * \param none
  330. *
  331. * \return none
  332. *
  333. ******************************************************************************************/
  334. PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_DrawThumbnailPhoto(UINT32 dPosX, UINT32 dPosY,
  335. UINT32 dRectW,UINT32 dRectH,
  336. UINT32 dPicW, UINT32 dPicH,
  337. UINT8* pBuf, UINT32 dSize);
  338. INT32 PhotoPlayer_IF_SetEffectType(PhotoEffectType_e eEffectType);
  339. INT32 PhotoPlayer_IF_GetPicFrameInfo(PIC_FrmInfo_t *pic_info);
  340. #endif