www.pudn.com > H264RtpSource.rar > SetUp.cpp


//#ifndef __SETUP_H 
//#define __SETUP_H 
 
#include "stdafx.h" 
#include "H264Source.h" 
#include "initguid.h" 
#include "FilterGuid.h" 
 
#define g_wszH264Source L"H264RtpSource" 
 
// Setup data. The RtpIn filter has only one pin which is an output pin.  
//it supports the H263 media type, although 
// i think there is no reason why it will not support other media in the RTP stream 
 
// media type 
const AMOVIESETUP_MEDIATYPE sudVideoPinTypes[] = 
{ 
	{ 
		&MEDIATYPE_Video,		// Major type 
			&MEDIASUBTYPE_NULL 
	} 
}; 
 
const AMOVIESETUP_PIN psudPins[] = 
{ 
	{ 
		L"H264Video",           // Pin string name 
			FALSE,                  // Is it rendered 
			TRUE,                   // Is it an output 
			FALSE,                  // Can we have none 
			FALSE,                  // Can we have many 
			&CLSID_NULL,            // Connects to filter 
			NULL,                   // Connects to pin 
			1,                      // Number of types 
			&sudVideoPinTypes[0]	// Pin details 
	} 
}; 
 
// define the filter 
const AMOVIESETUP_FILTER sudRtpInFilter = 
{ 
	&Clsid_H264RtpSource,	// Filter CLSID 
		g_wszH264Source,			// String name 
		MERIT_DO_NOT_USE,			// Filter merit 
		1,								// Number pins 
		psudPins 
}; 
 
 
// COM global table of objects in this dll 
CFactoryTemplate g_Templates[] =  
{ 
	{ 
		g_wszH264Source ,  
			&Clsid_H264RtpSource , 
			CH264Source::CreateInstance ,  
			NULL,  
			&sudRtpInFilter  
	} 
}; 
 
 
int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]); 
STDAPI DllRegisterServer()
{
	return AMovieDllRegisterServer2(TRUE);

} // DllRegisterServer


STDAPI DllUnregisterServer()
{
	return AMovieDllRegisterServer2(FALSE);

} // DllUnregisterServer


extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);

BOOL APIENTRY DllMain(HANDLE hModule, 
							 DWORD  dwReason, 
							 LPVOID lpReserved)
{
	return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
}  
 
//#endif