📄 dmovideowatermark.cpp
字号:
// DmoVideoWatermark.cpp : Implementation of DLL Exports.
/**
** Copyright (C) 2005 EnjoyView Inc., all rights reserved.
** Your View, Our Passion. Just Enjoy It!
**
** http://spaces.msn.com/members/jemylu
**
**/
/*************************************************************************/
// Note: Proxy/Stub Information
// To build a separate proxy/stub DLL,
// run nmake -f DmoVideoWatermarkps.mk in the project directory.
#include "stdafx.h"
#include "resource.h"
#define FIX_LOCK_NAME
#include <dmo.h>
#include <dmoimpl.h>
#include <amvideo.h>
#include <initguid.h>
#include "DmoVideoWatermark.h"
#include "flicker_ids.h"
//#include "DmoVideoWatermark_i.c"
#include "CFlickerLogo.h"
CComModule _Module;
BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_FlickerLogo, CFlickerLogo)
END_OBJECT_MAP()
/////////////////////////////////////////////////////////////////////////////
// DLL Entry Point
extern "C"
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
_Module.Init(ObjectMap, hInstance);//, &LIBID_DMOVIDEOWATERMARKLib);
DisableThreadLibraryCalls(hInstance);
}
else if (dwReason == DLL_PROCESS_DETACH)
_Module.Term();
return TRUE; // ok
}
/////////////////////////////////////////////////////////////////////////////
// Used to determine whether the DLL can be unloaded by OLE
STDAPI DllCanUnloadNow(void)
{
return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
}
/////////////////////////////////////////////////////////////////////////////
// Returns a class factory to create an object of the requested type
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
{
return _Module.GetClassObject(rclsid, riid, ppv);
}
EXTERN_GUID( WMT_DMOCATEGORY_AUDIO_WATERMARK,
0x65221c5a, 0xfa75, 0x4b39, 0xb5, 0x0c, 0x06, 0xc3, 0x36, 0xb6, 0xa3, 0xef );
EXTERN_GUID( WMT_DMOCATEGORY_VIDEO_WATERMARK,
0x187cc922, 0x8efc, 0x4404, 0x9d, 0xaf, 0x63, 0xf4, 0x83, 0x0d, 0xf1, 0xbc );
#define _TEST_IN_GRAPHEDIT_
/////////////////////////////////////////////////////////////////////////////
// DllRegisterServer - Adds entries to the system registry
STDAPI DllRegisterServer(void)
{
#ifdef _TEST_IN_GRAPHEDIT_
// For testing in GraphEdit, register this DMO to "DMO Video Effects" too.
DMORegister(L"DMO Flicker Watermark",
CLSID_FlickerLogo,
DMOCATEGORY_VIDEO_EFFECT,
0,
0,
NULL,
0,
NULL);
#endif // _TEST_IN_GRAPHEDIT_
// Register ourselves as a DMO with no types
// RGS file also registers with a merit of 0 so DShow won't try to use us
// Notes: register to DMOCATEGORY_VIDEO_EFFECT for testing.
DMORegister(L"DMO Flicker Watermark",
CLSID_FlickerLogo,
WMT_DMOCATEGORY_VIDEO_WATERMARK,
0,
0,
NULL,
0,
NULL);
// registers object, typelib and all interfaces in typelib
return _Module.RegisterServer(FALSE);
}
/////////////////////////////////////////////////////////////////////////////
// DllUnregisterServer - Removes entries from the system registry
STDAPI DllUnregisterServer(void)
{
#ifdef _TEST_IN_GRAPHEDIT_
DMOUnregister(CLSID_FlickerLogo, DMOCATEGORY_VIDEO_EFFECT);
#endif // _TEST_IN_GRAPHEDIT_
DMOUnregister(CLSID_FlickerLogo, WMT_DMOCATEGORY_VIDEO_WATERMARK);
return _Module.UnregisterServer(FALSE);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -