aja: Workaround for SDI5 output not working on io4K+

This commit is contained in:
Paul Hindt 2022-01-17 15:41:02 -08:00 committed by Colin Edwards
parent a59286f6b5
commit 04bf12f130
3 changed files with 18 additions and 8 deletions

View File

@ -6,6 +6,7 @@
#include <ajantv2/includes/ntv2debug.h>
#include <ajantv2/includes/ntv2devicescanner.h>
#include <ajantv2/includes/ntv2devicefeatures.h>
#include <ajantv2/includes/ntv2signalrouter.h>
#include <ajantv2/includes/ntv2utils.h>
void filter_io_selection_input_list(const std::string &cardID,
@ -395,6 +396,16 @@ NTV2VideoFormat HandleSpecialCaseFormats(IOSelection io, NTV2VideoFormat vf,
return vf;
}
NTV2Channel WidgetIDToChannel(NTV2WidgetID id)
{
#if AJA_NTV2_SDK_VERSION_MAJOR <= 16 && AJA_NTV2_SDK_VERSION_MINOR <= 2
// Workaround for bug in NTV2 SDK <= 16.2 where NTV2_WgtSDIMonOut1 maps incorrectly to NTV2_CHANNEL1.
if (id == NTV2_WgtSDIMonOut1)
return NTV2_CHANNEL5;
#endif
return CNTV2SignalRouter::WidgetIDToChannel(id);
}
uint32_t CardNumFramestores(NTV2DeviceID id)
{
auto numFramestores = NTV2DeviceGetNumFrameStores(id);

View File

@ -66,6 +66,8 @@ extern void GetSortedVideoFormats(NTV2DeviceID id,
extern NTV2VideoFormat
HandleSpecialCaseFormats(IOSelection io, NTV2VideoFormat vf, NTV2DeviceID id);
extern NTV2Channel WidgetIDToChannel(NTV2WidgetID id);
extern uint32_t CardNumFramestores(NTV2DeviceID id);
extern uint32_t CardNumAudioSystems(NTV2DeviceID id);
extern bool CardCanDoSDIMonitorOutput(NTV2DeviceID id);

View File

@ -1,4 +1,5 @@
#include "aja-widget-io.hpp"
#include "aja-common.hpp"
#include <ajantv2/includes/ntv2utils.h>
#include <ajantv2/includes/ntv2signalrouter.h>
@ -351,8 +352,7 @@ bool WidgetInputSocket::Find(const std::string &name, NTV2Channel channel,
{
for (const auto &in : kWidgetInputSockets) {
if (name == in.name &&
channel == CNTV2SignalRouter::WidgetIDToChannel(
in.widget_id) &&
channel == aja::WidgetIDToChannel(in.widget_id) &&
datastream == in.datastream_index) {
inp = in;
return true;
@ -392,8 +392,7 @@ NTV2Channel WidgetInputSocket::InputXptChannel(InputXpt xpt)
NTV2Channel channel = NTV2_CHANNEL_INVALID;
for (auto &x : kWidgetInputSockets) {
if (x.id == xpt) {
channel = CNTV2SignalRouter::WidgetIDToChannel(
x.widget_id);
channel = aja::WidgetIDToChannel(x.widget_id);
break;
}
}
@ -420,8 +419,7 @@ bool WidgetOutputSocket::Find(const std::string &name, NTV2Channel channel,
// << ", datastream = " << datastream << std::endl;
for (const auto &wo : kWidgetOutputSockets) {
if (name == wo.name &&
channel == CNTV2SignalRouter::WidgetIDToChannel(
wo.widget_id) &&
channel == aja::WidgetIDToChannel(wo.widget_id) &&
datastream == wo.datastream_index) {
out = wo;
return true;
@ -461,8 +459,7 @@ NTV2Channel WidgetOutputSocket::OutputXptChannel(OutputXpt xpt)
NTV2Channel channel = NTV2_CHANNEL_INVALID;
for (auto &x : kWidgetOutputSockets) {
if (x.id == xpt) {
channel = CNTV2SignalRouter::WidgetIDToChannel(
x.widget_id);
channel = aja::WidgetIDToChannel(x.widget_id);
break;
}
}