Frames no longer arrive with allocator

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

mikeboers

  • Posts: 1
  • Joined: Sun Dec 31, 2023 7:26 pm
  • Real Name: Mike Boers

Frames no longer arrive with allocator

PostSun Dec 31, 2023 7:48 pm

I have created a custom allocator and set it via IDeckLinkInput::SetVideoInputFrameMemoryAllocator.

It defaults to just using malloc/free and works fine. But I can toggle a setting while running so that it returns pointers to Vulkan buffers.

When I do so, frames stop arriving; my VideoInputFrameArrived stops getting called (once decklink has exhausted its list of malloc-ed pointers).

I've noticed that when using malloc, decklink will allocate 2 or 3 frames worth of data per frame. When not using malloc, decklink seems to keep attempting to release/alloc its entire internal set of buffers (a few dozen).

Any ideas what may be up? Are there internal checks that the returned pointer is put through that reject them?
Offline

Cameron Nichols

Blackmagic Design

  • Posts: 443
  • Joined: Mon Sep 04, 2017 4:05 am

Re: Frames no longer arrive with allocator

PostMon Jan 22, 2024 3:52 am

Hi Mike,

Check that your allocator is not holding onto reference of captured IDeckLinkVideoInputFrame objects. It may be possible that the DeckLink driver input frame queue may become exhausted of available input frame buffers to write to.

When the IDeckLinkVideoInputFrame is released (reference count is decremented to zero), the DeckLink API will call IDeckLinkMemoryAllocator::ReleaseBuffer in your custom allocator. At that point you can either free your Vulkan buffer or cache for future allocation. It may be worth to debug within your allocator to confirm that ReleaseBuffer is actually called and that there is an equivalent number of buffer releases for allocations.

Regards
Cameron

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 18 guests