/******************************************************************************/ /*! @addtogroup AL_Multimeidia_Player * @{ ******************************************************************************/ /******************************************************************************/ /*! * @file AL_Multimeidia_Player_IF.c * * @brief This file specifies the APIs used to control media_playback to play media file.\n * * @note Copyright (c) 2013 S2 Technology Co., Ltd. \n * All rights reserved. ********************************************************************************/ #ifndef __AL_MULTIMEDIA_PLAYER_IF_H__ #define __AL_MULTIMEDIA_PLAYER_IF_H__ /******************************************************************************* * Header include ******************************************************************************/ #include "AL_Multimedia_Player_Types.h" #include "AL_Multimedia_FileSystem_IF.h" #include "region.h" #include "AL_Media_CodePage.h" /******************************************************************************* * Enumeration ******************************************************************************/ typedef enum { PLAYER_PIC_ENVIRONMENT = 0, PLAYER_PE_ENVIRONMENT, } Player_Lib_Parameter_Type; typedef struct { AL_PLAYER_Zoom_Index_t Active_Zoom_Step; INT8 X_Direct_Percent; INT8 Y_Direct_Percent; } AL_PLAYER_Zoom_Info_t; typedef struct { UINT32 Time; } AL_PLAYER_Goto_Info_t; typedef union { AL_PLAYER_PIC_Rotation_Info_t Photo_Rotation_Info; struct { UINT8 Program_Index; /*!< Select target program index, some of the video file with multi programs, eg. TS*/ } Video_Config; struct { UINT8 Reserve; } Audio_Config; struct { BOOL Enable_Unmute; } Photo_Config; } AL_PLAYER_Play_Info_t; typedef struct { FileSystem_FileType_t FileType; AL_PLAYER_Play_Info_t Play_Info; } CtrlCmd_PLAYER_PLAY_t; typedef struct { FileSystem_FileType_t FileType; AL_PLAYER_Zoom_Index_t Index; AL_PLAYER_Zoom_Type_t Method; } CtrlCmd_PLAYER_ZOOM_t; typedef struct { FileSystem_FileType_t FileType; const char* Rom_File_Data; UINT32 Rom_File_Data_Size; } CtrlCmd_PLAYER_ROM_FILE_OPEN_t; typedef struct { FileSystem_FileType_t FileType; AL_PLAYER_Zoom_Type_t Zoom_Method; } CtrlCmd_PLAYER_HIERARCH_ZOOM_t; typedef struct { AL_PLAYER_PIC_Rotation_Info_t Angle; } CtrlCmd_PLAYER_ROTATION_SPECIFIED_t; typedef struct { FileSystem_FileType_t FileType; } CtrlCmd_PLAYER_FF_t; typedef struct { FileSystem_FileType_t FileType; } CtrlCmd_PLAYER_FB_t; typedef struct { FileSystem_FileType_t FileType; } CtrlCmd_PLAYER_SF_t; typedef struct { FileSystem_FileType_t FileType; } CtrlCmd_PLAYER_PAUSE_t; typedef struct { FileSystem_FileType_t FileType; } CtrlCmd_PLAYER_ROM_FILE_PLAY_t; typedef struct { FileSystem_FileType_t FileType; } CtrlCmd_PLAYER_ROM_FILE_CLOSE_t; typedef struct { FileSystem_FileType_t FileType; } CtrlCmd_PLAYER_CLEAR_DISPLAY_IMAGE_t; typedef struct { FileSystem_FileType_t FileType; } CtrlCmd_PLAYER_STOP_t; typedef struct { FileSystem_FileType_t FileType; AL_PLAYER_Zoom_Move_Direction_t Direction; } CtrlCmd_PLAYER_ZOOM_MOVE_t; typedef AL_PLAYER_PIC_Resolution_Info_t CtrlCmd_PLAYER_SET_PIC_RESOLUTION_t; typedef AL_PLAYER_Goto_Info_t CtrlCmd_PLAYER_GOTO_t; typedef union { FileSystem_FileType_t FileType; //AL_PLAYER_PIC_Resolution_Info_t PIC_Resolution_Info; //AL_PLAYER_Zoom_Index_t Zoom_Index; //AL_PLAYER_Goto_Info_t Goto_Info; /*If Cmd not in this union, this cmd cab be NULL*/ CtrlCmd_PLAYER_PAUSE_t Pause_Param; CtrlCmd_PLAYER_FF_t FF_Param; CtrlCmd_PLAYER_FB_t FB_Param; CtrlCmd_PLAYER_SF_t SF_Param; CtrlCmd_PLAYER_PLAY_t Play_Param; CtrlCmd_PLAYER_STOP_t Stop_Param; CtrlCmd_PLAYER_SET_PIC_RESOLUTION_t Set_Pic_Resolution_Param; CtrlCmd_PLAYER_ZOOM_t Zoom_Param; CtrlCmd_PLAYER_HIERARCH_ZOOM_t Hierarch_Param; CtrlCmd_PLAYER_ROTATION_SPECIFIED_t Rotation_Specified_Param; CtrlCmd_PLAYER_GOTO_t Goto_Param; CtrlCmd_PLAYER_ROM_FILE_OPEN_t Rom_File_Open_Param; CtrlCmd_PLAYER_ROM_FILE_PLAY_t Rom_File_Play_Param; CtrlCmd_PLAYER_ROM_FILE_CLOSE_t Rom_File_Close_Param; CtrlCmd_PLAYER_CLEAR_DISPLAY_IMAGE_t Clear_Display_Image_Param; CtrlCmd_PLAYER_ZOOM_MOVE_t Zoom_Move_Param; } AL_PLAYER_CtrlCmd_Info_t; /******************************************************************************* * Structure ******************************************************************************/ /******************************************************************************* * Program ******************************************************************************/ /******************************************************************************/ /** * @brief capture OSDBmp and change To JepgFile * @param cOutFile: e.g /mnt/sda1/test.jepg. * @return AL_PLAYER_SUCCESS if initial successful\n * AL_PLAYER_ERR_FAILURE if Initial Fail ******************************************************************************/ AL_PLAYER_t AL_Multimedia_Player_CaputreOSDBmpToJepgFile(char* OutFile,int encode_quality); /******************************************************************************/ /** * @brief AL Multimedia Player Lib Initial, If u need to call any Lib's Api, please call this func. first. * @return AL_PLAYER_SUCCESS if initial successful\n * AL_PLAYER_ERR_FAILURE if Initial Fail ******************************************************************************/ AL_PLAYER_t AL_Multimedia_Player_Lib_Init(void); /******************************************************************************/ /** * @brief AL Multimedia Player Initial, Please call this func. after AL_Multimedia_Player_Lib_Init() * @return AL_PLAYER_SUCCESS if successful\n * AL_PLAYER_ERR_FAILURE if Initial Fail ******************************************************************************/ AL_PLAYER_t AL_Multimedia_Player_IF_Init(void); /******************************************************************************/ /** * @brief AL Multimedia Player UnInitial * ******************************************************************************/ void AL_Multimeida_Player_IF_Uninit(void); /******************************************************************************/ /** * @brief Post Msg Hook API\n * AL_Multimedia_Player_RegisterMsgRouteway hooked success, we will use this API to post msg. * @param BOOL (*SendMsg_Func)(AL_PLAYER_Event_t) : Post Msg API * ******************************************************************************/ void AL_Multimedia_Player_RegisterMsgRouteway(BOOL (*SendMsg_Func)(AL_PLAYER_Event_t)); /******************************************************************************/ /** * @brief PIC Post Msg Hook API\n * AL_Multimedia_Player_RegisterPICMsgRouteway hooked success, we will use this API to post PIC msg. * @param BOOL (*SendMsg_Func)(AL_PLAYER_Event_t) : Post Msg API * ******************************************************************************/ void AL_Multimedia_Player_RegisterPICMsgRouteway(BOOL (*SendMsg_Func)(AL_PLAYER_Event_t)); /******************************************************************************/ /** * @brief PE Post Msg Hook API\n * AL_Multimedia_Player_RegisterPEMsgRouteway hooked success, we will use this API to post PE msg. * @param BOOL (*SendMsg_Func)(AL_PLAYER_Event_t) : Post Msg API * ******************************************************************************/ void AL_Multimedia_Player_RegisterPEMsgRouteway(BOOL (*SendMsg_Func)(AL_PLAYER_Event_t)); /******************************************************************************/ /** * @brief Hook FileSystem API to provide File Info. to Player. * @param AL_PLAYER_Hook_Func_List_t Hook_Api : Hook Api, detail please ref. AL_PLAYER_Hook_Func_List_t. * @return AL_PLAYER_SUCCESS if successful\n * AL_PLAYER_ERR_INVALID_PARAM if parameters is invalid.\n * ******************************************************************************/ AL_PLAYER_t AL_Multimedia_Player_HookFileSystemAPI(AL_PLAYER_Hook_Func_List_t Hook_Api); /******************************************************************************/ /** * @brief Register Parameter, that Lib Need it to do something. * @param Player_Lib_Parameter_Type Register_Type : PLAYER_PIC_ENVIRONMENT/PLAYER_PE_ENVIRONMENT\n * const void* Param : Parameter of PE/PIC Lib needed,\n * Detail please ref. AL_PLAYER_PIC_Register_Environment_Parameter_t and AL_PLAYER_PE_Register_Environment_Parameter_t * @return AL_PLAYER_SUCCESS if successful\n * AL_PLAYER_ERR_INVALID_PARAM if parameters is invalid.\n * AL_PLAYER_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_PLAYER_t AL_Multimedia_Player_RegisterParameterToLib(Player_Lib_Parameter_Type Register_Type, const void* Param); /******************************************************************************/ /** * @brief Send Cmd to Request PE/PIC Lib to do something * @param AL_PLAYER_CtrlCmd_t Player_Cmd : Command, detail please ref. AL_PLAYER_CtrlCmd_t.\n * AL_PLAYER_CtrlCmd_Info_t* const Player_Cmd_Info : detail information. * @return AL_PLAYER_SUCCESS if successful\n * AL_PLAYER_ERR_INVALID_PARAM if parameters is invalid.\n * AL_PLAYER_ERR_ACCESS if soruce device has some trouble\n * AL_PLAYER_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_PLAYER_t AL_Multimedia_Player_RequestCommand(AL_PLAYER_CtrlCmd_t Player_Cmd, AL_PLAYER_CtrlCmd_Info_t* const Player_Cmd_Info); /******************************************************************************/ /** * @brief Use to hook post Lyric message function. * @param AL_PLAYER_Hook_Lyric_t Hook_Func : Function point, to assign Post Lyric message func. * ******************************************************************************/ void AL_Multimedia_Player_HookLyricAPI(AL_PLAYER_Hook_Lyric_t Hook_Func); /******************************************************************************/ /** * @brief Configuration parameter settings of Lyric * @param BOOL Lyric_On_Off: Enable / Disable Subtitle Output * UINT32 Shift_Time: Reserve * ******************************************************************************/ void AL_Multimedia_Player_SetAudioLyricCfg(BOOL Lyric_On_Off, UINT32 Shift_Time); #if 0 // newfontmask /******************************************************************************/ /** * @brief Set subtitle font information when system power on. * @param * @return AL_PLAYER_SUCCESS if successful\n * AL_PLAYER_ERR_INVALID_PARAM if input param is invalid\n * AL_PLAYER_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_PLAYER_t AL_Multimedia_Player_SetSubtitleFontInfo(FONTInfo_t *pFontInfo, UINT32 FontBlockNum, UINT32 FontStyleNum, UINT8 LangNum); #endif /******************************************************************************/ /** * @brief Use to enable/disable subtitle * @param BOOL Subtitle_Enable : Set this param to enable/disable subtitle\n 1 : enable / 0 : disable * @return AL_PLAYER_SUCCESS if successful\n * AL_PLAYER_ERR_INVALID_PARAM if input param is invalid\n * AL_PLAYER_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_PLAYER_t AL_Multimedia_Player_SetVideoSubtitleEnable(BOOL Subtitle_Enable); /******************************************************************************/ /** * @brief Use to enable/disable subtitle * @param UINT8 Subtitle_Index : Set subtitle index. * @return AL_PLAYER_SUCCESS if successful\n * AL_PLAYER_ERR_INVALID_PARAM if input param is invalid\n * AL_PLAYER_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_PLAYER_t AL_Multimedia_Player_SetVideoSubtitleIndex(UINT8 Subtitle_Index); /******************************************************************************/ /** * @brief Use to set subtitle Y direction position * @param AL_PLAYER_Video_Subtitle_PosY_t Subtitle_Y_Position : position index * @return AL_PLAYER_SUCCESS if successful\n * AL_PLAYER_ERR_INVALID_PARAM if input param is invalid * AL_PLAYER_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_PLAYER_t AL_Multimedia_Player_SetVideoSubtitlePosY(AL_PLAYER_Video_Subtitle_PosY_t Subtitle_Y_Position); /******************************************************************************/ /** * @brief Use to set subtitle font color * @param AL_PLAYER_Video_Subtitle_FontColor_t ColorIdx : color index * @return AL_PLAYER_SUCCESS if successful\n * AL_PLAYER_ERR_INVALID_PARAM if input param is invalid * AL_PLAYER_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_PLAYER_t AL_Multimedia_Player_SetVideoSubtitleFontColor(AL_PLAYER_Video_Subtitle_FontColor_t ColorIdx); /******************************************************************************/ /** * @brief Use to set subtitle time shift * @param int ShiftTime_ms : (+) delay ; (-) in advance * Currently, define the max time shift value is (+) and (-) 10 s * @return AL_PLAYER_SUCCESS if successful\n * AL_PLAYER_ERR_INVALID_PARAM if input param is invalid * AL_PLAYER_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_PLAYER_t AL_Multimedia_Player_SetVideoSubtitleTimeShift(int TimeShift_ms); /******************************************************************************/ /** * @brief Use to set subtitle font size * @param AL_PLAYER_Video_Subtitle_FontSize_t FontSize : subtitle font size * The font size decrease from FONT_SIZE_LARGE_L to FONT_SIZE_SMALL_S * @return AL_PLAYER_SUCCESS if successful\n * AL_PLAYER_ERR_INVALID_PARAM if input param is invalid * AL_PLAYER_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_PLAYER_t AL_Multimedia_Player_SetVideoSubtitleFontSize(int FontSize); /******************************************************************************/ /** * @brief Use to set default system code page to subtitle * Please call this API before performing PLAYER_OPEN_SELECT_FILE Command. * @param MediaCodePage_e SysCodePage : code page * @return AL_PLAYER_SUCCESS if successful\n * AL_PLAYER_ERR_INVALID_PARAM if input param is invalid * AL_PLAYER_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_PLAYER_t AL_Multimedia_Player_SetVideoDefaultSubtitleSysCodePage(MediaCodePage_e SysCodePage); /******************************************************************************/ /** * @brief Use to set user language code page to subtitle * @param MediaCodePage_e SysCodePage : code page * Adjust code page after opening file for subtitle is displayed incorrectly. * @return AL_PLAYER_SUCCESS if successful\n * AL_PLAYER_ERR_INVALID_PARAM if input param is invalid * AL_PLAYER_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_PLAYER_t AL_Multimedia_Player_SetVideoSubtitleUserLangCodePage(MediaCodePage_e SysCodePage); /******************************************************************************/ /** * @brief Use to set system code page to subtitle * @param MediaCodePage_e SysCodePage : code page * Adjust code page after opening file for subtitle is displayed incorrectly. * @return AL_PLAYER_SUCCESS if successful\n * AL_PLAYER_ERR_INVALID_PARAM if input param is invalid * AL_PLAYER_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_PLAYER_t AL_Multimedia_Player_SetVideoSubtitleSysCodePage(MediaCodePage_e SysCodePage); /******************************************************************************/ /** * @brief Use to select the Sound Track, that u want to listen. * @param UINT8 SoundTrack_Index : Set this param to change currently sound track index.\n * @return AL_PLAYER_SUCCESS if successful\n * AL_PLAYER_ERR_INVALID_PARAM if parameters is invalid.\n * AL_PLAYER_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_PLAYER_t AL_Multimedia_Player_SetVideoSoundTrackCfg(UINT8 SoundTrack_Index); #ifdef CONFIG_SUPPORT_MEDIA_AD /******************************************************************************/ /** * @brief Use to select the Sound Track with AD, that u want to listen. * @param UINT8 SoundTrack_Main_Index : Set this param to change currently main sound track index.\n * UINT8 SoundTrack_AD_Index : Set this param to change currently ad sound track index.\n * @return AL_PLAYER_SUCCESS if successful\n * AL_PLAYER_ERR_INVALID_PARAM if parameters is invalid.\n * AL_PLAYER_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_PLAYER_t AL_Multimedia_Player_SetVideoSoundTrackCfg_WithAD(UINT8 SoundTrack_Main_Index, UINT8 SoundTrack_AD_Index); #endif /******************************************************************************/ /** * @brief Use to set sound out mode of Video / Audio file, that is u want to listen. * @param AL_PLAYER_SoundMode_t SoundMode : Output Sound Mode, Detail please ref. AL_PLAYER_SoundMode_t. * @return AL_PLAYER_SUCCESS if successful\n * AL_PLAYER_ERR_INVALID_PARAM if input param is invalid\n * AL_PLAYER_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_PLAYER_t AL_Multimedia_Player_SetVideo_SoundModeCfg(AL_PLAYER_SoundMode_t SoundMode); /******************************************************************************/ /** * @brief Get Opened Audio/Video File's Duration(Sec) * @param UINT32* const TotalTime : Output Media File's Duration(Sec) * @return AL_FS_SUCCESS if successful\n * AL_FS_ERR_INVALID_PARAM if parameters is invalid.\n * AL_FS_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_PLAYER_t AL_Multimedia_Player_GetOpenedAVDuration(UINT32* const Duration); /******************************************************************************/ /** * @brief Get Playing Audio/Video File's Playing Time(Sec) * @param UINT32* const PlayTime : Output Media File's Playing Time(Sec) * @return AL_FS_SUCCESS if successful\n * AL_FS_ERR_INVALID_PARAM if parameters is invalid.\n * AL_FS_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_PLAYER_t AL_Multimedia_Player_GetPlayingAVPlayTime(UINT32* const PlayTime); /******************************************************************************/ /** * @brief Report Opened Video File Information,\n * if u opened file isn't a Video file, it will report 0. * @return Video Information, detail please ref. AL_PLAYER_Video_Info_t. * ******************************************************************************/ const AL_PLAYER_Video_Info_t* AL_Multimedia_Player_GetOpenedVideoInfo(void); /******************************************************************************/ /** * @brief Use to get the playing music's lyric information,\n * @param UINT16 Song_Index : Lyric Index\n, * char* LRC_Buf : Output Lyric String Buffer\n * UINT16 LRC_Buf_Len : Lyric Buffer Size\n * UINT16* LRC_Time : Output Lyric Mapping Time * @return AL_PLAYER_SUCCESS if successful\n * AL_PLAYER_ERR_INVALID_PARAM if input param or environment is invalid\n * ******************************************************************************/ AL_PLAYER_t AL_Multimedia_Player_GetPlayingLRCInfo(UINT16 Song_Index, char* LRC_Buf, UINT16 LRC_Buf_Len, UINT16* LRC_Time); /******************************************************************************/ /** * @brief Use to get zoom info of the opened photo\n * @return Zoom Info, Detail please ref. AL_PLAYER_Zoom_Info_t * ******************************************************************************/ AL_PLAYER_Zoom_Info_t AL_Multimedia_Player_GetOpenedPhotoZoomInfo(void); /******************************************************************************/ /** * @brief Use to get the photo's display area\n * Please call this function after photo play, before photo stop!(It's a limitation of PIC Lib)\n * @param AL_PLAYER_Photo_Display_Area_t* Display_Area: Output Display Area, detail please reference AL_PLAYER_Photo_Display_Area_t. * @return AL_PLAYER_SUCCESS if successful\n * AL_PLAYER_ERR_INVALID_PARAM if input param or environment is invalid\n * ******************************************************************************/ AL_PLAYER_t AL_Multimedia_Player_GetOpenedPhotoDisplayInfo(AL_PLAYER_Photo_Display_Area_t* Display_Area); /******************************************************************************/ /** * @brief Report Opened Photo File Rotate Information,\n * if u opened file isn't a Photo file, it will report 0. * @return Photo Rotate Information, detail please ref. AL_PLAYER_PIC_Rotation_Info_t. * ******************************************************************************/ AL_PLAYER_PIC_Rotation_Info_t AL_Multimedia_Player_GetOpenedPhotoRotateInfo(void); /******************************************************************************/ /** * @brief Report Opened Audio File Information,\n * if u opened file isn't a Audio file, it will report 0. * @return Audio Information, detail please ref. AL_PLAYER_Audio_Info_t. * ******************************************************************************/ const AL_PLAYER_Audio_Info_t* AL_Multimedia_Player_GetOpenedAudioInfo(void); /******************************************************************************/ /** * @brief Report Opened Photo File Information,\n * if u opened file isn't a Photo file, it will report 0. * @return Photo Information, detail please ref. AL_PLAYER_Photo_Info_t. * ******************************************************************************/ const AL_PLAYER_Photo_Info_t* AL_Multimedia_Player_GetOpenedPhotoInfo(void); /******************************************************************************/ /** * @brief This function describe some process, that is Player Decode Lib requirements.\n * This function must only be called once, when first time use player module, or system bootup. * @return AL_PLAYER_SUCCESS if successful\n * AL_PLAYER_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_PLAYER_t AL_Multimedia_Player_Prior_Init(void); AL_PLAYER_t AL_Multimedia_Set_Video_Display_Window(UINT32 XStart, UINT32 YStart, UINT32 XEnd, UINT32 YEnd, BOOL FullScreen); /******************************************************************************/ /** * @brief Use to get WinOnFrame size\n * @return void * ******************************************************************************/ void AL_Multimedia_Player_GetWinOnFrameSize(int *width, int *height, int *WinWidth, int *WinHeight); AL_PLAYER_t AL_Multimedia_Player_Get_Play_State(void); #ifdef CONFIG_SUPPORT_DIVXDRM /******************************************************************************/ /** * @brief Use to get DivX Rental Information. * ******************************************************************************/ AL_PLAYER_DivX_Rental_Info_t AL_Multimedia_Player_Get_DivX_Rental_Info(void); AL_PLAYER_VideoType_t AL_Multimedia_Player_Get_Video_Type(void); void AL_Multimedia_Player_Set_Video_Type(AL_PLAYER_VideoType_t Param); #endif /******************************************************************************/ /** * @brief Use to Reset Trick Play Setup Parameter. * ******************************************************************************/ void AL_Multimedia_Player_PE_Reset_TrickPlay_Setting(void); /******************************************************************************/ /** * @brief Use to get rate information * @param AL_PLAYER_Rating_Info_t* Out_Rating_Info : Output rating Info. * ******************************************************************************/ AL_PLAYER_t AL_Multimedia_Player_Get_Rating_Info(AL_PLAYER_Rating_Info_t* Out_Rating_Info); #endif /*! @} end of addtogroup AL_Multimeidia_Player */