|
AJA NTV2 SDK
17.1.3.1410
NTV2 SDK 17.1.3.1410
|
Go to the documentation of this file.
27 int main (
int argc,
const char ** argv)
31 int channelNumber (1);
32 int doMultiFormat (0);
34 int doQuadRouting (0);
35 int numAudioLinks (1);
42 {
"device",
'd',
POPT_ARG_STRING, &pDeviceSpec, 0,
"device to use",
"index#, serial#, or model" },
43 {
"channel",
'c',
POPT_ARG_INT, &channelNumber, 0,
"channel to use",
"1-8" },
45 {
"pixelFormat",
'p',
POPT_ARG_STRING, &pPixelFormat, 0,
"pixel format to use",
"'?' or 'list' to list" },
47 {
"audioLinks", 0,
POPT_ARG_INT, &numAudioLinks, 0,
"# multilink aud systems",
"0=silence or 1-4" },
53 {cerr <<
"## ERROR: " << popt.
errorStr() << endl;
return 2;}
55 {cout << argv[0] <<
", NTV2 SDK " <<
::NTV2Version() << endl;
return 0;}
58 const string deviceSpec (pDeviceSpec ? pDeviceSpec :
"0");
65 if ((channelNumber < 1) || (channelNumber > 8))
66 {cerr <<
"## ERROR: Invalid channel number " << channelNumber <<
" -- expected 1 thru 8" << endl;
return 1;}
70 const string pixelFormatStr (pPixelFormat ? pPixelFormat :
"");
72 if (pixelFormatStr ==
"?" || pixelFormatStr ==
"list")
76 cerr <<
"## ERROR: Invalid '--pixelFormat' value '" << pixelFormatStr <<
"' -- expected values:" << endl
82 if (numAudioLinks < 0)
83 {cerr <<
"## ERROR: invalid '--audioLinks' value '" << numAudioLinks <<
"' -- negative" << endl;
return 1;}
84 if (numAudioLinks > 4)
85 {cerr <<
"## ERROR: invalid '--audioLinks' value '" << numAudioLinks <<
"' -- exceeds 4" << endl;
return 1;}
86 if (numAudioLinks != 1)
98 {cout <<
"## ERROR: Initialization failed: " <<
::AJAStatusToString(status) << endl;
return 1;}
109 cout <<
" Frames Frames Buffer" << endl
110 <<
" Captured Dropped Level" << endl;
113 ULWord framesProcessed, framesDropped, bufferLevel;
114 capturer.
GetACStatus (framesProcessed, framesDropped, bufferLevel);
115 cout << setw(9) << framesProcessed << setw(9) << framesDropped << setw(9) << bufferLevel <<
"\r" << flush;
Declares the NTV2Capture class.
bool fDoMultiFormat
If true, use multi-format/multi-channel mode, if device supports it; otherwise normal mode.
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
NTV2PixelFormat fPixelFormat
Pixel format to use.
int main(int argc, const char **argv)
bool fWithAnc
If true, also capture Anc.
static bool IsValidDevice(const std::string &inDeviceSpec)
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
static void Sleep(const int32_t inMilliseconds)
Suspends execution of the current thread for a given number of milliseconds.
This class is used to configure an NTV2Capture instance.
static NTV2FrameBufferFormat GetPixelFormatFromString(const std::string &inStr)
Returns the NTV2FrameBufferFormat that matches the given string.
Instances of me capture frames in real time from a video signal provided to an input of an AJA device...
static bool gGlobalQuit((0))
@ NTV2_FBF_8BIT_YCBCR
See 8-Bit YCbCr Format.
virtual const std::string & errorStr(void) const
std::string NTV2Version(const bool inDetailed=false)
static void SignalHandler(int inSignal)
virtual void GetACStatus(ULWord &outGoodFrames, ULWord &outDroppedFrames, ULWord &outBufferLevel)
Provides status information about my input (capture) process.
static AJAStatus Open(bool incrementRefCount=false)
NTV2Channel fInputChannel
The device channel to use.
virtual AJAStatus Run(void)
Runs me.
bool fDoTSIRouting
If true, do TSI routing; otherwise squares.
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())
UWord fNumAudioLinks
Number of audio links to capture.
#define NTV2_IS_VALID_FRAME_BUFFER_FORMAT(__s__)
#define AJA_FAILURE(_status_)
bool fWithAudio
If true, also capture Audio.