17 int main (
int argc,
const char ** argv)
24 int channelNumber (1);
25 int doMultiFormat (0);
33 {
"device",
'd',
POPT_ARG_STRING, &pDeviceSpec, 0,
"device to use",
"index#, serial#, or model" },
34 {
"channel",
'c',
POPT_ARG_INT, &channelNumber, 0,
"channel to use",
"1-8" },
36 {
"pattern",
'p',
POPT_ARG_STRING, &pTestPattern, 0,
"test pattern to show",
"0-15, name or '?' to list" },
37 {
"videoFormat",
'v',
POPT_ARG_STRING, &pVideoFormat, 0,
"video format to produce",
"'?' or 'list' to list"},
38 {
"pixelFormat", 0,
POPT_ARG_STRING, &pPixelFormat, 0,
"pixel format to use",
"'?' or 'list' to list"},
39 {
"vanc", 0,
POPT_ARG_STRING, &pVancMode, 0,
"vanc mode",
"off|none|0|on|tall|1|taller|tallest|2"},
45 {cerr <<
"## ERROR: " << popt.
errorStr() << endl;
return 2;}
47 {cerr <<
"## WARNING: ignored argument(s): '" <<
aja::join(popt.
otherArgs(),
"', '") <<
"'" << endl;
return 2;}
49 {cout << argv[0] <<
", NTV2 SDK " <<
::NTV2Version() << endl;
return 0;}
51 const string deviceSpec (pDeviceSpec ? pDeviceSpec :
"0");
56 if ((channelNumber < 1) || (channelNumber > 8))
57 {cerr <<
"## ERROR: Invalid channel number " << channelNumber <<
" -- expected 1 thru 8" << endl;
return 1;}
61 const string videoFormatStr (pVideoFormat ? pVideoFormat :
"");
63 if (videoFormatStr ==
"?" || videoFormatStr ==
"list")
70 { cerr <<
"## ERROR: Invalid '--videoFormat' value '" << videoFormatStr <<
"' -- expected values:" << endl
76 const string pixelFormatStr (pPixelFormat ? pPixelFormat :
"");
78 if (pixelFormatStr ==
"?" || pixelFormatStr ==
"list")
82 cerr <<
"## ERROR: Invalid '--pixelFormat' value '" << pixelFormatStr <<
"' -- expected values:" << endl
88 string tpSpec(pTestPattern ? pTestPattern :
"");
90 if (tpSpec ==
"?" || tpSpec ==
"list")
97 cerr <<
"## ERROR: Invalid '--pattern' value '" << tpSpec <<
"' -- expected values:" << endl
104 string vancStr (pVancMode ? pVancMode :
"");
106 if (vancStr ==
"?" || vancStr ==
"list")
108 if (videoFormatStr.empty() && !vancStr.empty())
109 {cerr <<
"## ERROR: '--vanc' option also requires --videoFormat option" << endl;
return 2;}
110 if (!vancStr.empty())
114 { cerr <<
"## ERROR: Invalid '--vanc' value '" << vancStr <<
"' -- expected values: " << endl
124 {cout <<
"## ERROR: Initialization failed: " <<
::AJAStatusToString(status) << endl;
return 1;}
129 {cout <<
"## ERROR: EmitPattern failed: " <<
::AJAStatusToString(status) << endl;
return 2;}
132 cout <<
"## NOTE: Press Enter or Return to exit..." << endl;
static std::string GetTestPatternNameFromString(const std::string &inStr)
int main(int argc, const char **argv)
AJAStatus Init(void)
Initializes me and prepares me to Run.
NTV2VANCMode fVancMode
VANC mode to use.
static AJAStatus Open(bool incrementRefCount=false)
Configures an NTV2OutputTestPattern instance.
std::string fTestPatternName
Name of the test pattern to use.
#define AJA_FAILURE(_status_)
static NTV2VideoFormat GetVideoFormatFromString(const std::string &inStr, const NTV2VideoFormatKinds inKinds=VIDEO_FORMATS_SDHD, const std::string &inDevSpec=std::string())
Returns the NTV2VideoFormat that matches the given string.
static std::string GetPixelFormatStrings(const NTV2PixelFormatKinds inKinds=PIXEL_FORMATS_ALL, const std::string inDevSpec=std::string())
static std::string GetTestPatternStrings(void)
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
std::string NTV2Version(const bool inDetailed=false)
static std::string GetVideoFormatStrings(const NTV2VideoFormatKinds inKinds=VIDEO_FORMATS_SDHD, const std::string inDevSpec=std::string())
virtual const NTV2StringList & otherArgs(void) const
NTV2PixelFormat fPixelFormat
The pixel format to use.
virtual const std::string & errorStr(void) const
NTV2VideoFormat fVideoFormat
The video format to use.
static NTV2VANCMode GetVANCModeFromString(const std::string &inStr)
AJAStatus EmitPattern(void)
Generates, transfers and displays the test pattern on the output.
bool fDoMultiFormat
If true, enable device-sharing; otherwise take exclusive control of device.
NTV2Channel fOutputChannel
The device channel to use.
I generate and transfer a test pattern into an AJA device's frame buffer for steady-state playout usi...
ULWord NTV2VideoFormatKinds
Private include file for all ajabase sources.
std::string AJAStatusToString(const AJAStatus inStatus, const bool inDetailed)
static std::string GetVANCModeStrings(void)
std::string join(const std::vector< std::string > &parts, const std::string &delim)
#define NTV2_IS_VALID_FRAME_BUFFER_FORMAT(__s__)
#define NTV2_IS_VALID_VANCMODE(__v__)
std::string & lower(std::string &str)
static NTV2PixelFormat GetPixelFormatFromString(const std::string &inStr, const NTV2PixelFormatKinds inKinds=PIXEL_FORMATS_ALL, const std::string inDevSpec=std::string())
Returns the NTV2PixelFormat that matches the given string.