SteffeyDev / atemOSC

Control ATEM video switchers over the network with OSC messages
http://www.atemosc.com
202 stars 32 forks source link

Finding SuperSources on a Constellation. #190

Closed toddfreese closed 3 years ago

toddfreese commented 3 years ago

The current code to get the number of SuperSources & Boxes does not work on a Constellation. This must have changed sometime in an SDK update. Based on the SDK docs, I don't think it will work on any other switcher either since it seems you have to query the interface. Am I missing something about this?

The following code works on my Constellation:

This goes after finding the aux inputs:

IBMDSwitcherInputSuperSource* ssObj;
result = input->QueryInterface(IID_IBMDSwitcherInputSuperSource, (void**)&ssObj);
if (SUCCEEDED(result))
{
    IBMDSwitcherSuperSourceBoxIterator* superSourceIterator = NULL;
    if (SUCCEEDED(ssObj->CreateIterator(IID_IBMDSwitcherSuperSourceBoxIterator, (void**)&superSourceIterator)))
    {
        IBMDSwitcherSuperSourceBox* superSourceBox = NULL;
        while (S_OK == superSourceIterator->Next(&superSourceBox))
        {
            mSuperSourceBoxes.push_back(superSourceBox);
        }
        superSourceIterator->Release();
        superSourceIterator = NULL;
    }
    else
    {
        [self logMessage:@"[Debug] Could not create IBMDSwitcherSuperSourceBoxIterator iterator"];
    }
}
SteffeyDev commented 3 years ago

I can't spot the difference between your code and mine, except for line 2-3, which is functionally the same. What exactly are you presenting here?

toddfreese commented 3 years ago

In your code:

if (SUCCEEDED(mSwitcher->CreateIterator(IID_IBMDSwitcherInputSuperSource, (void**)&mSuperSource))) {

You are trying to get the SS Iterator on mSwitcher which is incorrect. It always returns none.

You need to QueryInterface on an IBMDSwitcherInput input.

result = input->QueryInterface(IID_IBMDSwitcherInputSuperSource, (void**)&ssObj);

toddfreese commented 3 years ago

Correct me if I'm wrong, but your code does not see any super sources. I tested it on : 1 ME, 4ME and Constellation units.

SteffeyDev commented 3 years ago

Ah, you are correct, that makes sense. I haven't used SuperSource before, I'll get this updated and hopefully it will fix

toddfreese commented 3 years ago

I will test this in the next couple days.

SteffeyDev commented 3 years ago

Actually the testing needed is for my sake, not yours. I haven't released the fix yet, just keeping track of where different issues are.

SteffeyDev commented 3 years ago

Ok, might be fixed in version 4.0.0. Still need to run some more tests. Feel free to test yourself and see.

SteffeyDev commented 3 years ago

Ok, confirmed supersource control is now working