AJA NTV2 SDK  17.1.3.1410
NTV2 SDK 17.1.3.1410
ntv2signalrouter.cpp File Reference

CNTV2SignalRouter implementation. More...

#include "ntv2signalrouter.h"
#include "ntv2routingexpert.h"
#include "ntv2debug.h"
#include "ntv2utils.h"
#include "ntv2devicefeatures.hh"
#include "ntv2registerexpert.h"
#include "ajabase/system/debug.h"
#include "ajabase/common/common.h"
#include <memory.h>
#include <stdio.h>
#include <assert.h>
#include <algorithm>
Include dependency graph for ntv2signalrouter.cpp:

Go to the source code of this file.

Macros

#define HEX16(__x__)   "0x" << hex << setw(16) << setfill('0') << uint64_t(__x__) << dec
 
#define INSTP(_p_)   HEX16(uint64_t(_p_))
 
#define SRiFAIL(__x__)   AJA_sERROR (AJA_DebugUnit_RoutingGeneric, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
 
#define SRiWARN(__x__)   AJA_sWARNING(AJA_DebugUnit_RoutingGeneric, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
 
#define SRiNOTE(__x__)   AJA_sNOTICE (AJA_DebugUnit_RoutingGeneric, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
 
#define SRiINFO(__x__)   AJA_sINFO (AJA_DebugUnit_RoutingGeneric, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
 
#define SRiDBG(__x__)   AJA_sDEBUG (AJA_DebugUnit_RoutingGeneric, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
 
#define SRFAIL(__x__)   AJA_sERROR (AJA_DebugUnit_RoutingGeneric, AJAFUNC << ": " << __x__)
 
#define SRWARN(__x__)   AJA_sWARNING(AJA_DebugUnit_RoutingGeneric, AJAFUNC << ": " << __x__)
 
#define SRNOTE(__x__)   AJA_sNOTICE (AJA_DebugUnit_RoutingGeneric, AJAFUNC << ": " << __x__)
 
#define SRINFO(__x__)   AJA_sINFO (AJA_DebugUnit_RoutingGeneric, AJAFUNC << ": " << __x__)
 
#define SRDBG(__x__)   AJA_sDEBUG (AJA_DebugUnit_RoutingGeneric, AJAFUNC << ": " << __x__)
 

Functions

static NTV2StringListTokenize (const string &inString, NTV2StringList &outTokens, const string &inDelimiters=" ", bool inTrimEmpty=false)
 
NTV2InputXptID GetFrameBufferInputXptFromChannel (const NTV2Channel inChannel, const bool inIsBInput)
 
NTV2InputXptID GetCSCInputXptFromChannel (const NTV2Channel inChannel, const bool inIsKeyInput)
 
NTV2InputXptID GetLUTInputXptFromChannel (const NTV2Channel inLUT)
 
NTV2InputXptID GetDLInInputXptFromChannel (const NTV2Channel inChannel, const bool inLinkB)
 
NTV2InputXptID GetDLOutInputXptFromChannel (const NTV2Channel inChannel)
 
NTV2OutputXptID GetCSCOutputXptFromChannel (const NTV2Channel inChannel, const bool inIsKey, const bool inIsRGB)
 
NTV2OutputXptID GetLUTOutputXptFromChannel (const NTV2Channel inLUT)
 
NTV2OutputXptID GetFrameBufferOutputXptFromChannel (const NTV2Channel inChannel, const bool inIsRGB, const bool inIs425)
 
NTV2OutputXptID GetInputSourceOutputXpt (const NTV2InputSource inInputSource, const bool inIsSDI_DS2, const bool inIsHDMI_RGB, const UWord inHDMI_Quadrant)
 
NTV2OutputXptID GetSDIInputOutputXptFromChannel (const NTV2Channel inChannel, const bool inIsDS2)
 
NTV2OutputXptID GetDLOutOutputXptFromChannel (const NTV2Channel inChannel, const bool inIsLinkB)
 
NTV2OutputXptID GetDLInOutputXptFromChannel (const NTV2Channel inChannel)
 
NTV2InputXptID GetOutputDestInputXpt (const NTV2OutputDestination inOutputDest, const bool inIsSDI_DS2, const UWord inHDMI_Quadrant)
 
NTV2InputXptID GetSDIOutputInputXpt (const NTV2Channel inChannel, const bool inIsDS2)
 
NTV2OutputXptID GetMixerOutputXptFromChannel (const NTV2Channel inChannel, const bool inIsKey)
 
NTV2InputXptID GetMixerFGInputXpt (const NTV2Channel inChannel, const bool inIsKey)
 
NTV2InputXptID GetMixerBGInputXpt (const NTV2Channel inChannel, const bool inIsKey)
 
NTV2InputXptID GetTSIMuxInputXptFromChannel (const NTV2Channel inChannel, const bool inLinkB)
 
NTV2OutputXptID GetTSIMuxOutputXptFromChannel (const NTV2Channel inChannel, const bool inLinkB, const bool inIsRGB)
 
ostream & operator<< (ostream &inOutStream, const CNTV2SignalRouter &inObj)
 
ostream & operator<< (ostream &inOutStream, const NTV2OutputXptIDSet &inObj)
 
ostream & operator<< (ostream &inOutStream, const NTV2InputXptIDSet &inObj)
 
ostream & operator<< (ostream &inOutStream, const NTV2WidgetIDSet &inObj)
 
ostream & operator<< (ostream &inOutStream, const NTV2XptConnections &inObj)
 

Variables

static const ULWord sSignalRouterRegMasks [] = { 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 }
 
static const ULWord sSignalRouterRegShifts [] = { 0, 8, 16, 24 }
 

Detailed Description

CNTV2SignalRouter implementation.

Definition in file ntv2signalrouter.cpp.

Macro Definition Documentation

◆ HEX16

#define HEX16 (   __x__)    "0x" << hex << setw(16) << setfill('0') << uint64_t(__x__) << dec

Definition at line 23 of file ntv2signalrouter.cpp.

◆ INSTP

#define INSTP (   _p_)    HEX16(uint64_t(_p_))

Definition at line 24 of file ntv2signalrouter.cpp.

◆ SRDBG

#define SRDBG (   __x__)    AJA_sDEBUG (AJA_DebugUnit_RoutingGeneric, AJAFUNC << ": " << __x__)

Definition at line 34 of file ntv2signalrouter.cpp.

◆ SRFAIL

#define SRFAIL (   __x__)    AJA_sERROR (AJA_DebugUnit_RoutingGeneric, AJAFUNC << ": " << __x__)

Definition at line 30 of file ntv2signalrouter.cpp.

◆ SRiDBG

#define SRiDBG (   __x__)    AJA_sDEBUG (AJA_DebugUnit_RoutingGeneric, INSTP(this) << "::" << AJAFUNC << ": " << __x__)

Definition at line 29 of file ntv2signalrouter.cpp.

◆ SRiFAIL

#define SRiFAIL (   __x__)    AJA_sERROR (AJA_DebugUnit_RoutingGeneric, INSTP(this) << "::" << AJAFUNC << ": " << __x__)

Definition at line 25 of file ntv2signalrouter.cpp.

◆ SRiINFO

#define SRiINFO (   __x__)    AJA_sINFO (AJA_DebugUnit_RoutingGeneric, INSTP(this) << "::" << AJAFUNC << ": " << __x__)

Definition at line 28 of file ntv2signalrouter.cpp.

◆ SRINFO

#define SRINFO (   __x__)    AJA_sINFO (AJA_DebugUnit_RoutingGeneric, AJAFUNC << ": " << __x__)

Definition at line 33 of file ntv2signalrouter.cpp.

◆ SRiNOTE

#define SRiNOTE (   __x__)    AJA_sNOTICE (AJA_DebugUnit_RoutingGeneric, INSTP(this) << "::" << AJAFUNC << ": " << __x__)

Definition at line 27 of file ntv2signalrouter.cpp.

◆ SRiWARN

#define SRiWARN (   __x__)    AJA_sWARNING(AJA_DebugUnit_RoutingGeneric, INSTP(this) << "::" << AJAFUNC << ": " << __x__)

Definition at line 26 of file ntv2signalrouter.cpp.

◆ SRNOTE

#define SRNOTE (   __x__)    AJA_sNOTICE (AJA_DebugUnit_RoutingGeneric, AJAFUNC << ": " << __x__)

Definition at line 32 of file ntv2signalrouter.cpp.

◆ SRWARN

#define SRWARN (   __x__)    AJA_sWARNING(AJA_DebugUnit_RoutingGeneric, AJAFUNC << ": " << __x__)

Definition at line 31 of file ntv2signalrouter.cpp.

Function Documentation

◆ GetCSCInputXptFromChannel()

NTV2InputXptID GetCSCInputXptFromChannel ( const NTV2Channel  inCSC,
const bool  inIsKeyInput = false 
)
Returns
The appropriate NTV2InputXptID for the given color space converter (CSC) widget, or NTV2_INPUT_CROSSPOINT_INVALID upon failure.
Parameters
[in]inCSCSpecifies the CSC of interest, expressed as an NTV2Channel (a zero-based index value).
[in]inIsKeyInputSpecify true to obtain the key (alpha) input crosspoint. Defaults to false (the video input crosspoint).

Definition at line 775 of file ntv2signalrouter.cpp.

◆ GetCSCOutputXptFromChannel()

NTV2OutputXptID GetCSCOutputXptFromChannel ( const NTV2Channel  inCSC,
const bool  inIsKey = false,
const bool  inIsRGB = false 
)
Returns
The appropriate NTV2OutputCrosspointID for the given color space converter (CSC) widget, or NTV2_OUTPUT_CROSSPOINT_INVALID upon failure.
Parameters
[in]inCSCSpecifies the CSC of interest, expressed as an NTV2Channel (a zero-based index value).
[in]inIsKeySpecify true to obtain the key (alpha) output crosspoint. Defaults to false (the video output crosspoint).
[in]inIsRGBSpecify true to obtain the RGB video output crosspoint. Defaults to false (the YUV video output crosspoint). Ignored if true passed to inIsKey.

Definition at line 819 of file ntv2signalrouter.cpp.

◆ GetDLInInputXptFromChannel()

NTV2InputXptID GetDLInInputXptFromChannel ( const NTV2Channel  inChannel,
const bool  inLinkB = false 
)
Returns
The appropriate NTV2InputXptID for the given Dual-Link Input widget, or NTV2_INPUT_CROSSPOINT_INVALID upon failure.
Parameters
[in]inChannelSpecifies the Dual-Link Input converter of interest, expressed as an NTV2Channel (a zero-based index value).
[in]inLinkBSpecifies whether to return the A or the B link crosspoint ID. Defaults to the A link crosspoint.

Definition at line 796 of file ntv2signalrouter.cpp.

◆ GetDLInOutputXptFromChannel()

NTV2OutputXptID GetDLInOutputXptFromChannel ( const NTV2Channel  inDLInput)
Returns
The appropriate NTV2OutputCrosspointID for the given Dual Link Input, or NTV2_OUTPUT_CROSSPOINT_INVALID upon failure.
Parameters
[in]inDLInputSpecifies the Dual-Link Input widget of interest, expressed as an NTV2Channel (a zero-based index value).

Definition at line 917 of file ntv2signalrouter.cpp.

◆ GetDLOutInputXptFromChannel()

NTV2InputXptID GetDLOutInputXptFromChannel ( const NTV2Channel  inDLOutWidget)
Returns
The appropriate NTV2InputXptID for the given Dual Link Output widget, or NTV2_INPUT_CROSSPOINT_INVALID upon failure.
Parameters
[in]inDLOutWidgetSpecifies the Dual Link Output of interest, expressed as an NTV2Channel (a zero-based index value).

Definition at line 808 of file ntv2signalrouter.cpp.

◆ GetDLOutOutputXptFromChannel()

NTV2OutputXptID GetDLOutOutputXptFromChannel ( const NTV2Channel  inDLOutput,
const bool  inIsLinkB = false 
)
Returns
The NTV2OutputCrosspointID for the given Dual Link Output, or NTV2_OUTPUT_CROSSPOINT_INVALID upon failure.
Parameters
[in]inDLOutputSpecifies the Dual-Link Output widget of interest, expressed as an NTV2Channel (a zero-based index value).
[in]inIsLinkBSpecify true to obtain the DS2 output crosspoint. Defaults to false (the DS1 output crosspoint).

Definition at line 905 of file ntv2signalrouter.cpp.

◆ GetFrameBufferInputXptFromChannel()

NTV2InputXptID GetFrameBufferInputXptFromChannel ( const NTV2Channel  inFrameStore,
const bool  inIsBInput = false 
)
Returns
The appropriate NTV2InputXptID for the given FrameStore, or NTV2_INPUT_CROSSPOINT_INVALID upon failure.
Parameters
[in]inFrameStoreSpecifies the FrameStore of interest, expressed as an NTV2Channel (a zero-based index value).
[in]inIsBInputSpecify true to obtain the "B" input crosspoint (for dual-link). Defaults to false (the "A" input crosspoint).

Definition at line 762 of file ntv2signalrouter.cpp.

◆ GetFrameBufferOutputXptFromChannel()

NTV2OutputXptID GetFrameBufferOutputXptFromChannel ( const NTV2Channel  inFrameStore,
const bool  inIsRGB = false,
const bool  inIs425 = false 
)
Returns
The appropriate NTV2OutputCrosspointID for the given FrameStore, or NTV2_OUTPUT_CROSSPOINT_INVALID upon failure.
Parameters
[in]inFrameStoreSpecifies the FrameStore of interest, expressed as an NTV2Channel (a zero-based index value).
[in]inIsRGBSpecify true to obtain the RGB output crosspoint. Defaults to false (the YUV output crosspoint).
[in]inIs425Specify true to obtain the 425 output crosspoint. Defaults to false (the normal non-425 output crosspoint).

Definition at line 845 of file ntv2signalrouter.cpp.

◆ GetInputSourceOutputXpt()

NTV2OutputXptID GetInputSourceOutputXpt ( const NTV2InputSource  inInputSource,
const bool  inIsSDI_DS2 = false,
const bool  inIsHDMI_RGB = false,
const UWord  inHDMI_Quadrant = 0 
)
Returns
The appropriate NTV2OutputCrosspointID for the given NTV2InputSource, or NTV2_OUTPUT_CROSSPOINT_INVALID upon failure.
Parameters
[in]inInputSourceSpecifies the NTV2InputSource of interest.
[in]inIsSDI_DS2Specify true to obtain the DS2 output crosspoint (for SDI input sources). Defaults to false (the DS1 output crosspoint). Ignored for non-SDI input sources.
[in]inIsHDMI_RGBSpecify true to obtain the RGB output crosspoint (for HDMI input sources). Defaults to false (the YUV output crosspoint). Ignored for non-HDMI input sources.
[in]inHDMI_QuadrantSpecifies the 4K/UHD quadrant of interest (for HDMI input sources), where 0=upperLeft, 1=upperRight, 2=lowerLeft, 3=lowerRight. Defaults to 0 (upperLeft). Ignored for non-HDMI input sources.

Definition at line 865 of file ntv2signalrouter.cpp.

◆ GetLUTInputXptFromChannel()

NTV2InputXptID GetLUTInputXptFromChannel ( const NTV2Channel  inLUT)
Returns
The appropriate NTV2InputXptID for the given LUT widget, or NTV2_INPUT_CROSSPOINT_INVALID upon failure.
Parameters
[in]inLUTSpecifies the LUT of interest, expressed as an NTV2Channel (a zero-based index value).

Definition at line 788 of file ntv2signalrouter.cpp.

◆ GetLUTOutputXptFromChannel()

NTV2OutputXptID GetLUTOutputXptFromChannel ( const NTV2Channel  inLUT)
Returns
The appropriate NTV2OutputCrosspointID for the given LUT widget.
Parameters
[in]inLUTSpecifies the LUT of interest, expressed as an NTV2Channel (a zero-based index value).

Definition at line 838 of file ntv2signalrouter.cpp.

◆ GetMixerBGInputXpt()

NTV2InputXptID GetMixerBGInputXpt ( const NTV2Channel  inChannel,
const bool  inIsKey = false 
)
Returns
The appropriate mixer's background NTV2InputXptID for the given NTV2Channel, or NTV2_INPUT_CROSSPOINT_INVALID upon failure.
Parameters
[in]inChannelSpecifies the NTV2Channel of interest. Mixer 1 is used for channels 1 & 2, mixer 2 for channels 3 & 4, etc.
[in]inIsKeySpecify true to obtain the key input crosspoint. Defaults to false (the video input).
See also
GetMixerFGInputXpt, GetMixerOutputXptFromChannel, widget_mixkey

Definition at line 981 of file ntv2signalrouter.cpp.

◆ GetMixerFGInputXpt()

NTV2InputXptID GetMixerFGInputXpt ( const NTV2Channel  inChannel,
const bool  inIsKey = false 
)
Returns
The appropriate mixer's foreground NTV2InputXptID for the given NTV2Channel, or NTV2_INPUT_CROSSPOINT_INVALID upon failure.
Parameters
[in]inChannelSpecifies the NTV2Channel of interest. Mixer 1 is used for channels 1 & 2, mixer 2 for channels 3 & 4, etc.
[in]inIsKeySpecify true to obtain the key input crosspoint. Defaults to false (the video input).
See also
GetMixerBGInputXpt, GetMixerOutputXptFromChannel, widget_mixkey

Definition at line 968 of file ntv2signalrouter.cpp.

◆ GetMixerOutputXptFromChannel()

NTV2OutputXptID GetMixerOutputXptFromChannel ( const NTV2Channel  inChannel,
const bool  inIsKey = false 
)
Returns
The appropriate mixer's NTV2OutputCrosspointID for the given NTV2Channel, or NTV2_OUTPUT_CROSSPOINT_INVALID upon failure.
Parameters
[in]inChannelSpecifies the NTV2Channel of interest. Mixer 1 is used for channels 1 & 2, mixer 2 for channels 3 & 4, etc.
[in]inIsKeySpecify true to obtain the key output crosspoint. Defaults to false (the video output crosspoint).
See also
GetMixerFGInputXpt, GetMixerBGInputXpt, widget_mixkey

Definition at line 955 of file ntv2signalrouter.cpp.

◆ GetOutputDestInputXpt()

NTV2InputXptID GetOutputDestInputXpt ( const NTV2OutputDestination  inOutputDest,
const bool  inIsSDI_DS2 = false,
const UWord  inHDMI_Quadrant = 99 
)
Returns
The appropriate NTV2InputXptID for the given NTV2OutputDestination, or NTV2_INPUT_CROSSPOINT_INVALID upon failure.
Parameters
[in]inOutputDestSpecifies the NTV2OutputDestination of interest.
[in]inIsSDI_DS2Specify true to obtain the DS2 input crosspoint (SDI output destinations only). Defaults to false (the DS1 input). Ignored for non-SDI output destinations.
[in]inHDMI_QuadrantSpecifies the 4K/UHD quadrant of interest (for HDMI output destinations), where 0=upperLeft, 1=upperRight, 2=lowerLeft, 3=lowerRight. Values above 3 are deemed to be non-4K/UHD (the default). Ignored for non-HDMI output destinations.

Definition at line 928 of file ntv2signalrouter.cpp.

◆ GetSDIInputOutputXptFromChannel()

NTV2OutputXptID GetSDIInputOutputXptFromChannel ( const NTV2Channel  inSDIInput,
const bool  inIsDS2 = false 
)
Returns
The appropriate SDI input's NTV2OutputCrosspointID for the given SDI Input, or NTV2_OUTPUT_CROSSPOINT_INVALID upon failure.
Parameters
[in]inSDIInputSpecifies the SDI Input widget of interest, expressed as an NTV2Channel (a zero-based index value).
[in]inIsDS2Specify true to obtain the DS2 output crosspoint. Defaults to false (the DS1 output crosspoint).

Definition at line 893 of file ntv2signalrouter.cpp.

◆ GetSDIOutputInputXpt()

NTV2InputXptID GetSDIOutputInputXpt ( const NTV2Channel  inSDIOutput,
const bool  inIsDS2 = false 
)
Returns
The appropriate NTV2InputXptID for the given SDI Output, or NTV2_INPUT_CROSSPOINT_INVALID upon failure.
Parameters
[in]inSDIOutputSpecifies the SDI Output widget of interest, expressed as an NTV2Channel (a zero-based index value).
[in]inIsDS2Specify true to obtain the DS2 input crosspoint. Defaults to false (the DS1 input).

Definition at line 942 of file ntv2signalrouter.cpp.

◆ GetTSIMuxInputXptFromChannel()

NTV2InputXptID GetTSIMuxInputXptFromChannel ( const NTV2Channel  inTSIMuxer,
const bool  inLinkB = false 
)
Returns
The appropriate NTV2InputXptID for the given TSI Muxer widget, or NTV2_INPUT_CROSSPOINT_INVALID upon failure.
Parameters
[in]inTSIMuxerSpecifies the 425Mux widget of interest, expressed as an NTV2Channel (a zero-based index value).
[in]inLinkBSpecify true to obtain the "B" input crosspoint. Defaults to false, the "A" input.

Definition at line 993 of file ntv2signalrouter.cpp.

◆ GetTSIMuxOutputXptFromChannel()

NTV2OutputXptID GetTSIMuxOutputXptFromChannel ( const NTV2Channel  inTSIMuxer,
const bool  inLinkB = false,
const bool  inIsRGB = false 
)
Returns
The appropriate NTV2OutputXptID for the given TSI Muxer, or NTV2_OUTPUT_CROSSPOINT_INVALID upon failure.
Parameters
[in]inTSIMuxerSpecifies the 425Mux widget of interest, expressed as an NTV2Channel (a zero-based index value).
[in]inLinkBSpecify true to obtain the "B" output crosspoint. Defaults to false, the "A" output.
[in]inIsRGBSpecify true to obtain the RGB output crosspoint. Defaults to false, the YUV output.

Definition at line 1005 of file ntv2signalrouter.cpp.

◆ operator<<() [1/5]

ostream& operator<< ( ostream &  inOutStream,
const CNTV2SignalRouter inObj 
)

Definition at line 1092 of file ntv2signalrouter.cpp.

◆ operator<<() [2/5]

ostream& operator<< ( ostream &  inOutStream,
const NTV2InputXptIDSet inObj 
)

Definition at line 1113 of file ntv2signalrouter.cpp.

◆ operator<<() [3/5]

ostream& operator<< ( ostream &  inOutStream,
const NTV2OutputXptIDSet inObj 
)

Definition at line 1099 of file ntv2signalrouter.cpp.

◆ operator<<() [4/5]

ostream& operator<< ( ostream &  inOutStream,
const NTV2WidgetIDSet inObj 
)

Definition at line 1136 of file ntv2signalrouter.cpp.

◆ operator<<() [5/5]

ostream& operator<< ( ostream &  inOutStream,
const NTV2XptConnections inObj 
)

Definition at line 1147 of file ntv2signalrouter.cpp.

◆ Tokenize()

static NTV2StringList& Tokenize ( const string &  inString,
NTV2StringList outTokens,
const string &  inDelimiters = " ",
bool  inTrimEmpty = false 
)
static

Definition at line 36 of file ntv2signalrouter.cpp.

Variable Documentation

◆ sSignalRouterRegMasks

const ULWord sSignalRouterRegMasks[] = { 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 }
static

Definition at line 104 of file ntv2signalrouter.cpp.

◆ sSignalRouterRegShifts

const ULWord sSignalRouterRegShifts[] = { 0, 8, 16, 24 }
static

Definition at line 105 of file ntv2signalrouter.cpp.