AJA NTV2 SDK  18.0.0.2122
NTV2 SDK 18.0.0.2122
ntv2burn.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #include "ntv2burn.h"
9 #include "ntv2devicescanner.h"
10 #include "ntv2testpatterngen.h" // Needed for --novideo
11 #include "ajabase/common/types.h"
12 #include "ajabase/system/process.h"
15 #include <iostream>
16 
17 using namespace std;
18 
19 //#define NTV2_BUFFER_LOCKING // Define this to pre-lock video/audio buffers in kernel
20 #define HasWidgetsAnyOf(_w1,_w2,_w3) (mDevice.features().CanDoWidget(_w1) || mDevice.features().CanDoWidget(_w2) || mDevice.features().CanDoWidget(_w3))
21 #if defined(_DEBUG)
22  static const bool sShowConfig(true);
23 #else
24  static const bool sShowConfig(false);
25 #endif
26 static const uint32_t kAppSignature (NTV2_FOURCC('B','u','r','n'));
27 
28 
30 
31 
32 NTV2Burn::NTV2Burn (const BurnConfig & inConfig)
33  : mConfig (inConfig),
34  mPlayThread (AJAThread()),
35  mCaptureThread (AJAThread()),
36  mDeviceID (DEVICE_ID_NOTFOUND),
38  mSavedTaskMode (NTV2_DISABLE_TASKS),
39  mAudioSystem (inConfig.WithAudio() ? ::NTV2InputSourceToAudioSystem(inConfig.fInputSource) : NTV2_AUDIOSYSTEM_INVALID),
40  mGlobalQuit (false)
41 {
42 } // constructor
43 
44 
46 {
47  Quit(); // Stop my capture and playout threads, then destroy them
48  mDevice.UnsubscribeInputVerticalEvent(mConfig.fInputChannel); // Unsubscribe from input VBI event
49 } // destructor
50 
51 
52 void NTV2Burn::Quit (void)
53 {
54  // Set the global 'quit' flag, and wait for the threads to go inactive...
55  mGlobalQuit = true;
56 
57  while (mPlayThread.Active())
58  AJATime::Sleep(10);
59 
60  while (mCaptureThread.Active())
61  AJATime::Sleep(10);
62 
63  if (!mConfig.fDoMultiFormat)
64  { // Release the device...
66  if (NTV2_IS_VALID_TASK_MODE(mSavedTaskMode))
67  mDevice.SetTaskMode(mSavedTaskMode); // Restore prior task mode
68  }
69 } // Quit
70 
71 
73 {
75 
76  // Open the device...
78  {cerr << "## ERROR: Device '" << mConfig.fDeviceSpec << "' not found" << endl; return AJA_STATUS_OPEN;}
79 
80  if (!mDevice.IsDeviceReady(false))
81  {cerr << "## ERROR: Device '" << mConfig.fDeviceSpec << "' not ready" << endl; return AJA_STATUS_INITIALIZE;}
82 
83  mDeviceID = mDevice.GetDeviceID(); // Keep the device ID handy since it will be used frequently
84  if (!mDevice.features().CanDoCapture())
85  {cerr << "## ERROR: Device '" << mDeviceID << "' cannot capture" << endl; return AJA_STATUS_FEATURE;}
86  if (!mDevice.features().CanDoPlayback())
87  {cerr << "## ERROR: Device '" << mDeviceID << "' cannot playout" << endl; return AJA_STATUS_FEATURE;}
88 
89  ULWord appSignature (0);
90  int32_t appPID (0);
91  mDevice.GetStreamingApplication (appSignature, appPID); // Who currently "owns" the device?
92  mDevice.GetTaskMode(mSavedTaskMode); // Save the current device state
93  if (!mConfig.fDoMultiFormat)
94  {
96  {
97  cerr << "## ERROR: Unable to acquire device because another app (pid " << appPID << ") owns it" << endl;
98  return AJA_STATUS_BUSY; // Some other app is using the device
99  }
100  mDevice.ClearRouting(); // Clear the current device routing (since I "own" the device)
101  }
102  mDevice.SetTaskMode(NTV2_OEM_TASKS); // Force OEM tasks
103 
104  // Configure the SDI relays if present
105  if (mDevice.features().HasSDIRelays())
106  {
107  // Note that if the board's jumpers are not set in the position
108  // to enable the watchdog timer, these calls will have no effect.
109  mDevice.SetSDIWatchdogEnable(true, 0); // SDI 1/2
110  mDevice.SetSDIWatchdogEnable(true, 1); // SDI 3/4
111 
112  // Set timeout delay to 2 seconds expressed in multiples of 8 ns
113  // and take the relays out of bypass...
114  mDevice.SetSDIWatchdogTimeout(2 * 125000000);
115  mDevice.KickSDIWatchdog();
116 
117  // Give the mechanical relays some time to switch...
118  AJATime::Sleep(500);
119  }
120 
121  // Make sure the device actually supports custom anc before using it...
122  if (mConfig.WithAnc())
123  mConfig.fWithAnc = mDevice.features().CanDoCustomAnc();
124 
125  // Set up the video and audio...
126  status = SetupVideo();
127  if (AJA_FAILURE(status))
128  return status;
129  status = mConfig.WithAudio() ? SetupAudio() : AJA_STATUS_SUCCESS;
130  if (AJA_FAILURE(status))
131  return status;
132 
133  // Set up the circular buffers...
134  status = SetupHostBuffers();
135  if (AJA_FAILURE(status))
136  return status;
137 
138  // Set up the signal routing...
141 
142  // Lastly, prepare my AJATimeCodeBurn instance...
144  mFormatDesc.numPixels,
145  mFormatDesc.numLines);
146  // Ready to go...
147  if (mConfig.IsVerbose() || sShowConfig)
148  { cerr << mConfig;
149  if (mDevice.IsRemote())
150  cerr << "Device Description: " << mDevice.GetDescription() << endl;
151  cerr << endl;
152  }
153  BURNINFO("Configuration: " << mConfig);
154  return AJA_STATUS_SUCCESS;
155 
156 } // Init
157 
158 
160 {
161  // If no input source specified, choose a default...
163  {
165  if (mConfig.IsVerbose())
166  cout << "## NOTE: Input source was not specified, will use " << mConfig.ISrcStr() << endl;
167  }
168 
169  // Does this device have the requested input source?
170  if (!mDevice.features().CanDoInputSource(mConfig.fInputSource))
171  {cerr << "## ERROR: Device does not have input source " << mConfig.ISrcStr() << endl; return AJA_STATUS_BAD_PARAM;}
172 
173  // The input channel should match the input source...
175  if (mConfig.IsVerbose())
176  cout << "## NOTE: Input FrameStore chosen to be " << mConfig.IChStr() << endl;
177 
178  // Enable/subscribe interrupts...
179  mDevice.EnableInputInterrupt(mConfig.fInputChannel);
183 
184  // Flip the input spigot to "receive" if necessary...
185  bool isXmit (false);
186  if (mDevice.features().HasBiDirectionalSDI() // If device has bidirectional SDI connectors...
187  && mConfig.ISrcIsSDI() // ...and desired input source is SDI...
188  && mDevice.GetSDITransmitEnable (mConfig.fInputChannel, isXmit) // ...and GetSDITransmitEnable succeeds...
189  && isXmit) // ...and input is set to "transmit"...
190  {
191  mDevice.SetSDITransmitEnable (mConfig.fInputChannel, false); // ...then disable transmit mode...
192  mDevice.WaitForOutputVerticalInterrupt (NTV2_CHANNEL1, 10); // ...and give device time to lock to input
193  } // if input SDI connector needs to switch from transmit mode
194 
195  // Is there an input signal? What format is it?
196  mVideoFormat = mDevice.GetInputVideoFormat(mConfig.fInputSource);
198  {cerr << "## ERROR: No signal at input " << mConfig.ISrcStr() << endl; return AJA_STATUS_NOINPUT;}
199  if (mConfig.IsVerbose())
200  cout << "## NOTE: Signal at input " << mConfig.ISrcStr() << " is " << ::NTV2VideoFormatToString(mVideoFormat, true) << endl;
201 
202  // Free-run the device clock, since E-to-E mode isn't used, nor is a mixer tied to the input...
204 
205  // Check the timecode source...
207  {
208  const NTV2Channel tcChannel (::NTV2TimecodeIndexToChannel(mConfig.fTimecodeSource));
209  const NTV2Channel endNum (NTV2Channel (mDevice.features().GetNumVideoChannels()));
210  if (tcChannel >= endNum)
211  {cerr << "## ERROR: Timecode source '" << ::NTV2TCIndexToString(mConfig.fTimecodeSource, true) << "' illegal on this device" << endl; return AJA_STATUS_BAD_PARAM;}
212  if (tcChannel == mConfig.fOutputChannel)
213  {cerr << "## ERROR: Timecode source '" << ::NTV2TCIndexToString(mConfig.fTimecodeSource, true) << "' conflicts with output channel" << endl; return AJA_STATUS_BAD_PARAM;}
214  if (mDevice.features().HasBiDirectionalSDI() // If device has bidirectional SDI connectors...
215  && mDevice.GetSDITransmitEnable (tcChannel, isXmit) // ...and GetSDITransmitEnable succeeds...
216  && isXmit) // ...and the SDI timecode source is set to "transmit"...
217  {
218  mDevice.SetSDITransmitEnable (tcChannel, false); // ...then disable transmit mode...
219  mDevice.WaitForInputVerticalInterrupt(tcChannel, 12); // ...and allow device to lock to input signal
220  } // if SDI must switch from transmit to receive
221 
222  // Configure for VITC capture
223  mDevice.SetRP188SourceFilter(tcChannel, 0x01);
224 
225  const NTV2VideoFormat tcInputVideoFormat (mDevice.GetInputVideoFormat (::NTV2TimecodeIndexToInputSource(mConfig.fTimecodeSource)));
226  if (tcInputVideoFormat == NTV2_FORMAT_UNKNOWN)
227  cerr << "## WARNING: Timecode source '" << ::NTV2TCIndexToString(mConfig.fTimecodeSource, true) << "' has no input signal" << endl;
228  if (!InputSignalHasTimecode())
229  cerr << "## WARNING: Timecode source '" << ::NTV2TCIndexToString(mConfig.fTimecodeSource, true) << "' has no embedded timecode" << endl;
230  }
232  cerr << "## WARNING: Timecode source '" << ::NTV2TCIndexToString(mConfig.fTimecodeSource, true) << "' has no embedded timecode" << endl;
233 
235  mDevice.SetLTCInputEnable(true); // Enable analog LTC input (some LTC inputs are shared with reference input)
236  mDevice.DisableRP188Bypass (::NTV2InputSourceToChannel(mConfig.fInputSource)); // AutoCirculate will drive timecode output
237 
238  // Final pre-flight checks...
239  if (!mDevice.features().CanDoFrameBufferFormat(mConfig.fPixelFormat))
240  {cerr << "## ERROR: " << ::NTV2FrameBufferFormatToString(mConfig.fPixelFormat) << " unsupported" << endl; return AJA_STATUS_UNSUPPORTED;}
241  if (mFormatDesc.IsPlanar())
242  {cerr << "## ERROR: This demo doesn't work with planar pixel formats" << endl; return AJA_STATUS_UNSUPPORTED;}
243  if (mFormatDesc.IsSD() && mConfig.WithTallVANC() && mConfig.fPixelFormat == NTV2_FBF_8BIT_YCBCR)
244  {cerr << "## ERROR: NTV2_VANCDATA_8BITSHIFT_ENABLE unsupported in firmware for SD video" << endl; return AJA_STATUS_UNSUPPORTED;}
245  if (mConfig.WithTallVANC() && mConfig.fPixelFormat != NTV2_FBF_8BIT_YCBCR && mConfig.fPixelFormat != NTV2_FBF_10BIT_YCBCR)
246  {cerr << "## ERROR: Tall-frame VANC requires NTV2_FBF_8BIT_YCBCR or NTV2_FBF_10BIT_YCBCR pixel format" << endl; return AJA_STATUS_UNSUPPORTED;}
247  if (mConfig.WithTallVANC() && (mFormatDesc.Is4K() || mFormatDesc.Is8K()))
248  {cerr << "## ERROR: Tall-frame VANC unsupported for 4K or 8K video" << endl; return AJA_STATUS_UNSUPPORTED;}
249 
250  // If the device supports different per-channel video formats, configure it as requested...
251  if (mDevice.features().CanDoMultiFormat())
252  mDevice.SetMultiFormatMode(mConfig.fDoMultiFormat);
253 
254  // Get the raster description...
257 
258  // Configure the input FrameStore...
259  mDevice.EnableChannel (mConfig.fInputChannel);
260  mDevice.SetVideoFormat (mVideoFormat, false, false, mDevice.features().CanDoMultiFormat() ? mConfig.fInputChannel : NTV2_CHANNEL1);
261  mDevice.SetFrameBufferFormat (mConfig.fInputChannel, mConfig.fPixelFormat);
263  mDevice.SetVANCShiftMode (mConfig.fInputChannel, ::Is8BitFrameBufferFormat(mConfig.fPixelFormat) && mConfig.WithTallVANC()
265 
266  // Choose an output channel/FrameStore, and enable it...
267  const UWord numFrameStores (mDevice.features().GetNumFrameStores());
268  switch (mConfig.fInputSource)
269  {
270  case NTV2_INPUTSOURCE_SDI1: mConfig.fOutputChannel = numFrameStores > 4 ? NTV2_CHANNEL2 : (numFrameStores == 2 ? NTV2_CHANNEL2 : NTV2_CHANNEL3);
271  break;
272 
274  case NTV2_INPUTSOURCE_SDI2: mConfig.fOutputChannel = numFrameStores > 4 ? NTV2_CHANNEL3 : NTV2_CHANNEL4;
275  break;
276 
279  break;
280 
282  case NTV2_INPUTSOURCE_SDI4: mConfig.fOutputChannel = numFrameStores > 4 ? NTV2_CHANNEL5 : NTV2_CHANNEL3;
283  break;
284 
285  case NTV2_INPUTSOURCE_SDI5: mConfig.fOutputChannel = NTV2_CHANNEL6; break;
286  case NTV2_INPUTSOURCE_SDI6: mConfig.fOutputChannel = NTV2_CHANNEL7; break;
287  case NTV2_INPUTSOURCE_SDI7: mConfig.fOutputChannel = NTV2_CHANNEL8; break;
288  case NTV2_INPUTSOURCE_SDI8: mConfig.fOutputChannel = NTV2_CHANNEL7; break;
289 
291  case NTV2_INPUTSOURCE_HDMI1: mConfig.fOutputChannel = numFrameStores < 3 ? NTV2_CHANNEL2 : NTV2_CHANNEL3;
292  mAudioSystem = NTV2_AUDIOSYSTEM_2;
293  break;
294  default:
295  case NTV2_INPUTSOURCE_INVALID: cerr << "## ERROR: Bad input source" << endl; return AJA_STATUS_BAD_PARAM;
296  }
297  if (mConfig.IsVerbose())
298  cout << "## NOTE: Output FrameStore chosen to be " << mConfig.OChStr() << endl;
300  {
302  if (NTV2_IS_VALID_CHANNEL(mConfig.ODstCh()))
303  if (mConfig.ODstCh() != mConfig.fOutputChannel)
304  if (mConfig.WithAnc() && !mConfig.WithTallVANC())
305  {
306  const string oldChStr(mConfig.OChStr());
307  mConfig.fOutputChannel = mConfig.ODstCh();
308  if (mConfig.IsVerbose())
309  cout << "## NOTE: Output " << mConfig.ODstStr() << " with Anc forced FrameStore change to "
310  << mConfig.OChStr() << " from " << oldChStr << endl;
311  }
312  }
313  else // else output destination not specified
314  { // Pick an appropriate output spigot based on the output channel...
317  { // If device has only one SDI output
319  if (mConfig.IsVerbose())
320  cout << "## NOTE: Output destination was not specified, will use " << mConfig.ODstStr() << endl;
321  }
322  }
323  if (mDevice.features().HasBiDirectionalSDI() // If device has bidirectional SDI connectors...
324  && mConfig.ODstIsSDI()) // ...and output destination is SDI...
325  mDevice.SetSDITransmitEnable (mConfig.ODstCh(), true); // ...then enable transmit mode
326  if (mConfig.fInputChannel == mConfig.fOutputChannel)
327  {cerr << "## ERROR: Input " << mConfig.IChStr() << " & output " << mConfig.OChStr() << " conflict" << endl; return AJA_STATUS_BAD_PARAM;}
328  if (mDevice.features().HasBiDirectionalSDI() && mConfig.ISrcIsSDI() && mConfig.ODstIsSDI() && mConfig.ISrcCh() == mConfig.ODstCh())
329  {cerr << "## ERROR: SDI conflict: input " << mConfig.ISrcStr() << " & output " << mConfig.ODstStr() << " are same connector" << endl; return AJA_STATUS_BAD_PARAM;}
330 
331  // Configure the output FrameStore...
332  mDevice.EnableChannel(mConfig.fOutputChannel);
333  mDevice.SetVideoFormat (mVideoFormat, false, false, mConfig.fOutputChannel);
334  mDevice.SetFrameBufferFormat (mConfig.fOutputChannel, mConfig.fPixelFormat);
336  mDevice.SetVANCShiftMode (mConfig.fOutputChannel, ::Is8BitFrameBufferFormat(mConfig.fPixelFormat) && mConfig.WithTallVANC()
338  return AJA_STATUS_SUCCESS;
339 
340 } // SetupVideo
341 
342 
344 {
345  if (!NTV2_IS_VALID_AUDIO_SYSTEM(mAudioSystem))
346  return AJA_STATUS_SUCCESS;
347 
348  // Have the audio subsystem capture audio from the designated input source...
349  mDevice.SetAudioSystemInputSource (mAudioSystem, ::NTV2InputSourceToAudioSource(mConfig.fInputSource),
351 
352  // It's best to use all available audio channels...
353  mDevice.SetNumberAudioChannels (mDevice.features().GetMaxAudioChannels(), mAudioSystem);
354 
355  // Assume 48kHz PCM...
356  mDevice.SetAudioRate (NTV2_AUDIO_48K, mAudioSystem);
357 
358  // 4MB device audio buffers work best...
359  mDevice.SetAudioBufferSize (NTV2_AUDIO_BUFFER_BIG, mAudioSystem);
360 
361  // Set up the output audio embedders...
362  if (mDevice.features().GetNumAudioSystems() > 1)
363  {
364  // Some devices, like the Kona1, have 2 FrameStores but only 1 SDI output,
365  // which makes mConfig.fOutputChannel == NTV2_CHANNEL2, but need SDIoutput to be NTV2_CHANNEL1...
366  UWord SDIoutput(mConfig.fOutputChannel);
367  if (SDIoutput >= mDevice.features().GetNumVideoOutputs())
368  SDIoutput = mDevice.features().GetNumVideoOutputs() - 1;
369  mDevice.SetSDIOutputAudioSystem (NTV2Channel(SDIoutput), mAudioSystem);
370 
371  if (mDevice.features().GetNumHDMIVideoOutputs() > 0)
373  }
374 
375  //
376  // Loopback mode plays whatever audio appears in the input signal when it's
377  // connected directly to an output (i.e., "end-to-end" mode). If loopback is
378  // left enabled, the video will lag the audio as video frames get briefly delayed
379  // in our ring buffer. Audio, therefore, needs to come out of the (buffered) frame
380  // data being played, so loopback must be turned off...
381  //
382  mDevice.SetAudioLoopBack (NTV2_AUDIO_LOOPBACK_OFF, mAudioSystem);
383  return AJA_STATUS_SUCCESS;
384 
385 } // SetupAudio
386 
387 
389 {
390  CNTV2DemoCommon::SetDefaultPageSize(); // Set host-specific page size
391 
392  // Let my circular buffer know when it's time to quit...
393  mFrameDataRing.SetAbortFlag (&mGlobalQuit);
394 
395  // Determine video buffer size...
396  const ULWord vidBuffSizeBytes (mFormatDesc.GetVideoWriteSize(ULWord(NTV2Buffer::DefaultPageSize())));
397 
398  // Determine per-field max Anc buffer size...
399  ULWord ancBuffSizeBytes (0);
400  if (!mDevice.GetAncRegionOffsetFromBottom (ancBuffSizeBytes, NTV2_AncRgn_Field2))
401  ancBuffSizeBytes = NTV2_ANCSIZE_MAX;
402 
403  // Allocate and add each in-host NTV2FrameData to my mFrameDataRing...
404  mHostBuffers.reserve(CIRCULAR_BUFFER_SIZE);
405  while (mHostBuffers.size() < CIRCULAR_BUFFER_SIZE)
406  {
407  mHostBuffers.push_back(NTV2FrameData()); // Make a new NTV2FrameData...
408  NTV2FrameData & frameData (mHostBuffers.back()); // ...and get a reference to it
409 
410  // Allocate a page-aligned video buffer (if handling video)...
411  if (!mConfig.fSuppressVideo)
412  if (!frameData.fVideoBuffer.Allocate (vidBuffSizeBytes, /*pageAligned*/true))
413  {
414  BURNFAIL("Failed to allocate " << xHEX0N(vidBuffSizeBytes,8) << "-byte video buffer");
415  return AJA_STATUS_MEMORY;
416  }
417  #ifdef NTV2_BUFFER_LOCKING
418  if (frameData.fVideoBuffer)
419  mDevice.DMABufferLock(frameData.fVideoBuffer, true);
420  #endif
421 
422  // Allocate a page-aligned audio buffer (if handling audio)...
423  if (NTV2_IS_VALID_AUDIO_SYSTEM(mAudioSystem) && mConfig.WithAudio())
424  if (!frameData.fAudioBuffer.Allocate (NTV2_AUDIOSIZE_MAX, /*pageAligned*/true))
425  {
426  BURNFAIL("Failed to allocate " << xHEX0N(NTV2_AUDIOSIZE_MAX,8) << "-byte audio buffer");
427  return AJA_STATUS_MEMORY;
428  }
429  if (frameData.AudioBuffer())
430  frameData.fAudioBuffer.Fill(ULWord(0));
431 
432  if (mConfig.WithAnc() && !mConfig.WithTallVANC())
433  { // Allocate page-aligned anc buffers...
434  if (!frameData.fAncBuffer.Allocate (ancBuffSizeBytes, /*pageAligned*/true))
435  {
436  BURNFAIL("Failed to allocate " << xHEX0N(ancBuffSizeBytes,8) << "-byte anc buffer");
437  return AJA_STATUS_MEMORY;
438  }
440  if (!frameData.fAncBuffer2.Allocate(ancBuffSizeBytes, /*pageAligned*/true))
441  {
442  BURNFAIL("Failed to allocate " << xHEX0N(ancBuffSizeBytes,8) << "-byte F2 anc buffer");
443  return AJA_STATUS_MEMORY;
444  }
445  }
446  if (frameData.AncBuffer())
447  frameData.AncBuffer().Fill(ULWord(0));
448  if (frameData.AncBuffer2())
449  frameData.AncBuffer2().Fill(ULWord(0));
450 
451  // Add this NTV2FrameData to the ring...
452  mFrameDataRing.Add(&frameData);
453  } // for each NTV2FrameData
454 
455  return AJA_STATUS_SUCCESS;
456 
457 } // SetupHostBuffers
458 
459 
461 {
462  const NTV2OutputCrosspointID inputOutputXpt (::GetInputSourceOutputXpt(mConfig.fInputSource));
464  const bool isRGB (::IsRGBFormat(mConfig.fPixelFormat));
465 
466  if (isRGB)
467  {
468  // If the frame buffer is configured for RGB pixel format, incoming YUV must be converted.
469  // This routes the video signal from the input through a color space converter before
470  // connecting to the RGB frame buffer...
471  const NTV2InputCrosspointID cscVideoInputXpt (::GetCSCInputXptFromChannel (mConfig.fInputChannel));
472  const NTV2OutputCrosspointID cscOutputXpt (::GetCSCOutputXptFromChannel (mConfig.fInputChannel, false/*isKey*/, true/*isRGB*/));
473 
474  mDevice.Connect (cscVideoInputXpt, inputOutputXpt); // Connect the CSC's video input to the input spigot's output
475  mDevice.Connect (fbInputXpt, cscOutputXpt); // Connect the frame store's input to the CSC's output
476  }
477  else
478  mDevice.Connect (fbInputXpt, inputOutputXpt); // Route the YCbCr signal directly from the input to the frame buffer's input
479 
480 } // RouteInputSignal
481 
482 
484 {
485  const NTV2InputXptID outputInputXpt (::GetOutputDestInputXpt(mConfig.fOutputDest));
487  const bool isRGB (::IsRGBFormat(mConfig.fPixelFormat));
488  NTV2OutputXptID outputXpt (fbOutputXpt);
489 
490  if (isRGB)
491  {
492  const NTV2OutputXptID cscVidOutputXpt (::GetCSCOutputXptFromChannel(mConfig.fOutputChannel)); // Use CSC's YUV video output
493  const NTV2InputXptID cscVidInputXpt (::GetCSCInputXptFromChannel(mConfig.fOutputChannel));
494 
495  mDevice.Connect (cscVidInputXpt, fbOutputXpt); // Connect the CSC's video input to the frame store's output
496  mDevice.Connect (outputInputXpt, cscVidOutputXpt); // Connect the SDI output's input to the CSC's video output
497  outputXpt = cscVidOutputXpt;
498  }
499  else
500  mDevice.Connect (outputInputXpt, outputXpt);
501 
502  mTCOutputs.clear ();
503  mTCOutputs.insert (::NTV2ChannelToTimecodeIndex(mConfig.fOutputChannel));
504 
505  if (!mConfig.fDoMultiFormat)
506  {
507  // Route all SDI outputs to the outputXpt...
508  const NTV2Channel startNum (NTV2_CHANNEL1);
509  const NTV2Channel endNum (NTV2Channel(mDevice.features().GetNumVideoChannels()));
511  NTV2WidgetID outputWidgetID (NTV2_WIDGET_INVALID);
512 
513  for (NTV2Channel chan (startNum); chan < endNum; chan = NTV2Channel (chan + 1))
514  {
515  // this kills vitc capture
516 // mDevice.SetRP188SourceFilter (chan, 0); // Set all SDI spigots to capture embedded LTC (VITC could be an option)
517 
518  if (chan == mConfig.fInputChannel || chan == mConfig.fOutputChannel)
519  continue; // Skip the input & output channel, already routed
520  if (NTV2_IS_VALID_CHANNEL (tcInputChannel) && chan == tcInputChannel)
521  continue; // Skip the timecode input channel
522  if (mDevice.features().HasBiDirectionalSDI())
523  mDevice.SetSDITransmitEnable (chan, true);
524  if (CNTV2SignalRouter::GetWidgetForInput (::GetSDIOutputInputXpt (chan, mDevice.features().CanDoDualLink()), outputWidgetID, mDeviceID))
525  if (mDevice.features().CanDoWidget(outputWidgetID))
526  {
527  mDevice.Connect (::GetSDIOutputInputXpt (chan), outputXpt);
528  mTCOutputs.insert (::NTV2ChannelToTimecodeIndex (chan));
529  mTCOutputs.insert (::NTV2ChannelToTimecodeIndex (chan, true));
530  }
531  } // for each output spigot
532 
533  // If HDMI and/or analog video outputs are available, route them, too...
534  if (mDevice.features().GetNumHDMIVideoOutputs() > 0)
535  mDevice.Connect (NTV2_XptHDMIOutQ1Input, outputXpt); // Route the output signal to the HDMI output
536  if (mDevice.features().CanDoWidget(NTV2_WgtAnalogOut1))
537  mDevice.Connect (NTV2_XptAnalogOutInput, outputXpt); // Route the output signal to the Analog output
538  if (mDevice.features().CanDoWidget(NTV2_WgtSDIMonOut1))
539  mDevice.Connect (::GetSDIOutputInputXpt (NTV2_CHANNEL5), outputXpt); // Route the output signal to the SDI monitor output
540  } // if not multiChannel
541  PLDBG(mTCOutputs.size() << " timecode destination(s): " << mTCOutputs);
542 
543 } // RouteOutputSignal
544 
545 
547 {
548  // Start the playout and capture threads...
549  StartPlayThread();
551  return AJA_STATUS_SUCCESS;
552 
553 } // Run
554 
555 
556 
558 
559 // This is where we will start the play thread
561 {
562  // Create and start the playout thread...
563  mPlayThread.Attach(PlayThreadStatic, this);
565  mPlayThread.Start();
566 
567 } // StartPlayThread
568 
569 
570 // The playout thread function
571 void NTV2Burn::PlayThreadStatic (AJAThread * pThread, void * pContext) // static
572 { (void) pThread;
573  // Grab the NTV2Burn instance pointer from the pContext parameter,
574  // then call its PlayFrames method...
575  NTV2Burn * pApp (reinterpret_cast<NTV2Burn*>(pContext));
576  pApp->PlayFrames();
577 
578 } // PlayThreadStatic
579 
580 
582 {
583  const ULWord acOptions (AUTOCIRCULATE_WITH_RP188
584  | (mConfig.WithAnc() && !mConfig.WithTallVANC() ? AUTOCIRCULATE_WITH_ANC : 0));
585  ULWord goodXfers(0), badXfers(0), starves(0), noRoomWaits(0);
586  AUTOCIRCULATE_TRANSFER outputXferInfo;
587  AUTOCIRCULATE_STATUS outputStatus;
588 
589  // Stop AutoCirculate on this channel, just in case some other app left it running...
590  mDevice.AutoCirculateStop(mConfig.fOutputChannel);
591  mDevice.WaitForOutputVerticalInterrupt(mConfig.fOutputChannel, 4); // Let it stop
592  BURNNOTE("Thread started");
593 
594  // Initialize AutoCirculate...
595  if (!mDevice.AutoCirculateInitForOutput (mConfig.fOutputChannel, mConfig.fOutputFrames, mAudioSystem, acOptions))
596  {BURNFAIL("AutoCirculateInitForOutput failed"); mGlobalQuit = true;}
597  else if (!mConfig.WithVideo())
598  { // Video suppressed --
599  // Clear device frame buffers being AutoCirculated (prevent garbage output frames)
600  NTV2Buffer tmpFrame (mFormatDesc.GetVideoWriteSize());
601  NTV2TestPatternGen blackPatternGen;
602  blackPatternGen.DrawTestPattern (NTV2_TestPatt_Black, mFormatDesc, tmpFrame);
603  mDevice.AutoCirculateGetStatus (mConfig.fOutputChannel, outputStatus);
604  for (uint16_t frmNum(outputStatus.GetStartFrame()); frmNum <= outputStatus.GetEndFrame(); frmNum++)
605  mDevice.DMAWriteFrame(ULWord(frmNum), tmpFrame, mFormatDesc.GetTotalBytes(), mConfig.fOutputChannel);
606  } // else if --novideo
607 
608  while (!mGlobalQuit)
609  {
610  mDevice.AutoCirculateGetStatus (mConfig.fOutputChannel, outputStatus);
611 
612  // Check if there's room for another frame on the card...
613  if (outputStatus.CanAcceptMoreOutputFrames())
614  {
615  // Device has at least one free frame buffer that can be filled.
616  // Wait for the next frame in our ring to become ready to "consume"...
617  NTV2FrameData * pFrameData (mFrameDataRing.StartConsumeNextBuffer());
618  if (!pFrameData)
619  {starves++; continue;} // Producer thread isn't producing frames fast enough
620 
621  // Prepare to transfer this timecode-burned frame to the device for playout.
622  // Set the XferInfo struct's video, audio and anc buffers from playData's buffers...
623  if (pFrameData->VideoBuffer())
624  outputXferInfo.SetVideoBuffer (pFrameData->VideoBuffer(), pFrameData->VideoBufferSize());
625  if (pFrameData->AudioBuffer())
626  outputXferInfo.SetAudioBuffer (pFrameData->AudioBuffer(), pFrameData->NumCapturedAudioBytes());
627  if (pFrameData->AncBuffer() || pFrameData->AncBuffer2())
628  outputXferInfo.SetAncBuffers (pFrameData->AncBuffer(), pFrameData->AncBufferSize(), pFrameData->AncBuffer2(), pFrameData->AncBuffer2Size());
629 
630  // Tell AutoCirculate to embed this frame's timecode(s) into the SDI output(s)...
631  outputXferInfo.SetOutputTimeCodes(pFrameData->fTimecodes);
632  PLDBG(pFrameData->fTimecodes);
633 
634  // Transfer the frame to the device for eventual playout...
635  if (mDevice.AutoCirculateTransfer (mConfig.fOutputChannel, outputXferInfo))
636  goodXfers++;
637  else
638  badXfers++;
639 
640  if (goodXfers == 3) // Start AutoCirculate playout once 3 frames are buffered on the device...
641  mDevice.AutoCirculateStart(mConfig.fOutputChannel);
642 
643  // Signal that the frame has been "consumed"...
644  mFrameDataRing.EndConsumeNextBuffer ();
645  continue; // Back to top of while loop
646  } // if CanAcceptMoreOutputFrames
647 
648  // Wait for one or more buffers to become available on the device, which should occur at next VBI...
649  noRoomWaits++;
651  } // loop til quit signaled
652 
653  // Stop AutoCirculate...
654  mDevice.AutoCirculateStop(mConfig.fOutputChannel);
655  BURNNOTE("Thread completed: " << DEC(goodXfers) << " xfers, " << DEC(badXfers) << " failed, "
656  << DEC(starves) << " ring starves, " << DEC(noRoomWaits) << " device starves");
657 } // PlayFrames
658 
659 
661 
662 
663 
665 //
666 // This is where the capture thread gets started
667 //
669 {
670  // Create and start the capture thread...
671  mCaptureThread.Attach(CaptureThreadStatic, this);
672  mCaptureThread.SetPriority(AJA_ThreadPriority_High);
673  mCaptureThread.Start();
674 
675 } // StartCaptureThread
676 
677 
678 //
679 // The static capture thread function
680 //
681 void NTV2Burn::CaptureThreadStatic (AJAThread * pThread, void * pContext) // static
682 { (void) pThread;
683  // Grab the NTV2Burn instance pointer from the pContext parameter,
684  // then call its CaptureFrames method...
685  NTV2Burn * pApp (reinterpret_cast<NTV2Burn*>(pContext));
686  pApp->CaptureFrames();
687 } // CaptureThreadStatic
688 
689 
690 //
691 // Repeatedly captures frames until told to stop
692 //
694 {
695  AUTOCIRCULATE_TRANSFER inputXferInfo;
696  const ULWord acOptions ((mConfig.WithTimecode() ? AUTOCIRCULATE_WITH_RP188 : 0)
697  | (mConfig.WithAnc() && !mConfig.WithTallVANC() ? AUTOCIRCULATE_WITH_ANC : 0));
698  ULWord goodXfers(0), badXfers(0), ringFulls(0), devWaits(0);
699  Bouncer<UWord> yPercent (85/*upperLimit*/, 1/*lowerLimit*/, 1/*startValue*/); // "Bounces" timecode up & down in raster
700  BURNNOTE("Thread started");
701 
702  // Stop AutoCirculate on this channel, just in case some other app left it running...
703  mDevice.AutoCirculateStop(mConfig.fInputChannel);
704 
705  // Initialize AutoCirculate...
706  if (!mDevice.AutoCirculateInitForInput (mConfig.fInputChannel, // channel
707  mConfig.fInputFrames, // frame count/range
708  mAudioSystem, // audio system
709  acOptions)) // flags
710  {BURNFAIL("AutoCirculateInitForInput failed"); mGlobalQuit = true;}
711  else
712  // Start AutoCirculate running...
713  mDevice.AutoCirculateStart (mConfig.fInputChannel);
714 
715  while (!mGlobalQuit)
716  {
717  AUTOCIRCULATE_STATUS acStatus;
718  mDevice.AutoCirculateGetStatus (mConfig.fInputChannel, acStatus);
719 
720  if (mDevice.features().HasSDIRelays())
721  mDevice.KickSDIWatchdog(); // Prevent watchdog from timing out and putting the relays into bypass mode
722 
723  if (acStatus.IsRunning() && acStatus.HasAvailableInputFrame())
724  {
725  // At this point, there's at least one fully-formed frame available in the device's frame buffer
726  // memory waiting to be transferred to the host. Reserve an NTV2FrameData to fill ("produce"),
727  // and use it in the next frame transferred from the device...
728  NTV2FrameData * pFrameData (mFrameDataRing.StartProduceNextBuffer ());
729  if (!pFrameData)
730  {ringFulls++; continue;} // Ring full -- consumer thread isn't consuming frames fast enough
731 
732  if (pFrameData->VideoBuffer())
733  inputXferInfo.SetVideoBuffer (pFrameData->VideoBuffer(), pFrameData->VideoBufferSize());
734  if (pFrameData->AudioBuffer())
735  inputXferInfo.SetAudioBuffer (pFrameData->AudioBuffer(), pFrameData->AudioBufferSize());
736  if (pFrameData->AncBuffer() || pFrameData->AncBuffer2())
737  inputXferInfo.SetAncBuffers (pFrameData->AncBuffer(), pFrameData->AncBufferSize(), pFrameData->AncBuffer2(), pFrameData->AncBuffer2Size());
738 
739  // Transfer the frame from the device into our host buffers...
740  if (mDevice.AutoCirculateTransfer (mConfig.fInputChannel, inputXferInfo)) goodXfers++;
741  else badXfers++;
742 
743  // Remember the amount, in bytes, of captured audio & anc data...
744  pFrameData->fNumAudioBytes = pFrameData->AudioBuffer() ? inputXferInfo.GetCapturedAudioByteCount() : 0;
745  pFrameData->fNumAncBytes = pFrameData->AncBuffer() ? inputXferInfo.GetCapturedAncByteCount(false/*F1*/): 0;
746  pFrameData->fNumAnc2Bytes = pFrameData->AncBuffer2() ? inputXferInfo.GetCapturedAncByteCount(true/*F2*/) : 0;
747  if (pFrameData->AncBuffer())
748  { // Zero F1 anc buffer memory past last byte written by anc extractor
749  NTV2Buffer stale (pFrameData->fAncBuffer.GetHostAddress(pFrameData->fNumAncBytes),
750  pFrameData->fAncBuffer.GetByteCount() - pFrameData->fNumAncBytes);
751  stale.Fill(uint8_t(0));
752  }
753  if (pFrameData->AncBuffer2())
754  { // Zero F2 anc buffer memory past last byte written by anc extractor
755  NTV2Buffer stale (pFrameData->AncBuffer2().GetHostAddress(pFrameData->fNumAnc2Bytes),
756  pFrameData->AncBuffer2().GetByteCount() - pFrameData->fNumAnc2Bytes);
757  stale.Fill(uint8_t(0));
758  }
759 
760  if (pFrameData->AncBuffer() && !mConfig.WithHanc())
761  AJAAncList::StripNativeInserterGUMPPackets (pFrameData->AncBuffer(), pFrameData->AncBuffer());
762  if (pFrameData->AncBuffer2() && !mConfig.WithHanc())
763  AJAAncList::StripNativeInserterGUMPPackets (pFrameData->AncBuffer2(), pFrameData->AncBuffer2());
764 
765  // Determine which timecode value should be burned in to the video frame
766  string timeCodeString;
767  NTV2_RP188 timecodeValue;
769  {
770  // Use the embedded input time code...
771  mDevice.GetRP188Data (mConfig.fInputChannel, timecodeValue);
772  CRP188 inputRP188Info (timecodeValue);
773  inputRP188Info.GetRP188Str(timeCodeString);
774  }
776  {
777  // Use the analog input time code...
778  mDevice.ReadAnalogLTCInput (mConfig.fTimecodeSource == NTV2_TCINDEX_LTC1 ? 0 : 1, timecodeValue);
779  CRP188 analogRP188Info (timecodeValue);
780  analogRP188Info.GetRP188Str(timeCodeString);
781  }
782  else
783  {
784  // Invent a timecode (based on the number of frames procesed)...
786  const TimecodeFormat tcFormat (CNTV2DemoCommon::NTV2FrameRate2TimecodeFormat(ntv2FrameRate));
787  const CRP188 frameRP188Info (inputXferInfo.GetTransferStatus().GetProcessedFrameCount(), 0, 0, 10, tcFormat);
788 
789  frameRP188Info.GetRP188Reg(timecodeValue);
790  frameRP188Info.GetRP188Str(timeCodeString);
791  }
792 
793  // Get a timecode to use for burn-in...
794  NTV2_RP188 thisFrameTC;
795  inputXferInfo.GetInputTimeCodes (pFrameData->fTimecodes, mConfig.fInputChannel);
796  if (pFrameData->HasValidTimecode(mConfig.fTimecodeSource))
797  {
798  thisFrameTC = pFrameData->fTimecodes[mConfig.fTimecodeSource];
799  }
800  else
801  { // Invent a timecode (based on frame count)...
803  const TimecodeFormat tcFormat (CNTV2DemoCommon::NTV2FrameRate2TimecodeFormat(ntv2FrameRate));
804  const CRP188 inventedTC (inputXferInfo.GetTransferStatus().GetProcessedFrameCount(), 0, 0, 10, tcFormat);
805  inventedTC.GetRP188Reg(thisFrameTC);
806  }
807 
808  // While this NTV2FrameData's buffers are locked, "burn" timecode into the raster...
809  NTV2Buffer visibleRgn (mFormatDesc.GetTopVisibleRowAddress(pFrameData->VideoBuffer()),
810  mFormatDesc.GetVisibleRasterBytes());
811  mTCBurner.BurnTimeCode (visibleRgn, timeCodeString.c_str(), yPercent.Next());
812 
813  // Signal that we're done "producing" this frame, making it available for future "consumption"...
814  mFrameDataRing.EndProduceNextBuffer();
815  } // if A/C running and frame(s) are available for transfer
816  else
817  {
818  // Either AutoCirculate is not running, or there were no frames available on the device to transfer.
819  // Rather than waste CPU cycles spinning, waiting until a frame becomes available, it's far more
820  // efficient to wait for the next input vertical interrupt event to get signaled...
821  devWaits++;
822  mDevice.WaitForInputFieldID (NTV2_FIELD0, mConfig.fInputChannel);
823  }
824  } // loop til quit signaled
825 
826  // Stop AutoCirculate...
827  mDevice.AutoCirculateStop (mConfig.fInputChannel);
828  BURNNOTE("Thread completed: " << DEC(goodXfers) << " xfers, " << DEC(badXfers) << " failed, "
829  << DEC(ringFulls) << " ring full(s), " << DEC(devWaits) << " device waits");
830 
831 } // CaptureFrames
832 
833 
835 
836 
837 void NTV2Burn::GetStatus (AUTOCIRCULATE_STATUS & outInputStatus, AUTOCIRCULATE_STATUS & outOutputStatus)
838 {
839  mDevice.AutoCirculateGetStatus (mConfig.fInputChannel, outInputStatus);
840  mDevice.AutoCirculateGetStatus (mConfig.fOutputChannel, outOutputStatus);
841 
842 } // GetStatus
843 
844 
845 static ULWord GetRP188RegisterForInput (const NTV2InputSource inInputSource)
846 {
847  switch (inInputSource)
848  {
849  case NTV2_INPUTSOURCE_SDI1: return kRegRP188InOut1DBB; // reg 29
850  case NTV2_INPUTSOURCE_SDI2: return kRegRP188InOut2DBB; // reg 64
851  case NTV2_INPUTSOURCE_SDI3: return kRegRP188InOut3DBB; // reg 268
852  case NTV2_INPUTSOURCE_SDI4: return kRegRP188InOut4DBB; // reg 273
853  case NTV2_INPUTSOURCE_SDI5: return kRegRP188InOut5DBB; // reg 342
854  case NTV2_INPUTSOURCE_SDI6: return kRegRP188InOut6DBB; // reg 418
855  case NTV2_INPUTSOURCE_SDI7: return kRegRP188InOut7DBB; // reg 427
856  case NTV2_INPUTSOURCE_SDI8: return kRegRP188InOut8DBB; // reg 436
857  default: return 0;
858  } // switch on input source
859 
860 } // GetRP188RegisterForInput
861 
862 
864 {
865  const ULWord regNum (::GetRP188RegisterForInput(mConfig.fInputSource));
866  ULWord regValue(0);
867 
868  // Bit 16 of the RP188 DBB register will be set if there is timecode embedded in the input signal...
869  return regNum && mDevice.ReadRegister(regNum, regValue) && regValue & BIT(16);
870 
871 } // InputSignalHasTimecode
872 
873 
875 {
877  return false;
879  bool result(false);
880  mDevice.driverInterface().ReadRegister(kRegLTCStatusControl, result, regMask);
881  return result;
882 
883 } // AnalogLTCInputHasTimecode
NTV2Channel NTV2InputSourceToChannel(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2Channel value.
Definition: ntv2utils.cpp:5047
bool SetOutputTimeCodes(const NTV2TimeCodes &inValues)
Intended for playout, replaces the contents of my acOutputTimeCodes member.
The invalid video input.
Definition: ntv2enums.h:1277
NTV2FrameRate GetNTV2FrameRateFromVideoFormat(const NTV2VideoFormat inVideoFormat)
Definition: ntv2utils.cpp:3630
#define HasWidgetsAnyOf(_w1, _w2, _w3)
Definition: ntv2burn.cpp:20
virtual bool SetTaskMode(const NTV2TaskMode inMode)
Sets the device&#39;s task mode.
bool fWithAnc
If true, capture & play anc data (LLBurn). Defaults to false.
virtual bool WaitForInputFieldID(const NTV2FieldID inFieldID, const NTV2Channel inChannel=NTV2_CHANNEL1)
Efficiently sleeps the calling thread/process until the next input VBI for the given field and input ...
Identifies the 4th HDMI video input.
Definition: ntv2enums.h:1268
#define NTV2_IS_VALID_TASK_MODE(__m__)
Identifies the 5th SDI video input.
Definition: ntv2enums.h:1273
T Next(void)
virtual bool GetSDITransmitEnable(const NTV2Channel inChannel, bool &outEnabled)
Answers whether or not the specified SDI connector is currently acting as a transmitter (i...
virtual AJAStatus SetupAudio(void)
Sets up everything I need for capturing and playing audio.
Definition: ntv2burn.cpp:343
virtual bool SetSDIWatchdogEnable(const bool inEnable, const UWord inIndex0)
Sets the connector pair relays to be under watchdog timer control or manual control.
virtual bool SetHDMIOutAudioSource2Channel(const NTV2AudioChannelPair inNewValue, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1, const NTV2Channel inWhichHDMIOut=NTV2_CHANNEL1)
Sets the HDMI output&#39;s 2-channel audio source.
Definition: ntv2audio.cpp:868
Specifies SDI input/output kinds.
Definition: ntv2enums.h:1292
static void CaptureThreadStatic(AJAThread *pThread, void *pContext)
This is the capture thread&#39;s static callback function that gets called when the capture thread runs...
Definition: ntv2burn.cpp:681
Declares common types used in the ajabase library.
NTV2Channel NTV2TimecodeIndexToChannel(const NTV2TCIndex inTCIndex)
Converts the given NTV2TCIndex value into the appropriate NTV2Channel value.
Definition: ntv2utils.cpp:4979
virtual bool SetAudioLoopBack(const NTV2AudioLoopBack inMode, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Enables or disables NTV2AudioLoopBack mode for the given NTV2AudioSystem.
Definition: ntv2audio.cpp:300
virtual void StartCaptureThread(void)
Starts my capture thread.
Definition: ntv2burn.cpp:668
std::string ODstStr(void) const
Specifies the device&#39;s internal clock.
Definition: ntv2enums.h:1459
virtual bool SetReference(const NTV2ReferenceSource inRefSource, const bool inKeepFramePulseSelect=(0))
Sets the device&#39;s clock reference source. See Video Output Clocking & Synchronization for more inform...
virtual bool ReleaseStreamForApplication(ULWord inApplicationType, int32_t inProcessID)
Releases exclusive use of the AJA device for the given process, permitting other processes to acquire...
bool Is8BitFrameBufferFormat(const NTV2FrameBufferFormat fbFormat)
Definition: ntv2utils.cpp:5452
AJAStatus Add(FrameDataPtr pInFrameData)
Appends a new frame buffer to me, increasing my frame storage capacity by one frame.
The NTV2 test pattern generator.
Identifies the 2nd HDMI video input.
Definition: ntv2enums.h:1266
#define NTV2_IS_SDI_TIMECODE_INDEX(__x__)
Definition: ntv2enums.h:3997
#define BIT(_x_)
Definition: ajatypes.h:578
virtual bool SetVideoFormat(const NTV2VideoFormat inVideoFormat, const bool inIsAJARetail=(!(0)), const bool inKeepVancSettings=(0), const NTV2Channel inChannel=NTV2_CHANNEL1)
Configures the AJA device to handle a specific video format.
AJAStatus
Definition: types.h:380
See 10-Bit YCbCr Format.
Definition: ntv2enums.h:222
ULWord GetCapturedAudioByteCount(void) const
virtual ~NTV2Burn()
Definition: ntv2burn.cpp:45
virtual bool IsDeviceReady(const bool inCheckValid=(0))
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
Identifies the 1st HDMI video input.
Definition: ntv2enums.h:1265
NTV2OutputDestination NTV2ChannelToOutputDestination(const NTV2Channel inChannel, const NTV2IOKinds inKinds=NTV2_IOKINDS_SDI)
Converts the given NTV2Channel value into its ordinary equivalent NTV2OutputDestination.
Definition: ntv2utils.cpp:5167
static uint64_t GetPid()
Definition: process.cpp:35
#define AJA_FAILURE(_status_)
Definition: types.h:373
virtual void StartPlayThread(void)
Starts my playout thread.
Definition: ntv2burn.cpp:560
Declares the NTV2TestPatternGen class.
NTV2EmbeddedAudioInput NTV2InputSourceToEmbeddedAudioInput(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2EmbeddedAudioInput value.
Definition: ntv2utils.cpp:4877
NTV2InputSource NTV2ChannelToInputSource(const NTV2Channel inChannel, const NTV2IOKinds inKinds=NTV2_IOKINDS_SDI)
Definition: ntv2utils.cpp:5132
std::string IChStr(void) const
NTV2Burn(const BurnConfig &inConfig)
Constructs me using the given configuration settings.
Definition: ntv2burn.cpp:32
virtual bool DMAWriteFrame(const ULWord inFrameNumber, const ULWord *pInFrameBuffer, const ULWord inByteCount)
Transfers a single frame from the host to the AJA device.
Definition: ntv2dma.cpp:65
NTV2AudioSystem NTV2InputSourceToAudioSystem(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2AudioSystem value.
Definition: ntv2utils.cpp:5071
Declares the AJATime class.
virtual AJAStatus SetPriority(AJAThreadPriority priority)
Definition: thread.cpp:133
Analog LTC 2.
Definition: ntv2enums.h:3961
Specifies HDMI input/output kinds.
Definition: ntv2enums.h:1293
FrameDataPtr StartConsumeNextBuffer(void)
The thread that&#39;s responsible for processing incoming frames – the consumer – calls this function t...
#define NTV2_FOURCC(_a_, _b_, _c_, _d_)
static const bool sShowConfig((0))
bool CanAcceptMoreOutputFrames(void) const
#define NTV2_IS_VALID_OUTPUT_DEST(_dest_)
Definition: ntv2enums.h:1347
This identifies the mode in which there are some + extra VANC lines in the frame buffer.
Definition: ntv2enums.h:3801
Definition: json.hpp:5362
virtual bool SetAudioRate(const NTV2AudioRate inRate, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Sets the NTV2AudioRate for the given Audio System.
Definition: ntv2audio.cpp:205
virtual AJAStatus Start()
Definition: thread.cpp:91
virtual bool EnableInputInterrupt(const NTV2Channel channel=NTV2_CHANNEL1)
Allows the CNTV2Card instance to wait for and respond to input vertical blanking interrupts originati...
virtual bool SubscribeInputVerticalEvent(const NTV2Channel inChannel=NTV2_CHANNEL1)
Causes me to be notified when an input vertical blanking interrupt occurs on the given input channel...
void EndConsumeNextBuffer(void)
The consumer thread calls this function to signal that it has finished processing the frame it obtain...
#define false
bool WithTimecode(void) const
uint32_t ULWord
Definition: ajatypes.h:223
virtual bool AutoCirculateGetStatus(const NTV2Channel inChannel, AUTOCIRCULATE_STATUS &outStatus)
Returns the current AutoCirculate status for the given channel.
virtual bool SetFrameBufferFormat(NTV2Channel inChannel, NTV2FrameBufferFormat inNewFormat, bool inIsAJARetail=(!(0)), NTV2HDRXferChars inXferChars=NTV2_VPID_TC_SDR_TV, NTV2HDRColorimetry inColorimetry=NTV2_VPID_Color_Rec709, NTV2HDRLuminance inLuminance=NTV2_VPID_Luminance_YCbCr)
Sets the frame buffer format for the given FrameStore on the AJA device.
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They&#39;re also commonly use...
Definition: ntv2enums.h:1357
mVideoFormat
Definition: ntv2vcam.cpp:801
Identifies the 8th SDI video input.
Definition: ntv2enums.h:1276
virtual class DeviceCapabilities & features(void)
Definition: ntv2card.h:148
bool CanDoInputSource(const NTV2InputSource inSrc)
virtual bool GetAncRegionOffsetFromBottom(ULWord &outByteOffsetFromBottom, const NTV2AncillaryDataRegion inAncRegion=NTV2_AncRgn_All)
Answers with the byte offset to the start of an ancillary data region within a device frame buffer...
Definition: ntv2dma.cpp:601
virtual bool EnableOutputInterrupt(const NTV2Channel channel=NTV2_CHANNEL1)
Allows the CNTV2Card instance to wait for and respond to output vertical blanking interrupts originat...
virtual bool SetMultiFormatMode(const bool inEnable)
Enables or disables multi-format (per channel) device operation. If enabled, each device channel can ...
static bool StripNativeInserterGUMPPackets(const NTV2Buffer &inSrc, NTV2Buffer &outDst)
Copies GUMP from inSrc to outDst buffers, but removes ATC, VPID, VITC, EDH & raw/analog packets...
static void PlayThreadStatic(AJAThread *pThread, void *pContext)
This is the playout thread&#39;s static callback function that gets called when the playout thread runs...
Definition: ntv2burn.cpp:571
Identifies the 2nd SDI video input.
Definition: ntv2enums.h:1270
bool IsProgressivePicture(const NTV2VideoFormat format)
Definition: ntv2utils.cpp:5391
virtual bool ClearRouting(void)
Removes all existing signal path connections between any and all widgets on the AJA device...
NTV2ACFrameRange fOutputFrames
Playout frame count or range.
virtual bool GetRP188Data(const NTV2Channel inSDIInput, NTV2_RP188 &outRP188Data)
Reads the raw RP188 data from the DBB/Low/Hi registers for the given SDI input. On newer devices with...
This struct replaces the old RP188_STRUCT.
int32_t appPID(0)
A handy class that makes it easy to "bounce" an unsigned integer value between a minimum and maximum ...
NTV2TCIndex NTV2ChannelToTimecodeIndex(const NTV2Channel inChannel, const bool inEmbeddedLTC=false, const bool inIsF2=false)
Converts the given NTV2Channel value into the equivalent NTV2TCIndex value.
Definition: ntv2utils.cpp:4962
#define NTV2_IS_ANALOG_TIMECODE_INDEX(__x__)
Definition: ntv2enums.h:3986
#define NTV2_AUDIOSIZE_MAX
virtual bool IsRemote(void) const
NTV2OutputDest fOutputDest
The device output connector to use (NTV2_OUTPUTDESTINATION_INVALID means unspecified) ...
virtual bool Active()
Definition: thread.cpp:116
NTV2Channel ISrcCh(void) const
bool Fill(const T &inValue)
Fills me with the given scalar value.
virtual bool GetTaskMode(NTV2TaskMode &outMode)
Retrieves the device&#39;s current task mode.
virtual bool SetAudioSystemInputSource(const NTV2AudioSystem inAudioSystem, const NTV2AudioSource inAudioSource, const NTV2EmbeddedAudioInput inEmbeddedInput)
Sets the audio source for the given NTV2AudioSystem on the device.
Definition: ntv2audio.cpp:485
virtual bool KickSDIWatchdog(void)
Restarts the countdown timer to prevent the watchdog timer from timing out.
NTV2OutputXptID GetInputSourceOutputXpt(const NTV2InputSource inInputSource, const bool inIsSDI_DS2=false, const bool inIsHDMI_RGB=false, const UWord inHDMI_Quadrant=0)
NTV2PixelFormat fPixelFormat
The pixel format to use.
static AJA_PixelFormat GetAJAPixelFormat(const NTV2PixelFormat inFormat)
NTV2Channel fOutputChannel
The output channel to use.
NTV2FrameRate
Identifies a particular video frame rate.
Definition: ntv2enums.h:412
virtual bool SetLTCInputEnable(const bool inEnable)
Enables or disables the ability for the device to read analog LTC on the reference input connector...
virtual CNTV2DriverInterface & driverInterface(void)
Definition: ntv2card.h:6449
Analog LTC 1.
Definition: ntv2enums.h:3960
virtual bool DrawTestPattern(const std::string &inTPName, const NTV2FormatDescriptor &inFormatDesc, NTV2Buffer &inBuffer)
Renders the given test pattern or color into a host raster buffer.
0: Disabled (never recommended): device configured exclusively by client application(s).
virtual std::string GetDescription(void) const
Definition: ntv2card.cpp:139
virtual bool InputSignalHasTimecode(void)
Returns true if the current input signal has timecode embedded in it; otherwise returns false...
Definition: ntv2burn.cpp:863
static const uint32_t kAppSignature(((((uint32_t)( 'B'))<< 24)|(((uint32_t)( 'u'))<< 16)|(((uint32_t)( 'r'))<< 8)|(((uint32_t)( 'n'))<< 0)))
static TimecodeFormat NTV2FrameRate2TimecodeFormat(const NTV2FrameRate inFrameRate)
bool WithTallVANC(void) const
NTV2InputXptID GetOutputDestInputXpt(const NTV2OutputDestination inOutputDest, const bool inIsSDI_DS2=false, const UWord inHDMI_Quadrant=99)
Invalid or "not found".
Definition: ntv2enums.h:98
static bool GetFirstDeviceFromArgument(const std::string &inArgument, CNTV2Card &outDevice)
Rescans the host, and returns an open CNTV2Card instance for the AJA device that matches a command li...
virtual bool SetSDITransmitEnable(const NTV2Channel inChannel, const bool inEnable)
Sets the specified bidirectional SDI connector to act as an input or an output.
const AUTOCIRCULATE_TRANSFER_STATUS & GetTransferStatus(void) const
Returns a constant reference to my AUTOCIRCULATE_TRANSFER_STATUS.
virtual bool AutoCirculateTransfer(const NTV2Channel inChannel, AUTOCIRCULATE_TRANSFER &transferInfo)
Transfers all or part of a frame as specified in the given AUTOCIRCULATE_TRANSFER object to/from the ...
virtual bool SetRP188SourceFilter(const NTV2Channel inSDIInput, const UWord inFilterValue)
Sets the RP188 DBB filter for the given SDI input.
virtual bool AcquireStreamForApplication(ULWord inApplicationType, int32_t inProcessID)
Reserves exclusive use of the AJA device for a given process, preventing other processes on the host ...
ULWord GetProcessedFrameCount(void) const
virtual bool DMABufferLock(const NTV2Buffer &inBuffer, bool inMap=(0), bool inRDMA=(0))
Page-locks the given host buffer to reduce transfer time and CPU usage of DMA transfers.
Definition: ntv2dma.cpp:429
Header file for the NTV2Burn demonstration class.
virtual void Quit(void)
Gracefully stops me from running.
Definition: ntv2burn.cpp:52
void SetAbortFlag(const bool *pAbortFlag)
Tells me the boolean variable I should monitor such that when it gets set to "true" will cause any th...
virtual bool ReadAnalogLTCInput(const UWord inLTCInput, RP188_STRUCT &outRP188Data)
Reads the current contents of the device&#39;s analog LTC input registers.
virtual bool ReadRegister(const ULWord inRegNum, ULWord &outValue, const ULWord inMask=0xFFFFFFFF, const ULWord inShift=0)
Reads all or part of the 32-bit contents of a specific register (real or virtual) on the AJA device...
Identifies the 3rd SDI video input.
Definition: ntv2enums.h:1271
NTV2InputXptID GetCSCInputXptFromChannel(const NTV2Channel inCSC, const bool inIsKeyInput=false)
bool WithHanc(void) const
virtual NTV2VideoFormat GetInputVideoFormat(const NTV2InputSource inVideoSource=NTV2_INPUTSOURCE_SDI1, const bool inIsProgressive=(0))
Returns the video format of the signal that is present on the given input source. ...
Describes a video frame for a given video standard or format and pixel format, including the total nu...
static void Sleep(const int32_t inMilliseconds)
Suspends execution of the current thread for a given number of milliseconds.
Definition: systemtime.cpp:284
This selects audio channels 1 and 2 (Group 1 channels 1 and 2)
Definition: ntv2enums.h:3133
static ULWord GetRP188RegisterForInput(const NTV2InputSource inInputSource)
Definition: ntv2burn.cpp:845
2: OEM (recommended): device configured by client application(s) with some driver involvement...
NTV2InputXptID GetFrameStoreInputXptFromChannel(const NTV2Channel inFrameStore, const bool inIsBInput=false)
static size_t DefaultPageSize(void)
virtual bool SetSDIOutputAudioSystem(const NTV2Channel inSDIOutputConnector, const NTV2AudioSystem inAudioSystem)
Sets the device&#39;s NTV2AudioSystem that will provide audio for the given SDI output&#39;s audio embedder...
std::string NTV2VideoFormatToString(const NTV2VideoFormat inValue, const bool inUseFrameRate=false)
Definition: ntv2utils.cpp:6746
virtual void CaptureFrames(void)
Repeatedly captures frames using AutoCirculate (until global quit flag set).
Definition: ntv2burn.cpp:693
Embeds silence (zeroes) into the data stream.
Definition: ntv2enums.h:2030
virtual bool SetVANCShiftMode(NTV2Channel inChannel, NTV2VANCDataShiftMode inMode)
Enables or disables the "VANC Shift Mode" feature for the given channel.
Configures an NTV2Burn or NTV2FieldBurn instance.
Specifies channel or FrameStore 8 (or the 8th item).
Definition: ntv2enums.h:1366
See KONA HDMI.
Definition: ntv2enums.h:68
AJA_EXPORT bool RenderTimeCodeFont(AJA_PixelFormat pixelFormat, uint32_t numPixels, uint32_t numLines)
#define AUTOCIRCULATE_WITH_ANC
Use this to AutoCirculate with ancillary data.
Specifies channel or FrameStore 2 (or the 2nd item).
Definition: ntv2enums.h:1360
virtual NTV2DeviceID GetDeviceID(void)
std::string NTV2TCIndexToString(const NTV2TCIndex inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:6394
bool ISrcIsSDI(void) const
virtual void GetStatus(AUTOCIRCULATE_STATUS &outInputStatus, AUTOCIRCULATE_STATUS &outOutputStatus)
Provides status information about my input (capture) and output (playout) processes.
Definition: ntv2burn.cpp:837
Declares the CNTV2DeviceScanner class.
bool IsVerbose(void) const
Identifies the 4th SDI video input.
Definition: ntv2enums.h:1272
virtual bool ReadRegister(const ULWord inRegNum, ULWord &outValue, const ULWord inMask=0xFFFFFFFF, const ULWord inShift=0)
Reads all or part of the 32-bit contents of a specific register (real or virtual) on the AJA device...
std::string fDeviceSpec
The AJA device to use.
#define NTV2_OUTPUT_DEST_IS_SDI(_dest_)
Definition: ntv2enums.h:1346
virtual bool AutoCirculateStop(const NTV2Channel inChannel, const bool inAbort=(0))
Stops AutoCirculate for the given channel, and releases the on-device frame buffers that were allocat...
#define NTV2_IS_VALID_CHANNEL(__x__)
Definition: ntv2enums.h:1371
Declares the AJAProcess class.
virtual void RouteInputSignal(void)
Sets up board routing for capture.
Definition: ntv2burn.cpp:460
Describes a user-space buffer on the host computer. I have an address and a length, plus some optional attributes (allocated by SDK?, page-aligned? etc.).
virtual bool Connect(const NTV2InputCrosspointID inInputXpt, const NTV2OutputCrosspointID inOutputXpt, const bool inValidate=(0))
Connects the given widget signal input (sink) to the given widget signal output (source).
virtual bool UnsubscribeInputVerticalEvent(const NTV2Channel inChannel=NTV2_CHANNEL1)
Unregisters me so I&#39;m no longer notified when an input VBI is signaled on the given input channel...
std::string OChStr(void) const
uint16_t GetEndFrame(void) const
NTV2InputSource
Identifies a specific video input source.
Definition: ntv2enums.h:1262
bool IsRGBFormat(const NTV2FrameBufferFormat format)
Definition: ntv2utils.cpp:5410
Identifies the 6th SDI video input.
Definition: ntv2enums.h:1274
This object specifies the information that will be transferred to or from the AJA device in the CNTV2...
virtual bool SetAudioBufferSize(const NTV2AudioBufferSize inValue, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Changes the size of the audio buffer that is used for a given Audio System in the AJA device...
Definition: ntv2audio.cpp:249
#define BURNNOTE(_expr_)
#define DEC(__x__)
static bool GetWidgetForInput(const NTV2InputXptID inInputXpt, NTV2WidgetID &outWidgetID, const NTV2DeviceID inDeviceID=DEVICE_ID_NOTFOUND)
Returns the widget that "owns" the specified input crosspoint.
I capture frames from a video signal provided to an AJA device&#39;s video input. I burn timecode into th...
Definition: ntv2burn.h:30
void EndProduceNextBuffer(void)
The producer thread calls this function to signal that it has finished populating the frame it obtain...
virtual AJAStatus Run(void)
Runs me.
Definition: ntv2burn.cpp:546
virtual bool WaitForOutputVerticalInterrupt(const NTV2Channel inChannel=NTV2_CHANNEL1, UWord inRepeatCount=1)
Efficiently sleeps the calling thread/process until the next one or more field (interlaced video) or ...
bool WithAudio(void) const
#define NTV2_IS_VALID_INPUT_SOURCE(_inpSrc_)
Definition: ntv2enums.h:1284
Identifies the 7th SDI video input.
Definition: ntv2enums.h:1275
static const size_t CIRCULAR_BUFFER_SIZE(10)
Number of NTV2FrameData&#39;s in our ring.
virtual bool SetSDIWatchdogTimeout(const ULWord inValue)
Specifies the amount of time that must elapse before the watchdog timer times out.
virtual AJAStatus Attach(AJAThreadFunction *pThreadFunction, void *pUserContext)
Definition: thread.cpp:169
FrameDataPtr StartProduceNextBuffer(void)
The thread that&#39;s responsible for providing frames – the producer – calls this function to populate...
NTV2OutputCrosspointID
Identifies a widget output, a signal source, that potentially can drive another widget&#39;s input (ident...
Definition: ntv2enums.h:2527
NTV2InputCrosspointID
Identifies a widget input that potentially can accept a signal emitted from another widget&#39;s output (...
Definition: ntv2enums.h:2752
Identifies the "normal" Field 2 ancillary data region.
Definition: ntv2enums.h:4230
bool fDoMultiFormat
If true, enables device-sharing; otherwise takes exclusive control of the device. ...
mFormatDesc
Definition: ntv2vcam.cpp:942
bool GetInputTimeCodes(NTV2TimeCodeList &outValues) const
Intended for capture, answers with the timecodes captured in my acTransferStatus member&#39;s acFrameStam...
bool WithAnc(void) const
This is returned from the CNTV2Card::AutoCirculateGetStatus function.
NTV2OutputXptID GetFrameStoreOutputXptFromChannel(const NTV2Channel inFrameStore, const bool inIsRGB=false, const bool inIs425=false)
NTV2WidgetID
Definition: ntv2enums.h:2909
NTV2ACFrameRange fInputFrames
Ingest frame count or range.
bool fSuppressVideo
If true, suppress video; otherwise include video.
uint16_t UWord
Definition: ajatypes.h:221
Specifies channel or FrameStore 1 (or the first item).
Definition: ntv2enums.h:1359
virtual bool AutoCirculateStart(const NTV2Channel inChannel, const ULWord64 inStartTime=0)
Starts AutoCirculating the specified channel that was previously initialized by CNTV2Card::AutoCircul...
bool CanDoFrameBufferFormat(const NTV2PixelFormat inPF)
ULWord appSignature(0)
virtual bool SubscribeOutputVerticalEvent(const NTV2Channel inChannel)
Causes me to be notified when an output vertical blanking interrupt is generated for the given output...
virtual bool AutoCirculateInitForOutput(const NTV2Channel inChannel, const UWord inFrameCount=7, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_INVALID, const ULWord inOptionFlags=0, const UByte inNumChannels=1, const UWord inStartFrameNumber=0, const UWord inEndFrameNumber=0)
Prepares for subsequent AutoCirculate playout, designating a contiguous block of frame buffers on the...
#define xHEX0N(__x__, __n__)
bool CanDoWidget(const NTV2WidgetID inWgtID)
TimecodeFormat
Definition: ntv2rp188.h:22
#define NTV2_IS_VALID_AUDIO_SYSTEM(__x__)
Definition: ntv2enums.h:3914
Identifies the 3rd HDMI video input.
Definition: ntv2enums.h:1267
bool SetAncBuffers(ULWord *pInANCBuffer, const ULWord inANCByteCount, ULWord *pInANCF2Buffer=NULL, const ULWord inANCF2ByteCount=0)
Sets my ancillary data buffers for use in a subsequent call to CNTV2Card::AutoCirculateTransfer.
std::string NTV2FrameBufferFormatToString(const NTV2FrameBufferFormat inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:6936
NTV2Channel ODstCh(void) const
AJA_EXPORT bool BurnTimeCode(void *pBaseVideoAddress, const std::string &inTimeCodeStr, const uint32_t inYPercent)
I encapsulate the video, audio and anc host buffers used in the AutoCirculate demos. I&#39;m a more modern version of the AVDataBuffer.
bool HasAvailableInputFrame(void) const
Specifies channel or FrameStore 4 (or the 4th item).
Definition: ntv2enums.h:1362
NTV2InputSource NTV2TimecodeIndexToInputSource(const NTV2TCIndex inTCIndex)
Converts the given NTV2TCIndex value into the appropriate NTV2InputSource value.
Definition: ntv2utils.cpp:4988
NTV2Channel fInputChannel
The input channel to use.
enum NTV2InputCrosspointID NTV2InputXptID
Specifies channel or FrameStore 5 (or the 5th item).
Definition: ntv2enums.h:1363
Identifies the first analog video input.
Definition: ntv2enums.h:1264
NTV2TCIndex fTimecodeSource
Timecode source to use.
bool GetRP188Reg(RP188_STRUCT &outRP188) const
Definition: ntv2rp188.cpp:1241
bool IsRunning(void) const
std::string ISrcStr(void) const
NTV2AudioSource NTV2InputSourceToAudioSource(const NTV2InputSource inInputSource)
Definition: ntv2utils.cpp:4901
virtual AJAStatus SetupVideo(void)
Sets up everything I need for capturing and playing video.
Definition: ntv2burn.cpp:159
Identifies the first field in time for an interlaced video frame, or the first and only field in a pr...
Definition: ntv2enums.h:1842
static size_t SetDefaultPageSize(void)
#define BURNFAIL(_expr_)
virtual bool DisableRP188Bypass(const NTV2Channel inSDIOutput)
Configures the SDI output&#39;s embedder to embed SMPTE 12M timecode specified in calls to CNTV2Card::Set...
This identifies the 2nd Audio System.
Definition: ntv2enums.h:3898
ULWord GetCapturedAncByteCount(const bool inField2=false) const
Specifies channel or FrameStore 6 (or the 6th item).
Definition: ntv2enums.h:1364
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
Definition: ntv2burn.cpp:72
virtual bool AutoCirculateInitForInput(const NTV2Channel inChannel, const UWord inFrameCount=7, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_INVALID, const ULWord inOptionFlags=0, const UByte inNumChannels=1, const UWord inStartFrameNumber=0, const UWord inEndFrameNumber=0)
Prepares for subsequent AutoCirculate ingest, designating a contiguous block of frame buffers on the ...
#define BURNINFO(_expr_)
#define AUTOCIRCULATE_WITH_RP188
Use this to AutoCirculate with RP188.
Specifies channel or FrameStore 7 (or the 7th item).
Definition: ntv2enums.h:1365
bool GetRP188Str(std::string &sRP188) const
Definition: ntv2rp188.cpp:918
Declares the AJAAncillaryList class.
bool SetAudioBuffer(ULWord *pInAudioBuffer, const ULWord inAudioByteCount)
Sets my audio buffer for use in a subsequent call to CNTV2Card::AutoCirculateTransfer.
virtual void PlayFrames(void)
Repeatedly plays out frames using AutoCirculate (until global quit flag set).
Definition: ntv2burn.cpp:581
virtual bool AnalogLTCInputHasTimecode(void)
Returns true if there is a valid LTC signal on my device&#39;s primary analog LTC input port; otherwise r...
Definition: ntv2burn.cpp:874
Identifies the 1st SDI video input.
Definition: ntv2enums.h:1269
#define PLDBG(_xpr_)
NTV2InputXptID GetSDIOutputInputXpt(const NTV2Channel inSDIOutput, const bool inIsDS2=false)
virtual bool SetVANCMode(const NTV2VANCMode inVancMode, const NTV2Channel inChannel=NTV2_CHANNEL1)
Sets the VANC mode for the given FrameStore.
virtual bool GetStreamingApplication(ULWord &outAppType, int32_t &outProcessID)
Answers with the four-CC type and process ID of the application that currently "owns" the AJA device ...
virtual bool SetNumberAudioChannels(const ULWord inNumChannels, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Sets the number of audio channels to be concurrently captured or played for a given Audio System on t...
Definition: ntv2audio.cpp:146
virtual void RouteOutputSignal(void)
Sets up board routing for playout.
Definition: ntv2burn.cpp:483
enum NTV2OutputCrosspointID NTV2OutputXptID
uint16_t GetStartFrame(void) const
NTV2OutputXptID GetCSCOutputXptFromChannel(const NTV2Channel inCSC, const bool inIsKey=false, const bool inIsRGB=false)
virtual bool WaitForInputVerticalInterrupt(const NTV2Channel inChannel=NTV2_CHANNEL1, UWord inRepeatCount=1)
Efficiently sleeps the calling thread/process until the next one or more field (interlaced video) or ...
bool WithVideo(void) const
#define NTV2_ANCSIZE_MAX
This identifies the mode in which there are no VANC lines in the frame buffer.
Definition: ntv2enums.h:3799
bool SetVideoBuffer(ULWord *pInVideoBuffer, const ULWord inVideoByteCount)
Sets my video buffer for use in a subsequent call to CNTV2Card::AutoCirculateTransfer.
Specifies channel or FrameStore 3 (or the 3rd item).
Definition: ntv2enums.h:1361
bool ODstIsSDI(void) const
See 8-Bit YCbCr Format.
Definition: ntv2enums.h:223
virtual AJAStatus SetupHostBuffers(void)
Sets up my circular buffers.
Definition: ntv2burn.cpp:388
NTV2InputSource fInputSource
The device input connector to use.
virtual bool EnableChannel(const NTV2Channel inChannel)
Enables the given FrameStore.