Custom filter is incompatible?

3

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

  • Source output pin's "connectionType" is PIN_CONNECTION_TYPE_STREAM
  • Custom filter input pin's "connectionType" is
    PIN_CONNECTION_TYPE_OTHER

What my graph looks like: My Graph of what I'm trying to accomplish

Properties for Source Filter and Custom Filter Properties for Source Filter and Custom Filter

Any clue on why my filter won't connect? Thank-you!

c++
filter
directshow

1 Answer

3

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.

answered on Stack Overflow May 6, 2016 by Roman R.

User contributions licensed under CC BY-SA 3.0