- Posts: 5
- Joined: Wed Apr 19, 2017 8:33 am
Hello Lars,
The described memory usage pattern is indeed expected when using the default allocator (e.g. used by the Capture sample).
The DeckLink API will by default allocate a buffer sufficient for approximately 1 second of video frames in the largest video mode / pixel format combination.
This memory is then partitioned to create the video frame buffers in other video modes.
It should be possible to reduce the amount of memory allocated by implementing a custom IDeckLinkMemoryAllocator which rejects allocation attempts beyond some application defined limit.
To implement a custom allocator, implement the IDeckLinkMemoryAllocator[1] interface, and pass an instance of your allocator to the IDeckLinkOutput::SetVideoOutputFrameMemoryAllocator[2] method which will replace the default allocator with your custom instance.
Regards
Waqqas
[1] 2.5.18 IDeckLinkMemoryAllocator Interface
[2] 2.5.3.7 IDeckLinkOutput::SetVideoOutputFrameMemoryAllocator method