2004-05-21 22:54:47 +02:00
|
|
|
/*
|
2005-05-07 20:00:33 +02:00
|
|
|
* Qcap implementation, dllentry points
|
2004-05-21 22:54:47 +02:00
|
|
|
*
|
|
|
|
* Copyright (C) 2003 Dominik Strasser
|
2005-05-07 20:00:33 +02:00
|
|
|
* Copyright (C) 2005 Rolf Kalbermatter
|
2004-05-21 22:54:47 +02:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2004-05-21 22:54:47 +02:00
|
|
|
*/
|
2005-05-07 20:00:33 +02:00
|
|
|
#include "config.h"
|
2004-05-21 22:54:47 +02:00
|
|
|
|
2005-05-07 20:00:33 +02:00
|
|
|
#include <assert.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
2008-07-10 19:38:47 +02:00
|
|
|
#include "wingdi.h"
|
2003-01-02 18:55:45 +01:00
|
|
|
#include "winerror.h"
|
2005-05-07 20:00:33 +02:00
|
|
|
#include "objbase.h"
|
|
|
|
#include "uuids.h"
|
|
|
|
#include "strmif.h"
|
2003-01-02 18:55:45 +01:00
|
|
|
|
2005-05-07 20:00:33 +02:00
|
|
|
#include "qcap_main.h"
|
|
|
|
|
|
|
|
#include "wine/unicode.h"
|
|
|
|
#include "wine/debug.h"
|
2003-01-02 18:55:45 +01:00
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(qcap);
|
|
|
|
|
2005-07-12 21:21:36 +02:00
|
|
|
static LONG objects_ref = 0;
|
2005-05-07 20:00:33 +02:00
|
|
|
|
2012-03-26 22:04:15 +02:00
|
|
|
static const WCHAR wAudioCaptureFilter[] =
|
2005-05-07 20:00:33 +02:00
|
|
|
{'A','u','d','i','o',' ','C','a','p','t','u','r','e',' ','F','i','l','t','e','r',0};
|
|
|
|
static const WCHAR wAVICompressor[] =
|
|
|
|
{'A','V','I',' ','C','o','m','p','r','e','s','s','o','r',0};
|
|
|
|
static const WCHAR wVFWCaptFilter[] =
|
|
|
|
{'V','F','W',' ','C','a','p','t','u','r','e',' ','F','i','l','t','e','r',0};
|
|
|
|
static const WCHAR wVFWCaptFilterProp[] =
|
|
|
|
{'V','F','W',' ','C','a','p','t','u','r','e',' ','F','i','l','t','e','r',' ',
|
|
|
|
'P','r','o','p','e','r','t','y',' ','P','a','g','e',0};
|
|
|
|
static const WCHAR wAVIMux[] =
|
|
|
|
{'A','V','I',' ','m','u','x',0};
|
|
|
|
static const WCHAR wAVIMuxPropPage[] =
|
|
|
|
{'A','V','I',' ','m','u','x',' ','P','r','o','p','e','r','t','y',' ','P','a','g','e',0};
|
|
|
|
static const WCHAR wAVIMuxPropPage1[] =
|
|
|
|
{'A','V','I',' ','m','u','x',' ','P','r','o','p','e','r','t','y',' ','P','a','g','e','1',0};
|
|
|
|
static const WCHAR wFileWriter[] =
|
|
|
|
{'F','i','l','e',' ','W','r','i','t','e','r',0};
|
|
|
|
static const WCHAR wCaptGraphBuilder[] =
|
|
|
|
{'C','a','p','t','u','r','e',' ','G','r','a','p','h',' ','B','u','i','l','d','e','r',0};
|
|
|
|
static const WCHAR wCaptGraphBuilder2[] =
|
|
|
|
{'C','a','p','t','u','r','e',' ','G','r','a','p','h',' ','B','u','i','l','d','e','r','2',0};
|
|
|
|
static const WCHAR wInfPinTeeFilter[] =
|
|
|
|
{'I','n','f','i','n','i','t','e',' ','P','i','n',' ','T','e','e',' ','F','i',
|
|
|
|
'l','t','e','r',0};
|
|
|
|
static const WCHAR wSmartTeeFilter[] =
|
|
|
|
{'S','m','a','r','t',' ','T','e','e',' ','F','i','l','t','e','r',0};
|
|
|
|
static const WCHAR wAudioInMixerProp[] =
|
|
|
|
{'A','u','d','i','o','I','n','p','u','t','M','i','x','e','r',' ','P','r','o',
|
|
|
|
'p','e','r','t','y',' ','P','a','g','e',0};
|
|
|
|
|
2010-10-19 20:23:38 +02:00
|
|
|
FactoryTemplate const g_Templates[] = {
|
2005-05-07 20:00:33 +02:00
|
|
|
{
|
2012-03-26 22:04:15 +02:00
|
|
|
wAudioCaptureFilter,
|
|
|
|
&CLSID_AudioRecord,
|
|
|
|
NULL, /* FIXME: Implement QCAP_createAudioCaptureFilter */
|
2005-05-07 20:00:33 +02:00
|
|
|
NULL
|
|
|
|
},{
|
2012-03-26 22:04:15 +02:00
|
|
|
wAVICompressor,
|
|
|
|
&CLSID_AVICo,
|
2013-12-19 15:31:52 +01:00
|
|
|
QCAP_createAVICompressor,
|
2005-05-07 20:00:33 +02:00
|
|
|
NULL
|
2012-03-26 22:04:15 +02:00
|
|
|
},{
|
2005-05-07 20:00:33 +02:00
|
|
|
wVFWCaptFilter,
|
2005-05-27 21:22:39 +02:00
|
|
|
&CLSID_VfwCapture,
|
2005-05-07 20:00:33 +02:00
|
|
|
QCAP_createVFWCaptureFilter,
|
|
|
|
NULL
|
2012-03-26 22:04:15 +02:00
|
|
|
},{
|
2005-05-07 20:00:33 +02:00
|
|
|
wVFWCaptFilterProp,
|
2012-03-26 22:04:15 +02:00
|
|
|
&CLSID_CaptureProperties,
|
|
|
|
NULL, /* FIXME: Implement QCAP_createVFWCaptureFilterPropertyPage */
|
2005-05-07 20:00:33 +02:00
|
|
|
NULL
|
|
|
|
},{
|
|
|
|
wAVIMux,
|
2012-03-26 22:04:15 +02:00
|
|
|
&CLSID_AviDest,
|
2013-11-20 22:48:04 +01:00
|
|
|
QCAP_createAVIMux,
|
2005-05-07 20:00:33 +02:00
|
|
|
NULL
|
|
|
|
},{
|
|
|
|
wAVIMuxPropPage,
|
2012-03-26 22:04:15 +02:00
|
|
|
&CLSID_AviMuxProptyPage,
|
2013-11-20 22:48:04 +01:00
|
|
|
NULL, /* FIXME: Implement QCAP_createAVIMuxPropertyPage */
|
2005-05-07 20:00:33 +02:00
|
|
|
NULL
|
|
|
|
},{
|
|
|
|
wAVIMuxPropPage1,
|
2012-03-26 22:04:15 +02:00
|
|
|
&CLSID_AviMuxProptyPage1,
|
2013-11-20 22:48:04 +01:00
|
|
|
NULL, /* FIXME: Implement QCAP_createAVIMuxPropertyPage1 */
|
2005-05-07 20:00:33 +02:00
|
|
|
NULL
|
|
|
|
},{
|
|
|
|
wFileWriter,
|
|
|
|
&CLSID_FileWriter,
|
2012-03-26 22:04:15 +02:00
|
|
|
NULL, /* FIXME: Implement QCAP_createFileWriter */
|
2005-05-07 20:00:33 +02:00
|
|
|
NULL
|
2012-03-26 22:04:15 +02:00
|
|
|
},{
|
2005-05-07 20:00:33 +02:00
|
|
|
wCaptGraphBuilder,
|
|
|
|
&CLSID_CaptureGraphBuilder,
|
|
|
|
QCAP_createCaptureGraphBuilder2,
|
|
|
|
NULL
|
|
|
|
},{
|
|
|
|
wCaptGraphBuilder2,
|
|
|
|
&CLSID_CaptureGraphBuilder2,
|
|
|
|
QCAP_createCaptureGraphBuilder2,
|
|
|
|
NULL
|
2012-03-26 22:04:15 +02:00
|
|
|
},{
|
2005-05-07 20:00:33 +02:00
|
|
|
wInfPinTeeFilter,
|
2012-03-26 22:04:15 +02:00
|
|
|
&CLSID_InfTee,
|
|
|
|
NULL, /* FIXME: Implement QCAP_createInfinitePinTeeFilter */
|
2005-05-07 20:00:33 +02:00
|
|
|
NULL
|
|
|
|
},{
|
|
|
|
wSmartTeeFilter,
|
2012-03-26 22:04:15 +02:00
|
|
|
&CLSID_SmartTee,
|
|
|
|
NULL, /* FIXME: Implement QCAP_createSmartTeeFilter */
|
2005-05-07 20:00:33 +02:00
|
|
|
NULL
|
|
|
|
},{
|
|
|
|
wAudioInMixerProp,
|
2012-03-26 22:04:15 +02:00
|
|
|
&CLSID_AudioInputMixerProperties,
|
|
|
|
NULL, /* FIXME: Implement QCAP_createAudioInputMixerPropertyPage */
|
2005-05-07 20:00:33 +02:00
|
|
|
NULL
|
2012-03-26 22:04:15 +02:00
|
|
|
}
|
2005-05-07 20:00:33 +02:00
|
|
|
};
|
|
|
|
|
2010-10-19 20:23:38 +02:00
|
|
|
int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
|
2005-05-07 20:00:33 +02:00
|
|
|
|
2003-01-02 18:55:45 +01:00
|
|
|
/***********************************************************************
|
2005-05-07 20:00:33 +02:00
|
|
|
* Dll EntryPoint (QCAP.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
|
|
|
|
{
|
2010-10-19 20:24:03 +02:00
|
|
|
return STRMBASE_DllMain(hInstDLL,fdwReason,lpv);
|
2005-05-07 20:00:33 +02:00
|
|
|
}
|
|
|
|
|
2010-10-28 11:42:35 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* DllGetClassObject
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
|
|
|
|
{
|
|
|
|
return STRMBASE_DllGetClassObject( rclsid, riid, ppv );
|
|
|
|
}
|
|
|
|
|
2005-05-07 20:00:33 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* DllRegisterServer (QCAP.@)
|
2003-01-02 18:55:45 +01:00
|
|
|
*/
|
2005-08-08 19:35:28 +02:00
|
|
|
HRESULT WINAPI DllRegisterServer(void)
|
2003-01-02 18:55:45 +01:00
|
|
|
{
|
2005-05-07 20:00:33 +02:00
|
|
|
TRACE("()\n");
|
2010-10-20 16:25:37 +02:00
|
|
|
return AMovieDllRegisterServer2(TRUE);
|
2005-05-07 20:00:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DllUnregisterServer (QCAP.@)
|
|
|
|
*/
|
2005-08-08 19:35:28 +02:00
|
|
|
HRESULT WINAPI DllUnregisterServer(void)
|
2005-05-07 20:00:33 +02:00
|
|
|
{
|
|
|
|
TRACE("\n");
|
2010-10-20 16:25:37 +02:00
|
|
|
return AMovieDllRegisterServer2(FALSE);
|
2003-01-02 18:55:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2005-05-07 20:00:33 +02:00
|
|
|
* DllCanUnloadNow (QCAP.@)
|
2003-01-02 18:55:45 +01:00
|
|
|
*/
|
2005-08-08 19:35:28 +02:00
|
|
|
HRESULT WINAPI DllCanUnloadNow(void)
|
2005-05-07 20:00:33 +02:00
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2010-10-19 20:24:29 +02:00
|
|
|
if (STRMBASE_DllCanUnloadNow() && objects_ref == 0)
|
2005-05-07 20:00:33 +02:00
|
|
|
return S_OK;
|
2010-10-19 20:24:29 +02:00
|
|
|
return S_FALSE;
|
2005-05-07 20:00:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
DWORD ObjectRefCount(BOOL increment)
|
2003-01-02 18:55:45 +01:00
|
|
|
{
|
2005-05-07 20:00:33 +02:00
|
|
|
if (increment)
|
|
|
|
return InterlockedIncrement(&objects_ref);
|
|
|
|
return InterlockedDecrement(&objects_ref);
|
2003-01-02 18:55:45 +01:00
|
|
|
}
|