|
AJA NTV2 SDK
17.1.3.1410
NTV2 SDK 17.1.3.1410
|
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;}
94 const string pixelFormatStr (pPixelFormat ? pPixelFormat :
"");
96 if (pixelFormatStr ==
"?" || pixelFormatStr ==
"list")
100 cerr <<
"## ERROR: Invalid '--pixelFormat' value '" << pixelFormatStr <<
"' -- expected values:" << endl
106 static const string legalFramesSpec(
"{frameCount}[@{firstFrameNum}] or {firstFrameNum}-{lastFrameNum}");
107 const string framesSpec (pFramesSpec ? pFramesSpec :
"");
108 if (!framesSpec.empty())
111 if (!parseResult.empty())
112 {cerr <<
"## ERROR: Bad 'frames' spec '" << framesSpec <<
"'\n## " << parseResult << endl;
return 1;}
115 {cerr <<
"## ERROR: Bad 'frames' spec '" << framesSpec <<
"'\n## Expected " << legalFramesSpec << endl;
return 1;}
120 ostringstream fileName; fileName <<
"ntv2dolbycapture-" << deviceSpec <<
"-"
128 ostringstream fileName; fileName <<
"ntv2dolbycapture-" << deviceSpec <<
"-"
136 ostringstream fileName; fileName <<
"ntv2dolbycapture-" << deviceSpec <<
"-"
149 status = capturer.
Init();
151 {cout <<
"## ERROR: Initialization failed: " <<
::AJAStatusToString(status) << endl;
return 1;}
162 cout <<
" Frames Frames Buffer" << endl
163 <<
" Captured Dropped Level" << endl;
166 ULWord framesProcessed, framesDropped, bufferLevel;
167 capturer.
GetACStatus (framesProcessed, framesDropped, bufferLevel);
168 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.
static NTV2InputSource GetInputSourceFromString(const std::string &inStr)
Returns the NTV2InputSource that matches the given string.
bool fDoAudioFilter
If true, capture only audio anc.
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.
@ NTV2_IOKINDS_HDMI
Specifies HDMI input/output kinds.
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 NTV2FrameBufferFormat GetPixelFormatFromString(const std::string &inStr)
Returns the NTV2FrameBufferFormat that matches the given 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 inDeviceSpecifier=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)
static std::string GetPixelFormatStrings(const NTV2PixelFormatKinds inKinds=PIXEL_FORMATS_ALL, const std::string inDeviceSpecifier=std::string())
std::string NTV2ChannelToString(const NTV2Channel inValue, const bool inForRetailDisplay=false)
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.