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
37 #include "qcap_main.h"
39 #include "wine/unicode.h"
40 #include "wine/debug.h"
42 WINE_DEFAULT_DEBUG_CHANNEL(qcap
);
44 static LONG objects_ref
= 0;
46 static const WCHAR wAudioCaptureFilter
[] =
47 {'A','u','d','i','o',' ','C','a','p','t','u','r','e',' ','F','i','l','t','e','r',0};
48 static const WCHAR wAVICompressor
[] =
49 {'A','V','I',' ','C','o','m','p','r','e','s','s','o','r',0};
50 static const WCHAR wVFWCaptFilter
[] =
51 {'V','F','W',' ','C','a','p','t','u','r','e',' ','F','i','l','t','e','r',0};
52 static const WCHAR wVFWCaptFilterProp
[] =
53 {'V','F','W',' ','C','a','p','t','u','r','e',' ','F','i','l','t','e','r',' ',
54 'P','r','o','p','e','r','t','y',' ','P','a','g','e',0};
55 static const WCHAR wAVIMux
[] =
56 {'A','V','I',' ','m','u','x',0};
57 static const WCHAR wAVIMuxPropPage
[] =
58 {'A','V','I',' ','m','u','x',' ','P','r','o','p','e','r','t','y',' ','P','a','g','e',0};
59 static const WCHAR wAVIMuxPropPage1
[] =
60 {'A','V','I',' ','m','u','x',' ','P','r','o','p','e','r','t','y',' ','P','a','g','e','1',0};
61 static const WCHAR wFileWriter
[] =
62 {'F','i','l','e',' ','W','r','i','t','e','r',0};
63 static const WCHAR wCaptGraphBuilder
[] =
64 {'C','a','p','t','u','r','e',' ','G','r','a','p','h',' ','B','u','i','l','d','e','r',0};
65 static const WCHAR wCaptGraphBuilder2
[] =
66 {'C','a','p','t','u','r','e',' ','G','r','a','p','h',' ','B','u','i','l','d','e','r','2',0};
67 static const WCHAR wInfPinTeeFilter
[] =
68 {'I','n','f','i','n','i','t','e',' ','P','i','n',' ','T','e','e',' ','F','i',
70 static const WCHAR wSmartTeeFilter
[] =
71 {'S','m','a','r','t',' ','T','e','e',' ','F','i','l','t','e','r',0};
72 static const WCHAR wAudioInMixerProp
[] =
73 {'A','u','d','i','o','I','n','p','u','t','M','i','x','e','r',' ','P','r','o',
74 'p','e','r','t','y',' ','P','a','g','e',0};
76 FactoryTemplate
const g_Templates
[] = {
80 QCAP_createAudioCaptureFilter
,
85 QCAP_createAVICompressor
,
90 QCAP_createVFWCaptureFilter
,
94 &CLSID_CaptureProperties
,
95 NULL
, /* FIXME: Implement QCAP_createVFWCaptureFilterPropertyPage */
104 &CLSID_AviMuxProptyPage
,
105 NULL
, /* FIXME: Implement QCAP_createAVIMuxPropertyPage */
109 &CLSID_AviMuxProptyPage1
,
110 NULL
, /* FIXME: Implement QCAP_createAVIMuxPropertyPage1 */
115 NULL
, /* FIXME: Implement QCAP_createFileWriter */
119 &CLSID_CaptureGraphBuilder
,
120 QCAP_createCaptureGraphBuilder2
,
124 &CLSID_CaptureGraphBuilder2
,
125 QCAP_createCaptureGraphBuilder2
,
130 NULL
, /* FIXME: Implement QCAP_createInfinitePinTeeFilter */
135 QCAP_createSmartTeeFilter
,
139 &CLSID_AudioInputMixerProperties
,
140 NULL
, /* FIXME: Implement QCAP_createAudioInputMixerPropertyPage */
145 int g_cTemplates
= sizeof(g_Templates
) / sizeof(g_Templates
[0]);
147 /***********************************************************************
148 * Dll EntryPoint (QCAP.@)
150 BOOL WINAPI
DllMain(HINSTANCE hInstDLL
, DWORD fdwReason
, LPVOID lpv
)
152 return STRMBASE_DllMain(hInstDLL
,fdwReason
,lpv
);
155 /***********************************************************************
158 HRESULT WINAPI
DllGetClassObject(REFCLSID rclsid
, REFIID riid
, LPVOID
*ppv
)
160 return STRMBASE_DllGetClassObject( rclsid
, riid
, ppv
);
163 /***********************************************************************
164 * DllRegisterServer (QCAP.@)
166 HRESULT WINAPI
DllRegisterServer(void)
169 return AMovieDllRegisterServer2(TRUE
);
172 /***********************************************************************
173 * DllUnregisterServer (QCAP.@)
175 HRESULT WINAPI
DllUnregisterServer(void)
178 return AMovieDllRegisterServer2(FALSE
);
181 /***********************************************************************
182 * DllCanUnloadNow (QCAP.@)
184 HRESULT WINAPI
DllCanUnloadNow(void)
188 if (STRMBASE_DllCanUnloadNow() == S_OK
&& objects_ref
== 0)
193 DWORD
ObjectRefCount(BOOL increment
)
196 return InterlockedIncrement(&objects_ref
);
197 return InterlockedDecrement(&objects_ref
);