- Posts: 18
- Joined: Sun Jun 07, 2015 4:07 am
I've been working with the Switcher SDK 6.4 for about a week now. My test application is written in C# using VisualStudio 2013, .NET 4.5, and WPF. I've been very successful enumerating inputs, and performing transitions with my ATEM TelevisionStudio, but I am having one bizarre problem.
When I try to upload a 'still' (SwitcherFrame) to the switcher, I execute a Lock, receive the Lock callback, add a callback to the SwitcherStills, and tell the stills to upload my SwitcherFrame. This all works fine except I never receive a _BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeTransferCompleted event when the upload is complete.
I have spent days trying to figure out why? When I use (almost) identical code in a windows console application I receive this event notification perfectly. But as soon as I try the code under WPF, the event is never received. The only difference between these two test apps is the WPF code must Disptach the event callbacks to the UI thread to keep COM happy under the hood. When I remove the Dispatcher.Invoke logic from my WPF app, the callbacks occur on a different thread and I can no longer reference some COM objects without getting 'Unable to Query Interface' errors, so I think it is appropriate to handle the callbacks on the UI thread. (I've read that COM behaves best when used from an STAThread, and I think the UI thread for windows apps is STA anyway).
I do manage to get other notifications, including (when appropriate):
_BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeLockBusy
_BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeNameChanged
_BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeHashChanged
but for the life of me, I can not get
_BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeTransferCompleted
Does anyone have any advice for me? I'll take any ideas at this point. I'm totally stumped.
When I try to upload a 'still' (SwitcherFrame) to the switcher, I execute a Lock, receive the Lock callback, add a callback to the SwitcherStills, and tell the stills to upload my SwitcherFrame. This all works fine except I never receive a _BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeTransferCompleted event when the upload is complete.
I have spent days trying to figure out why? When I use (almost) identical code in a windows console application I receive this event notification perfectly. But as soon as I try the code under WPF, the event is never received. The only difference between these two test apps is the WPF code must Disptach the event callbacks to the UI thread to keep COM happy under the hood. When I remove the Dispatcher.Invoke logic from my WPF app, the callbacks occur on a different thread and I can no longer reference some COM objects without getting 'Unable to Query Interface' errors, so I think it is appropriate to handle the callbacks on the UI thread. (I've read that COM behaves best when used from an STAThread, and I think the UI thread for windows apps is STA anyway).
I do manage to get other notifications, including (when appropriate):
_BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeLockBusy
_BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeNameChanged
_BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeHashChanged
but for the life of me, I can not get
_BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeTransferCompleted
Does anyone have any advice for me? I'll take any ideas at this point. I'm totally stumped.