Here's my confusion:
In all three languages I can get an instance of the DeckLinkIterator. In c# and Powerbasic, it's pretty easy. With Purebasic I had to use:
Code: Select all
Protected *deckLinkIterator.IDeckLinkIterator
Protected IID_IDeckLinkIterator.iid
Protected CLSID_DeckLinkIterator.ClSid
IIDFromString_(#IID_DeckLinkAPI_IDeckLinkIterator,@IID_IDeckLinkIterator)
CLSIDFromString_(#CLSID_DeckLinkAPI_CDeckLinkIterator,@CLSID_DeckLinkIterator)
Protected ok = CoCreateInstance_(@CLSID_DeckLinkIterator,#Null,$1f,@IID_IDeckLinkIterator,@*deckLinkIterator)Let's say we only care about outputs for the moment and I select an iDeckLink object. I then do:
Code: Select all
IIDFromString_(#IID_DeckLinkAPI_IDeckLinkOutput,@IID_IDeckLinkOutput)
ok = dl(i)\QueryInterface(IID_IDeckLinkOutput, @*deckLinkOutput)
Protected DisplayModeSupport
Protected DisplayMode.IDeckLinkDisplayMode
*deckLinkOutput\DoesSupportVideoMode(#bmdModeHD1080i5994,#bmdFormat8BitYUV,#bmdSupportedVideoModeDefault,@DisplayModeSupport, @DisplayMode)
UpdateActivity("DisplayMode: " + Hex(DisplayMode)
UpdateActivity(Str(DisplayMode\GetWidth()) + "x" + Str(DisplayMode\GetHeight()))Code: Select all
Interface IDeckLinkDisplayMode Extends IUnknown ;#IID_DeckLinkAPI_IDeckLinkDisplayMode
GetName.l(*PB_name)
GetDisplayMode.l()
GetWidth.l()
GetHeight.l()
GetFrameRate.l(*frameDuration.q, *timeScale.q)
GetFieldDominance.l()
GetFlags.l()
EndInterfaceCode: Select all
Protected ModeName$ = Space(255)
DisplayMode\GetName(@ModeName$)
UpdateActivity(ModeName$ + " and just for the heck of it: " + PeekS(@ModeName$,255,#PB_Unicode))This is the interface definition in Powerbasic
Code: Select all
Interface IDeckLinkDisplayMode $IID_DeckLinkAPI_IDeckLinkDisplayMode
Inherit IUnknown
Method GetName(ByRef PB_name As WString) As Long
Method GetDisplayMode() As Long
Method GetWidth() As Long
Method GetHeight() As Long
Method GetFrameRate(ByRef frameDuration As Quad, ByRef timeScale As Quad) As Long
Method GetFieldDominance() As Long
Method GetFlags() As Long
End InterfaceCode: Select all
Local displayModeSupport&,displayMode As IDeckLinkDisplayMode
Local vidFormat&,Result&
vidformat = %bmdModeHD720p5994
deckLinkOutput.DoesSupportVideoMode(VidFormat,%bmdFormat8BitYUV,%bmdVideoOutputFlagDefault,displayModeSupport, displayMode)
UpdateActivity "Output Support" + Hex$(DisplayModeSupport)
UpdateActivity "resolution: " + Str$(DisplayMode.GetWidth()) + "x" + Str$(DisplayMode.GetHeight())
DisplayMode.getName(mname$$)
UpdateActivity mName$$TIA,
Russ



