dlna_if.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. /******************************************************************************/
  2. /**
  3. *
  4. * \file dlna_if.h
  5. *
  6. *
  7. * \brief include dlna interface functions. \n
  8. *
  9. * \note Copyright (c) 2011 sunmedia Technology Co., Ltd. \n
  10. * All rights reserved.
  11. *
  12. *
  13. * \author cs.wei@sunmedia.com.cn
  14. *
  15. ** Date Author Modification
  16. ** 11/8/29 cs.wei create
  17. *
  18. ******************************************************************************/
  19. #ifndef __DLNA_IF_H__
  20. #define __DLNA_IF_H__
  21. #ifdef DLNA_IF_IMPLEMENTATION
  22. #define DLNA_IF_EXTERN
  23. #else
  24. #define DLNA_IF_EXTERN extern
  25. #endif
  26. #include "gl_sema.h" // johnson
  27. //#include "net/net_player/net_player_if.h" // johnson
  28. #include "net_player_if.h" // johnson
  29. #define DLNA_SUCCESS (0)
  30. #define DLNA_FAIL (-1)
  31. typedef enum {
  32. DLNA_DMP = 0,
  33. DLNA_DMR,
  34. DLNA_MAX,
  35. } DLNA_MODE_e;
  36. typedef enum {
  37. DLNA_START = 0,
  38. DLNA_STOP,
  39. DLNA_RMAX,
  40. } DLNA_RUNFLAG_e;
  41. typedef int (*DLNA_CALLBACK_LISTNER)(int, UINT32, UINT32);
  42. typedef struct DLNA_CustomInfo_t_
  43. {
  44. DLNA_MODE_e eMode;
  45. DLNA_CALLBACK_LISTNER pfCbListner;
  46. GL_Semaphore_t pSema;
  47. INT32 (*pfInitializePack)(char **pszBuf);
  48. INT32 (*pfPrepareData)(UINT32 dHandle,char *pszBuf,UINT32 dIndex); //pack for pcm data.
  49. INT32 (*pfFinalizePack)(char *pszBuf);
  50. } DLNA_CustomInfo_t;
  51. typedef enum {
  52. DLNA_EVENT_NULL = NET_PLAYER_CBK_MAX,
  53. DLNA_EVENT_AddDms,
  54. DLNA_EVENT_DelDms,
  55. DLNA_EVENT_AddDmr,
  56. DLNA_EVENT_DelDmr,
  57. // AVT
  58. DLNA_EVENT_SET_METADATA,
  59. DLNA_EVENT_SetAVTransportURI,
  60. DLNA_EVENT_Play,
  61. DLNA_EVENT_Stop,
  62. DLNA_EVENT_Pause,
  63. DLNA_EVENT_FF,
  64. DLNA_EVENT_FR,
  65. DLNA_EVENT_Goto,
  66. DLNA_EVENT_Prev,
  67. DLNA_EVENT_Next,
  68. DLNA_EVENT_SET,
  69. DLNA_EVENT_GET,
  70. // RCS
  71. DLNA_EVENT_SetMute,
  72. DLNA_EVENT_GetMute,
  73. DLNA_EVENT_SetVolume,
  74. DLNA_EVENT_GetVolume,
  75. DLNA_EVENT_GetDmsList,
  76. DLNA_EVENT_GetDmrList,
  77. DLNA_EVENT_GetCdsById,
  78. DLNA_EVENT_GetCds,
  79. DLNA_EVENT_SUBSCRIBE,
  80. DLNA_EVENT_UNSUBSCRIBE,
  81. DLNA_EVENT_KEEPSUBSCRIBE,
  82. DLNA_EVENT_ReSearch,
  83. DLNA_EVENT_STATE,//add by rui.l 0309 upnp test
  84. DLNA_EVENT_MAX,
  85. #if 0 //(DLNA_TEST == 1)
  86. // below for test
  87. DLNA_EVENT_1 = DLNA_EVENT_MAX,
  88. DLNA_EVENT_2,
  89. DLNA_EVENT_3,
  90. DLNA_EVENT_4,
  91. DLNA_EVENT_5,
  92. DLNA_EVENT_6,
  93. DLNA_EVENT_7,
  94. DLNA_EVENT_8,
  95. DLNA_EVENT_9,
  96. DLNA_EVENT_0,
  97. #endif
  98. } DLNA_EVENT_e;
  99. #define DLNA_LENGTH (2048)
  100. typedef struct DLNA_DevInfo_t_
  101. {
  102. char pFriName[DLNA_LENGTH];
  103. char pUdn[DLNA_LENGTH];
  104. char pDevIconUrl[DLNA_LENGTH];
  105. } DLNA_DevInfo_t;
  106. typedef struct DLNA_DevListInfo_t_
  107. {
  108. int dCnt; // [out]
  109. DLNA_DevInfo_t* pDevList; // [out]
  110. } DLNA_DevListInfo_t;
  111. typedef struct DLNA_CdsInfo_t_
  112. {
  113. char pID[DLNA_LENGTH];
  114. char pTitle[DLNA_LENGTH];
  115. char pIcon[DLNA_LENGTH];
  116. char pClass[DLNA_LENGTH];
  117. char pUrl[DLNA_LENGTH];
  118. } DLNA_CdsInfo_t;
  119. typedef struct DLNA_CdsListInfo_t_
  120. {
  121. char* pUdn; // [in]
  122. char* pID; // [in]
  123. char* pStart; // [in]
  124. char* pReqCount; // [in]
  125. char* pFilter; // [in]
  126. char* pCdsXml; // [out]
  127. } DLNA_CdsListInfo_t;
  128. #define STATE_CBK_DONE 1 //add by rui.l
  129. /********************************************************************
  130. Function
  131. ********************************************************************/
  132. DLNA_IF_EXTERN int DLNA_IF_Initialize(DLNA_CustomInfo_t* pstCustomInfo);
  133. DLNA_IF_EXTERN int DLNA_IF_Finalize(void);
  134. DLNA_IF_EXTERN int DLNA_IF_Start(void);
  135. DLNA_IF_EXTERN int DLNA_IF_Stop(void);
  136. DLNA_IF_EXTERN int DLNA_IF_OnEvent(int dEvent, unsigned int dParam, void* pPrivate);
  137. DLNA_IF_EXTERN int DLNA_IF_NET_Player_Finalize(void);
  138. DLNA_IF_EXTERN int DLNA_IF_NET_Player_Initialize();
  139. DLNA_IF_EXTERN int DLNA_IF_StartDMR(void);
  140. DLNA_IF_EXTERN int DLNA_IF_StopDMR(void);
  141. DLNA_IF_EXTERN void DLNA_IF_DLNAServiceStop(void);
  142. DLNA_IF_EXTERN void DLNA_IF_DLNAServiceStart(void);
  143. DLNA_IF_EXTERN int DLNA_IF_DMC_IPChange(void);
  144. DLNA_IF_EXTERN int DLNA_IF_ReStartDMR(void);
  145. DLNA_IF_EXTERN void DLNA_SetDeviceNameRetrieveAPI(INT32 (*pfGetDeviceName)(char*));
  146. #endif