123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379 |
- /*******************************************************************/
- /**
- *
- * \file photoplayer_if.h
- *
- * \brief This file provides photo player external api implements . \n
- *
- * \note Copyright (c) 2008 Sunplus Technology Co., Ltd. \n
- * All rights reserved.
- *
- * \author gbm.youjin@sunmedia.com.cn
- *
- ** Date Author Modification
- ** 2011/05/18 gbm.youjin create
- *********************************************************************/
- #ifndef _PHOTO_PLAYER_IF_H_
- #define _PHOTO_PLAYER_IF_H_
- #ifdef PHOTO_PLAYER_IF_IMPLEMENTATION
- #define PHOTO_PLAYER_IF_EXTERN
- #else
- #define PHOTO_PLAYER_IF_EXTERN extern
- #endif
- #include <stdlib.h>
- //#include "drivers/eff_if.h"
- //#include "mw_logo.h"
- #include "pic_if.h"
- #include "types.h"
- /*!
- * \brief callback message
- */
- typedef enum
- {
- PHOTO_PLAYER_CALLBACK_PLAYBACK_DECODE_PIC_DONE = 0,
- PHOTO_PLAYER_CALLBACK_PLAYBACK_DRAW_LARGE_PIC_READY,
- PHOTO_PLAYER_CALLBACK_PLAYBACK_DRAW_LARGE_PIC_ERROR= 9,
- PHOTO_PLAYER_CALLBACK_PLAYBACK_DRAW_LARGE_PIC_DONE = 10,
- PHOTO_PLAYER_CALLBACK_PLAYBACK_DRAW_THUMBNAIL_DONE = 17,
- PHOTO_PLAYER_CALLBACK_PLAYBACK_DRAW_THUMBNAIL_ERROR = 18,
- PHOTO_PLAYER_CALLBACK_PLAYBACK_SLIDESHOW_NEXT = 19,
- PHOTO_PLAYER_CALLBACK_MAX /*<! Maximum Event Tag */
- } PHOTO_PLAYER_CallbackType_e;
- //typedef int (*PhotoPlayerCallbackFunc)(PHOTO_PLAYER_CallbackType_e dCallbackType, UINT32 dparam);
- typedef int (*PhotoPlayerCallbackFunc)(UINT32 dCallbackType, UINT32 dparam);
- #define PHOTO_PLAYER_IF_WARNING_SYSTEM_UO_BUSY (1)/*!< Warnning for middleware is busy,it means middleware is processing some routine */
- #define PHOTO_PLAYER_IF_SUCCESSFUL (0)
- #define PHOTO_PLAYER_IF_FAILED (-1)
- #define PHOTO_PLAYER_IF_ERROR_INITIALIZED (-2)/*!< error for middleware initialize twice*/
- #define PHOTO_PLAYER_IF_ERROR_UNINITIALIZED (-3)/*!< error for middleware not initialize,should call ETMW_IF_Initialize() first*/
- #define PHOTO_PLAYER_IF_ERROR_PARAMETER (-4)/*!< error for the input paramenter is illegal */
- #define PHOTO_PLAYER_IF_ERROR_RESOURCE_ALLOCATION (-5)
- #define PHOTO_PLAYER_IF_ERROR_QUEUE (-6)
- #define PHOTO_PLAYER_IF_ERROR_G2D_INVALID (-24)
- #define PHOTO_PLAYER_IF_ERROR_ZOOM_OUT_NOT_MOVE (-31)
- #define PHOTO_PLAYER_IF_ERROR_UNREASONABLE_ZOOM_FACTOR (-32)
- #define PHOTO_PLAYER_IF_ERROR_MID_DISP (-17)
- /**
- * \brief Define picture Zoom In factor
- */
- typedef enum _PhotoPlayerZoomInFactor_t
- {
- PHOTO_PLAYER_ZOOMIN_NONE=1, /*!< Zoom In factor none*/
- PHOTO_PLAYER_ZOOMIN_2, /*!< Zoom In factor 2*/
- PHOTO_PLAYER_ZOOMIN_3, /*!< Zoom In factor 3*/
- PHOTO_PLAYER_ZOOMIN_4, /*!< Zoom In factor 4*/
- PHOTO_PLAYER_ZOOMIN_MAX, /*!< Zoom In factor max*/
- } PhotoPlayerZoomInFactor_t;
- /**
- * \brief Define picture Zoom Move factor
- */
- typedef enum _PhotoPlayerZoomMoveFactor_t
- {
- PHOTO_PLAYER_ZOOMMOVE_LEFT=1, /*!< Zoom Move to Left*/
- PHOTO_PLAYER_ZOOMMOVE_RIGHT, /*!< Zoom Move to Left*/
- PHOTO_PLAYER_ZOOMMOVE_UP, /*!< Zoom Move to Left*/
- PHOTO_PLAYER_ZOOMMOVE_DOWN, /*!< Zoom Move to Left*/
- PHOTO_PLAYER_ZOOMMOVE_MAX, /*!< Zoom Move max*/
- } PhotoPlayerZoomMoveFactor_t;
- /**
- * \brief picture slideshow switch.
- */
- typedef enum _PhotoPlayerSlideShowSwitch
- {
- PHOTO_PLAYER_SLIDESHOW_OFF = 0,
- PHOTO_PLAYER_SLIDESHOW_1 = 3000,
- PHOTO_PLAYER_SLIDESHOW_2 = 5000,
- PHOTO_PLAYER_SLIDESHOW_3 = 10000,
- PHOTO_PLAYER_SLIDESHOW_MAX = 20000,
- } PhotoPlayerSlideShowSwitch_e;
- /* johnson: test */
- typedef enum _PhotoEffectType_
- {
- NET_PHOTO_EFFECT_NONE = 0,
- NET_PHOTO_EFFECT_RANDOM,
- NET_PHOTO_EFFECT_SLIDE,
- NET_PHOTO_EFFECT_DOOR,
- NET_PHOTO_EFFECT_LATTICE,
- NET_PHOTO_EFFECT_MAX,
- } PhotoEffectType_e;
- /******************************************************************************************/
- /*!
- * \fn INT32 PhotoPlayer_IF_Initialize(PHotoPlayCallbackFunc pfNetPhotoMWCallBack)
- *
- * \brief Initialize the photo play MiddleWare thread , data Structure and various
- *
- * \param pfNetPhotoMWCallBack[PHotoPlayCallbackFunc]: Function pointer to Callback Function for event reporting
- *
- * \return \e NETPHOTOMW_IF_PIC_SUCCESSFUL on success.
- * \e NETPHOTOMW_IF_PIC_FAILED on failed.
- * \e NETPHOTOMW_IF_PIC_RESOURCE_ALLOCATION_ERROR if malloc fail or cannot get enough resources from System.
- * \e NETPHOTOMW_IF_PIC_ERROR_PARAMETER_ERROR if the parameters are not the valid values.
- *
- ******************************************************************************************/
- PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_Initialize(PhotoPlayerCallbackFunc pfPhotoPlayerCallBack);
- /******************************************************************************************/
- /*!
- * \fn INT32 PhotoPlayer_IF_Finalize(void)
- *
- * \brief Finalize the photo play middleWare thread, free the Data Structure.
- *
- * \return \e NETPHOTOMW_IF_PIC_SUCCESSFUL on success.
- * \e NETPHOTOMW_IF_PIC_ERROR_QUEUE_ERROR Send shutdown message to queue failed.
- *
- ******************************************************************************************/
- PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_Finalize(void);
- /******************************************************************************************/
- /*!
- * \fn INT32 PhotoPlayer_IF_MemInit(UINT8* pExtMemory , UINT32 dSize)
- *
- * \brief Finalize the photo play middleWare thread, free the Data Structure.
- *
- * \param pExtMemory[UINT8*]: The point of extra memory to be use larger photo effect.
- * dSize[UINT32]: The size of the extra memory.
- *
- * \return \e NETPHOTOMW_IF_PIC_SUCCESSFUL on success.
- * \e NETPHOTOMW_IF_PIC_FAILED on failed.
- *
- ******************************************************************************************/
- PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_MemInit(UINT8* pExtMemory, UINT32 dSize);
- /******************************************************************************************/
- /*!
- * \fn INT32 PhotoPlayer_IF_Rotate(enum effect_mode_t eRotation)
- *
- * \brief Rotate current photo,threre is five rotate mode(Left,180,Right, L_R_Reverse, UP_DOWN_Reverse).
- *
- * \param eRotation[effect_mode_t]: The mode of rotation.
- *
- * \return \e NETPHOTOMW_IF_PIC_SUCCESSFUL on success.
- * \e NETPHOTOMW_IF_PIC_FAILED on failed.
- *
- ******************************************************************************************/
- PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_Rotate(enum effect_mode_t eRotation);
- /******************************************************************************************/
- /*!
- * \fn INT32 PhotoPlayer_IF_ZoomIn(PhotoZoomInFactor_t eZoomFactor)
- *
- * \brief Zoom in current photo,threre is three zoom in factors.
- *
- * \param eZoomFactor[PhotoZoomInFactor_t]: The factor of zoom in.
- *
- * \return \e NETPHOTOMW_IF_PIC_SUCCESSFUL on success.
- * \e NETPHOTOMW_IF_PIC_FAILED on failed.
- *
- ******************************************************************************************/
- PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_ZoomIn(PhotoPlayerZoomInFactor_t eZoomFactor);
- /******************************************************************************************/
- /*!
- * \fn INT32 PhotoPlayer_IF_ZoomMove(PhotoZoomMoveFactor_t eDirect, UINT16 wDistStep, UINT16 wDistance)
- *
- * \brief Zoom in current photo,threre is three zoom in factors.
- *
- * \param eDirect[PhotoZoomMoveFactor_t]: The direction of zoom move. \n
- * wDistStep[UINT16]: The step of move distance. \n
- * wDistance[UINT16]: The distance value.
- *
- * \return \e NETPHOTOMW_IF_PIC_SUCCESSFUL on success.
- * \e NETPHOTOMW_IF_PIC_FAILED on failed.
- * \e NETPHOTOMW_IF_PIC_WARNING_ZOOM_OUT_NOT_MOVE Display window size > Plane size
- * \e NETPHOTOMW_IF_PIC_ERROR_UNREASONABLE_ZOOM_FACTOR unreasonable zoom factor
- * \e NETPHOTOMW_IF_PIC_ERROR_MID_DISP_ERROR Call middleware display function to zoom move failed.
- *
- ******************************************************************************************/
- PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_ZoomMove(PhotoPlayerZoomMoveFactor_t eDirect, UINT16 wDistStep, UINT16 wDistance);
- /******************************************************************************************/
- /*!
- * \fn void PhotoPlayer_IF_DisableEffect(void)
- *
- * \brief Disable photo effect.
- *
- * \param none
- *
- * \return none
- *
- ******************************************************************************************/
- PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_DisableEffect(void);
- /******************************************************************************************/
- /*!
- * \fn void PhotoPlayer_IF_EnableEffect(void)
- *
- * \brief Enable photo effect.
- *
- * \param none
- *
- * \return none
- *
- ******************************************************************************************/
- PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_EnableEffect(void);
- /******************************************************************************************/
- /*!
- * \fn void PhotoPlayer_IF_Stop(void)
- *
- * \brief Stop photo effect.
- *
- * \param none
- *
- * \return none
- *
- ******************************************************************************************/
- PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_Stop(void);
- /******************************************************************************************/
- /*!
- * \fn INT32 PhotoPlayer_IF_GetPICInfoOnDispFrame(UINT32 *pX, UINT32 *pY, UINT32 *pWidth, UINT32 *pHeight)
- *
- * \brief Get display frame information.
- *
- * \param pX[UINT32 *][out]: The x pos of display frame. \n
- * pY[UINT32 *][out]: The y pos of display frame. \n
- * pWidth[UINT32 *][out]: The width of display frame. \n
- * pHeight[UINT32 *][out]: The height of display frame.
- *
- * \return \e NETPHOTOMW_IF_PIC_SUCCESSFUL on success.
- * \e NETPHOTOMW_IF_PIC_FAILED on failed.
- *
- ******************************************************************************************/
- PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_GetPICInfoOnDispFrame(UINT32 *pX, UINT32 *pY, UINT32 *pWidth, UINT32 *pHeight);
- /******************************************************************************************/
- /*!
- * \fn INT32 PhotoPlayer_IF_ClearDispFrameBuffer(int index)
- *
- * \brief Get display frame information.
- *
- * \param index[int]: 0:black, 5: TRANSPARENT
- *
- * \return \e NETPHOTOMW_IF_PIC_SUCCESSFUL on success.
- * \e NETPHOTOMW_IF_PIC_FAILED on failed.
- *
- ******************************************************************************************/
- PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_ClearDispFrameBuffer(int index);
- /******************************************************************************************/
- /*!
- * \fn void PhotoPlayer_IF_SetSlideShowTime(PhotoSlideShowSwitch_e eSlideShowTime)
- *
- * \brief Set Slide show time.
- *
- * \param eSlideShowTime[PhotoSlideShowSwitch_e]:
- * PHOTO_INTER_STATE_OFF = 0, \n
- * PHOTO_INTER_STATE_1 = 3000, \n
- * PHOTO_INTER_STATE_2 = 5000, \n
- * PHOTO_INTER_STATE_3 = 10000, \n
- * PHOTO_INTER_STATE_MAX = 20000, \n
- *
- * \return none
- *
- ******************************************************************************************/
- PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_SetSlideShowTime(PhotoPlayerSlideShowSwitch_e eSlideShowTime);
- /******************************************************************************************/
- /*!
- * \fn void NetPhotoMw_IF_EnableSlideTimer(PhotoSlideShowSwitch_e eSlideShowTime)
- *
- * \brief Enable slide show timer.
- *
- * \param eSlideShowTime[PhotoSlideShowSwitch_e]:
- * PHOTO_INTER_STATE_OFF = 0, \n
- * PHOTO_INTER_STATE_1 = 3000, \n
- * PHOTO_INTER_STATE_2 = 5000, \n
- * PHOTO_INTER_STATE_3 = 10000, \n
- * PHOTO_INTER_STATE_MAX = 20000, \n
- *
- * \return none
- *
- ******************************************************************************************/
- PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_EnableSlideTimer(PhotoPlayerSlideShowSwitch_e eSlideShowTime);
- /******************************************************************************************/
- /*!
- * \fn void NetPhotoMw_IF_DisableSlideTimer(PhotoSlideShowSwitch_e eSlideShowTime)
- *
- * \brief Enable slide show timer.
- *
- * \param none
- *
- * \return none
- *
- ******************************************************************************************/
- PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_DisableSlideTimer(void);
- /******************************************************************************************/
- /*!
- * \fn void PhotoPlayer_IF_DrawLargePhoto(UINT8* pBuf, UINT32 dSize, UINT32 dPhotoIdx)
- *
- * \brief Enable slide show timer.
- *
- * \param none
- *
- * \return none
- *
- ******************************************************************************************/
- PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_DrawLargePhoto(UINT8* pBuf, UINT32 dSize, UINT32 dPhotoIdx);
- /******************************************************************************************/
- /*!
- * \fn void PhotoPlayer_IF_DrawLargePhotoStream(UINT8* pBuf, UINT32 dSize, UINT32 dPhotoIdx,
- int handle, void *ReadFunc, void *SeekFunc)
- *
- * \brief Draw large photo with stream method.
- *
- * \param none
- *
- * \return none
- *
- ******************************************************************************************/
- PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_DrawLargePhotoStream(UINT8* pBuf, UINT32 dSize, UINT32 dPhotoIdx,
- int handle, void *ReadFunc, void *SeekFunc);
- /******************************************************************************************/
- /*!
- * \fn void PhotoPlayer_IF_DrawThumbnailPhoto(UINT32 dPosX, UINT32 dPosY,
- UINT32 dRectW,UINT32 dRectH,
- UINT32 dPicW, UINT32 dPicH,
- UINT8* pBuf, UINT32 dSize)
- *
- * \brief Enable slide show timer.
- *
- * \param none
- *
- * \return none
- *
- ******************************************************************************************/
- PHOTO_PLAYER_IF_EXTERN INT32 PhotoPlayer_IF_DrawThumbnailPhoto(UINT32 dPosX, UINT32 dPosY,
- UINT32 dRectW,UINT32 dRectH,
- UINT32 dPicW, UINT32 dPicH,
- UINT8* pBuf, UINT32 dSize);
- INT32 PhotoPlayer_IF_SetEffectType(PhotoEffectType_e eEffectType);
- INT32 PhotoPlayer_IF_GetPicFrameInfo(PIC_FrmInfo_t *pic_info);
- #endif
|