Mediapool

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

Jens Walkowiak

  • Posts: 32
  • Joined: Thu Jan 03, 2013 4:52 pm

Mediapool

PostSun Feb 16, 2020 12:38 pm

Hallo,

I have a problem using the Media Pool.
I'd like to upload a file to mediaplayer1 od Mediaplayer 2 an I'd like to show tis with a key from the same player.
I'm looking for a example in c#.

Does anyone have an example for me to try this?

Thank you.
Jens
Offline

Cameron Nichols

Blackmagic Design

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

Re: Mediapool

PostMon Feb 17, 2020 1:35 am

Hi Jens,

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:
  1. 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]
  2. 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]
Regards
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
Offline

Jens Walkowiak

  • Posts: 32
  • Joined: Thu Jan 03, 2013 4:52 pm

Re: Mediapool

PostMon Feb 17, 2020 7:59 am

Hi Cameron,

Thanks, I try it.


Regards
Jens

Return to Software Developers

Who is online

Users browsing this forum: vladimir.cg and 17 guests