I created a custom filter in DirectShow called decryption however when using GraphStudioNext gives me a "VFW_E_NO_ACCEPTABLE_TYPES (0x80040207)" when trying to connect the output from a MP4 into the input of my custom filter.
// Media Types
const AMOVIESETUP_MEDIATYPE sudPinTypes =
{
&MEDIATYPE_Stream,
&MEDIASUBTYPE_NULL
};
// Pins
const AMOVIESETUP_PIN psudPins[] =
{
{ L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, L"Output", 1, &sudPinTypes },
{ L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, L"Input", 1, &sudPinTypes }
};
// Filters
const AMOVIESETUP_FILTER sudAudioVolume =
{
&CLSID_Decryption,
L"Decryption",
MERIT_NORMAL,
2,
psudPins
};
HRESULT DecryptionFilter::CheckInputType(const CMediaType *mtIn)
{
//Streaming
if (mtIn->majortype != MEDIATYPE_Stream) return E_FAIL;
if (mtIn->subtype != MEDIATYPE_NULL) return E_FAIL;
return S_OK;
}
HRESULT DecryptionFilter::CheckTransform(const CMediaType *mtIn, const CMediaType *mtOut)
{
HRESULT hr = CheckInputType(mtIn);
if (FAILED(hr)) return hr;
if (mtIn->majortype != MEDIATYPE_Stream) return E_FAIL;
if (mtIn->subtype != MEDIATYPE_NULL) return E_FAIL;
return S_OK;
}
I debugged through GraphStudioNext and
Properties for Source Filter and Custom Filter
Any clue on why my filter won't connect? Thank-you!
Your filter is incompatible because it does not implement the same functionality as File Source Filter you are impersonating. Specifically, you need to implement IAsyncReader
interface.
Additionally, GDCL source is available - you can step the source and identify the exact problem with debugger.
User contributions licensed under CC BY-SA 3.0