I think I am starting to answer my own question here...
I downloaded the BMD code and had a look through the files last night.
It looks like I need something like:
- Code: Select all
// includes the Blackmagic Design SDI Control library.
#include <BMDSDIControl.h>
const int shieldAddress = 0x6E; // Match to shield configuration.
BMD_SDICameraControl_I2C ccu( shieldAddress );
int ccuLength = 0; // Number of bytes returned to process.
byte ccuData[256]; // Maximum allowed.
// Once initialisation...
//
void setup() {
ccu.begin();
ccu.setOverride( false );
} // End of function setup.
// Sit here for eternity...
//
void loop() {
if( ccu.available() ) {
ccuLength = ccu.read( ccuData, 256 );
ccu.flushRead();
// TODO: Process the data.
} // End if.
} // End of function loop.
This should just sit and wait for an incoming SDI frame containing some data.
When the data frame occurs, .available() should return true.
At this point .read is invoked to extract the data packet itself. The data packet can be no longer than 256 bytes, so the read shouldn't fail because the incoming data packet was larger than the buffer.
The number of bytes in the packet is returned in ccuLength.
The .flushRead() call should prepare the shield for the next incoming frame.
Assuming a 1080p50 configuration, that should give me 20 milliseconds to process the current frame data before the next potential frame comes in.
I assume there is no help in parsing the packet of data that has been received and I have to do that myself.
How close am I to what is needed? Or is what I am stating pure rubbish!?
Assuming I want to pickup camera control packets (pan, tilt, zoom, focus, etc.) and which camera is currently selected to preview and live is this all I need - or would I have to intercept the tally messages as well?
I assume that when I get (say) a ZOOM message, the camera that has been selected by the ATEM will be within the header for the message?
Which SDI output on the ATEM would I be required to connect the 3G-SDI shield to? Or could I just connect it to the main output?
Cheers,
Dave