ATEM SDK - Problem with CallBack in VB.Net

Questions about ATEM Switchers, Camera Converter and everything live!
  • Author
  • Message
Offline

sublan

  • Posts: 72
  • Joined: Sun Oct 21, 2012 10:27 pm

ATEM SDK - Problem with CallBack in VB.Net

PostWed Mar 06, 2013 2:32 am

Hi everybody,

I wasted the last 1,5 days to get into the atem switcher sdk and had some success.
But I'm really losing at the CallBack function of the IMBDSwitcherMixEffectBlock Callback.

On each IBMDSwitcherMixEffectBlock.PropertyChanged callback, I want to check
1. if it is a input change at prgm or prew bus
2. check which input has become active at the bus

So far, it is no problem to register the callback method and do part 1 like this:
Code: Select all
Public Sub PropertyChanged(ByVal propertyId As BMDSwitcherAPI._BMDSwitcherMixEffectBlockPropertyId) Implements BMDSwitcherAPI.IBMDSwitcherMixEffectBlockCallback.PropertyChanged
        Select Case propertyId
            Case _BMDSwitcherMixEffectBlockPropertyId.bmdSwitcherMixEffectBlockPropertyIdProgramInput
                'do something
            Case _BMDSwitcherMixEffectBlockPropertyId.bmdSwitcherMixEffectBlockPropertyIdPreviewInput
                'do something
        End Select
    End Sub


But if I try to get the value of a property like this:
Code: Select all
mixEfxBlk.GetInt(_BMDSwitcherMixEffectBlockPropertyId.bmdSwitcherMixEffectBlockPropertyIdProgramInput, iid)


It does not work. The mixEfxBlk is a global variable in the class with the IBMDSwitcherMixEffectBlock object.

So, after hours of testing and failing, I found out, that this is a problem caused by the way the callback is invoked. It seems as the system forks the part of the class when its invoked by the COM object and therefore, the mixEfxBlk object is not able to call anything on the COM interface anymore.

The same happens when I try to access the IBMDSwitcherMixEffectBlock from an other class which runs as own thread.

I tried to hand out an IntPtr (pointer) instead of the COM Object itself and then reconnect it to an object but without any success.

So, my question is, has anybody here experience how to access the IBMDSwitcherMixEffectBlock Object in the propertyChanged Callback with VB.Net?

Thanks in advance
cheers
sublan
Offline

gacarlisle

  • Posts: 1
  • Joined: Wed Mar 19, 2014 6:12 pm

Re: ATEM SDK - Problem with CallBack in VB.Net

PostWed Mar 19, 2014 6:17 pm

Same problem here.

Return to Live Production

Who is online

Users browsing this forum: Bing [Bot] and 52 guests