📄 setup.cpp
字号:
//------------------------------------------------------------------------------
// File: Setup.cpp
//
// Desc: DirectShow sample code - implementation of PushSource sample filters
//
// Copyright (c) 2000-2002 Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
#include "streams.h"
#include <initguid.h>
#include "PushGuids.h"
#include "PushSource.h"
#include "PushSourceProp.h"
// Note: It is better to register no media types than to register a partial
// media type (subtype == GUID_NULL) because that can slow down intelligent connect
// for everyone else.
// For a specialized source filter like this, it is best to leave out the
// AMOVIESETUP_FILTER altogether, so that the filter is not available for
// intelligent connect. Instead, use the CLSID to create the filter or just
// use 'new' in your application.
// Filter setup data
const AMOVIESETUP_MEDIATYPE sudOpPinTypes =
{
&MEDIATYPE_NULL, // Major type
&MEDIASUBTYPE_NULL // Minor type
};
const AMOVIESETUP_PIN sudVedioOutPin =
{
L"Output", // Obsolete, not used.
FALSE, // Is this pin rendered?
TRUE, // Is it an output pin?
FALSE, // Can the filter create zero instances?
FALSE, // Does the filter create multiple instances?
&CLSID_NULL, // Obsolete.
NULL, // Obsolete.
1, // Number of media types.
&sudOpPinTypes // Pointer to media types.
};
const AMOVIESETUP_FILTER sudPushSourceMP4File =
{
&CLSID_iFlyNetPushSource,// Filter CLSID
g_wszPushSource, // String name
MERIT_DO_NOT_USE, // Filter merit
1, // Number pins
&sudVedioOutPin // Pin details
};
// List of class IDs and creator functions for the class factory. This
// provides the link between the OLE entry point in the DLL and an object
// being created. The class factory will call the static CreateInstance.
// We provide a set of filters in this one DLL.
CFactoryTemplate g_Templates[] =
{
{
g_wszPushSource, // Name
&CLSID_iFlyNetPushSource, // CLSID
CNetPushSource::CreateInstance, // Method to create an instance of MyComponent
NULL, // Initialization function
&sudPushSourceMP4File // Set-up information (for filters)
},
{
L"Net Params Page",
&CLSID_iFlyNetParamsProp,
CiFlyNetSourceProp::CreateInstance
}
};
int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
////////////////////////////////////////////////////////////////////////
//
// Exported entry points for registration and unregistration
// (in this case they only call through to default implementations).
//
////////////////////////////////////////////////////////////////////////
STDAPI DllRegisterServer()
{
return AMovieDllRegisterServer2( TRUE );
}
STDAPI DllUnregisterServer()
{
return AMovieDllRegisterServer2( FALSE );
}
// DllEntryPoint
extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
BOOL APIENTRY DllMain(HANDLE hModule,
DWORD dwReason,
LPVOID lpReserved)
{
return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -