How is padding done with IDeckLinkVideoFrame

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

bchen_bin

  • Posts: 1
  • Joined: Fri May 06, 2022 11:23 pm
  • Real Name: Ben Chen

How is padding done with IDeckLinkVideoFrame

PostFri May 06, 2022 11:35 pm

In the 2.5.5 of the "BlackMagic DeckLink SDK" document, there's such a description about padding:

"Note that in some formats (HD720 formats, for example), there is padding between rows always use GetRowBytes to account for the row length, including padding."

My question is:

After we calculate the row length using GetRowBytes(), if (row_length > GetWidth()), then apparently there is padding between rows. Are the padding pixels evenly padded to both sides of the frame or one side(left or right?) ?
Offline

Cameron Nichols

Blackmagic Design

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

Re: How is padding done with IDeckLinkVideoFrame

PostThu May 12, 2022 10:53 pm

Hi Ben,

Consider the following code segment:
Code: Select all
IDeckLinkVideoFrame* videoFrame;
// Initialize videoFrame with IDeckLinkOutput::CreateVideoFrame

uint32_t rowBytes = videoFrame->GetRowBytes();
uint32_t* buffer = nullptr;
if (videoFrame->GetBytes((void**) buffer) == S_OK)
{
     // Process buffer
}

The output buffer parameter points to the beginning (top-left) of the video frame buffer. The beginning of the 2nd row is buffer + rowBytes, beginning of 3rd row is buffer + 2 * rowBytes, etc. Then any additional padding is always at the end of the row.

Regards
Cameron

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 16 guests