- Posts: 32
- Joined: Thu Jan 03, 2013 4:52 pm
The closest we have to this is SDK sample SwitcherMediaPool, however it is written in C++, and it loads from a TGA file. I think you would be better to use .NET framework System.Drawing.Imaging library. The bitmap pixel format PixelFormat.Format32bppArgb [1] maps to Switcher pixel format bmdSwitcherPixelFormat8BitARGB.
You then have two options to get BitmapData into IBMDSwitcherFrame:
- Create the IBMDSwitcherFrame object with IBMDSwitcherMediaPool::CreateFrame, the BitmapData should be locked and copied to the unmanaged buffer with IntPtr output by IBMDSwitcherFrame::GetBytes.[2][3]
- If you want to prevent pixel buffer copy, then you can wrap the BitmapData in a class that implements IBMDSwitcherFrame. You should have a look at Desktop Video SDK sample StillsCSharp, to see this concept with the DeckLinkAPI (implementing IDeckLinkVideoFrame) [4]
Cameron
References
[1] Pixel Format enum: https://docs.microsoft.com/en-us/dotnet ... mework-4.8
[2] Accessing and copying BitmapData - https://docs.microsoft.com/en-us/dotnet ... mework-4.8
[3] SDK Manual - 4.3.4.5 IBMDSwitcherFrame::GetBytes method
[4] Desktop Video SDK - https://www.blackmagicdesign.com/develo ... d-playback