const AMOVIESETUP_MEDIATYPE sudPinTypes =
{ &MEDIATYPE_NULL, // Major CLSID
&MEDIASUBTYPE_NULL // Minor type
};
const AMOVIESETUP_PIN psudPins[] =
{
{
L"Output", // Pin's string name
FALSE, // Is it rendered
TRUE, // Is it an output
FALSE, // Allowed none
FALSE, // Allowed many
&CLSID_NULL, // Connects to filter
L"Input", // Connects to pin
1, // Number of types
&sudPinTypes // Pin type information
},
};
const AMOVIESETUP_FILTER sudTry01 =
{
&CLSID_Try01, // CLSID of filter
L"Try01 Filter", // Filter's name
MERIT_DO_NOT_USE, // Filter merit
1, // Number of pins
psudPins // Pin information
};
int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
CUnknown *CTry01Filter::CreateInstance(LPUNKNOWN pUnk, HRESULT *phr)
{
// DLLEntry does the right thing with the return code and
// returned value on failure
CUnknown *pUnknown = new CTry01Filter(pUnk, phr);
if (pUnknown == NULL)
{
*phr = E_OUTOFMEMORY;
}
return pUnknown;
}
class CTry01Filter : public CBaseFilter
{
public:
static CUnknown * WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *phr);
CTry01Filter();
virtual ~CTry01Filter();
...
};
CUnknown *CTry01Filter::CreateInstance(LPUNKNOWN pUnk, HRESULT *phr)
{
// DLLEntry does the right thing with the return code and
// returned value on failure
CUnknown *pUnknown = new CTry01Filter(pUnk, phr);
if (pUnknown == NULL)
{
*phr = E_OUTOFMEMORY;
}
return pUnknown;
}
CBasePin -> IPin
출력 핀
IPin::Connect()
call .AgreeMediaType()
call pReceivePin->IPin::EnumMediaTypes()
or call IPin::EnumMediaTypes()
call TryMediaTypes()
call pEnum->Next()
call pReceivePin->GetMediaType()
or call GetMediaType()