forked from synther/gdcl-mpeg-4-mux
/
mp4mux.cpp
52 lines (43 loc) · 1.58 KB
/
mp4mux.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// mp4mux.cpp : Defines the entry point for the DLL
//
// Copyright (c) GDCL 2004-6. All Rights Reserved.
// You are free to re-use this as the basis for your own filter development,
// provided you retain this copyright notice in the source.
// http://www.gdcl.co.uk
#include "stdafx.h"
#include "muxfilter.h"
// --- COM factory table and registration code --------------
// DirectShow base class COM factory requires this table,
// declaring all the COM objects in this DLL
CFactoryTemplate g_Templates[] = {
// one entry for each CoCreate-able object
{
Mpeg4Mux::m_sudFilter.strName,
Mpeg4Mux::m_sudFilter.clsID,
Mpeg4Mux::CreateInstance,
NULL,
&Mpeg4Mux::m_sudFilter
},
};
int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
// self-registration entrypoint
STDAPI DllRegisterServer()
{
// base classes will handle registration using the factory template table
HRESULT hr = AMovieDllRegisterServer2(true);
return hr;
}
STDAPI DllUnregisterServer()
{
// base classes will handle de-registration using the factory template table
HRESULT hr = AMovieDllRegisterServer2(false);
return hr;
}
// if we declare the correct C runtime entrypoint and then forward it to the DShow base
// classes we will be sure that both the C/C++ runtimes and the base classes are initialized
// correctly
extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
BOOL WINAPI DllMain(HANDLE hDllHandle, DWORD dwReason, LPVOID lpReserved)
{
return DllEntryPoint(reinterpret_cast<HINSTANCE>(hDllHandle), dwReason, lpReserved);
}