|
AJA NTV2 SDK
17.0.1.1246
NTV2 SDK 17.0.1.1246
|
Go to the documentation of this file.
17 int main (
int argc,
const char ** argv)
24 int channelNumber (1);
32 {
"device",
'd',
POPT_ARG_STRING, &pDeviceSpec, 0,
"device to use",
"index#, serial#, or model" },
33 {
"channel",
'c',
POPT_ARG_INT, &channelNumber, 0,
"channel to use",
"1-8" },
34 {
"pattern",
'p',
POPT_ARG_STRING, &pTestPattern, 0,
"test pattern to show",
"0-15, name or '?' to list" },
35 {
"videoFormat",
'v',
POPT_ARG_STRING, &pVideoFormat, 0,
"video format to produce",
"'?' or 'list' to list"},
36 {
"pixelFormat", 0,
POPT_ARG_STRING, &pPixelFormat, 0,
"pixel format to use",
"'?' or 'list' to list"},
37 {
"vanc", 0,
POPT_ARG_STRING, &pVancMode, 0,
"vanc mode",
"off|none|0|on|tall|1|taller|tallest|2"},
43 {cerr <<
"## ERROR: " << popt.
errorStr() << endl;
return 2;}
45 {cout << argv[0] <<
", NTV2 SDK " <<
::NTV2Version() << endl;
return 0;}
48 const string deviceSpec (pDeviceSpec ? pDeviceSpec :
"0");
55 if ((channelNumber < 1) || (channelNumber > 8))
56 {cerr <<
"## ERROR: Invalid channel number " << channelNumber <<
" -- expected 1 thru 8" << endl;
return 1;}
60 const string videoFormatStr (pVideoFormat ? pVideoFormat :
"");
63 if (videoFormatStr ==
"?" || videoFormatStr ==
"list")
66 { cerr <<
"## ERROR: Invalid '--videoFormat' value '" << videoFormatStr <<
"' -- expected values:" << endl
72 const string pixelFormatStr (pPixelFormat ? pPixelFormat :
"");
74 if (pixelFormatStr ==
"?" || pixelFormatStr ==
"list")
78 cerr <<
"## ERROR: Invalid '--pixelFormat' value '" << pixelFormatStr <<
"' -- expected values:" << endl
84 string tpSpec(pTestPattern ? pTestPattern :
"");
86 if (tpSpec ==
"?" || tpSpec ==
"list")
93 cerr <<
"## ERROR: Invalid '--pattern' value '" << tpSpec <<
"' -- expected values:" << endl
100 string vancStr (pVancMode ? pVancMode :
"");
102 if (vancStr ==
"?" || vancStr ==
"list")
104 if (videoFormatStr.empty() && !vancStr.empty())
105 {cerr <<
"## ERROR: '--vanc' option also requires --videoFormat option" << endl;
return 2;}
106 if (!vancStr.empty())
110 { cerr <<
"## ERROR: Invalid '--vanc' value '" << vancStr <<
"' -- expected values: " << endl
120 {cout <<
"## ERROR: Initialization failed: " <<
::AJAStatusToString(status) << endl;
return 1;}
125 {cout <<
"## ERROR: EmitPattern failed: " <<
::AJAStatusToString(status) << endl;
return 2;}
128 cout <<
"## NOTE: Press Enter or Return to exit..." << endl;
static std::string GetVideoFormatStrings(const NTV2VideoFormatKinds inKinds=VIDEO_FORMATS_NON_4KUHD, const std::string inDeviceSpecifier=std::string())
static NTV2VANCMode GetVANCModeFromString(const std::string &inStr)
NTV2Channel
These enum values are mostly used to identify a specific Frame Store. They're also commonly used to i...
Configures an NTV2OutputTestPattern instance.
int main(int argc, const char **argv)
NTV2VANCMode fVancMode
VANC mode to use.
static NTV2VideoFormat GetVideoFormatFromString(const std::string &inStr, const NTV2VideoFormatKinds inKinds=VIDEO_FORMATS_NON_4KUHD)
Returns the NTV2VideoFormat that matches the given string.
AJAStatus EmitPattern(void)
Generates, transfers and displays the test pattern on the output.
static bool IsValidDevice(const std::string &inDeviceSpec)
static std::string GetTestPatternStrings(void)
std::string & lower(std::string &str)
std::string fTestPatternName
Name of the test pattern to use.
static NTV2FrameBufferFormat GetPixelFormatFromString(const std::string &inStr)
Returns the NTV2FrameBufferFormat that matches the given string.
NTV2VideoFormat fVideoFormat
The video format to use.
static std::string GetVANCModeStrings(void)
@ NTV2_FBF_8BIT_YCBCR
See 8-Bit YCbCr Format.
NTV2Channel fOutputChannel
The device channel to use.
virtual const std::string & errorStr(void) const
std::string NTV2Version(const bool inDetailed=false)
static std::string GetTestPatternNameFromString(const std::string &inStr)
AJAStatus Init(void)
Initializes me and prepares me to Run.
static AJAStatus Open(bool incrementRefCount=false)
@ VIDEO_FORMATS_NON_4KUHD
Private include file for all ajabase sources.
I generate and transfer a test pattern into an AJA device's frame buffer for steady-state playout usi...
std::string AJAStatusToString(const AJAStatus inStatus, const bool inDetailed)
static std::string GetPixelFormatStrings(const NTV2PixelFormatKinds inKinds=PIXEL_FORMATS_ALL, const std::string inDeviceSpecifier=std::string())
NTV2PixelFormat fPixelFormat
The pixel format to use.
#define NTV2_IS_VALID_FRAME_BUFFER_FORMAT(__s__)
#define AJA_FAILURE(_status_)
#define NTV2_IS_VALID_VANCMODE(__v__)