Video frame buffer copy

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

Basavaraja Vandrotti

  • Posts: 4
  • Joined: Tue Dec 06, 2016 5:46 pm

Video frame buffer copy

PostTue Dec 06, 2016 9:25 pm

Hi

Currently I am doing memory copy of video data to IDeckLinkVideoFrame, it is taking lot of time.
is there any way, i can assign the buffer pointer and avoid copy.

Regards
Basav
Offline

Nicholas Gill

Blackmagic Design

  • Posts: 169
  • Joined: Mon May 04, 2015 10:28 pm

Re: Video frame buffer copy

PostWed Dec 14, 2016 3:17 am

Hi Basavaraja,

If your application has a pointer to pixel data in an appropriate pixel format [1] for the DeckLink API, and on the assumption that the video frame cannot be generated directly into an IDeckLinkVideoFrame[2] buffer created via IDeckLinkOutput::CreateVideoFrame [3], the next option is that your application can implement your own class implementing the IDeckLinkVideoFrame interface, and provide those frames for playback via the DeckLink API.

Your custom video frame class can implement the methods exposed by the IDeckLinkVideoFrame interface in order to return the frame width, height, pixel format, etc, and implement GetBytes[4] to return the pointer to the valid pixel buffer data generated by your application.

Please note that your implementation will have to take care to ensure that the pointer returned by GetBytes is valid for as long as the video frame instance is valid.

For an example of a custom IDeckLinkVideoFrame implementation, please see the SignalGenerator SDK sample class SignalGenerator3DVideoFrame, which implements the IDeckLinkVideoFrame and IDeckLinkVideoFrame3DExtensions [5] interfaces, noting that IDeckLinkVideoFrame3DExtensions will be unnecessary for your application unless you are implementing 3D playback.

Cheers,

-nick

[1] 2.7.4 Pixel Formats
[2] 2.5.5 IDeckLinkVideoFrame Interface
[3] 22.5.3.8 IDeckLinkOutput::CreateVideoFrame method
[4] 2.5.5.6 IDeckLinkVideoFrame::GetBytes method
[5] 2.5.8 IDeckLinkVideoFrame3DExtensions Interface

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 17 guests