2 * Qcap implementation, dllentry points
4 * Copyright (C) 2003 Dominik Strasser
5 * Copyright (C) 2005 Rolf Kalbermatter
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
28 #define NONAMELESSSTRUCT
29 #define NONAMELESSUNION
39 #include "qcap_main.h"
41 #include "wine/unicode.h"
42 #include "wine/debug.h"
44 WINE_DEFAULT_DEBUG_CHANNEL(qcap);
46 static LONG objects_ref = 0;
48 static const WCHAR wAudioCaptFilter[] =
49 {'A','u','d','i','o',' ','C','a','p','t','u','r','e',' ','F','i','l','t','e','r',0};
50 static const WCHAR wAVICompressor[] =
51 {'A','V','I',' ','C','o','m','p','r','e','s','s','o','r',0};
52 static const WCHAR wVFWCaptFilter[] =
53 {'V','F','W',' ','C','a','p','t','u','r','e',' ','F','i','l','t','e','r',0};
54 static const WCHAR wVFWCaptFilterProp[] =
55 {'V','F','W',' ','C','a','p','t','u','r','e',' ','F','i','l','t','e','r',' ',
56 'P','r','o','p','e','r','t','y',' ','P','a','g','e',0};
57 static const WCHAR wAVIMux[] =
58 {'A','V','I',' ','m','u','x',0};
59 static const WCHAR wAVIMuxPropPage[] =
60 {'A','V','I',' ','m','u','x',' ','P','r','o','p','e','r','t','y',' ','P','a','g','e',0};
61 static const WCHAR wAVIMuxPropPage1[] =
62 {'A','V','I',' ','m','u','x',' ','P','r','o','p','e','r','t','y',' ','P','a','g','e','1',0};
63 static const WCHAR wFileWriter[] =
64 {'F','i','l','e',' ','W','r','i','t','e','r',0};
65 static const WCHAR wCaptGraphBuilder[] =
66 {'C','a','p','t','u','r','e',' ','G','r','a','p','h',' ','B','u','i','l','d','e','r',0};
67 static const WCHAR wCaptGraphBuilder2[] =
68 {'C','a','p','t','u','r','e',' ','G','r','a','p','h',' ','B','u','i','l','d','e','r','2',0};
69 static const WCHAR wInfPinTeeFilter[] =
70 {'I','n','f','i','n','i','t','e',' ','P','i','n',' ','T','e','e',' ','F','i',
72 static const WCHAR wSmartTeeFilter[] =
73 {'S','m','a','r','t',' ','T','e','e',' ','F','i','l','t','e','r',0};
74 static const WCHAR wAudioInMixerProp[] =
75 {'A','u','d','i','o','I','n','p','u','t','M','i','x','e','r',' ','P','r','o',
76 'p','e','r','t','y',' ','P','a','g','e',0};
78 FactoryTemplate const g_Templates[] = {
82 &CLSID_AudioCaptureFilter,
83 QCAP_createAudioCaptureFilter,
88 QCAP_createAVICompressor,
93 QCAP_createVFWCaptureFilter,
97 &CLSID_VFWCaptureFilterPropertyPage,
98 QCAP_createVFWCaptureFilterPropertyPage,
107 &CLSID_AVImuxPropertyPage,
108 QCAP_createAVImuxPropertyPage,
112 &CLSID_AVImuxPropertyPage1,
113 QCAP_createAVImuxPropertyPage1,
118 QCAP_createFileWriter,
122 &CLSID_CaptureGraphBuilder,
123 QCAP_createCaptureGraphBuilder2,
127 &CLSID_CaptureGraphBuilder2,
128 QCAP_createCaptureGraphBuilder2,
132 &CLSID_InfinitePinTeeFilter,
133 QCAP_createInfinitePinTeeFilter,
137 &CLSID_SmartTeeFilter,
138 QCAP_createSmartTeeFilter,
142 &CLSID_AudioInputMixerPropertyPage,
143 QCAP_createAudioInputMixerPropertyPage,
148 int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
150 /***********************************************************************
151 * Dll EntryPoint (QCAP.@)
153 BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
155 return STRMBASE_DllMain(hInstDLL,fdwReason,lpv);
158 /***********************************************************************
161 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
163 return STRMBASE_DllGetClassObject( rclsid, riid, ppv );
166 /***********************************************************************
167 * DllRegisterServer (QCAP.@)
169 HRESULT WINAPI DllRegisterServer(void)
172 return AMovieDllRegisterServer2(TRUE);
175 /***********************************************************************
176 * DllUnregisterServer (QCAP.@)
178 HRESULT WINAPI DllUnregisterServer(void)
181 return AMovieDllRegisterServer2(FALSE);
184 /***********************************************************************
185 * DllCanUnloadNow (QCAP.@)
187 HRESULT WINAPI DllCanUnloadNow(void)
191 if (STRMBASE_DllCanUnloadNow() && objects_ref == 0)
196 DWORD ObjectRefCount(BOOL increment)
199 return InterlockedIncrement(&objects_ref);
200 return InterlockedDecrement(&objects_ref);