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 wAudioCaptureFilter
[] =
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 NULL
, /* FIXME: Implement QCAP_createAudioCaptureFilter */
87 NULL
, /* FIXME: Implement QCAP_createAVICompressor */
92 QCAP_createVFWCaptureFilter
,
96 &CLSID_CaptureProperties
,
97 NULL
, /* FIXME: Implement QCAP_createVFWCaptureFilterPropertyPage */
102 NULL
, /* FIXME: Implement QCAP_createAVImux */
106 &CLSID_AviMuxProptyPage
,
107 NULL
, /* FIXME: Implement QCAP_createAVImuxPropertyPage */
111 &CLSID_AviMuxProptyPage1
,
112 NULL
, /* FIXME: Implement QCAP_createAVImuxPropertyPage1 */
117 NULL
, /* FIXME: Implement QCAP_createFileWriter */
121 &CLSID_CaptureGraphBuilder
,
122 QCAP_createCaptureGraphBuilder2
,
126 &CLSID_CaptureGraphBuilder2
,
127 QCAP_createCaptureGraphBuilder2
,
132 NULL
, /* FIXME: Implement QCAP_createInfinitePinTeeFilter */
137 NULL
, /* FIXME: Implement QCAP_createSmartTeeFilter */
141 &CLSID_AudioInputMixerProperties
,
142 NULL
, /* FIXME: Implement QCAP_createAudioInputMixerPropertyPage */
147 int g_cTemplates
= sizeof(g_Templates
) / sizeof(g_Templates
[0]);
149 /***********************************************************************
150 * Dll EntryPoint (QCAP.@)
152 BOOL WINAPI
DllMain(HINSTANCE hInstDLL
, DWORD fdwReason
, LPVOID lpv
)
154 return STRMBASE_DllMain(hInstDLL
,fdwReason
,lpv
);
157 /***********************************************************************
160 HRESULT WINAPI
DllGetClassObject(REFCLSID rclsid
, REFIID riid
, LPVOID
*ppv
)
162 return STRMBASE_DllGetClassObject( rclsid
, riid
, ppv
);
165 /***********************************************************************
166 * DllRegisterServer (QCAP.@)
168 HRESULT WINAPI
DllRegisterServer(void)
171 return AMovieDllRegisterServer2(TRUE
);
174 /***********************************************************************
175 * DllUnregisterServer (QCAP.@)
177 HRESULT WINAPI
DllUnregisterServer(void)
180 return AMovieDllRegisterServer2(FALSE
);
183 /***********************************************************************
184 * DllCanUnloadNow (QCAP.@)
186 HRESULT WINAPI
DllCanUnloadNow(void)
190 if (STRMBASE_DllCanUnloadNow() && objects_ref
== 0)
195 DWORD
ObjectRefCount(BOOL increment
)
198 return InterlockedIncrement(&objects_ref
);
199 return InterlockedDecrement(&objects_ref
);