AJA NTV2 SDK  17.5.0.1242
NTV2 SDK 17.5.0.1242
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  if (!CNTV2DemoCommon::IsValidDevice(deviceSpec))
115  return 1;
116 
117  CCPlayerConfig config(deviceSpec);
118 
119  // Channel
120  if ((channelNumber < 1) || (channelNumber > 8))
121  {cerr << "## ERROR: Invalid channel number " << channelNumber << " -- expected 1 thru 8" << endl; return 1;}
122  config.fOutputChannel = NTV2Channel(channelNumber - 1);
123 
124  // VideoFormat
125  const string videoFormatStr (pVideoFormat ? pVideoFormat : "");
126  config.fVideoFormat = videoFormatStr.empty() ? NTV2_FORMAT_1080i_5994
127  : CNTV2DemoCommon::GetVideoFormatFromString(videoFormatStr, VIDEO_FORMATS_ALL, deviceSpec);
128  if (videoFormatStr == "?" || videoFormatStr == "list")
129  {cout << CNTV2DemoCommon::GetVideoFormatStrings(VIDEO_FORMATS_ALL, pDeviceSpec ? deviceSpec : "") << endl; return 0;}
130  else if (!videoFormatStr.empty() && !NTV2_IS_VALID_VIDEO_FORMAT(config.fVideoFormat))
131  { cerr << "## ERROR: Invalid '--videoFormat' value '" << videoFormatStr << "' -- expected values:" << endl
133  return 2;
134  }
135  if (noLine21 && !NTV2_IS_SD_VIDEO_FORMAT(config.fVideoFormat))
136  cerr << "## WARNING: '--noline21' (-n) option specified with non-SD video format '" << ::NTV2VideoFormatToString(config.fVideoFormat) << "'" << endl;
137  if (no708 && NTV2_IS_SD_VIDEO_FORMAT(config.fVideoFormat))
138  cerr << "## WARNING: '--no708' (-n) option specified with SD video format '" << ::NTV2VideoFormatToString(config.fVideoFormat) << "'" << endl;
139  if (noLine21 && no608 && NTV2_IS_SD_VIDEO_FORMAT(config.fVideoFormat))
140  cerr << "## WARNING: '--noline21' and '--no608' options will result in no captions in SD" << endl;
141  if (no608 && no708 && !NTV2_IS_SD_VIDEO_FORMAT(config.fVideoFormat))
142  cerr << "## WARNING: '--no608' and '--no708' options will result in no captions in HD" << endl;
144  no708 = true;
145  else
146  noLine21 = true;
147 
148  // Pixel Format
149  const string pixelFormatStr (pPixelFormat ? pPixelFormat : "");
150  config.fPixelFormat = pixelFormatStr.empty() ? NTV2_FBF_8BIT_YCBCR : CNTV2DemoCommon::GetPixelFormatFromString(pixelFormatStr);
151  if (pixelFormatStr == "?" || pixelFormatStr == "list")
152  {cout << CNTV2DemoCommon::GetPixelFormatStrings(PIXEL_FORMATS_ALL, deviceSpec) << endl; return 0;}
153  else if (!pixelFormatStr.empty() && !NTV2_IS_VALID_FRAME_BUFFER_FORMAT(config.fPixelFormat))
154  {
155  cerr << "## ERROR: Invalid '--pixelFormat' value '" << pixelFormatStr << "' -- expected values:" << endl
157  return 2;
158  }
159 
160  // AutoCirculate Frames
161  static const string legalFramesSpec ("{frameCount}[@{firstFrameNum}] or {firstFrameNum}-{lastFrameNum}");
162  const string framesSpec (pFramesSpec ? pFramesSpec : "");
163  if (!framesSpec.empty())
164  {
165  const string parseResult(config.fFrames.setFromString(framesSpec));
166  if (!parseResult.empty())
167  {cerr << "## ERROR: Bad 'frames' spec '" << framesSpec << "'\n## " << parseResult << endl; return 1;}
168  }
169  if (!config.fFrames.valid())
170  {cerr << "## ERROR: Bad 'frames' spec '" << framesSpec << "'\n## Expected " << legalFramesSpec << endl; return 1;}
171 
172  // Output Spigot
174  pDeviceSpec ? deviceSpec : ""));
175  const string outputDestStr (pOutputDest ? CNTV2DemoCommon::ToLower(string(pOutputDest)) : "");
177  if (outputDestStr == "?" || outputDestStr == "list")
178  {cout << legalOutputs << endl; return 0;}
179  if (!outputDestStr.empty())
180  {
181  outputSpigot = CNTV2DemoCommon::GetOutputDestinationFromString (outputDestStr,
183  pDeviceSpec ? deviceSpec : "");
184  if (!NTV2_IS_VALID_OUTPUT_DEST(outputSpigot))
185  {cerr << "## ERROR: Output '" << outputDestStr << "' not of:" << endl << legalOutputs << endl; return 1;}
186  } // if output spigot specified
187 
188  if (!NTV2_IS_VALID_OUTPUT_DEST(outputSpigot) && !NTV2_IS_VALID_CHANNEL(config.fOutputChannel))
189  {
190  config.fOutputChannel = NTV2_CHANNEL1;
191  outputSpigot = ::NTV2ChannelToOutputDestination(config.fOutputChannel);
192  }
193  else if (!NTV2_IS_VALID_OUTPUT_DEST(outputSpigot) && NTV2_IS_VALID_CHANNEL(config.fOutputChannel))
194  outputSpigot = ::NTV2ChannelToOutputDestination(config.fOutputChannel);
195  else if (NTV2_IS_VALID_OUTPUT_DEST(outputSpigot) && !NTV2_IS_VALID_CHANNEL(config.fOutputChannel))
196  config.fOutputChannel = ::NTV2OutputDestinationToChannel(outputSpigot);
197 
198  // Test Pattern
199  string testPattern(pTestPattern ? pTestPattern : "");
200  if (testPattern == "?" || testPattern == "list")
201  {cout << CNTV2DemoCommon::GetTestPatternStrings() << endl; return 0;}
202  if (!testPattern.empty())
203  {
204  testPattern = CNTV2DemoCommon::GetTestPatternNameFromString(testPattern);
205  if (testPattern.empty())
206  {
207  cerr << "## ERROR: Invalid '--pattern' value '" << pTestPattern << "' -- expected values:" << endl
209  return 2;
210  }
211  }
212  else
213  testPattern = "Flat Field";
214 
215  // NOTE: From one command line invocation, you can inject different captions into separate caption channels.
216  // For example:
217  // ./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 
222  // Users can play one or more caption channels by specifying more than one, separating each with a comma:
223  // --608chan cc2,cc4,tx1,tx2
224  // You can vary the mode, end-action and rate for each caption channel in the same way:
225  // --608mode pop,paint,roll --rate 1500,800,300,600
226  const NTV2StringList sCaptionChannels(aja::split(CNTV2DemoCommon::ToLower(pCaptionChan ? pCaptionChan : "CC1"), ','));
227  const NTV2StringList sCaptionModes (aja::split(CNTV2DemoCommon::ToLower(pMode ? pMode : "roll4"), ','));
228  const NTV2StringList sEndActions (aja::split(CNTV2DemoCommon::ToLower(pEndAction ? pEndAction : "exit"), ','));
229  const NTV2StringList sCaptionRates (aja::split(CNTV2DemoCommon::ToLower(pCaptionRate ? pCaptionRate : "500"), ','));
230  size_t ndx (0);
231  size_t fileNdx (0);
232 
233  for (NTV2StringListConstIter iter (sCaptionChannels.begin()); iter != sCaptionChannels.end(); ++iter, ++ndx)
234  {
235  CCGenConfig generatorConfig;
236 
237  // Caption Channel
238  generatorConfig.fCaptionChannel = ::StrToNTV2Line21Channel (*iter);
239  if (!IsValidLine21Channel (generatorConfig.fCaptionChannel) || IsLine21XDSChannel (generatorConfig.fCaptionChannel))
240  {cerr << "## ERROR: Bad '608chan' value '" << pCaptionChan << "' -- expected '" << ::GetLine21ChannelNames () << "'" << endl; return 1;}
241 
242  // Caption Mode
243  const string sCaptionMode (ndx < sCaptionModes.size() ? sCaptionModes.at(ndx) : sCaptionModes.back());
244  if (sCaptionMode == "") generatorConfig.fCaptionMode = NTV2_CC608_CapModeUnknown;
245  else if (sCaptionMode == "pop") generatorConfig.fCaptionMode = NTV2_CC608_CapModePopOn;
246  else if (sCaptionMode == "paint") generatorConfig.fCaptionMode = NTV2_CC608_CapModePaintOn;
247  else if (sCaptionMode == "roll2") generatorConfig.fCaptionMode = NTV2_CC608_CapModeRollUp2;
248  else if (sCaptionMode == "roll3") generatorConfig.fCaptionMode = NTV2_CC608_CapModeRollUp3;
249  else if (sCaptionMode == "roll" || sCaptionMode == "roll4") generatorConfig.fCaptionMode = NTV2_CC608_CapModeRollUp4;
250  else {cerr << "## ERROR: Bad '608mode' parameter '" << sCaptionMode << "'" << endl; return 1;}
251 
252  if (IsLine21TextChannel (generatorConfig.fCaptionChannel))
253  generatorConfig.fCaptionMode = NTV2_CC608_CapModeUnknown; // Must use unknown caption mode for TX caption channels
254 
255  // Newline
256  generatorConfig.fNewLinesAreNewRows = breakNewLines ? true : false;
257  if (IsLine21TextChannel (generatorConfig.fCaptionChannel))
258  generatorConfig.fNewLinesAreNewRows = true; // Tx1/Tx2/Tx3/Tx4 always break rows on newLine chars
259 
260  // End Action
261  const string sEndAction (ndx < sEndActions.size() ? sEndActions.at(ndx) : sEndActions.back());
262  if (sEndAction.empty () || sEndAction == "quit" || sEndAction == "exit" || sEndAction == "terminate" || sEndAction == "end")
263  generatorConfig.fEndAction = AtEndAction_Quit;
264  else if (sEndAction == "loop" || sEndAction == "repeat")
265  generatorConfig.fEndAction = AtEndAction_Repeat;
266  else if (sEndAction == "sleep" || sEndAction == "idle" || sEndAction == "rest")
267  generatorConfig.fEndAction = AtEndAction_Idle;
268  else
269  {cerr << "## ERROR: Bad 'end' parameter '" << sEndAction << "' -- expected 'loop|repeat | rest|sleep|idle | quit|end|exit|terminate'" << endl; return 1;}
270 
271  // Caption Rate
272  const string sCaptionRate (ndx < sCaptionRates.size() ? sCaptionRates.at(ndx) : sCaptionRates.back());
273  istringstream iss(sCaptionRate);
274  uint32_t charsPerMin;
275  iss >> charsPerMin;
276  generatorConfig.fCharsPerMinute = double(charsPerMin);
277 
278  if (!pathList.empty())
279  { // Text Files to Play
280  generatorConfig.fFilesToPlay.push_back (fileNdx < pathList.size() ? pathList.at(fileNdx) : pathList.back());
281  ++fileNdx;
282  if ((ndx+1) == sCaptionChannels.size())
283  while (fileNdx < pathList.size())
284  generatorConfig.fFilesToPlay.push_back (pathList.at (fileNdx++));
285  }
286  config.fCapChanGenConfigs [generatorConfig.fCaptionChannel] = generatorConfig; // Add this generator to the player configuration
287  } // for each specified caption channel
288 
289  config.fTestPatternName = testPattern;
290  config.fOutputDest = outputSpigot;
291  config.fForceRTP = uint16_t(forceRTP);
292  config.fVancMode = forceVanc ? NTV2_VANCMODE_TALLER : NTV2_VANCMODE_OFF;
293  config.fDoMultiFormat = doMultiFormat ? true : false; // Multiformat mode?
294  config.fDoTsiRouting = doSquares ? false : true;
295  config.fDoRGBOnWire = doRGBOnWire ? true : false;
296  config.fSuppressLine21 = noLine21 ? true : false;
297  config.fSuppress608 = no608 ? true : false;
298  config.fSuppress708 = no708 ? true : false;
299  config.fSuppressAudio = noAudio ? true : false;
300  config.fSuppressTimecode = noTimecode ? true : false;
301  config.fEmitStats = bEmitStats ? true : false;
302 
303  // Instantiate and initialize the NTV2CCPlayer object...
304  NTV2CCPlayer player(config);
305  AJAStatus status = player.Init();
306  if (AJA_FAILURE(status))
307  {cout << "## ERROR: Initialization failed: " << ::AJAStatusToString(status) << endl; return 1;}
308 
309  ::signal (SIGINT, SignalHandler);
310  #if defined (AJAMac)
311  ::signal (SIGHUP, SignalHandler);
312  ::signal (SIGQUIT, SignalHandler);
313  #endif
314 
315  // Run it...
316  player.Run();
317 
318  size_t msgsQued (0), bytesQued (0), totMsgsEnq (0), totBytesEnq (0), totMsgsDeq (0), totBytesDeq (0), maxQueDepth (0), droppedFrames (0);
319  if (bEmitStats)
320  cout << " Current Current Total Total Total Total Max " << endl
321  << " Messages Bytes Messages Bytes Messages Bytes Queue Dropped" << endl
322  << " Queued Queued Enqueued Enqueued Dequeued Dequeued Depth Frames" << endl;
323 
324  // Loop until we're told to stop...
325  do
326  { // Poll the player's encoder's status until stopped...
327  player.GetStatus (msgsQued, bytesQued, totMsgsEnq, totBytesEnq, totMsgsDeq, totBytesDeq, maxQueDepth, droppedFrames);
328  if (bEmitStats)
329  cout << setw(9) << msgsQued
330  << setw(9) << bytesQued
331  << setw(9) << totMsgsEnq
332  << setw(9) << totBytesEnq
333  << setw(9) << totMsgsDeq
334  << setw(9) << totBytesDeq
335  << setw(9) << maxQueDepth
336  << setw(9) << droppedFrames << "\r" << flush;
337  } while (!gGlobalQuit); // loop til done
338 
339  // Ask the player to stop...
340  player.Quit (gQuitImmediately);
341 
342  player.GetStatus (msgsQued, bytesQued, totMsgsEnq, totBytesEnq, totMsgsDeq, totBytesDeq, maxQueDepth, droppedFrames);
343  cout << endl
344  << msgsQued << " message(s) left in queue" << endl
345  << bytesQued << " byte(s) left in queue" << endl
346  << totMsgsEnq << " total message(s) enqueued" << endl
347  << totBytesEnq << " total byte(s) enqueued" << endl
348  << totMsgsDeq << " total message(s) dequeued" << endl
349  << totBytesDeq << " total byte(s) dequeued" << endl
350  << maxQueDepth << " maximum message(s) enqueued" << endl;
351  return 0;
352 
353 } // main
NTV2CCPlayer
I am an object that can inject text captions into an SDI output of an AJA device in real time....
Definition: ntv2ccplayer.h:125
CNTV2DemoCommon::Popt::otherArgs
virtual const NTV2StringList & otherArgs(void) const
Definition: ntv2democommon.h:857
CNTV2DemoCommon::GetVideoFormatFromString
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.
Definition: ntv2democommon.cpp:553
NTV2_IS_SD_VIDEO_FORMAT
#define NTV2_IS_SD_VIDEO_FORMAT(__f__)
Definition: ntv2enums.h:730
NTV2OutputDestination
NTV2OutputDestination
Identifies a specific video output destination.
Definition: ntv2enums.h:1301
poptOption
Definition: options_popt.h:148
CNTV2DemoCommon::GetPixelFormatFromString
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.
Definition: ntv2democommon.cpp:637
gQuitImmediately
static bool gQuitImmediately((0))
NTV2Channel
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
Definition: ntv2enums.h:1334
CCGenConfig::fNewLinesAreNewRows
bool fNewLinesAreNewRows
If true, newlines break caption rows; otherwise are treated as whitespace.
Definition: ntv2ccplayer.h:50
CCPlayerConfig::fForceRTP
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
aja::join
std::string join(const std::vector< std::string > &parts, const std::string &delim)
Definition: common.cpp:468
aja::split
void split(const std::string &str, const char delim, std::vector< std::string > &elems)
Definition: common.cpp:350
AtEndAction_Idle
@ AtEndAction_Idle
Repeat the file list (must Ctrl-C to terminate)
Definition: ntv2ccplayer.h:31
CCPlayerConfig
Configures an NTV2CCPlayer instance.
Definition: ntv2ccplayer.h:80
CCGenConfig::fCaptionMode
NTV2Line21Mode fCaptionMode
The CEA-608 caption mode to use.
Definition: ntv2ccplayer.h:48
VIDEO_FORMATS_ALL
@ VIDEO_FORMATS_ALL
Definition: ntv2democommon.h:229
NTV2_CC608_CapModePaintOn
@ NTV2_CC608_CapModePaintOn
Paint-on caption mode.
Definition: ntv2caption608types.h:131
SignalHandler
void SignalHandler(int inSignal)
Definition: main.cpp:26
GetLine21ChannelNames
static string GetLine21ChannelNames(const string inDelimiterStr="|")
Definition: main.cpp:33
NTV2_FORMAT_1080i_5994
@ NTV2_FORMAT_1080i_5994
Definition: ntv2enums.h:535
CCPlayerConfig::fSuppressTimecode
bool fSuppressTimecode
If true, suppress timecode; otherwise embed VITC/LTC.
Definition: ntv2ccplayer.h:87
NTV2OutputDestinationToChannel
NTV2Channel NTV2OutputDestinationToChannel(const NTV2OutputDestination inOutputDest)
Converts a given NTV2OutputDestination to its equivalent NTV2Channel value.
Definition: ntv2utils.cpp:5215
CCGenConfig::fFilesToPlay
NTV2StringList fFilesToPlay
A list of zero or more strings containing paths to text files to be "played".
Definition: ntv2ccplayer.h:46
main
int main(int argc, const char **argv)
Definition: main.cpp:30
CCPlayerConfig::fCapChanGenConfigs
CaptionChanGenMap fCapChanGenConfigs
Caption channel generator configs.
Definition: ntv2ccplayer.h:90
CCGenConfig::fCaptionChannel
NTV2Line21Channel fCaptionChannel
The caption channel to use.
Definition: ntv2ccplayer.h:49
PlayerConfig::fDoMultiFormat
bool fDoMultiFormat
If true, enable device-sharing; otherwise take exclusive control of device.
Definition: ntv2democommon.h:332
NTV2_IS_VALID_OUTPUT_DEST
#define NTV2_IS_VALID_OUTPUT_DEST(_dest_)
Definition: ntv2enums.h:1324
NTV2ACFrameRange::setFromString
std::string setFromString(const std::string &inStr)
Definition: ntv2utils.cpp:4155
PlayerConfig::fVancMode
NTV2VANCMode fVancMode
VANC mode to use.
Definition: ntv2democommon.h:329
NTV2_CHANNEL1
@ NTV2_CHANNEL1
Specifies channel or Frame Store 1 (or the first item).
Definition: ntv2enums.h:1336
NTV2ChannelToOutputDestination
NTV2OutputDestination NTV2ChannelToOutputDestination(const NTV2Channel inChannel, const NTV2IOKinds inKinds=NTV2_IOKINDS_SDI)
Converts the given NTV2Channel value into its ordinary equivalent NTV2OutputDestination.
Definition: ntv2utils.cpp:5227
POPT_ARG_INT
#define POPT_ARG_INT
Definition: options_popt.h:58
NTV2_IOKINDS_ANALOG
@ NTV2_IOKINDS_ANALOG
Specifies analog input/output kinds.
Definition: ntv2enums.h:1276
CNTV2DemoCommon::GetOutputDestinationStrings
static std::string GetOutputDestinationStrings(const NTV2IOKinds inKinds, const std::string inDevSpec=std::string())
Definition: ntv2democommon.cpp:769
PlayerConfig::fDoTsiRouting
bool fDoTsiRouting
If true, enable TSI routing; otherwise route for square division (4K/8K)
Definition: ntv2democommon.h:338
IsLine21XDSChannel
#define IsLine21XDSChannel(_chan_)
Definition: ntv2caption608types.h:105
POPT_AUTOHELP
#define POPT_AUTOHELP
Definition: options_popt.h:220
NTV2CCPlayer::Init
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
Definition: ntv2ccplayer.cpp:944
NTV2_IOKINDS_SDI
@ NTV2_IOKINDS_SDI
Specifies SDI input/output kinds.
Definition: ntv2enums.h:1274
CNTV2DemoCommon::IsValidDevice
static bool IsValidDevice(const std::string &inDeviceSpec)
Definition: ntv2democommon.cpp:455
AJAStatus
AJAStatus
Definition: types.h:378
ntv2ccplayer.h
CNTV2DemoCommon::GetTestPatternStrings
static std::string GetTestPatternStrings(void)
Definition: ntv2democommon.cpp:996
PlayerConfig::fFrames
NTV2ACFrameRange fFrames
AutoCirculate frame count or range.
Definition: ntv2democommon.h:326
CCGenConfig::fEndAction
AtEndAction fEndAction
The action to take after the file list has finished playing.
Definition: ntv2ccplayer.h:47
CCPlayerConfig::fEmitStats
bool fEmitStats
If true, show stats while playing; otherwise echo caption text being played.
Definition: ntv2ccplayer.h:83
NTV2_VANCMODE_OFF
@ NTV2_VANCMODE_OFF
This identifies the mode in which there are no VANC lines in the frame buffer.
Definition: ntv2enums.h:3752
CNTV2DemoCommon::ToLower
static std::string ToLower(const std::string &inStr)
Returns the given string after converting it to lower case.
Definition: ntv2democommon.cpp:1033
NTV2_CC608_CapModeUnknown
@ NTV2_CC608_CapModeUnknown
Unknown or invalid caption mode.
Definition: ntv2caption608types.h:126
PlayerConfig::fSuppressAudio
bool fSuppressAudio
If true, suppress audio; otherwise generate & xfer audio tone.
Definition: ntv2democommon.h:333
CCPlayerConfig::fSuppress608
bool fSuppress608
If true, don't transmit CEA608 packets; otherwise include 608 packets.
Definition: ntv2ccplayer.h:85
CCGenConfig
This class is used to configure a caption generator for a single caption channel.
Definition: ntv2ccplayer.h:43
IsValidLine21Channel
#define IsValidLine21Channel(_chan_)
Definition: ntv2caption608types.h:102
AtEndAction_Repeat
@ AtEndAction_Repeat
Terminate.
Definition: ntv2ccplayer.h:30
CNTV2DemoCommon::GetPixelFormatStrings
static std::string GetPixelFormatStrings(const NTV2PixelFormatKinds inKinds=PIXEL_FORMATS_ALL, const std::string inDevSpec=std::string())
Definition: ntv2democommon.cpp:605
StrToNTV2Line21Channel
NTV2Line21Channel StrToNTV2Line21Channel(const std::string &inStr)
Converts the given string into the equivalent NTV2Line21Channel value.
PlayerConfig::fVideoFormat
NTV2VideoFormat fVideoFormat
The video format to use.
Definition: ntv2democommon.h:328
NTV2_FBF_8BIT_YCBCR
@ NTV2_FBF_8BIT_YCBCR
See 8-Bit YCbCr Format.
Definition: ntv2enums.h:214
CNTV2DemoCommon::GetOutputDestinationFromString
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.
Definition: ntv2democommon.cpp:801
CNTV2DemoCommon::Popt
Definition: ntv2democommon.h:848
PlayerConfig::fOutputChannel
NTV2Channel fOutputChannel
The device channel to use.
Definition: ntv2democommon.h:324
CNTV2DemoCommon::Popt::errorStr
virtual const std::string & errorStr(void) const
Definition: ntv2democommon.h:856
NTV2Version
std::string NTV2Version(const bool inDetailed=false)
Definition: ntv2version.cpp:41
NTV2VideoFormatToString
std::string NTV2VideoFormatToString(const NTV2VideoFormat inValue, const bool inUseFrameRate=false)
Definition: ntv2utils.cpp:6793
CNTV2DemoCommon::GetVideoFormatStrings
static std::string GetVideoFormatStrings(const NTV2VideoFormatKinds inKinds=VIDEO_FORMATS_SDHD, const std::string inDevSpec=std::string())
Definition: ntv2democommon.cpp:523
CCPlayerConfig::fSuppressLine21
bool fSuppressLine21
SD output only: if true, do not encode Line 21 waveform; otherwise encode Line 21 waveform.
Definition: ntv2ccplayer.h:84
gGlobalQuit
static bool gGlobalQuit((0))
NTV2_CC608_XDS
@ NTV2_CC608_XDS
Definition: ntv2caption608types.h:95
NTV2_CC608_CapModeRollUp4
@ NTV2_CC608_CapModeRollUp4
4-row roll-up from bottom
Definition: ntv2caption608types.h:130
CNTV2DemoCommon::GetTestPatternNameFromString
static std::string GetTestPatternNameFromString(const std::string &inStr)
Definition: ntv2democommon.cpp:1024
NTV2StringList
std::vector< std::string > NTV2StringList
Definition: ntv2utils.h:1143
IsLine21TextChannel
#define IsLine21TextChannel(_chan_)
Definition: ntv2caption608types.h:104
AJADebug::Open
static AJAStatus Open(bool incrementRefCount=false)
Definition: debug.cpp:44
AJA_NULL
#define AJA_NULL
Definition: ajatypes.h:199
NTV2_IS_VALID_CHANNEL
#define NTV2_IS_VALID_CHANNEL(__x__)
Definition: ntv2enums.h:1348
NTV2_CC608_CapModeRollUp2
@ NTV2_CC608_CapModeRollUp2
2-row roll-up from bottom
Definition: ntv2caption608types.h:128
NTV2_VANCMODE_TALLER
@ NTV2_VANCMODE_TALLER
This identifies the mode in which there are some + extra VANC lines in the frame buffer.
Definition: ntv2enums.h:3754
PlayerConfig::fDoRGBOnWire
bool fDoRGBOnWire
If true, produce RGB on the wire; otherwise output YUV.
Definition: ntv2democommon.h:339
NTV2Line21ChannelToStr
const std::string & NTV2Line21ChannelToStr(const NTV2Line21Channel inLine21Channel, const bool inCompact=true)
Converts the given NTV2Line21Channel value into a human-readable string.
PlayerConfig::fOutputDest
NTV2OutputDest fOutputDest
The desired output connector to use.
Definition: ntv2democommon.h:325
false
#define false
Definition: ntv2devicefeatures.h:25
NTV2_OUTPUTDESTINATION_INVALID
@ NTV2_OUTPUTDESTINATION_INVALID
Definition: ntv2enums.h:1313
NTV2Line21Channel
NTV2Line21Channel
The CEA-608 caption channels: CC1 thru CC4, TX1 thru TX4, plus XDS.
Definition: ntv2caption608types.h:82
std
Definition: json.hpp:5362
CCPlayerConfig::fTestPatternName
std::string fTestPatternName
The test pattern to use.
Definition: ntv2ccplayer.h:89
AJAStatusToString
std::string AJAStatusToString(const AJAStatus inStatus, const bool inDetailed)
Definition: debug.cpp:981
POPT_TABLEEND
#define POPT_TABLEEND
Definition: options_popt.h:215
NTV2_CC608_CapModeRollUp3
@ NTV2_CC608_CapModeRollUp3
3-row roll-up from bottom
Definition: ntv2caption608types.h:129
NTV2CCPlayer::Quit
virtual void Quit(const bool inQuitImmediately=(0))
Stops me.
Definition: ntv2ccplayer.cpp:893
true
#define true
Definition: ntv2devicefeatures.h:26
NTV2CCPlayer::Run
virtual AJAStatus Run(void)
Runs me.
Definition: ntv2ccplayer.cpp:1350
CCPlayerConfig::fSuppress708
bool fSuppress708
If true, don't transmit CEA708 packets; otherwise include 708 packets.
Definition: ntv2ccplayer.h:86
NTV2StringListConstIter
NTV2StringList::const_iterator NTV2StringListConstIter
Definition: ntv2utils.h:1145
NTV2ACFrameRange::valid
bool valid(void) const
Definition: ntv2utils.h:985
PlayerConfig::fPixelFormat
NTV2PixelFormat fPixelFormat
The pixel format to use.
Definition: ntv2democommon.h:327
CCGenConfig::fCharsPerMinute
double fCharsPerMinute
The rate at which caption characters get enqueued, in characters per minute.
Definition: ntv2ccplayer.h:51
NTV2_IS_VALID_FRAME_BUFFER_FORMAT
#define NTV2_IS_VALID_FRAME_BUFFER_FORMAT(__s__)
Definition: ntv2enums.h:254
SIG_AJA_STOP
#define SIG_AJA_STOP
Definition: ntv2ccplayer.h:21
NTV2CCPlayer::GetStatus
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.
Definition: ntv2ccplayer.cpp:1825
AJA_FAILURE
#define AJA_FAILURE(_status_)
Definition: types.h:371
NTV2_CC608_CapModePopOn
@ NTV2_CC608_CapModePopOn
Pop-on caption mode.
Definition: ntv2caption608types.h:127
POPT_ARG_STRING
#define POPT_ARG_STRING
Definition: options_popt.h:57
POPT_ARG_NONE
#define POPT_ARG_NONE
Definition: options_popt.h:56
NTV2_IS_VALID_VIDEO_FORMAT
#define NTV2_IS_VALID_VIDEO_FORMAT(__f__)
Definition: ntv2enums.h:711
AtEndAction_Quit
@ AtEndAction_Quit
Definition: ntv2ccplayer.h:29
PIXEL_FORMATS_ALL
@ PIXEL_FORMATS_ALL
Definition: ntv2democommon.h:252