|
AJA NTV2 SDK
17.5.0.1492
NTV2 SDK 17.5.0.1492
|
Go to the documentation of this file.
28 int main (
int argc,
const char ** argv)
35 uint32_t channelNumber (1);
36 int doMultiFormat (0);
38 int doRecordAudio (0);
39 int doRecordDolby (0);
40 int doAudioFilter (0);
49 {
"device",
'd',
POPT_ARG_STRING, &pDeviceSpec, 0,
"device to use",
"index#, serial#, or model" },
50 {
"channel",
'c',
POPT_ARG_INT, &channelNumber, 0,
"channel to use",
"1-8" },
52 {
"pixelFormat",
'p',
POPT_ARG_STRING, &pPixelFormat, 0,
"pixel format to use",
"'?' or 'list' to list" },
53 {
"frames", 0,
POPT_ARG_STRING, &pFramesSpec, 0,
"frames to AutoCirculate",
"num[@min] or min-max" },
54 {
"input",
'i',
POPT_ARG_STRING, &pInputSrcSpec, 0,
"which HDMI input",
"?=list" },
66 {cerr <<
"## ERROR: " << popt.
errorStr() << endl;
return 2;}
68 {cout << argv[0] <<
", NTV2 SDK " <<
::NTV2Version() << endl;
return 0;}
71 const string deviceSpec (pDeviceSpec ? pDeviceSpec :
"0");
78 if ((channelNumber < 1) || (channelNumber > 8))
79 {cerr <<
"## ERROR: Invalid channel number " << channelNumber <<
" -- expected 1 thru 8" << endl;
return 1;}
85 if (inputSourceStr ==
"?" || inputSourceStr ==
"list")
86 {cout << legalSources << endl;
return 0;}
87 if (!inputSourceStr.empty())
91 {cerr <<
"## ERROR: Input source '" << inputSourceStr <<
"' not one of:" << endl << legalSources << endl;
return 1;}
95 const string pixelFormatStr (pPixelFormat ? pPixelFormat :
"");
97 if (pixelFormatStr ==
"?" || pixelFormatStr ==
"list")
101 cerr <<
"## ERROR: Invalid '--pixelFormat' value '" << pixelFormatStr <<
"' -- expected values:" << endl
107 static const string legalFramesSpec(
"{frameCount}[@{firstFrameNum}] or {firstFrameNum}-{lastFrameNum}");
108 const string framesSpec (pFramesSpec ? pFramesSpec :
"");
109 if (!framesSpec.empty())
112 if (!parseResult.empty())
113 {cerr <<
"## ERROR: Bad 'frames' spec '" << framesSpec <<
"'\n## " << parseResult << endl;
return 1;}
116 {cerr <<
"## ERROR: Bad 'frames' spec '" << framesSpec <<
"'\n## Expected " << legalFramesSpec << endl;
return 1;}
121 ostringstream fileName; fileName <<
"ntv2dolbycapture-" << deviceSpec <<
"-"
129 ostringstream fileName; fileName <<
"ntv2dolbycapture-" << deviceSpec <<
"-"
137 ostringstream fileName; fileName <<
"ntv2dolbycapture-" << deviceSpec <<
"-"
150 status = capturer.
Init();
152 {cout <<
"## ERROR: Initialization failed: " <<
::AJAStatusToString(status) << endl;
return 1;}
163 cout <<
" Frames Frames Buffer" << endl
164 <<
" Captured Dropped Level" << endl;
167 ULWord framesProcessed, framesDropped, bufferLevel;
168 capturer.
GetACStatus (framesProcessed, framesDropped, bufferLevel);
169 cout << setw(9) << framesProcessed << setw(9) << framesDropped << setw(9) << bufferLevel <<
"\r" << flush;
bool fDoMultiFormat
If true, use multi-format/multi-channel mode, if device supports it; otherwise normal mode.
std::string fDolbyDataFilePath
Optional path to Dolby binary data file.
Declares the NTV2DolbyCapture class.
bool fDoAudioFilter
If true, capture only audio anc.
@ NTV2_IOKINDS_HDMI
Specifies HDMI input/output kinds.
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.
This class is used to configure an NTV2Capture instance.
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
virtual void GetACStatus(ULWord &outGoodFrames, ULWord &outDroppedFrames, ULWord &outBufferLevel)
Provides status information about my input (capture) process.
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
void SignalHandler(int inSignal)
NTV2PixelFormat fPixelFormat
Pixel format to use.
std::string fAncDataFilePath
Optional path to Anc binary data file.
int main(int argc, const char **argv)
std::string setFromString(const std::string &inStr)
bool fWithAnc
If true, also capture Anc.
std::string fAudioDataFilePath
Optional path to Audio binary data file.
static bool IsValidDevice(const std::string &inDeviceSpec)
Declares the AJAProcess class.
static void Sleep(const int32_t inMilliseconds)
Suspends execution of the current thread for a given number of milliseconds.
static std::string ToLower(const std::string &inStr)
Returns the given string after converting it to lower case.
static std::string GetPixelFormatStrings(const NTV2PixelFormatKinds inKinds=PIXEL_FORMATS_ALL, const std::string inDevSpec=std::string())
#define NTV2_IS_VALID_INPUT_SOURCE(_inpSrc_)
@ NTV2_FBF_8BIT_YCBCR
See 8-Bit YCbCr Format.
virtual const std::string & errorStr(void) const
std::string NTV2Version(const bool inDetailed=false)
static AJAStatus Open(bool incrementRefCount=false)
NTV2ACFrameRange fFrames
AutoCirculate frame count or range.
NTV2Channel fInputChannel
The device channel to use.
static std::string GetInputSourceStrings(const NTV2IOKinds inKinds=NTV2_IOKINDS_ALL, const std::string inDevSpec=std::string())
static bool gGlobalQuit((0))
bool fDoFrameStats
if true, output per frame statistics
virtual AJAStatus Run(void)
Runs me.
std::string AJAStatusToString(const AJAStatus inStatus, const bool inDetailed)
std::string NTV2ChannelToString(const NTV2Channel inValue, const bool inForRetailDisplay=false)
static NTV2InputSource GetInputSourceFromString(const std::string &inStr, const NTV2IOKinds inKinds=NTV2_IOKINDS_ALL, const std::string inDevSpec=std::string())
Returns the NTV2InputSource that matches the given string.
I capture HDMI Dolby audio from an HDMI input of an AJA device.
#define NTV2_IS_VALID_FRAME_BUFFER_FORMAT(__s__)
#define AJA_FAILURE(_status_)
NTV2InputSource fInputSource
The device input connector to use.
bool fWithAudio
If true, also capture Audio.