|
AJA NTV2 SDK
17.1.3.1410
NTV2 SDK 17.1.3.1410
|
Go to the documentation of this file.
30 int main (
int argc,
const char ** argv)
38 int doMultiFormat (0);
49 {
"device",
'd',
POPT_ARG_STRING, &pDeviceSpec, 0,
"device to use",
"index#, serial#, or model" },
51 {
"pixelFormat",
'p',
POPT_ARG_STRING, &pPixelFormat, 0,
"pixel format to use",
"'?' or 'list' to list" },
52 {
"input",
'i',
POPT_ARG_STRING, &pInputSrcSpec, 0,
"SDI input to use",
"1-8, ?=list" },
56 {
"iframes", 0,
POPT_ARG_STRING, &pInFramesSpec, 0,
"input AutoCirc frames",
"num[@min] or min-max" },
57 {
"oframes", 0,
POPT_ARG_STRING, &pOutFramesSpec,0,
"output AutoCirc frames",
"num[@min] or min-max" },
58 {
"tcsource",
't',
POPT_ARG_STRING, &pTcSource, 0,
"time code source",
"'?' to list" },
64 {cerr <<
"## ERROR: " << popt.
errorStr() << endl;
return 2;}
66 {cout << argv[0] <<
", NTV2 SDK " <<
::NTV2Version() << endl;
return 0;}
69 const string deviceSpec (pDeviceSpec ? pDeviceSpec :
"0");
78 if (inputSourceStr ==
"?" || inputSourceStr ==
"list")
79 {cout << legalSources << endl;
return 0;}
80 if (!inputSourceStr.empty())
84 {cerr <<
"## ERROR: Input source '" << inputSourceStr <<
"' not one of:" << endl << legalSources << endl;
return 1;}
88 const string pixelFormatStr (pPixelFormat ? pPixelFormat :
"");
90 if (pixelFormatStr ==
"?" || pixelFormatStr ==
"list")
94 cerr <<
"## ERROR: Invalid '--pixelFormat' value '" << pixelFormatStr <<
"' -- expected values:" << endl
102 if (tcSourceStr ==
"?" || tcSourceStr ==
"list")
103 {cout << legalTCSources << endl;
return 0;}
104 if (!tcSourceStr.empty())
108 {cerr <<
"## ERROR: Timecode source '" << tcSourceStr <<
"' not one of these:" << endl << legalTCSources << endl;
return 1;}
112 string framesSpec(pInFramesSpec ? pInFramesSpec :
"");
113 static const string legalFrmSpec(
"{frameCount}[@{firstFrameNum}] or {firstFrameNum}-{lastFrameNum}");
114 if (!framesSpec.empty())
116 if (!parseResult.empty())
117 {cerr <<
"## ERROR: Bad '--iframes' spec '" << framesSpec <<
"'" << endl <<
"## " << parseResult << endl;
return 1;}
120 {cerr <<
"## ERROR: Bad '--iframes' spec '" << framesSpec <<
"'" << endl <<
"## Expected " << legalFrmSpec << endl;
return 1;}
123 framesSpec = pOutFramesSpec ? pOutFramesSpec :
"";
124 if (!framesSpec.empty())
126 if (!parseResult.empty())
127 {cerr <<
"## ERROR: Bad '--oframes' spec '" << framesSpec <<
"'" << endl <<
"## " << parseResult << endl;
return 1;}
130 {cerr <<
"## ERROR: Bad '--oframes' spec '" << framesSpec <<
"'" << endl <<
"## Expected " << legalFrmSpec << endl;
return 1;}
132 if (noVideo && noAudio)
133 {cerr <<
"## ERROR: '--novideo' and '--noaudio' cannot both be specified" << endl;
return 1;}
145 {cerr <<
"## ERROR: Initialization failed, status=" << status << endl;
return 4;}
157 cout <<
" Capture Playout Capture Playout" << endl
158 <<
" Frames Frames Frames Buffer Buffer" << endl
159 <<
"Processed Dropped Dropped Level Level" << endl;
163 burner.
GetStatus (inputStatus, outputStatus);
static NTV2InputSource GetInputSourceFromString(const std::string &inStr)
Returns the NTV2InputSource that matches the given string.
static bool gGlobalQuit((0))
Set this "true" to exit gracefully.
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
ULWord GetProcessedFrameCount(void) const
#define NTV2_IS_VALID_TIMECODE_INDEX(__x__)
bool fDoMultiFormat
If true, enables device-sharing; otherwise takes exclusive control of the device.
bool fSuppressAudio
If true, suppress audio; otherwise include audio.
NTV2TCIndex fTimecodeSource
Timecode source to use.
ULWord GetBufferLevel(void) const
int main(int argc, const char **argv)
bool fSuppressVideo
If true, suppress video; otherwise include video.
std::string setFromString(const std::string &inStr)
static NTV2TCIndex GetTCIndexFromString(const std::string &inStr)
Returns the NTV2TCIndex that matches the given string.
NTV2PixelFormat fPixelFormat
The pixel format to use.
virtual void GetStatus(AUTOCIRCULATE_STATUS &outInputStatus, AUTOCIRCULATE_STATUS &outOutputStatus)
Provides status information about my input (capture) and output (playout) processes.
NTV2ACFrameRange fOutputFrames
Playout frame count or range.
static bool IsValidDevice(const std::string &inDeviceSpec)
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.
This is returned from the CNTV2Card::AutoCirculateGetStatus function.
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 std::string GetTCIndexStrings(const NTV2TCIndexKinds inKinds=TC_INDEXES_ALL, const std::string inDeviceSpecifier=std::string(), const bool inIsInputOnly=(!(0)))
bool fWithAnc
If true, capture & play anc data (LLBurn). Defaults to false.
static AJAStatus Open(bool incrementRefCount=false)
static void SignalHandler(int inSignal)
NTV2InputSource fInputSource
The device input connector to use.
I capture frames from a video signal provided to an AJA device's video input. I burn timecode into th...
Header file for the NTV2Burn demonstration class.
static std::string GetInputSourceStrings(const NTV2IOKinds inKinds=NTV2_IOKINDS_ALL, const std::string inDeviceSpecifier=std::string())
ULWord GetDroppedFrameCount(void) const
@ NTV2_IOKINDS_ALL
Specifies any/all input/output kinds.
static std::string GetPixelFormatStrings(const NTV2PixelFormatKinds inKinds=PIXEL_FORMATS_ALL, const std::string inDeviceSpecifier=std::string())
virtual AJAStatus Run(void)
Runs me.
#define NTV2_IS_VALID_FRAME_BUFFER_FORMAT(__s__)
#define AJA_FAILURE(_status_)
NTV2ACFrameRange fInputFrames
Ingest frame count or range.
Configures an NTV2Burn or NTV2FieldBurn instance.