wininet: Move freeing netconn into create_netconn_socket (Coverity).
[wine.git] / dlls / qcap / qcap_main.c
blob6f175cf27f9339553ee99142a1311d3dce708b5d
1 /*
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
21 #include "config.h"
23 #include <assert.h>
24 #include <stdio.h>
25 #include <stdarg.h>
27 #define COBJMACROS
28 #define NONAMELESSSTRUCT
29 #define NONAMELESSUNION
31 #include "windef.h"
32 #include "winbase.h"
33 #include "wingdi.h"
34 #include "winerror.h"
35 #include "objbase.h"
36 #include "uuids.h"
37 #include "strmif.h"
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',
71 'l','t','e','r',0};
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[] = {
80 wAudioCaptureFilter,
81 &CLSID_AudioRecord,
82 NULL, /* FIXME: Implement QCAP_createAudioCaptureFilter */
83 NULL
84 },{
85 wAVICompressor,
86 &CLSID_AVICo,
87 NULL, /* FIXME: Implement QCAP_createAVICompressor */
88 NULL
89 },{
90 wVFWCaptFilter,
91 &CLSID_VfwCapture,
92 QCAP_createVFWCaptureFilter,
93 NULL
94 },{
95 wVFWCaptFilterProp,
96 &CLSID_CaptureProperties,
97 NULL, /* FIXME: Implement QCAP_createVFWCaptureFilterPropertyPage */
98 NULL
99 },{
100 wAVIMux,
101 &CLSID_AviDest,
102 NULL, /* FIXME: Implement QCAP_createAVImux */
103 NULL
105 wAVIMuxPropPage,
106 &CLSID_AviMuxProptyPage,
107 NULL, /* FIXME: Implement QCAP_createAVImuxPropertyPage */
108 NULL
110 wAVIMuxPropPage1,
111 &CLSID_AviMuxProptyPage1,
112 NULL, /* FIXME: Implement QCAP_createAVImuxPropertyPage1 */
113 NULL
115 wFileWriter,
116 &CLSID_FileWriter,
117 NULL, /* FIXME: Implement QCAP_createFileWriter */
118 NULL
120 wCaptGraphBuilder,
121 &CLSID_CaptureGraphBuilder,
122 QCAP_createCaptureGraphBuilder2,
123 NULL
125 wCaptGraphBuilder2,
126 &CLSID_CaptureGraphBuilder2,
127 QCAP_createCaptureGraphBuilder2,
128 NULL
130 wInfPinTeeFilter,
131 &CLSID_InfTee,
132 NULL, /* FIXME: Implement QCAP_createInfinitePinTeeFilter */
133 NULL
135 wSmartTeeFilter,
136 &CLSID_SmartTee,
137 NULL, /* FIXME: Implement QCAP_createSmartTeeFilter */
138 NULL
140 wAudioInMixerProp,
141 &CLSID_AudioInputMixerProperties,
142 NULL, /* FIXME: Implement QCAP_createAudioInputMixerPropertyPage */
143 NULL
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 /***********************************************************************
158 * DllGetClassObject
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)
170 TRACE("()\n");
171 return AMovieDllRegisterServer2(TRUE);
174 /***********************************************************************
175 * DllUnregisterServer (QCAP.@)
177 HRESULT WINAPI DllUnregisterServer(void)
179 TRACE("\n");
180 return AMovieDllRegisterServer2(FALSE);
183 /***********************************************************************
184 * DllCanUnloadNow (QCAP.@)
186 HRESULT WINAPI DllCanUnloadNow(void)
188 TRACE("\n");
190 if (STRMBASE_DllCanUnloadNow() && objects_ref == 0)
191 return S_OK;
192 return S_FALSE;
195 DWORD ObjectRefCount(BOOL increment)
197 if (increment)
198 return InterlockedIncrement(&objects_ref);
199 return InterlockedDecrement(&objects_ref);