On pin connection, pins agree on the memory allocator to use, and the method is question is involved in negotiation of parameters of such allocator. DecideBufferSize
does NOT do allocation.
Next thing you possibly take incorrectly is using buffers. Eventually, you pass data using those buffers taking one by one and passing downstream. No matter how many buffers the allocator has, you can use even one buffer to pass all your NALUs because you stream buffers one by one anyway. If you have another NAL to deliver then you request new buffer (by the way, the method to request a new buffer is IMemAllocator::GetBuffer
) to fill and you have it once there is a free one. So, amount of buffers is irrelevant and is not the answer to your problem.
You typically want more buffers if you are interested in buffering for some synchronous activity, or you need a few at a time, in which case DecideBufferSize
is a good place to state your minimal requirements.
Stuffing multiple NALUs into single large buffer is unlikely to be a solution: you are basically expected to fill one buffer per frame, no matter how many NALUs are there. A buffer with NALUs without a frame is perhaps acceptable, but multiple frame NALUs in a single buffer are not/unlikely. Although, it is more a decoder/multiplexer compatibility question.