2010-12-03 14:33:08 +01:00
|
|
|
/*
|
2010-12-11 14:25:28 +01:00
|
|
|
* DirectShow filter for QuickTime Toolkit on Mac OS X
|
2010-12-03 14:33:08 +01:00
|
|
|
*
|
|
|
|
* Copyright (C) 2010 Aric Stewart, CodeWeavers
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
#define NONAMELESSSTRUCT
|
|
|
|
#define NONAMELESSUNION
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "wingdi.h"
|
|
|
|
#include "winerror.h"
|
|
|
|
#include "objbase.h"
|
|
|
|
#include "uuids.h"
|
|
|
|
#include "strmif.h"
|
2012-04-04 19:31:42 +02:00
|
|
|
#include "rpcproxy.h"
|
2010-12-03 14:33:08 +01:00
|
|
|
|
|
|
|
#include "wine/unicode.h"
|
|
|
|
#include "wine/debug.h"
|
|
|
|
#include "wine/strmbase.h"
|
|
|
|
|
|
|
|
#include "initguid.h"
|
|
|
|
DEFINE_GUID(CLSID_QTVDecoder, 0x683DDACB, 0x4354, 0x490C, 0xA0,0x58, 0xE0,0x5A,0xD0,0xF2,0x05,0x37);
|
2011-04-05 19:56:00 +02:00
|
|
|
DEFINE_GUID(CLSID_QTSplitter, 0xD0E70E49, 0x5927, 0x4894, 0xA3,0x86, 0x35,0x94,0x60,0xEE,0x87,0xC9);
|
2012-04-04 19:31:42 +02:00
|
|
|
DEFINE_GUID(WINESUBTYPE_QTSplitter, 0xFFFFFFFF, 0x5927, 0x4894, 0xA3,0x86, 0x35,0x94,0x60,0xEE,0x87,0xC9);
|
2010-12-03 14:33:08 +01:00
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(qtdecoder);
|
|
|
|
|
|
|
|
extern IUnknown * CALLBACK QTVDecoder_create(IUnknown * pUnkOuter, HRESULT* phr);
|
2011-04-05 19:56:00 +02:00
|
|
|
extern IUnknown * CALLBACK QTSplitter_create(IUnknown * pUnkOuter, HRESULT* phr);
|
2010-12-03 14:33:08 +01:00
|
|
|
|
|
|
|
static const WCHAR wQTVName[] =
|
|
|
|
{'Q','T',' ','V','i','d','e','o',' ','D','e','c','o','d','e','r',0};
|
2011-04-05 19:56:00 +02:00
|
|
|
static const WCHAR wQTDName[] =
|
|
|
|
{'Q','T',' ','V','i','d','e','o',' ','D','e','m','u','x',0};
|
2010-12-03 14:33:08 +01:00
|
|
|
static WCHAR wNull[] = {'\0'};
|
|
|
|
|
|
|
|
static const AMOVIESETUP_MEDIATYPE amfMTvideo[] =
|
|
|
|
{ { &MEDIATYPE_Video, &MEDIASUBTYPE_NULL } };
|
2011-04-05 19:56:00 +02:00
|
|
|
static const AMOVIESETUP_MEDIATYPE amfMTaudio[] =
|
|
|
|
{ { &MEDIATYPE_Audio, &MEDIASUBTYPE_NULL } };
|
|
|
|
static const AMOVIESETUP_MEDIATYPE amfMTstream[] =
|
2012-04-04 19:31:42 +02:00
|
|
|
{ { &MEDIATYPE_Stream, &WINESUBTYPE_QTSplitter},
|
|
|
|
{ &MEDIATYPE_Stream, &MEDIASUBTYPE_NULL } };
|
2010-12-03 14:33:08 +01:00
|
|
|
|
|
|
|
static const AMOVIESETUP_PIN amfQTVPin[] =
|
|
|
|
{ { wNull,
|
|
|
|
FALSE, FALSE, FALSE, FALSE,
|
|
|
|
&GUID_NULL,
|
|
|
|
NULL,
|
|
|
|
1,
|
|
|
|
amfMTvideo
|
|
|
|
},
|
|
|
|
{
|
|
|
|
wNull,
|
|
|
|
FALSE, TRUE, FALSE, FALSE,
|
|
|
|
&GUID_NULL,
|
|
|
|
NULL,
|
|
|
|
1,
|
|
|
|
amfMTvideo
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2011-04-05 19:56:00 +02:00
|
|
|
static const AMOVIESETUP_PIN amfQTDPin[] =
|
|
|
|
{ { wNull,
|
|
|
|
FALSE, FALSE, FALSE, FALSE,
|
|
|
|
&GUID_NULL,
|
|
|
|
NULL,
|
2012-04-04 19:31:42 +02:00
|
|
|
2,
|
2011-04-05 19:56:00 +02:00
|
|
|
amfMTstream
|
|
|
|
},
|
|
|
|
{
|
|
|
|
wNull,
|
|
|
|
FALSE, TRUE, TRUE, FALSE,
|
|
|
|
&GUID_NULL,
|
|
|
|
NULL,
|
|
|
|
1,
|
|
|
|
amfMTvideo
|
|
|
|
},
|
|
|
|
{
|
|
|
|
wNull,
|
|
|
|
FALSE, TRUE, TRUE, FALSE,
|
|
|
|
&GUID_NULL,
|
|
|
|
NULL,
|
|
|
|
1,
|
|
|
|
amfMTaudio
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2010-12-03 14:33:08 +01:00
|
|
|
static const AMOVIESETUP_FILTER amfQTV =
|
|
|
|
{ &CLSID_QTVDecoder,
|
|
|
|
wQTVName,
|
2012-01-13 13:38:44 +01:00
|
|
|
MERIT_NORMAL-1,
|
2010-12-03 14:33:08 +01:00
|
|
|
2,
|
|
|
|
amfQTVPin
|
|
|
|
};
|
|
|
|
|
2011-04-05 19:56:00 +02:00
|
|
|
static const AMOVIESETUP_FILTER amfQTD =
|
|
|
|
{ &CLSID_QTSplitter,
|
|
|
|
wQTDName,
|
2012-01-13 13:38:44 +01:00
|
|
|
MERIT_NORMAL-1,
|
2011-04-05 19:56:00 +02:00
|
|
|
3,
|
|
|
|
amfQTDPin
|
|
|
|
};
|
|
|
|
|
2010-12-03 14:33:08 +01:00
|
|
|
FactoryTemplate const g_Templates[] = {
|
|
|
|
{
|
|
|
|
wQTVName,
|
|
|
|
&CLSID_QTVDecoder,
|
|
|
|
QTVDecoder_create,
|
|
|
|
NULL,
|
|
|
|
&amfQTV,
|
2011-04-05 19:56:00 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
wQTDName,
|
|
|
|
&CLSID_QTSplitter,
|
|
|
|
QTSplitter_create,
|
|
|
|
NULL,
|
|
|
|
&amfQTD,
|
2010-12-03 14:33:08 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-11-06 21:01:07 +01:00
|
|
|
int g_cTemplates = ARRAY_SIZE(g_Templates);
|
2012-04-04 19:31:42 +02:00
|
|
|
static HINSTANCE hInst = NULL;
|
2010-12-03 14:33:08 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* Dll EntryPoint (wineqtdecoder.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
|
|
|
|
{
|
2012-04-04 19:31:42 +02:00
|
|
|
hInst = hInstDLL;
|
2010-12-03 14:33:08 +01:00
|
|
|
return STRMBASE_DllMain(hInstDLL,fdwReason,lpv);
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DllGetClassObject
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
|
|
|
|
{
|
|
|
|
return STRMBASE_DllGetClassObject( rclsid, riid, ppv );
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DllRegisterServer (wineqtdecoder.@)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI DllRegisterServer(void)
|
|
|
|
{
|
2012-04-04 19:31:42 +02:00
|
|
|
HRESULT hr;
|
2010-12-03 14:33:08 +01:00
|
|
|
TRACE("()\n");
|
2012-04-04 19:31:42 +02:00
|
|
|
hr = AMovieDllRegisterServer2(TRUE);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
hr = __wine_register_resources(hInst);
|
|
|
|
return hr;
|
2010-12-03 14:33:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DllUnregisterServer (wineqtdecoder.@)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI DllUnregisterServer(void)
|
|
|
|
{
|
2012-04-04 19:31:42 +02:00
|
|
|
HRESULT hr;
|
2010-12-03 14:33:08 +01:00
|
|
|
TRACE("\n");
|
2012-04-04 19:31:42 +02:00
|
|
|
hr = AMovieDllRegisterServer2(FALSE);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
hr = __wine_unregister_resources(hInst);
|
|
|
|
return hr;
|
2010-12-03 14:33:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DllCanUnloadNow (wineqtdecoder.@)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI DllCanUnloadNow(void)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
return STRMBASE_DllCanUnloadNow();
|
|
|
|
}
|