Image data of IDeckLinkVideoInputFrame 64byte aligned

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

Steffen Pätzold

  • Posts: 21
  • Joined: Mon Mar 30, 2015 10:35 am
  • Location: Leipzig, Germany

Image data of IDeckLinkVideoInputFrame 64byte aligned

PostTue Nov 17, 2020 10:30 am

Is it possible to retrieve the IDeckLinkVideoInputFrame(s) which are delivered of an IDecklinkInput with image data that is 64byte aligned?

Is it possible to force 16/32/64 byte alignment of image data that can be queried with IDeckLinkVideoInputFrame::GetBytes ?

I have tried to use the IDeckLinkMemoryAllocator for this purpose.
But this allocated memory has absolute no relation to the receivedIDeckLinkVideoInputFrame.
It is not even within the memory range of the requested data, neither is it possible to find any pattern of the image within this memory.
Offline

Cameron Nichols

Blackmagic Design

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

Re: Image data of IDeckLinkVideoInputFrame 64byte aligned

PostWed Nov 18, 2020 11:15 pm

Hi Steffen,

Yes this is possible to set byte alignment. With the default memory allocator, the frame buffer will be provided with page alignment. If you need 16-, 32- or 64- bytes alignment then you should create your own memory allocator class that implements IDeckLinkMemoryAllocator. It is a requirement that an implemented IDeckLinkMemoryAllocator::AllocateBuffer outputs a buffer that is at minimum 16-byte aligned.

An example of this can be found in the Windows FileCapture SDK sample, where API call to AllocateBuffer will allocate the requested memory with 64-byte alignment.

Regards
Cameron
Offline

Steffen Pätzold

  • Posts: 21
  • Joined: Mon Mar 30, 2015 10:35 am
  • Location: Leipzig, Germany

Re: Image data of IDeckLinkVideoInputFrame 64byte aligned

PostThu Nov 19, 2020 1:21 pm

Hi Cameron,

i found the issue:
The memory from my custom allocator is only used for valid grabbed frames.
By default the device also delivers empty black frames if no signal is attached. In this case the memory for the image data is taken from somewhere else.

So it only works when a signal is attached and locked. This perfectly makes sense when considering performance but you should mention that behaviour in the SDK documentation.

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 15 guests