AJA NTV2 SDK  18.1.0.2262
NTV2 SDK 18.1.0.2262
main.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
10 // Includes
11 #include "ntv2ccplayer.h"
12 #include <signal.h>
13 #if defined(MSWindows) || defined(AJAWindows)
14  #define SIGQUIT SIGBREAK
15 #endif
16 
17 
18 using namespace std;
19 
20 
21 // Globals
22 static bool gGlobalQuit (false); // Set this "true" to exit gracefully
23 static bool gQuitImmediately(false); // Set this "true" to exit ungracefully
24 
25 
26 void SignalHandler (int inSignal)
27 {
28  gQuitImmediately = (inSignal != SIG_AJA_STOP);
29  gGlobalQuit = true;
30 }
31 
32 
33 static string GetLine21ChannelNames (const string inDelimiterStr = "|")
34 {
35  static NTV2StringList gChannelNames;
36  if (gChannelNames.empty())
37  for (unsigned enumVal(0); enumVal < NTV2_CC608_XDS; )
38  gChannelNames.push_back(::NTV2Line21ChannelToStr(NTV2Line21Channel(enumVal++)));
39  return aja::join(gChannelNames, inDelimiterStr);
40 }
41 
42 
43 int main (int argc, const char ** argv)
44 {
45  char * pDeviceSpec (AJA_NULL); // Device specifier string, if any
46  char * pPixelFormat (AJA_NULL); // Pixel format argument
47  char * pFramesSpec (AJA_NULL); // AutoCirculate frames spec
48  char * pVideoFormat (AJA_NULL); // Video format to use
49  char * pCaptionChan (AJA_NULL); // Caption channel of interest (cc1, cc2 ... text1, text2, ...)
50  char * pOutputDest (AJA_NULL); // Output connector of interest (sdi1 ... sdi8)
51  char * pMode (AJA_NULL); // Kind of 608 display (roll, paint, pop)?
52  char * pTestPattern (AJA_NULL); // Test pattern to use
53  char * pEndAction (AJA_NULL); // End action (quit, repeat, idle)?
54  char * pCaptionRate (AJA_NULL); // Caption rate (chars/min)
55  int channelNumber (1); // Channel/FrameStore to use
56  int doMultiFormat (0); // MultiFormat mode?
57  int showVersion (0); // Show version?
58  int noAudio (0); // Disable audio tone?
59  int noTimecode (0); // Disable timecode?
60  int forceRTP (0); // Force RTP?
61  int bEmitStats (0); // Emit stats while running?
62  int breakNewLines (0); // Newlines break rows instead of treated as whitespace?
63  int forceVanc (0); // Force use of Vanc?
64  int noLine21 (0); // Suppress line 21 waveform (SD only)?
65  int no608 (0); // Don't transmit CEA608 packets?
66  int no708 (0); // Don't transmit CEA708 packets (HD only)?
67  int doRGBOnWire (0); // Dual-link RGB output? (YUV is default)
68  int doSquares (0); // For UHD/4K, do squares? Otherwise, default to TSI.
69  const string L21ChanNames (::GetLine21ChannelNames());
71 
72  // Command line option descriptions:
73  const CNTV2DemoCommon::PoptOpts optionsTable [] =
74  {
75  {"version", 0, POPT_ARG_NONE, &showVersion, 0, "show version & exit", AJA_NULL },
76  {"device", 'd', POPT_ARG_STRING, &pDeviceSpec, 0, "device to use", "index#, serial#, or model" },
77  {"channel", 'c', POPT_ARG_INT, &channelNumber, 0, "channel to use", "1-8" },
78  {"multiFormat", 'm', POPT_ARG_NONE, &doMultiFormat, 0, "use multi-format/channel", AJA_NULL },
79  {"pixelFormat", 'p', POPT_ARG_STRING, &pPixelFormat, 0, "pixel format to use", "'?' or 'list' to list" },
80  {"frames", 0, POPT_ARG_STRING, &pFramesSpec, 0, "frames to AutoCirculate", "num[@min] or min-max" },
81  {"videoFormat", 'v', POPT_ARG_STRING, &pVideoFormat, 0, "video format to produce", "'?' or 'list' to list" },
82  {"noaudio", 0, POPT_ARG_NONE, &noAudio, 0, "disable audio tone", AJA_NULL },
83 
84  {"output", 'o', POPT_ARG_STRING, &pOutputDest, 0, "output connector to use", "'?' or 'list' to list" },
85  {"pattern", 0, POPT_ARG_STRING, &pTestPattern, 0, "test pattern to use", "'?' or 'list' to list" },
86  {"notimecode", 0, POPT_ARG_NONE, &noTimecode, 0, "disable timecode?", AJA_NULL },
87  {"rgb", 0, POPT_ARG_NONE, &doRGBOnWire, 0, "RGB on SDI?", AJA_NULL },
88  {"squares", 0, POPT_ARG_NONE, &doSquares, 0, "use square routing?", AJA_NULL },
89 
90  {"stats", 's', POPT_ARG_NONE, &bEmitStats, 0, "show queue stats?", AJA_NULL },
91  {"vanc", 0, POPT_ARG_NONE, &forceVanc, 0, "force use of vanc", AJA_NULL },
92  {"noline21", 'n', POPT_ARG_NONE, &noLine21, 0, "disable line 21 wvfrm?", AJA_NULL },
93  {"no608", 0, POPT_ARG_NONE, &no608, 0, "don't xmit 608 packets?", AJA_NULL },
94  {"no708", 0, POPT_ARG_NONE, &no708, 0, "don't xmit 708 packets?", AJA_NULL },
95 
96  // Per-caption-channel options -- specify more than one by separating with comma (e.g., --end loop,idle,idle,loop --608chan cc1,cc2,tx3,tx4)
97  {"end", 'e', POPT_ARG_STRING, &pEndAction, 0, "end action", "exit|loop|idle,..." },
98  {"rate", 'r', POPT_ARG_STRING, &pCaptionRate, 0, "caption rate", "chars/min,..." },
99  {"608mode", 0, POPT_ARG_STRING, &pMode, 0, "608 caption mode", "roll[N]|paint|pop,..." },
100  {"608chan", 0, POPT_ARG_STRING, &pCaptionChan, 0, "608 caption channel", L21ChanNames.c_str() },
101  {"newline", 0, POPT_ARG_NONE, &breakNewLines, 0, "newlines break rows?", AJA_NULL },
104  };
105  CNTV2DemoCommon::Popt popt(argc, argv, optionsTable);
106  NTV2StringList pathList (popt.otherArgs()); // List of text files (paths) to "play"
107  if (!popt)
108  {cerr << "## ERROR: " << popt.errorStr() << endl; return 2;}
109  if (showVersion)
110  {cout << argv[0] << ", NTV2 SDK " << ::NTV2Version() << endl; return 0;}
111 
112  // Device
113  const string deviceSpec (pDeviceSpec ? pDeviceSpec : "0");
114  CCPlayerConfig config(deviceSpec);
115 
116  // Channel
117  if ((channelNumber < 1) || (channelNumber > 8))
118  {cerr << "## ERROR: Invalid channel number " << channelNumber << " -- expected 1 thru 8" << endl; return 1;}
119  config.fOutputChannel = NTV2Channel(channelNumber - 1);
120 
121  // VideoFormat
122  const string videoFormatStr (pVideoFormat ? pVideoFormat : "");
123  config.fVideoFormat = videoFormatStr.empty() ? NTV2_FORMAT_1080i_5994
124  : CNTV2DemoCommon::GetVideoFormatFromString(videoFormatStr, VIDEO_FORMATS_ALL, deviceSpec);
125  if (videoFormatStr == "?" || videoFormatStr == "list")
126  {cout << CNTV2DemoCommon::GetVideoFormatStrings(VIDEO_FORMATS_ALL, pDeviceSpec ? deviceSpec : "") << endl; return 0;}
127  else if (!videoFormatStr.empty() && !NTV2_IS_VALID_VIDEO_FORMAT(config.fVideoFormat))
128  { cerr << "## ERROR: Invalid '--videoFormat' value '" << videoFormatStr << "' -- expected values:" << endl
130  return 2;
131  }
132  if (noLine21 && !NTV2_IS_SD_VIDEO_FORMAT(config.fVideoFormat))
133  cerr << "## WARNING: '--noline21' (-n) option specified with non-SD video format '" << ::NTV2VideoFormatToString(config.fVideoFormat) << "'" << endl;
134  if (no708 && NTV2_IS_SD_VIDEO_FORMAT(config.fVideoFormat))
135  cerr << "## WARNING: '--no708' (-n) option specified with SD video format '" << ::NTV2VideoFormatToString(config.fVideoFormat) << "'" << endl;
136  if (noLine21 && no608 && NTV2_IS_SD_VIDEO_FORMAT(config.fVideoFormat))
137  cerr << "## WARNING: '--noline21' and '--no608' options will result in no captions in SD" << endl;
138  if (no608 && no708 && !NTV2_IS_SD_VIDEO_FORMAT(config.fVideoFormat))
139  cerr << "## WARNING: '--no608' and '--no708' options will result in no captions in HD" << endl;
141  no708 = true;
142  else
143  noLine21 = true;
144 
145  // Pixel Format
146  const string pixelFormatStr (pPixelFormat ? pPixelFormat : "");
147  config.fPixelFormat = pixelFormatStr.empty() ? NTV2_FBF_8BIT_YCBCR : CNTV2DemoCommon::GetPixelFormatFromString(pixelFormatStr);
148  if (pixelFormatStr == "?" || pixelFormatStr == "list")
149  {cout << CNTV2DemoCommon::GetPixelFormatStrings(PIXEL_FORMATS_ALL, deviceSpec) << endl; return 0;}
150  else if (!pixelFormatStr.empty() && !NTV2_IS_VALID_FRAME_BUFFER_FORMAT(config.fPixelFormat))
151  {
152  cerr << "## ERROR: Invalid '--pixelFormat' value '" << pixelFormatStr << "' -- expected values:" << endl
154  return 2;
155  }
156 
157  // AutoCirculate Frames
158  static const string legalFramesSpec ("{frameCount}[@{firstFrameNum}] or {firstFrameNum}-{lastFrameNum}");
159  const string framesSpec (pFramesSpec ? pFramesSpec : "");
160  if (!framesSpec.empty())
161  {
162  const string parseResult(config.fFrames.setFromString(framesSpec));
163  if (!parseResult.empty())
164  {cerr << "## ERROR: Bad 'frames' spec '" << framesSpec << "'\n## " << parseResult << endl; return 1;}
165  }
166  if (!config.fFrames.valid())
167  {cerr << "## ERROR: Bad 'frames' spec '" << framesSpec << "'\n## Expected " << legalFramesSpec << endl; return 1;}
168 
169  // Output Spigot
171  pDeviceSpec ? deviceSpec : ""));
172  const string outputDestStr (pOutputDest ? CNTV2DemoCommon::ToLower(string(pOutputDest)) : "");
174  if (outputDestStr == "?" || outputDestStr == "list")
175  {cout << legalOutputs << endl; return 0;}
176  if (!outputDestStr.empty())
177  {
178  outputSpigot = CNTV2DemoCommon::GetOutputDestinationFromString (outputDestStr,
180  pDeviceSpec ? deviceSpec : "");
181  if (!NTV2_IS_VALID_OUTPUT_DEST(outputSpigot))
182  {cerr << "## ERROR: Output '" << outputDestStr << "' not of:" << endl << legalOutputs << endl; return 1;}
183  } // if output spigot specified
184 
185  if (!NTV2_IS_VALID_OUTPUT_DEST(outputSpigot) && !NTV2_IS_VALID_CHANNEL(config.fOutputChannel))
186  {
187  config.fOutputChannel = NTV2_CHANNEL1;
188  outputSpigot = ::NTV2ChannelToOutputDestination(config.fOutputChannel);
189  }
190  else if (!NTV2_IS_VALID_OUTPUT_DEST(outputSpigot) && NTV2_IS_VALID_CHANNEL(config.fOutputChannel))
191  outputSpigot = ::NTV2ChannelToOutputDestination(config.fOutputChannel);
192  else if (NTV2_IS_VALID_OUTPUT_DEST(outputSpigot) && !NTV2_IS_VALID_CHANNEL(config.fOutputChannel))
193  config.fOutputChannel = ::NTV2OutputDestinationToChannel(outputSpigot);
194 
195  // Test Pattern
196  string testPattern(pTestPattern ? pTestPattern : "");
197  if (testPattern == "?" || testPattern == "list")
198  {cout << CNTV2DemoCommon::GetTestPatternStrings() << endl; return 0;}
199  if (!testPattern.empty())
200  {
201  testPattern = CNTV2DemoCommon::GetTestPatternNameFromString(testPattern);
202  if (testPattern.empty())
203  {
204  cerr << "## ERROR: Invalid '--pattern' value '" << pTestPattern << "' -- expected values:" << endl
206  return 2;
207  }
208  }
209  else
210  testPattern = "Flat Field";
211 
212  // Play multiple caption channels using a comma-separated list of them (no spaces):
213  // --608chan cc2,cc4,tx1,tx2
214  // Mode, End-Action and Rate also use comma-separated lists (no spaces), and are applied per-caption-channel:
215  // --608mode pop,paint,roll --rate 1500,800,300,600 --end idle,loop,idle,loop
216  // Caption files are assigned sequentially to the caption channels, in caption-channel order.
217  // Example: ./bin/ntv2ccplayer --device kona4 --channel 3 --stats --608chan cc1,cc2,cc3,cc4,tx1,tx2,tx3,tx4
218  // --608mode pop,paint,roll3,roll4 --rate 1000,700,500,300,200
219  // --end idle,loop,idle,loop,idle,loop,idle,loop
220  // English.txt Spanish.txt French.txt German.txt txt1 txt2 txt3 txt4
221  const NTV2StringList sCaptionChannels(aja::split(CNTV2DemoCommon::ToLower(pCaptionChan ? pCaptionChan : "CC1"), ',')),
222  sCaptionModes (aja::split(CNTV2DemoCommon::ToLower(pMode ? pMode : "roll4"), ',')),
223  sEndActions (aja::split(CNTV2DemoCommon::ToLower(pEndAction ? pEndAction : "exit"), ',')),
224  sCaptionRates (aja::split(CNTV2DemoCommon::ToLower(pCaptionRate ? pCaptionRate : "500"), ','));
225  size_t ndx(0), fileNdx(0);
226 
227  for (NTV2StringListConstIter iter (sCaptionChannels.begin()); iter != sCaptionChannels.end(); ++iter, ++ndx)
228  {
229  CCGenConfig generatorConfig;
230 
231  // Caption Channel
232  generatorConfig.fCaptionChannel = ::StrToNTV2Line21Channel (*iter);
233  if (!IsValidLine21Channel (generatorConfig.fCaptionChannel) || IsLine21XDSChannel (generatorConfig.fCaptionChannel))
234  {cerr << "## ERROR: Bad '608chan' value '" << pCaptionChan << "' -- expected '" << ::GetLine21ChannelNames () << "'" << endl; return 1;}
235 
236  // Caption Mode
237  const string sCaptionMode (ndx < sCaptionModes.size() ? sCaptionModes.at(ndx) : sCaptionModes.back());
238  if (sCaptionMode == "") generatorConfig.fCaptionMode = NTV2_CC608_CapModeUnknown;
239  else if (sCaptionMode == "pop") generatorConfig.fCaptionMode = NTV2_CC608_CapModePopOn;
240  else if (sCaptionMode == "paint") generatorConfig.fCaptionMode = NTV2_CC608_CapModePaintOn;
241  else if (sCaptionMode == "roll2") generatorConfig.fCaptionMode = NTV2_CC608_CapModeRollUp2;
242  else if (sCaptionMode == "roll3") generatorConfig.fCaptionMode = NTV2_CC608_CapModeRollUp3;
243  else if (sCaptionMode == "roll" || sCaptionMode == "roll4") generatorConfig.fCaptionMode = NTV2_CC608_CapModeRollUp4;
244  else {cerr << "## ERROR: Bad '608mode' parameter '" << sCaptionMode << "'" << endl; return 1;}
245 
246  if (IsLine21TextChannel (generatorConfig.fCaptionChannel))
247  generatorConfig.fCaptionMode = NTV2_CC608_CapModeUnknown; // Must use unknown caption mode for TX caption channels
248 
249  // Newline
250  generatorConfig.fNewLinesAreNewRows = breakNewLines ? true : false;
251  if (IsLine21TextChannel (generatorConfig.fCaptionChannel))
252  generatorConfig.fNewLinesAreNewRows = true; // Tx1/Tx2/Tx3/Tx4 always break rows on newLine chars
253 
254  // End Action
255  const string sEndAction (ndx < sEndActions.size() ? sEndActions.at(ndx) : sEndActions.back());
256  if (sEndAction.empty () || sEndAction == "quit" || sEndAction == "exit" || sEndAction == "terminate" || sEndAction == "end")
257  generatorConfig.fEndAction = AtEndAction_Quit;
258  else if (sEndAction == "loop" || sEndAction == "repeat")
259  generatorConfig.fEndAction = AtEndAction_Repeat;
260  else if (sEndAction == "sleep" || sEndAction == "idle" || sEndAction == "rest")
261  generatorConfig.fEndAction = AtEndAction_Idle;
262  else
263  {cerr << "## ERROR: Bad 'end' parameter '" << sEndAction << "' -- expected 'loop|repeat | rest|sleep|idle | quit|end|exit|terminate'" << endl; return 1;}
264 
265  // Caption Rate
266  const string sCaptionRate (ndx < sCaptionRates.size() ? sCaptionRates.at(ndx) : sCaptionRates.back());
267  istringstream iss(sCaptionRate);
268  uint32_t charsPerMin;
269  iss >> charsPerMin;
270  generatorConfig.fCharsPerMinute = double(charsPerMin);
271 
272  if (!pathList.empty())
273  { // Text Files to Play
274  generatorConfig.fFilesToPlay.push_back (fileNdx < pathList.size() ? pathList.at(fileNdx) : pathList.back());
275  ++fileNdx;
276  if ((ndx+1) == sCaptionChannels.size())
277  while (fileNdx < pathList.size())
278  generatorConfig.fFilesToPlay.push_back (pathList.at (fileNdx++));
279  }
280  config.fCapChanGenConfigs [generatorConfig.fCaptionChannel] = generatorConfig; // Add this generator to the player configuration
281  } // for each specified caption channel
282 
283  config.fTestPatternName = testPattern;
284  config.fOutputDest = outputSpigot;
285  config.fForceRTP = uint16_t(forceRTP);
286  config.fVancMode = forceVanc ? NTV2_VANCMODE_TALLER : NTV2_VANCMODE_OFF;
287  config.fDoMultiFormat = doMultiFormat ? true : false;
288  config.fDoTsiRouting = doSquares ? false : true;
289  config.fDoRGBOnWire = doRGBOnWire ? true : false;
290  config.fSuppressLine21 = noLine21 ? true : false;
291  config.fSuppress608 = no608 ? true : false;
292  config.fSuppress708 = no708 ? true : false;
293  config.fSuppressAudio = noAudio ? true : false;
294  config.fSuppressTimecode = noTimecode ? true : false;
295  config.fEmitStats = bEmitStats ? true : false;
296 
297  // Instantiate and initialize the NTV2CCPlayer object...
298  NTV2CCPlayer player(config);
299  AJAStatus status = player.Init();
300  if (AJA_FAILURE(status))
301  return 1;
302 
303  ::signal (SIGINT, SignalHandler);
304  #if defined (AJAMac)
305  ::signal (SIGHUP, SignalHandler);
306  ::signal (SIGQUIT, SignalHandler);
307  #endif
308 
309  // Run it...
310  player.Run();
311 
312  size_t msgsQued (0), bytesQued (0), totMsgsEnq (0), totBytesEnq (0), totMsgsDeq (0), totBytesDeq (0), maxQueDepth (0), droppedFrames (0);
313  if (bEmitStats)
314  cout << " Current Current Total Total Total Total Max " << endl
315  << " Messages Bytes Messages Bytes Messages Bytes Queue Dropped" << endl
316  << " Queued Queued Enqueued Enqueued Dequeued Dequeued Depth Frames" << endl;
317 
318  // Loop until we're told to stop...
319  do
320  { // Poll the player's encoder's status until stopped...
321  player.GetStatus (msgsQued, bytesQued, totMsgsEnq, totBytesEnq, totMsgsDeq, totBytesDeq, maxQueDepth, droppedFrames);
322  if (bEmitStats)
323  cout << setw(9) << msgsQued
324  << setw(9) << bytesQued
325  << setw(9) << totMsgsEnq
326  << setw(9) << totBytesEnq
327  << setw(9) << totMsgsDeq
328  << setw(9) << totBytesDeq
329  << setw(9) << maxQueDepth
330  << setw(9) << droppedFrames << "\r" << flush;
331  } while (!gGlobalQuit); // loop til done
332 
333  // Ask the player to stop...
334  player.Quit (gQuitImmediately);
335 
336  player.GetStatus (msgsQued, bytesQued, totMsgsEnq, totBytesEnq, totMsgsDeq, totBytesDeq, maxQueDepth, droppedFrames);
337  cout << endl
338  << msgsQued << " message(s) left in queue" << endl
339  << bytesQued << " byte(s) left in queue" << endl
340  << totMsgsEnq << " total message(s) enqueued" << endl
341  << totBytesEnq << " total byte(s) enqueued" << endl
342  << totMsgsDeq << " total message(s) dequeued" << endl
343  << totBytesDeq << " total byte(s) dequeued" << endl
344  << maxQueDepth << " maximum message(s) enqueued" << endl;
345  return 0;
346 
347 } // main
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
#define NTV2_IS_SD_VIDEO_FORMAT(__f__)
Definition: ntv2enums.h:746
static std::string GetTestPatternNameFromString(const std::string &inStr)
static string GetLine21ChannelNames(const string inDelimiterStr="|")
Definition: main.cpp:33
bool fSuppress608
If true, don&#39;t transmit CEA608 packets; otherwise include 608 packets.
Definition: ntv2ccplayer.h:85
I am an object that can inject text captions into an SDI output of an AJA device in real time...
Definition: ntv2ccplayer.h:125
int main(int argc, const char **argv)
Definition: main.cpp:30
Specifies SDI input/output kinds.
Definition: ntv2enums.h:1294
bool fSuppressAudio
If true, suppress audio; otherwise generate & xfer audio tone.
AJAStatus
Definition: types.h:380
NTV2OutputDestination
Identifies a specific video output destination.
Definition: ntv2enums.h:1326
virtual void Quit(const bool inQuitImmediately=(0))
Stops me.
NTV2VANCMode fVancMode
VANC mode to use.
NTV2Line21Channel fCaptionChannel
The caption channel to use.
Definition: ntv2ccplayer.h:49
static AJAStatus Open(bool incrementRefCount=false)
Definition: debug.cpp:44
2-row roll-up from bottom
NTV2OutputDestination NTV2ChannelToOutputDestination(const NTV2Channel inChannel, const NTV2IOKinds inKinds=NTV2_IOKINDS_SDI)
Converts the given NTV2Channel value into its ordinary equivalent NTV2OutputDestination.
Definition: ntv2utils.cpp:5170
NTV2StringList::const_iterator NTV2StringListConstIter
#define AJA_FAILURE(_status_)
Definition: types.h:373
static NTV2VideoFormat GetVideoFormatFromString(const std::string &inStr, const NTV2VideoFormatKinds inKinds=VIDEO_FORMATS_SDHD, const std::string &inDevSpec=std::string())
Returns the NTV2VideoFormat that matches the given string.
Pop-on caption mode.
Configures an NTV2CCPlayer instance.
Definition: ntv2ccplayer.h:80
bool fNewLinesAreNewRows
If true, newlines break caption rows; otherwise are treated as whitespace.
Definition: ntv2ccplayer.h:50
static std::string GetPixelFormatStrings(const NTV2PixelFormatKinds inKinds=PIXEL_FORMATS_ALL, const std::string inDevSpec=std::string())
if(!(riid==IID_IUnknown) &&!(riid==IID_IClassFactory))
Definition: dllentry.cpp:196
#define IsLine21XDSChannel(_chan_)
#define NTV2_IS_VALID_OUTPUT_DEST(_dest_)
Definition: ntv2enums.h:1349
std::string setFromString(const std::string &inStr)
Definition: ntv2utils.cpp:4256
bool fSuppress708
If true, don&#39;t transmit CEA708 packets; otherwise include 708 packets.
Definition: ntv2ccplayer.h:86
This identifies the mode in which there are some + extra VANC lines in the frame buffer.
Definition: ntv2enums.h:3804
Definition: json.hpp:5362
static std::string GetTestPatternStrings(void)
#define POPT_ARG_INT
Definition: options_popt.h:58
void SignalHandler(int inSignal)
Definition: main.cpp:26
#define false
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They&#39;re also commonly use...
Definition: ntv2enums.h:1359
Unknown or invalid caption mode.
#define POPT_AUTOHELP
Definition: options_popt.h:227
bool fSuppressLine21
SD output only: if true, do not encode Line 21 waveform; otherwise encode Line 21 waveform...
Definition: ntv2ccplayer.h:84
NTV2Line21Mode fCaptionMode
The CEA-608 caption mode to use.
Definition: ntv2ccplayer.h:48
#define SIG_AJA_STOP
Definition: ntv2ccplayer.h:21
NTV2Channel NTV2OutputDestinationToChannel(const NTV2OutputDestination inOutputDest)
Converts a given NTV2OutputDestination to its equivalent NTV2Channel value.
Definition: ntv2utils.cpp:5158
Repeat the file list (must Ctrl-C to terminate)
Definition: ntv2ccplayer.h:31
#define true
std::string NTV2Version(const bool inDetailed=false)
Definition: ntv2version.cpp:41
NTV2StringList fFilesToPlay
A list of zero or more strings containing paths to text files to be "played".
Definition: ntv2ccplayer.h:46
static std::string GetVideoFormatStrings(const NTV2VideoFormatKinds inKinds=VIDEO_FORMATS_SDHD, const std::string inDevSpec=std::string())
Specifies analog input/output kinds.
Definition: ntv2enums.h:1296
#define AJA_NULL
Definition: ajatypes.h:180
virtual const NTV2StringList & otherArgs(void) const
virtual AJAStatus Run(void)
Runs me.
void split(const std::string &str, const char delim, std::vector< std::string > &elems)
Definition: common.cpp:350
NTV2PixelFormat fPixelFormat
The pixel format to use.
#define IsLine21TextChannel(_chan_)
virtual void GetStatus(size_t &outMessagesQueued, size_t &outBytesQueued, size_t &outTotMsgsEnq, size_t &outTotBytesEnq, size_t &outTotMsgsDeq, size_t &outTotBytesDeq, size_t &outMaxQueDepth, size_t &outDroppedFrames) const
Returns status information from my caption encoder.
static NTV2OutputDestination GetOutputDestinationFromString(const std::string &inStr, const NTV2IOKinds inKinds=NTV2_IOKINDS_ALL, const std::string inDevSpec=std::string())
Returns the NTV2OutputDestination that matches the given string.
static bool gQuitImmediately((0))
CaptionChanGenMap fCapChanGenConfigs
Caption channel generator configs.
Definition: ntv2ccplayer.h:90
static std::string ToLower(const std::string &inStr)
Returns the given string after converting it to lower case.
virtual const std::string & errorStr(void) const
NTV2VideoFormat fVideoFormat
The video format to use.
std::string NTV2VideoFormatToString(const NTV2VideoFormat inValue, const bool inUseFrameRate=false)
Definition: ntv2utils.cpp:6749
bool fDoRGBOnWire
If true, produce RGB on the wire; otherwise output YUV.
NTV2OutputDest fOutputDest
The desired output connector to use.
3-row roll-up from bottom
This class is used to configure a caption generator for a single caption channel. ...
Definition: ntv2ccplayer.h:43
#define NTV2_IS_VALID_CHANNEL(__x__)
Definition: ntv2enums.h:1373
bool fDoMultiFormat
If true, enable device-sharing; otherwise take exclusive control of device.
#define IsValidLine21Channel(_chan_)
bool fEmitStats
If true, show stats while playing; otherwise echo caption text being played.
Definition: ntv2ccplayer.h:83
bool fDoTsiRouting
If true, enable TSI routing; otherwise route for square division (4K/8K)
NTV2Channel fOutputChannel
The device channel to use.
NTV2Line21Channel StrToNTV2Line21Channel(const std::string &inStr)
Converts the given string into the equivalent NTV2Line21Channel value.
#define POPT_TABLEEND
Definition: options_popt.h:222
double fCharsPerMinute
The rate at which caption characters get enqueued, in characters per minute.
Definition: ntv2ccplayer.h:51
Specifies channel or FrameStore 1 (or the first item).
Definition: ntv2enums.h:1361
4-row roll-up from bottom
const std::string & NTV2Line21ChannelToStr(const NTV2Line21Channel inLine21Channel, const bool inCompact=true)
Converts the given NTV2Line21Channel value into a human-readable string.
static bool gGlobalQuit((0))
bool fSuppressTimecode
If true, suppress timecode; otherwise embed VITC/LTC.
Definition: ntv2ccplayer.h:87
std::string fTestPatternName
The test pattern to use.
Definition: ntv2ccplayer.h:89
NTV2ACFrameRange fFrames
AutoCirculate frame count or range.
#define NTV2_IS_VALID_VIDEO_FORMAT(__f__)
Definition: ntv2enums.h:727
std::string join(const std::vector< std::string > &parts, const std::string &delim)
Definition: common.cpp:468
AtEndAction fEndAction
The action to take after the file list has finished playing.
Definition: ntv2ccplayer.h:47
#define NTV2_IS_VALID_FRAME_BUFFER_FORMAT(__s__)
Definition: ntv2enums.h:265
std::vector< std::string > NTV2StringList
bool valid(void) const
Definition: ntv2utils.h:987
#define POPT_ARG_STRING
Definition: options_popt.h:57
NTV2Line21Channel
The CEA-608 caption channels: CC1 thru CC4, TX1 thru TX4, plus XDS.
uint16_t fForceRTP
BIT(0):0=normal,1=forceRTP BIT(1):0=uniPkt,1=multiPkt BIT(2):0=normal,1=patchDeviceID.
Definition: ntv2ccplayer.h:88
Paint-on caption mode.
#define POPT_ARG_NONE
Definition: options_popt.h:56
static std::string GetOutputDestinationStrings(const NTV2IOKinds inKinds, const std::string inDevSpec=std::string())
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 identifies the mode in which there are no VANC lines in the frame buffer.
Definition: ntv2enums.h:3802
See 8-Bit YCbCr Format.
Definition: ntv2enums.h:225