DllSetup.cpp

Go to the documentation of this file.
00001 
00034 #include "stdafx.h"
00035 
00036 // DirectShow includes
00037 #pragma warning(push)     // disable for this header only
00038 #pragma warning(disable:4312) 
00039 // DirectShow
00040 #include <Streams.h>
00041 #pragma warning(pop)      // restore original warning level
00042 
00043 #include "RtspSourceFilter.h"
00044 #include "RtspSourceOutputPin.h"
00045 #include "RtspProperties.h"
00046 
00047 // Note: It is better to register no media types than to register a partial 
00048 // media type (subtype == GUID_NULL) because that can slow down intelligent connect 
00049 // for everyone else.
00050 
00051 // For a specialized source filter like this, it is best to leave out the 
00052 // AMOVIESETUP_FILTER altogether, so that the filter is not available for 
00053 // intelligent connect. Instead, use the CLSID to create the filter or just 
00054 // use 'new' in your application.
00055 
00056 
00057 // Filter setup data
00058 const AMOVIESETUP_MEDIATYPE sudOpPinTypes =
00059 {
00060         &MEDIATYPE_Audio,       // Major type
00061         &MEDIASUBTYPE_NULL      // Minor type
00062 };
00063 
00064 const AMOVIESETUP_PIN sudOutputPinBitmapSet = 
00065 {
00066         L"Output",      // Obsolete, not used.
00067         FALSE,          // Is this pin rendered?
00068         TRUE,           // Is it an output pin?
00069         FALSE,          // Can the filter create zero instances?
00070         FALSE,          // Does the filter create multiple instances?
00071         &CLSID_NULL,    // Obsolete.
00072         NULL,           // Obsolete.
00073         1,              // Number of media types.
00074         &sudOpPinTypes  // Pointer to media types.
00075 };
00076 
00077 const AMOVIESETUP_FILTER sudAdvertSource=
00078 {
00079         &CLSID_RTVC_RtspAudioSourceFilter,      // Filter CLSID
00080         g_wszFilterName,                                        // String name
00081         MERIT_DO_NOT_USE,                                       // Filter merit
00082         1,                                                                      // Number pins
00083         &sudOutputPinBitmapSet                          // Pin details
00084 };
00085 
00086 
00087 // List of class IDs and creator functions for the class factory. This
00088 // provides the link between the OLE entry point in the DLL and an object
00089 // being created. The class factory will call the static CreateInstance.
00090 // We provide a set of filters in this one DLL.
00091 
00092 CFactoryTemplate g_Templates[] = 
00093 {
00094         { 
00095                 g_wszFilterName,                                        // Name
00096                 &CLSID_RTVC_RtspAudioSourceFilter,  // CLSID
00097                 RtspSourceFilter::CreateInstance,       // Method to create an instance of MyComponent
00098                 NULL,                                                           // Initialization function
00099                 &sudAdvertSource                                        // Set-up information (for filters)
00100         },
00101         // This entry is for the property page.
00102         { 
00103                 L"Rtsp Properties",
00104                 &CLSID_RtspProperties,
00105                 RtspProperties::CreateInstance, 
00106                 NULL, NULL
00107         }
00108 
00109 };
00110 
00111 int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);    
00112 
00113 
00114 
00116 //
00117 // Exported entry points for registration and unregistration 
00118 // (in this case they only call through to default implementations).
00119 //
00121 
00122 STDAPI DllRegisterServer()
00123 {
00124         return AMovieDllRegisterServer2( TRUE );
00125 }
00126 
00127 STDAPI DllUnregisterServer()
00128 {
00129         return AMovieDllRegisterServer2( FALSE );
00130 }
00131 
00132 //
00133 // DllEntryPoint
00134 //
00135 extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
00136 
00137 BOOL APIENTRY DllMain(HANDLE hModule, 
00138                                           DWORD  dwReason, 
00139                                           LPVOID lpReserved)
00140 {
00141         return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
00142 }
00143 

Generated on Fri Mar 13 14:12:38 2009 for RTVC by  doxygen 1.5.3