/******************************************************************************/ /** * * \file dlna_if.h * * * \brief include dlna interface functions. \n * * \note Copyright (c) 2011 sunmedia Technology Co., Ltd. \n * All rights reserved. * * * \author cs.wei@sunmedia.com.cn * ** Date Author Modification ** 11/8/29 cs.wei create * ******************************************************************************/ #ifndef __DLNA_IF_H__ #define __DLNA_IF_H__ #ifdef DLNA_IF_IMPLEMENTATION #define DLNA_IF_EXTERN #else #define DLNA_IF_EXTERN extern #endif #include "gl_sema.h" // johnson //#include "net/net_player/net_player_if.h" // johnson #include "net_player_if.h" // johnson #define DLNA_SUCCESS (0) #define DLNA_FAIL (-1) typedef enum { DLNA_DMP = 0, DLNA_DMR, DLNA_MAX, } DLNA_MODE_e; typedef enum { DLNA_START = 0, DLNA_STOP, DLNA_RMAX, } DLNA_RUNFLAG_e; typedef int (*DLNA_CALLBACK_LISTNER)(int, UINT32, UINT32); typedef struct DLNA_CustomInfo_t_ { DLNA_MODE_e eMode; DLNA_CALLBACK_LISTNER pfCbListner; GL_Semaphore_t pSema; INT32 (*pfInitializePack)(char **pszBuf); INT32 (*pfPrepareData)(UINT32 dHandle,char *pszBuf,UINT32 dIndex); //pack for pcm data. INT32 (*pfFinalizePack)(char *pszBuf); } DLNA_CustomInfo_t; typedef enum { DLNA_EVENT_NULL = NET_PLAYER_CBK_MAX, DLNA_EVENT_AddDms, DLNA_EVENT_DelDms, DLNA_EVENT_AddDmr, DLNA_EVENT_DelDmr, // AVT DLNA_EVENT_SET_METADATA, DLNA_EVENT_SetAVTransportURI, DLNA_EVENT_Play, DLNA_EVENT_Stop, DLNA_EVENT_Pause, DLNA_EVENT_FF, DLNA_EVENT_FR, DLNA_EVENT_Goto, DLNA_EVENT_Prev, DLNA_EVENT_Next, DLNA_EVENT_SET, DLNA_EVENT_GET, // RCS DLNA_EVENT_SetMute, DLNA_EVENT_GetMute, DLNA_EVENT_SetVolume, DLNA_EVENT_GetVolume, DLNA_EVENT_GetDmsList, DLNA_EVENT_GetDmrList, DLNA_EVENT_GetCdsById, DLNA_EVENT_GetCds, DLNA_EVENT_SUBSCRIBE, DLNA_EVENT_UNSUBSCRIBE, DLNA_EVENT_KEEPSUBSCRIBE, DLNA_EVENT_ReSearch, DLNA_EVENT_STATE,//add by rui.l 0309 upnp test DLNA_EVENT_MAX, #if 0 //(DLNA_TEST == 1) // below for test DLNA_EVENT_1 = DLNA_EVENT_MAX, DLNA_EVENT_2, DLNA_EVENT_3, DLNA_EVENT_4, DLNA_EVENT_5, DLNA_EVENT_6, DLNA_EVENT_7, DLNA_EVENT_8, DLNA_EVENT_9, DLNA_EVENT_0, #endif } DLNA_EVENT_e; #define DLNA_LENGTH (2048) typedef struct DLNA_DevInfo_t_ { char pFriName[DLNA_LENGTH]; char pUdn[DLNA_LENGTH]; char pDevIconUrl[DLNA_LENGTH]; } DLNA_DevInfo_t; typedef struct DLNA_DevListInfo_t_ { int dCnt; // [out] DLNA_DevInfo_t* pDevList; // [out] } DLNA_DevListInfo_t; typedef struct DLNA_CdsInfo_t_ { char pID[DLNA_LENGTH]; char pTitle[DLNA_LENGTH]; char pIcon[DLNA_LENGTH]; char pClass[DLNA_LENGTH]; char pUrl[DLNA_LENGTH]; } DLNA_CdsInfo_t; typedef struct DLNA_CdsListInfo_t_ { char* pUdn; // [in] char* pID; // [in] char* pStart; // [in] char* pReqCount; // [in] char* pFilter; // [in] char* pCdsXml; // [out] } DLNA_CdsListInfo_t; #define STATE_CBK_DONE 1 //add by rui.l /******************************************************************** Function ********************************************************************/ DLNA_IF_EXTERN int DLNA_IF_Initialize(DLNA_CustomInfo_t* pstCustomInfo); DLNA_IF_EXTERN int DLNA_IF_Finalize(void); DLNA_IF_EXTERN int DLNA_IF_Start(void); DLNA_IF_EXTERN int DLNA_IF_Stop(void); DLNA_IF_EXTERN int DLNA_IF_OnEvent(int dEvent, unsigned int dParam, void* pPrivate); DLNA_IF_EXTERN int DLNA_IF_NET_Player_Finalize(void); DLNA_IF_EXTERN int DLNA_IF_NET_Player_Initialize(); DLNA_IF_EXTERN int DLNA_IF_StartDMR(void); DLNA_IF_EXTERN int DLNA_IF_StopDMR(void); DLNA_IF_EXTERN void DLNA_IF_DLNAServiceStop(void); DLNA_IF_EXTERN void DLNA_IF_DLNAServiceStart(void); DLNA_IF_EXTERN int DLNA_IF_DMC_IPChange(void); DLNA_IF_EXTERN int DLNA_IF_ReStartDMR(void); DLNA_IF_EXTERN void DLNA_SetDeviceNameRetrieveAPI(INT32 (*pfGetDeviceName)(char*)); #endif