Skip to main content

Code sample - Select video input (configure crossbar)

Delphi and C# (ActiveX) sample code.

Init crossbar

CrossBarFound := VideoCapture1.Video_CaptureDevice_CrossBar_Init;
CrossBarFound = VideoCapture1.Video_CaptureDevice_CrossBar_Init();

Get available inputs

VideoCapture1.Video_CaptureDevice_CrossBar_ClearConnections;
cbCrossbarVideoInput.Clear;
for i := 0 to VideoCapture1.Video_CaptureDevice_CrossBar_GetInputsForOutput_GetCount('Video Decoder' ) - 1 do
cbCrossbarVideoInput.Items.Add(VideoCapture1.Video_CaptureDevice_CrossBar_GetInputsForOutput_GetItem('Video Decoder', i));
VideoCapture1.Video_CaptureDevice_CrossBar_ClearConnections();
cbCrossbarVideoInput.Clear();
for (int i = 0; i < VideoCapture1.Video_CaptureDevice_CrossBar_GetInputsForOutput_GetCount("Video Decoder"); i++)
cbCrossbarVideoInput.Items.Add(VideoCapture1.Video_CaptureDevice_CrossBar_GetInputsForOutput_GetItem("Video Decoder", i));

Apply selected input

VideoCapture1.Video_CaptureDevice_CrossBar_ClearConnections;
VideoCapture1.Video_CaptureDevice_CrossBar_Connect(cbCrossbarVideoInput.Items[cbCrossbarVideoInput.ItemIndex], 'Video Decoder', true);
VideoCapture1.Video_CaptureDevice_CrossBar_ClearConnections();
VideoCapture1.Video_CaptureDevice_CrossBar_Connect(cbCrossbarVideoInput.Text, "Video Decoder", true);

Please get in touch with support to get help with this tutorial. Visit our GitHub page to get more code samples.