|
@@ -106,7 +106,8 @@ AJAOutput::AJAOutput(CNTV2Card *card, const std::string &cardID,
|
|
|
mRunThreadLock{},
|
|
mRunThreadLock{},
|
|
|
mVideoQueue{},
|
|
mVideoQueue{},
|
|
|
mAudioQueue{},
|
|
mAudioQueue{},
|
|
|
- mOBSOutput{nullptr}
|
|
|
|
|
|
|
+ mOBSOutput{nullptr},
|
|
|
|
|
+ mCrosspoints{}
|
|
|
{
|
|
{
|
|
|
mVideoQueue = std::make_unique<VideoQueue>();
|
|
mVideoQueue = std::make_unique<VideoQueue>();
|
|
|
mAudioQueue = std::make_unique<AudioQueue>();
|
|
mAudioQueue = std::make_unique<AudioQueue>();
|
|
@@ -173,6 +174,20 @@ OutputProps AJAOutput::GetOutputProps() const
|
|
|
return mOutputProps;
|
|
return mOutputProps;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+void AJAOutput::CacheConnections(const NTV2XptConnections &cnx)
|
|
|
|
|
+{
|
|
|
|
|
+ mCrosspoints.clear();
|
|
|
|
|
+ mCrosspoints = cnx;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void AJAOutput::ClearConnections()
|
|
|
|
|
+{
|
|
|
|
|
+ for (auto &&xpt : mCrosspoints) {
|
|
|
|
|
+ mCard->Connect(xpt.first, NTV2_XptBlack);
|
|
|
|
|
+ }
|
|
|
|
|
+ mCrosspoints.clear();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
void AJAOutput::GenerateTestPattern(NTV2VideoFormat vf, NTV2PixelFormat pf,
|
|
void AJAOutput::GenerateTestPattern(NTV2VideoFormat vf, NTV2PixelFormat pf,
|
|
|
NTV2TestPatternSelect pattern)
|
|
NTV2TestPatternSelect pattern)
|
|
|
{
|
|
{
|
|
@@ -1068,6 +1083,7 @@ static bool aja_output_start(void *data)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Configures crosspoint routing on AJA card
|
|
// Configures crosspoint routing on AJA card
|
|
|
|
|
+ ajaOutput->ClearConnections();
|
|
|
NTV2XptConnections xpt_cnx;
|
|
NTV2XptConnections xpt_cnx;
|
|
|
if (!aja::Routing::ConfigureOutputRoute(outputProps, NTV2_MODE_DISPLAY,
|
|
if (!aja::Routing::ConfigureOutputRoute(outputProps, NTV2_MODE_DISPLAY,
|
|
|
card, xpt_cnx)) {
|
|
card, xpt_cnx)) {
|
|
@@ -1075,7 +1091,7 @@ static bool aja_output_start(void *data)
|
|
|
"aja_output_start: Error configuring output route!");
|
|
"aja_output_start: Error configuring output route!");
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ ajaOutput->CacheConnections(xpt_cnx);
|
|
|
aja::Routing::ConfigureOutputAudio(outputProps, card);
|
|
aja::Routing::ConfigureOutputAudio(outputProps, card);
|
|
|
|
|
|
|
|
const auto &formatDesc = outputProps.FormatDesc();
|
|
const auto &formatDesc = outputProps.FormatDesc();
|
|
@@ -1144,14 +1160,15 @@ static void aja_output_stop(void *data, uint64_t ts)
|
|
|
aja::IOSelectionToString(outputProps.ioSelect).c_str(),
|
|
aja::IOSelectionToString(outputProps.ioSelect).c_str(),
|
|
|
cardID.c_str());
|
|
cardID.c_str());
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
ajaOutput->GenerateTestPattern(outputProps.videoFormat,
|
|
ajaOutput->GenerateTestPattern(outputProps.videoFormat,
|
|
|
outputProps.pixelFormat,
|
|
outputProps.pixelFormat,
|
|
|
NTV2_TestPatt_Black);
|
|
NTV2_TestPatt_Black);
|
|
|
|
|
|
|
|
obs_output_end_data_capture(ajaOutput->GetOBSOutput());
|
|
obs_output_end_data_capture(ajaOutput->GetOBSOutput());
|
|
|
-
|
|
|
|
|
auto audioSystem = outputProps.AudioSystem();
|
|
auto audioSystem = outputProps.AudioSystem();
|
|
|
card->StopAudioOutput(audioSystem);
|
|
card->StopAudioOutput(audioSystem);
|
|
|
|
|
+ ajaOutput->ClearConnections();
|
|
|
|
|
|
|
|
blog(LOG_INFO, "AJA Output stopped.");
|
|
blog(LOG_INFO, "AJA Output stopped.");
|
|
|
}
|
|
}
|