当连接过滤到InPlace变换过滤器时,调用Notify Allocator失败

时间:2014-04-07 12:58:17

标签: c++ directshow

我得到:访问冲突读取位置0xFFFFFFFFFFFFFFFF。尝试将过滤器连接到另一个自定义编写的TransInPlaceFilter时,在我的自定义mux过滤器的DecideAllocator方法中。

过滤器:

filters

第一个过滤器来自CBaseFilter。第二个来自CTransInPlaceFiler。

将mux滤波器连接到avi mux滤波器工作正常。错误可能在变压器滤波器中。但是我不知道在哪里,因为CTransInPlace滤波器不使用自定义写入引脚而是使用预定义引脚。

DecideAllocator功能:

HRESULT MCMyOutputPin::DecideAllocator(IMemInputPin *pPin, IMemAllocator **ppAlloc)
{
    ALLOCATOR_PROPERTIES *pprops = new ALLOCATOR_PROPERTIES;
    HRESULT hr = pPin->GetAllocatorRequirements(pprops);
    if (FAILED(hr))
        return hr;

        hr = InitAllocator(ppAlloc);
        if (FAILED(hr))
            return hr;

    hr = DecideBufferSize(*ppAlloc, pprops);
    if (FAILED(hr))
        return hr;

-    hr = pPin->NotifyAllocator(*ppAlloc, TRUE); //error happens here

    if (FAILED(hr))
    {
        return hr;
    }

    *ppAlloc = m_pAllocator;
    //m_pAllocator = *ppAlloc;

    m_pAllocator->Commit();
    m_pAllocator->AddRef();
    return hr;

}

堆栈跟踪

qasf.dll!000007f8c5e5ec90() Unknown
qasf.dll!000007f8c5e611c9() Unknown
myfilter64.ax!MCMyOutputPin::DecideAllocator(IMemInputPin * pPin, IMemAllocator * * ppAlloc) Line 193   C++
myfilter64.ax!MCMyOutputPin::CompleteConnect(IPin * pReceivePin) Line 58    C++
myfilter64.ax!CBasePin::AttemptConnection(IPin * pReceivePin, const CMediaType * pmt) Line 1799 C++
myfilter64.ax!CBasePin::TryMediaTypes(IPin * pReceivePin, const CMediaType * pmt, IEnumMediaTypes * pEnum) Line 1890    C++
myfilter64.ax!CBasePin::AgreeMediaType(IPin * pReceivePin, const CMediaType * pmt) Line 1956    C++
myfilter64.ax!CBasePin::Connect(IPin * pReceivePin, const _AMMediaType * pmt) Line 1728 C++
[External Code] 
GraphStudioNext64.exe!000007f63a90206e()    Unknown
GraphStudioNext64.exe!000007f63a899ee1()    Unknown
GraphStudioNext64.exe!000007f63a8a519d()    Unknown
GraphStudioNext64.exe!000007f63a6543c2()    Unknown
GraphStudioNext64.exe!000007f63a656084()    Unknown
GraphStudioNext64.exe!000007f63a65011b()    Unknown
GraphStudioNext64.exe!000007f63a650c04()    Unknown
[External Code] 
GraphStudioNext64.exe!000007f63a667ad6()    Unknown
GraphStudioNext64.exe!000007f63a66811e()    Unknown
GraphStudioNext64.exe!000007f63a803eed()    Unknown
GraphStudioNext64.exe!000007f63a7e4c6c()    Unknown
[External Code] 

0 个答案:

没有答案