- Posts: 2
- Joined: Mon Aug 10, 2020 8:32 am
- Real Name: Michael Krebs
The buffer size provided by the default memory allocator is based on the maximum frame size supported by the device. In the case of DeckLink Duo 2, where 1920x1080 is the maximum frame size - you would have higher frame buffer for 720p, NTSC, PAL.
You cannot alter this limit, to increase the number of frames you can implement your own custom memory allocator with the following steps:
- Create custom allocator class that implements IDeckLinkMemoryAllocator interface[1]. Implement all methods defined by interface.
- AllocateBuffer should output the pointer to allocated memory of size requested by DeckLinkAPI. This will be repetitively called on IDeckLinkInput::EnableVideoInput, return HRESULT = E_OUTOFMEMORY when you have reached upper limit of allocated frames
- ReleaseBuffer called when frame is released by DeckLinkAPI, you can either delete allocation, or cache and reuse for later allocation
- Commit and Decommit are optional, they can be used to create and delete resources for memory pool allocation.
- Register your customer memory allocator with IDeckLinkInput::SetVideoInputFrameMemoryAllocator [2] (prior to call to EnableVideoInput).
Cameron
Refs:
[1] 2.5.18 IDeckLinkMemoryAllocator Interface
[2] 2.5.4.11 IDeckLinkInput::SetVideoInputFrameMemoryAllocator method