c++ - Inserting filter between custom source and SmartTee leaks COM object -


we have directshow graph consisting of our own source filter rendered using capturegraphbuilder. in preview mode graph results in [source] -> [smarttee] -(previewpin)-> [decoder] -> [renderer]. our own filter has custom allocator , notifies smarttee it. exiting fine, objects released.

now trying insert filter between our own source filter , smarttee filter. when connecting newly created filter our source filter new allocator created @ source filter. when connecting new filter (which propose custom allocator on output pin itself) smarttee filter smarttee proposes allocator created in first connection between source , smarttee. smarttee should have dropped allocator due breakconnect. exiting application results in 1 remaining source allocator object allocator created in first connection.

the source filter, inserted filter have initallocator function on output pin propose allocator.

you can check source of decideallocator function in cbaseoutputpin class. output pin selects allocator. can use 1 provided input pin, or create own: https://msdn.microsoft.com/en-us/library/windows/desktop/dd390924(v=vs.85).aspx in order cbaseoutputpin calls getallocator of input pin , determines if input provides it's own allocator. provide allocator output pin, override cbaseoutputpin::initallocator method create instance of allocator: https://msdn.microsoft.com/en-us/library/windows/desktop/dd377477(v=vs.85).aspx @ point allocator should used , outpin calls imeminputpin::notifyallocator inform input pin of selection. if notifyallocator returns error allocator released. have based output pin on cbaseoutputpin , have replaced decideallocator method?


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -