Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

302 lines
7.5 KiB

  1. /*********************************************************************
  2. *
  3. * Copyright (C) Microsoft Corporation, 1997 - 1999
  4. *
  5. * File: dxmrtp.cpp
  6. *
  7. * Abstract:
  8. * Include all factory templates to create a single DLL with
  9. * all the filters.
  10. *
  11. * History:
  12. * 05/03/99 AndresVG - Added rtutil tracing facilities
  13. * 10/21/97 AndresVG - Created
  14. *
  15. **********************************************************************/
  16. #define INCL_WINSOCK_API_TYPEDEFS 1
  17. #include <winsock2.h>
  18. #include <windows.h>
  19. #include <qossp.h>
  20. #include <streams.h>
  21. #include <crtdbg.h>
  22. #include <objbase.h>
  23. #include <initguid.h> // add GUIDs to this module...
  24. #define INITGUID
  25. #include "trace.h"
  26. /*********************************************************************
  27. * Include below what is needed for every module
  28. *********************************************************************/
  29. /*********************************************************************
  30. * AM RTP Demux
  31. *********************************************************************/
  32. #if defined(AMRTPDMX_IN_DXMRTP)
  33. // avoid compiler warning C4786:
  34. // 'identifier' : identifier was truncated to 'number'
  35. // characters in the debug information
  36. #pragma warning( disable : 4786 )
  37. #include <map.h>
  38. #include <multimap.h>
  39. #include <amrtpuid.h>
  40. #include <amrtpdmx.h>
  41. #include "rtpdtype.h"
  42. #include "rtpdmx.h"
  43. #include "rtpdprop.h"
  44. #include "..\amrtpdmx\globals.h"
  45. #include "..\amrtpdmx\template.h"
  46. #endif
  47. /*********************************************************************
  48. * AM RTP Network
  49. *********************************************************************/
  50. #if defined(AMRTPNET_IN_DXMRTP)
  51. #include <olectl.h>
  52. #include <ws2tcpip.h>
  53. #include <amrtpuid.h>
  54. #include <amrtpnet.h>
  55. #include <rrcm_dll.h>
  56. #include <rrcmprot.h>
  57. #include "..\amrtpnet\queue.h"
  58. #include "..\amrtpnet\shared.h"
  59. #include "..\amrtpnet\classes.h"
  60. #include "..\amrtpnet\template.h"
  61. #endif
  62. /*********************************************************************
  63. * AM RTP Silence Supressor
  64. *********************************************************************/
  65. #if defined(AMRTPSS_IN_DXMRTP)
  66. #include <amrtpss.h>
  67. #include <silence.h>
  68. #include <siprop.h>
  69. #include "..\amrtpss\template.h"
  70. #endif
  71. /*********************************************************************
  72. * Receive Paylod Handler RPH
  73. *********************************************************************/
  74. #if defined(RPH_IN_DXMRTP)
  75. #include <amrtpuid.h>
  76. #if !defined(_UUIDS_H_INCLUDED_)
  77. #define _UUIDS_H_INCLUDED_
  78. #include <uuids.h>
  79. #endif
  80. #include "ppmclsid.h"
  81. #include "auduids.h"
  82. #include "ippm.h"
  83. #include "rph.h"
  84. #include "rphprop.h"
  85. #include "rphaud.h"
  86. #include "rphgena.h"
  87. #include "..\rph\rphgena\genaprop.h"
  88. #include "rphgenv.h"
  89. #include "..\rph\rphgenv\genvprop.h"
  90. #include "rphh26x.h"
  91. #include "rphprop2.h"
  92. #include "..\rph\rphaud\template.h"
  93. #include "..\rph\rphgena\template.h"
  94. #include "..\rph\rphgenv\template.h"
  95. #include "..\rph\rphh26x\template.h"
  96. #endif
  97. /*********************************************************************
  98. * Sender Paylod Handler SPH
  99. *********************************************************************/
  100. #if defined(SPH_IN_DXMRTP)
  101. #include <amrtpuid.h>
  102. #if !defined(_UUIDS_H_INCLUDED_)
  103. #define _UUIDS_H_INCLUDED_
  104. #include <uuids.h>
  105. #endif
  106. #include "ppmclsid.h"
  107. #include "auduids.h"
  108. #include "ippm.h"
  109. #include "sph.h"
  110. #include "sphprop.h"
  111. #include "sphaud.h"
  112. #include "sphgena.h"
  113. #include "..\sph\sphgena\genaprop.h"
  114. #include "sphgenv.h"
  115. #include "..\sph\sphgenv\genvprop.h"
  116. #include "sphh26x.h"
  117. #include "..\sph\sphaud\template.h"
  118. #include "..\sph\sphgena\template.h"
  119. #include "..\sph\sphgenv\template.h"
  120. #include "..\sph\sphh26x\template.h"
  121. #endif
  122. /*********************************************************************
  123. * PCM Mixer
  124. *********************************************************************/
  125. #if defined(MIXER_IN_DXMRTP)
  126. #if !defined(_UUIDS_H_INCLUDED_)
  127. #define _UUIDS_H_INCLUDED_
  128. #include <uuids.h>
  129. #endif
  130. #include "..\mixer\stdafx.h"
  131. #include "mxfilter.h"
  132. #include "..\mixer\template.h"
  133. #endif
  134. /*********************************************************************
  135. * PPM
  136. *********************************************************************/
  137. #if defined(PPM_IN_DXMRTP)
  138. STDAPI PPMDllGetClassObject( REFCLSID rclsid, REFIID riid, LPVOID FAR* ppvObj );
  139. STDAPI PPMDllCanUnloadNow( void );
  140. STDAPI PPMDllRegisterServer( void );
  141. STDAPI PPMDllUnregisterServer( void );
  142. #endif
  143. /*********************************************************************
  144. * Codecs: G711, H261, H263
  145. *********************************************************************/
  146. #if defined(CODECS_IN_DXMRTP)
  147. #if !defined(_UUIDS_H_INCLUDED_)
  148. #define _UUIDS_H_INCLUDED_
  149. #include <uuids.h>
  150. #endif
  151. #include "amacodec.h"
  152. #include "amacprop.h"
  153. #include "..\codecs\g711\template.h"
  154. #include "..\codecs\h261\template.h"
  155. #endif
  156. /*********************************************************************
  157. * Bridge Filters
  158. *********************************************************************/
  159. #if defined(BRIDGE_IN_DXMRTP)
  160. #include "..\bridge\precomp.h"
  161. #include "..\bridge\template.h"
  162. #include "ibfilter.h"
  163. #include "..\bridge\bsource.h"
  164. #include "..\bridge\brender.h"
  165. #include "..\bridge\bprop.h"
  166. #endif
  167. /*********************************************************************
  168. * Entry point
  169. *********************************************************************/
  170. extern "C" BOOL WINAPI DllMain(HINSTANCE, ULONG, LPVOID);
  171. extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
  172. BOOL WINAPI
  173. DllMain(
  174. HINSTANCE hInstance,
  175. ULONG ulReason,
  176. LPVOID pv
  177. )
  178. {
  179. if (ulReason == DLL_PROCESS_ATTACH)
  180. {
  181. TRACEREGISTER(TEXT("dxmrtp")); // rtutil tracing facilities
  182. _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
  183. }
  184. BOOL res = DllEntryPoint(hInstance, ulReason, pv);
  185. if (ulReason == DLL_PROCESS_DETACH)
  186. {
  187. _RPT0( _CRT_WARN, "Going to call dump memory leaks.\n");
  188. _CrtDumpMemoryLeaks();
  189. TRACEDEREGISTER(); // rtutil tracing facilities
  190. }
  191. return res;
  192. }
  193. STDAPI
  194. DxmDllGetClassObject(REFCLSID rClsID, REFIID riid, void **pv)
  195. {
  196. #if defined(PPM_IN_DXMRTP)
  197. if (PPMDllGetClassObject(rClsID, riid, pv) == NOERROR)
  198. return(NOERROR);
  199. #endif
  200. return(DllGetClassObject(rClsID, riid, pv));
  201. }
  202. STDAPI
  203. DxmDllCanUnloadNow()
  204. {
  205. #if defined(PPM_IN_DXMRTP)
  206. if (PPMDllCanUnloadNow() != S_OK)
  207. return(S_FALSE);
  208. #endif
  209. return(DllCanUnloadNow());
  210. }
  211. HRESULT
  212. DllRegisterServer()
  213. {
  214. #if defined(AMRTPDMX_IN_DXMRTP)
  215. RtpDemuxRegisterResources();
  216. #endif
  217. #if defined(PPM_IN_DXMRTP)
  218. PPMDllRegisterServer();
  219. #endif
  220. // forward to amovie framework
  221. return AMovieDllRegisterServer2( TRUE );
  222. }
  223. HRESULT
  224. DllUnregisterServer()
  225. {
  226. #if defined(PPM_IN_DXMRTP)
  227. PPMDllUnregisterServer();
  228. #endif
  229. // forward to amovie framework
  230. return AMovieDllRegisterServer2( FALSE );
  231. }
  232. CFactoryTemplate g_Templates[] = {
  233. #if defined(AMRTPDMX_IN_DXMRTP)
  234. CFT_AMRTPDMX_ALL_FILTERS,
  235. #endif
  236. #if defined(AMRTPNET_IN_DXMRTP)
  237. CFT_AMRTPNET_ALL_FILTERS,
  238. #endif
  239. #if defined(AMRTPSS_IN_DXMRTP)
  240. CFT_AMRTPSS_ALL_FILTERS,
  241. #endif
  242. #if defined(RPH_IN_DXMRTP)
  243. CFT_RPHAUD_ALL_FILTERS,
  244. CFT_RPHGENA_ALL_FILTERS,
  245. #if !defined(NO_GENERIC_VIDEO)
  246. CFT_RPHGENV_ALL_FILTERS,
  247. #endif
  248. CFT_RPHH26X_ALL_FILTERS,
  249. #endif
  250. #if defined(SPH_IN_DXMRTP)
  251. CFT_SPHAUD_ALL_FILTERS,
  252. CFT_SPHGENA_ALL_FILTERS,
  253. #if !defined(NO_GENERIC_VIDEO)
  254. CFT_SPHGENV_ALL_FILTERS,
  255. #endif
  256. CFT_SPHH26X_ALL_FILTERS,
  257. #endif
  258. #if defined(MIXER_IN_DXMRTP)
  259. CFT_MIXER_ALL_FILTERS,
  260. #endif
  261. #if defined(CODECS_IN_DXMRTP)
  262. CFT_G711_ALL_FILTERS,
  263. #endif
  264. #if defined(BRIDGE_IN_DXMRTP)
  265. CFT_BRIDGE_ALL_FILTERS,
  266. #endif
  267. };
  268. int g_cTemplates = (sizeof(g_Templates)/sizeof(g_Templates[0]));