AJA NTV2 SDK  18.1.0.2439
NTV2 SDK 18.1.0.2439
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()),
37  mSavedTaskMode (NTV2_DISABLE_TASKS),
38  mAudioSystem (inConfig.WithAudio() ? ::NTV2InputSourceToAudioSystem(inConfig.fInputSource) : NTV2_AUDIOSYSTEM_INVALID),
39  mGlobalQuit (false)
40 {
41 } // constructor
42 
43 
45 {
46  Quit(); // Stop my capture and playout threads, then destroy them
47  mDevice.UnsubscribeInputVerticalEvent(mConfig.fInputChannel); // Unsubscribe from input VBI event
48 } // destructor
49 
50 
51 void NTV2Burn::Quit (void)
52 {
53  // Set the global 'quit' flag, and wait for the threads to go inactive...
54  mGlobalQuit = true;
55 
56  while (mPlayThread.Active())
57  AJATime::Sleep(10);
58 
59  while (mCaptureThread.Active())
60  AJATime::Sleep(10);
61 
62  if (!mConfig.fDoMultiFormat)
63  { // Release the device...
65  if (NTV2_IS_VALID_TASK_MODE(mSavedTaskMode))
66  mDevice.SetTaskMode(mSavedTaskMode); // Restore prior task mode
67  }
68 } // Quit
69 
70 
72 {
74 
75  // Open the device...
77  { if (aja::lower(mConfig.fDeviceSpec) != "list" && mConfig.fDeviceSpec != "?")
78  cerr << "## ERROR: Device '" << mConfig.fDeviceSpec << "' not found" << endl;
79  return AJA_STATUS_OPEN;
80  }
81  if (!mDevice.IsDeviceReady(false))
82  {cerr << "## ERROR: '" << mDevice.GetDescription() << "' not ready" << endl; return AJA_STATUS_INITIALIZE;}
83  if (!mDevice.features().CanDoCapture())
84  {cerr << "## ERROR: '" << mDevice.GetDescription() << "' cannot capture" << endl; return AJA_STATUS_FEATURE;}
85  if (!mDevice.features().CanDoPlayback())
86  {cerr << "## ERROR: '" << mDevice.GetDescription() << "' cannot playout" << endl; return AJA_STATUS_FEATURE;}
87 
88  ULWord appSignature (0);
89  int32_t appPID (0);
90  mDevice.GetStreamingApplication (appSignature, appPID); // Who currently "owns" the device?
91  mDevice.GetTaskMode(mSavedTaskMode); // Save the current device state
92  if (!mConfig.fDoMultiFormat)
93  {
95  {
96  cerr << "## ERROR: Unable to acquire '" << mDevice.GetDescription() << "' because another app (pid " << appPID << ") owns it" << endl;
97  return AJA_STATUS_BUSY; // Some other app is using the device
98  }
99  mDevice.ClearRouting(); // Clear the current device routing (since I "own" the device)
100  }
101  mDevice.SetTaskMode(NTV2_OEM_TASKS); // Force OEM tasks
102 
103  // Configure the SDI relays if present
104  if (mDevice.features().HasSDIRelays())
105  {
106  // Note that if the board's jumpers are not set in the position
107  // to enable the watchdog timer, these calls will have no effect.
108  mDevice.SetSDIWatchdogEnable(true, 0); // SDI 1/2
109  mDevice.SetSDIWatchdogEnable(true, 1); // SDI 3/4
110 
111  // Set timeout delay to 2 seconds expressed in multiples of 8 ns
112  // and take the relays out of bypass...
113  mDevice.SetSDIWatchdogTimeout(2 * 125000000);
114  mDevice.KickSDIWatchdog();
115 
116  // Give the mechanical relays some time to switch...
117  AJATime::Sleep(500);
118  }
119 
120  // Make sure the device actually supports custom anc before using it...
121  if (mConfig.WithAnc())
122  mConfig.fWithAnc = mDevice.features().CanDoCustomAnc();
123 
124  // Set up the video and audio...
125  status = SetupVideo();
126  if (AJA_FAILURE(status))
127  return status;
128  status = mConfig.WithAudio() ? SetupAudio() : AJA_STATUS_SUCCESS;
129  if (AJA_FAILURE(status))
130  return status;
131 
132  // Set up the circular buffers...
133  status = SetupHostBuffers();
134  if (AJA_FAILURE(status))
135  return status;
136 
137  // Set up the signal routing...
140 
141  // Lastly, prepare my AJATimeCodeBurn instance...
143  // Ready to go...
144  if (mConfig.IsVerbose() || sShowConfig)
145  { cerr << mConfig
146  << "Device Description: " << mDevice.GetDescription() << endl
147  << endl;
148  }
149  BURNINFO("Configuration: " << mConfig);
150  return AJA_STATUS_SUCCESS;
151 
152 } // Init
153 
154 
156 {
157  // If no input source specified, choose a default...
159  {
161  if (mConfig.IsVerbose())
162  cout << "## NOTE: Input source was not specified, will use " << mConfig.ISrcStr() << endl;
163  }
164 
165  // Does this device have the requested input source?
166  if (!mDevice.features().CanDoInputSource(mConfig.fInputSource))
167  {cerr << "## ERROR: Device does not have input source " << mConfig.ISrcStr() << endl; return AJA_STATUS_BAD_PARAM;}
168 
169  // The input channel should match the input source...
171  if (mConfig.IsVerbose())
172  cout << "## NOTE: Input FrameStore chosen to be " << mConfig.IChStr() << endl;
173 
174  // Subscribe interrupts...
177 
178  // Flip the input spigot to "receive" if necessary...
179  bool isXmit (false);
180  if (mDevice.features().HasBiDirectionalSDI() // If device has bidirectional SDI connectors...
181  && mConfig.ISrcIsSDI() // ...and desired input source is SDI...
182  && mDevice.GetSDITransmitEnable (mConfig.fInputChannel, isXmit) // ...and GetSDITransmitEnable succeeds...
183  && isXmit) // ...and input is set to "transmit"...
184  {
185  mDevice.SetSDITransmitEnable (mConfig.fInputChannel, false); // ...then disable transmit mode...
186  mDevice.WaitForOutputVerticalInterrupt (NTV2_CHANNEL1, 10); // ...and give device time to lock to input
187  } // if input SDI connector needs to switch from transmit mode
188 
189  // Is there an input signal? What format is it?
190  mVideoFormat = mDevice.GetInputVideoFormat(mConfig.fInputSource);
192  {cerr << "## ERROR: No signal at input " << mConfig.ISrcStr() << endl; return AJA_STATUS_NOINPUT;}
193  if (mConfig.IsVerbose())
194  cout << "## NOTE: Signal at input " << mConfig.ISrcStr() << " is " << ::NTV2VideoFormatToString(mVideoFormat, true) << endl;
195 
196  // Free-run the device clock, since E-to-E mode isn't used, nor is a mixer tied to the input...
198 
199  // Check the timecode source...
201  {
202  const NTV2Channel tcChannel (::NTV2TimecodeIndexToChannel(mConfig.fTimecodeSource));
203  const NTV2Channel endNum (NTV2Channel (mDevice.features().GetNumVideoChannels()));
204  if (tcChannel >= endNum)
205  {cerr << "## ERROR: Timecode source '" << ::NTV2TCIndexToString(mConfig.fTimecodeSource, true) << "' illegal on this device" << endl; return AJA_STATUS_BAD_PARAM;}
206  if (tcChannel == mConfig.fOutputChannel)
207  {cerr << "## ERROR: Timecode source '" << ::NTV2TCIndexToString(mConfig.fTimecodeSource, true) << "' conflicts with output channel" << endl; return AJA_STATUS_BAD_PARAM;}
208  if (mDevice.features().HasBiDirectionalSDI() // If device has bidirectional SDI connectors...
209  && mDevice.GetSDITransmitEnable (tcChannel, isXmit) // ...and GetSDITransmitEnable succeeds...
210  && isXmit) // ...and the SDI timecode source is set to "transmit"...
211  {
212  mDevice.SetSDITransmitEnable (tcChannel, false); // ...then disable transmit mode...
213  mDevice.WaitForInputVerticalInterrupt(tcChannel, 12); // ...and allow device to lock to input signal
214  } // if SDI must switch from transmit to receive
215 
216  // Configure for VITC capture
217  mDevice.SetRP188SourceFilter(tcChannel, 0x01);
218 
219  const NTV2VideoFormat tcInputVideoFormat (mDevice.GetInputVideoFormat (::NTV2TimecodeIndexToInputSource(mConfig.fTimecodeSource)));
220  if (tcInputVideoFormat == NTV2_FORMAT_UNKNOWN)
221  cerr << "## WARNING: Timecode source '" << ::NTV2TCIndexToString(mConfig.fTimecodeSource, true) << "' has no input signal" << endl;
222  if (!InputSignalHasTimecode())
223  cerr << "## WARNING: Timecode source '" << ::NTV2TCIndexToString(mConfig.fTimecodeSource, true) << "' has no embedded timecode" << endl;
224  }
226  cerr << "## WARNING: Timecode source '" << ::NTV2TCIndexToString(mConfig.fTimecodeSource, true) << "' has no embedded timecode" << endl;
227 
229  mDevice.SetLTCInputEnable(true); // Enable analog LTC input (some LTC inputs are shared with reference input)
230  mDevice.DisableRP188Bypass (::NTV2InputSourceToChannel(mConfig.fInputSource)); // AutoCirculate will drive timecode output
231 
232  // Final pre-flight checks...
233  if (!mDevice.features().CanDoFrameBufferFormat(mConfig.fPixelFormat))
234  {cerr << "## ERROR: " << ::NTV2FrameBufferFormatToString(mConfig.fPixelFormat) << " unsupported" << endl; return AJA_STATUS_UNSUPPORTED;}
235  if (mFormatDesc.IsPlanar())
236  {cerr << "## ERROR: This demo doesn't work with planar pixel formats" << endl; return AJA_STATUS_UNSUPPORTED;}
237  if (mFormatDesc.IsSD() && mConfig.WithTallVANC() && mConfig.fPixelFormat == NTV2_FBF_8BIT_YCBCR)
238  {cerr << "## ERROR: NTV2_VANCDATA_8BITSHIFT_ENABLE unsupported in firmware for SD video" << endl; return AJA_STATUS_UNSUPPORTED;}
239  if (mConfig.WithTallVANC() && mConfig.fPixelFormat != NTV2_FBF_8BIT_YCBCR && mConfig.fPixelFormat != NTV2_FBF_10BIT_YCBCR)
240  {cerr << "## ERROR: Tall-frame VANC requires NTV2_FBF_8BIT_YCBCR or NTV2_FBF_10BIT_YCBCR pixel format" << endl; return AJA_STATUS_UNSUPPORTED;}
241  if (mConfig.WithTallVANC() && (mFormatDesc.Is4K() || mFormatDesc.Is8K()))
242  {cerr << "## ERROR: Tall-frame VANC unsupported for 4K or 8K video" << endl; return AJA_STATUS_UNSUPPORTED;}
243 
244  // If the device supports different per-channel video formats, configure it as requested...
245  if (mDevice.features().CanDoMultiFormat())
246  mDevice.SetMultiFormatMode(mConfig.fDoMultiFormat);
247 
248  // Get the raster description...
251 
252  // Configure the input FrameStore...
253  mDevice.EnableChannel (mConfig.fInputChannel);
254  mDevice.SetVideoFormat (mVideoFormat, false, false, mDevice.features().CanDoMultiFormat() ? mConfig.fInputChannel : NTV2_CHANNEL1);
255  mDevice.SetFrameBufferFormat (mConfig.fInputChannel, mConfig.fPixelFormat);
257  mDevice.SetVANCShiftMode (mConfig.fInputChannel, ::Is8BitFrameBufferFormat(mConfig.fPixelFormat) && mConfig.WithTallVANC()
259 
260  // Choose an output channel/FrameStore, and enable it...
261  const UWord numFrameStores (mDevice.features().GetNumFrameStores());
262  switch (mConfig.fInputSource)
263  {
264  case NTV2_INPUTSOURCE_SDI1: mConfig.fOutputChannel = numFrameStores > 4 ? NTV2_CHANNEL2 : (numFrameStores == 2 ? NTV2_CHANNEL2 : NTV2_CHANNEL3);
265  break;
266 
268  case NTV2_INPUTSOURCE_SDI2: mConfig.fOutputChannel = numFrameStores > 4 ? NTV2_CHANNEL3 : NTV2_CHANNEL4;
269  break;
270 
273  break;
274 
276  case NTV2_INPUTSOURCE_SDI4: mConfig.fOutputChannel = numFrameStores > 4 ? NTV2_CHANNEL5 : NTV2_CHANNEL3;
277  break;
278 
279  case NTV2_INPUTSOURCE_SDI5: mConfig.fOutputChannel = NTV2_CHANNEL6; break;
280  case NTV2_INPUTSOURCE_SDI6: mConfig.fOutputChannel = NTV2_CHANNEL7; break;
281  case NTV2_INPUTSOURCE_SDI7: mConfig.fOutputChannel = NTV2_CHANNEL8; break;
282  case NTV2_INPUTSOURCE_SDI8: mConfig.fOutputChannel = NTV2_CHANNEL7; break;
283 
285  case NTV2_INPUTSOURCE_HDMI1: mConfig.fOutputChannel = numFrameStores < 3 ? NTV2_CHANNEL2 : NTV2_CHANNEL3;
286  mAudioSystem = NTV2_AUDIOSYSTEM_2;
287  break;
288  default:
289  case NTV2_INPUTSOURCE_INVALID: cerr << "## ERROR: Bad input source" << endl; return AJA_STATUS_BAD_PARAM;
290  }
291  if (mConfig.IsVerbose())
292  cout << "## NOTE: Output FrameStore chosen to be " << mConfig.OChStr() << endl;
294  {
296  if (NTV2_IS_VALID_CHANNEL(mConfig.ODstCh()))
297  if (mConfig.ODstCh() != mConfig.fOutputChannel)
298  if (mConfig.WithAnc() && !mConfig.WithTallVANC())
299  {
300  const string oldChStr(mConfig.OChStr());
301  mConfig.fOutputChannel = mConfig.ODstCh();
302  if (mConfig.IsVerbose())
303  cout << "## NOTE: Output " << mConfig.ODstStr() << " with Anc forced FrameStore change to "
304  << mConfig.OChStr() << " from " << oldChStr << endl;
305  }
306  }
307  else // else output destination not specified
308  { // Pick an appropriate output spigot based on the output channel...
311  { // If device has only one SDI output
313  if (mConfig.IsVerbose())
314  cout << "## NOTE: Output destination was not specified, will use " << mConfig.ODstStr() << endl;
315  }
316  }
317  if (mDevice.features().HasBiDirectionalSDI() // If device has bidirectional SDI connectors...
318  && mConfig.ODstIsSDI()) // ...and output destination is SDI...
319  mDevice.SetSDITransmitEnable (mConfig.ODstCh(), true); // ...then enable transmit mode
320  if (mConfig.fInputChannel == mConfig.fOutputChannel)
321  {cerr << "## ERROR: Input " << mConfig.IChStr() << " & output " << mConfig.OChStr() << " conflict" << endl; return AJA_STATUS_BAD_PARAM;}
322  if (mDevice.features().HasBiDirectionalSDI() && mConfig.ISrcIsSDI() && mConfig.ODstIsSDI() && mConfig.ISrcCh() == mConfig.ODstCh())
323  {cerr << "## ERROR: SDI conflict: input " << mConfig.ISrcStr() << " & output " << mConfig.ODstStr() << " are same connector" << endl; return AJA_STATUS_BAD_PARAM;}
324 
325  // Configure the output FrameStore...
326  mDevice.EnableChannel(mConfig.fOutputChannel);
327  mDevice.SetVideoFormat (mVideoFormat, false, false, mConfig.fOutputChannel);
328  mDevice.SetFrameBufferFormat (mConfig.fOutputChannel, mConfig.fPixelFormat);
330  mDevice.SetVANCShiftMode (mConfig.fOutputChannel, ::Is8BitFrameBufferFormat(mConfig.fPixelFormat) && mConfig.WithTallVANC()
332  return AJA_STATUS_SUCCESS;
333 
334 } // SetupVideo
335 
336 
338 {
339  if (!NTV2_IS_VALID_AUDIO_SYSTEM(mAudioSystem))
340  return AJA_STATUS_SUCCESS;
341 
342  // Have the audio subsystem capture audio from the designated input source...
343  mDevice.SetAudioSystemInputSource (mAudioSystem, ::NTV2InputSourceToAudioSource(mConfig.fInputSource),
345 
346  // It's best to use all available audio channels...
347  mDevice.SetNumberAudioChannels (mDevice.features().GetMaxAudioChannels(), mAudioSystem);
348 
349  // Assume 48kHz PCM...
350  mDevice.SetAudioRate (NTV2_AUDIO_48K, mAudioSystem);
351 
352  // 4MB device audio buffers work best...
353  mDevice.SetAudioBufferSize (NTV2_AUDIO_BUFFER_BIG, mAudioSystem);
354 
355  // Set up the output audio embedders...
356  if (mDevice.features().GetNumAudioSystems() > 1)
357  {
358  // Some devices, like the Kona1, have 2 FrameStores but only 1 SDI output,
359  // which makes mConfig.fOutputChannel == NTV2_CHANNEL2, but need SDIoutput to be NTV2_CHANNEL1...
360  UWord SDIoutput(mConfig.fOutputChannel);
361  if (SDIoutput >= mDevice.features().GetNumVideoOutputs())
362  SDIoutput = mDevice.features().GetNumVideoOutputs() - 1;
363  mDevice.SetSDIOutputAudioSystem (NTV2Channel(SDIoutput), mAudioSystem);
364 
365  if (mDevice.features().GetNumHDMIVideoOutputs() > 0)
367  }
368 
369  //
370  // Loopback mode plays whatever audio appears in the input signal when it's
371  // connected directly to an output (i.e., "end-to-end" mode). If loopback is
372  // left enabled, the video will lag the audio as video frames get briefly delayed
373  // in our ring buffer. Audio, therefore, needs to come out of the (buffered) frame
374  // data being played, so loopback must be turned off...
375  //
376  mDevice.SetAudioLoopBack (NTV2_AUDIO_LOOPBACK_OFF, mAudioSystem);
377  return AJA_STATUS_SUCCESS;
378 
379 } // SetupAudio
380 
381 
383 {
384  CNTV2DemoCommon::SetDefaultPageSize(); // Set host-specific page size
385 
386  // Let my circular buffer know when it's time to quit...
387  mFrameDataRing.SetAbortFlag (&mGlobalQuit);
388 
389  // Determine video buffer size...
390  const ULWord vidBuffSizeBytes (mFormatDesc.GetVideoWriteSize(ULWord(NTV2Buffer::DefaultPageSize())));
391 
392  // Determine per-field max Anc buffer size...
393  ULWord ancBuffSizeBytes (0);
394  if (!mDevice.GetAncRegionOffsetFromBottom (ancBuffSizeBytes, NTV2_AncRgn_Field2))
395  ancBuffSizeBytes = NTV2_ANCSIZE_MAX;
396 
397  // Allocate and add each in-host NTV2FrameData to my mFrameDataRing...
398  mHostBuffers.reserve(CIRCULAR_BUFFER_SIZE);
399  while (mHostBuffers.size() < CIRCULAR_BUFFER_SIZE)
400  {
401  mHostBuffers.push_back(NTV2FrameData()); // Make a new NTV2FrameData...
402  NTV2FrameData & frameData (mHostBuffers.back()); // ...and get a reference to it
403 
404  // Allocate a page-aligned video buffer (if handling video)...
405  if (!mConfig.fSuppressVideo)
406  if (!frameData.fVideoBuffer.Allocate (vidBuffSizeBytes, /*pageAligned*/true))
407  {
408  BURNFAIL("Failed to allocate " << xHEX0N(vidBuffSizeBytes,8) << "-byte video buffer");
409  return AJA_STATUS_MEMORY;
410  }
411  #ifdef NTV2_BUFFER_LOCKING
412  if (frameData.fVideoBuffer)
413  mDevice.DMABufferLock(frameData.fVideoBuffer, true);
414  #endif
415 
416  // Allocate a page-aligned audio buffer (if handling audio)...
417  if (NTV2_IS_VALID_AUDIO_SYSTEM(mAudioSystem) && mConfig.WithAudio())
418  if (!frameData.fAudioBuffer.Allocate (NTV2_AUDIOSIZE_MAX, /*pageAligned*/true))
419  {
420  BURNFAIL("Failed to allocate " << xHEX0N(NTV2_AUDIOSIZE_MAX,8) << "-byte audio buffer");
421  return AJA_STATUS_MEMORY;
422  }
423  if (frameData.AudioBuffer())
424  frameData.fAudioBuffer.Fill(ULWord(0));
425 
426  if (mConfig.WithAnc() && !mConfig.WithTallVANC())
427  { // Allocate page-aligned anc buffers...
428  if (!frameData.fAncBuffer.Allocate (ancBuffSizeBytes, /*pageAligned*/true))
429  {
430  BURNFAIL("Failed to allocate " << xHEX0N(ancBuffSizeBytes,8) << "-byte anc buffer");
431  return AJA_STATUS_MEMORY;
432  }
434  if (!frameData.fAncBuffer2.Allocate(ancBuffSizeBytes, /*pageAligned*/true))
435  {
436  BURNFAIL("Failed to allocate " << xHEX0N(ancBuffSizeBytes,8) << "-byte F2 anc buffer");
437  return AJA_STATUS_MEMORY;
438  }
439  }
440  if (frameData.AncBuffer())
441  frameData.AncBuffer().Fill(ULWord(0));
442  if (frameData.AncBuffer2())
443  frameData.AncBuffer2().Fill(ULWord(0));
444 
445  // Add this NTV2FrameData to the ring...
446  mFrameDataRing.Add(&frameData);
447  } // for each NTV2FrameData
448 
449  return AJA_STATUS_SUCCESS;
450 
451 } // SetupHostBuffers
452 
453 
455 {
456  const NTV2OutputCrosspointID inputOutputXpt (::GetInputSourceOutputXpt(mConfig.fInputSource));
458  const bool isRGB (::IsRGBFormat(mConfig.fPixelFormat));
459 
460  if (isRGB)
461  {
462  // If the frame buffer is configured for RGB pixel format, incoming YUV must be converted.
463  // This routes the video signal from the input through a color space converter before
464  // connecting to the RGB frame buffer...
465  const NTV2InputCrosspointID cscVideoInputXpt (::GetCSCInputXptFromChannel (mConfig.fInputChannel));
466  const NTV2OutputCrosspointID cscOutputXpt (::GetCSCOutputXptFromChannel (mConfig.fInputChannel, false/*isKey*/, true/*isRGB*/));
467 
468  mDevice.Connect (cscVideoInputXpt, inputOutputXpt); // Connect the CSC's video input to the input spigot's output
469  mDevice.Connect (fbInputXpt, cscOutputXpt); // Connect the frame store's input to the CSC's output
470  }
471  else
472  mDevice.Connect (fbInputXpt, inputOutputXpt); // Route the YCbCr signal directly from the input to the frame buffer's input
473 
474 } // RouteInputSignal
475 
476 
478 {
479  const NTV2InputXptID outputInputXpt (::GetOutputDestInputXpt(mConfig.fOutputDest));
481  const bool isRGB (::IsRGBFormat(mConfig.fPixelFormat));
482  NTV2OutputXptID outputXpt (fbOutputXpt);
483 
484  if (isRGB)
485  {
486  const NTV2OutputXptID cscVidOutputXpt (::GetCSCOutputXptFromChannel(mConfig.fOutputChannel)); // Use CSC's YUV video output
487  const NTV2InputXptID cscVidInputXpt (::GetCSCInputXptFromChannel(mConfig.fOutputChannel));
488 
489  mDevice.Connect (cscVidInputXpt, fbOutputXpt); // Connect the CSC's video input to the frame store's output
490  mDevice.Connect (outputInputXpt, cscVidOutputXpt); // Connect the SDI output's input to the CSC's video output
491  outputXpt = cscVidOutputXpt;
492  }
493  else
494  mDevice.Connect (outputInputXpt, outputXpt);
495 
496  mTCOutputs.clear ();
497  mTCOutputs.insert (::NTV2ChannelToTimecodeIndex(mConfig.fOutputChannel));
498 
499  if (!mConfig.fDoMultiFormat)
500  {
501  // Route all SDI outputs to the outputXpt...
502  const NTV2Channel startNum (NTV2_CHANNEL1);
503  const NTV2Channel endNum (NTV2Channel(mDevice.features().GetNumVideoChannels()));
505  NTV2WidgetID outputWidgetID (NTV2_WIDGET_INVALID);
506 
507  for (NTV2Channel chan (startNum); chan < endNum; chan = NTV2Channel (chan + 1))
508  {
509  if (chan == mConfig.fInputChannel || chan == mConfig.fOutputChannel)
510  continue; // Skip the input & output channel, already routed
511  if (NTV2_IS_VALID_CHANNEL (tcInputChannel) && chan == tcInputChannel)
512  continue; // Skip the timecode input channel
513  if (mDevice.features().HasBiDirectionalSDI())
514  mDevice.SetSDITransmitEnable (chan, true);
515  if (CNTV2SignalRouter::GetWidgetForInput (::GetSDIOutputInputXpt (chan, mDevice.features().CanDoDualLink()), outputWidgetID, mDevice.GetDeviceID()))
516  if (mDevice.features().CanDoWidget(outputWidgetID))
517  {
518  mDevice.Connect (::GetSDIOutputInputXpt (chan), outputXpt);
519  mTCOutputs.insert (::NTV2ChannelToTimecodeIndex (chan));
520  mTCOutputs.insert (::NTV2ChannelToTimecodeIndex (chan, true));
521  }
522  } // for each output spigot
523 
524  // If HDMI and/or analog video outputs are available, route them, too...
525  if (mDevice.features().GetNumHDMIVideoOutputs() > 0)
526  mDevice.Connect (NTV2_XptHDMIOutQ1Input, outputXpt); // Route the output signal to the HDMI output
527  if (mDevice.features().CanDoWidget(NTV2_WgtAnalogOut1))
528  mDevice.Connect (NTV2_XptAnalogOutInput, outputXpt); // Route the output signal to the Analog output
529  if (mDevice.features().CanDoWidget(NTV2_WgtSDIMonOut1))
530  mDevice.Connect (::GetSDIOutputInputXpt (NTV2_CHANNEL5), outputXpt); // Route the output signal to the SDI monitor output
531  } // if not multiChannel
532  PLDBG(mTCOutputs.size() << " timecode destination(s): " << mTCOutputs);
533 
534 } // RouteOutputSignal
535 
536 
538 {
539  // Start the playout and capture threads...
540  StartPlayThread();
542  return AJA_STATUS_SUCCESS;
543 
544 } // Run
545 
546 
547 
549 
550 // This is where we will start the play thread
552 {
553  // Create and start the playout thread...
554  mPlayThread.Attach(PlayThreadStatic, this);
556  mPlayThread.Start();
557 
558 } // StartPlayThread
559 
560 
561 // The playout thread function
562 void NTV2Burn::PlayThreadStatic (AJAThread * pThread, void * pContext) // static
563 { (void) pThread;
564  // Grab the NTV2Burn instance pointer from the pContext parameter,
565  // then call its PlayFrames method...
566  NTV2Burn * pApp (reinterpret_cast<NTV2Burn*>(pContext));
567  pApp->PlayFrames();
568 
569 } // PlayThreadStatic
570 
571 
573 {
574  const ULWord acOptions (AUTOCIRCULATE_WITH_RP188
575  | (mConfig.WithAnc() && !mConfig.WithTallVANC() ? AUTOCIRCULATE_WITH_ANC : 0));
576  ULWord goodXfers(0), badXfers(0), starves(0), noRoomWaits(0), startFrm(3);
577  AUTOCIRCULATE_TRANSFER outputXferInfo;
578  AUTOCIRCULATE_STATUS outputStatus;
579 
580  // Stop AutoCirculate on this channel, just in case some other app left it running...
581  mDevice.AutoCirculateStop(mConfig.fOutputChannel);
582  mDevice.WaitForOutputVerticalInterrupt(mConfig.fOutputChannel, 4); // Let it stop
583  BURNNOTE("Thread started");
584 
585  // Initialize AutoCirculate...
586  if (!mDevice.AutoCirculateInitForOutput (mConfig.fOutputChannel, mConfig.fOutputFrames, mAudioSystem, acOptions))
587  {BURNFAIL("AutoCirculateInitForOutput failed"); mGlobalQuit = true;}
588  else if (!mConfig.WithVideo())
589  { // Video suppressed --
590  // Clear device frame buffers being AutoCirculated (prevent garbage output frames)
591  NTV2Buffer tmpFrame (mFormatDesc.GetVideoWriteSize());
592  NTV2TestPatternGen blackPatternGen;
593  blackPatternGen.DrawTestPattern (NTV2_TestPatt_Black, mFormatDesc, tmpFrame);
594  mDevice.AutoCirculateGetStatus (mConfig.fOutputChannel, outputStatus);
595  for (uint16_t frmNum(outputStatus.GetStartFrame()); frmNum <= outputStatus.GetEndFrame(); frmNum++)
596  mDevice.DMAWriteFrame(ULWord(frmNum), tmpFrame, mFormatDesc.GetTotalBytes(), mConfig.fOutputChannel);
597  } // else if --novideo
598  if (!mGlobalQuit && mDevice.AutoCirculateGetStatus (mConfig.fOutputChannel, outputStatus))
599  { startFrm = outputStatus.GetFrameCount() - 1;
600  if (startFrm > 3)
601  startFrm = 3;
602  }
603 
604  while (!mGlobalQuit)
605  {
606  mDevice.AutoCirculateGetStatus (mConfig.fOutputChannel, outputStatus);
607 
608  // Check if there's room for another frame on the card...
609  if (outputStatus.CanAcceptMoreOutputFrames())
610  {
611  // Device has at least one free frame buffer that can be filled.
612  // Wait for the next frame in our ring to become ready to "consume"...
613  NTV2FrameData * pFrameData (mFrameDataRing.StartConsumeNextBuffer());
614  if (!pFrameData)
615  {starves++; continue;} // Producer thread isn't producing frames fast enough
616 
617  // Prepare to transfer this timecode-burned frame to the device for playout.
618  // Set the XferInfo struct's video, audio and anc buffers from playData's buffers...
619  if (pFrameData->VideoBuffer())
620  outputXferInfo.SetVideoBuffer (pFrameData->VideoBuffer(), pFrameData->VideoBufferSize());
621  if (pFrameData->AudioBuffer())
622  outputXferInfo.SetAudioBuffer (pFrameData->AudioBuffer(), pFrameData->NumCapturedAudioBytes());
623  if (pFrameData->AncBuffer() || pFrameData->AncBuffer2())
624  outputXferInfo.SetAncBuffers (pFrameData->AncBuffer(), pFrameData->AncBufferSize(), pFrameData->AncBuffer2(), pFrameData->AncBuffer2Size());
625 
626  // Tell AutoCirculate to embed this frame's timecode(s) into the SDI output(s)...
627  outputXferInfo.SetOutputTimeCodes(pFrameData->fTimecodes);
628  PLDBG(pFrameData->fTimecodes);
629 
630  // Transfer the frame to the device for eventual playout...
631  if (mDevice.AutoCirculateTransfer (mConfig.fOutputChannel, outputXferInfo))
632  { if (++goodXfers == startFrm)
633  mDevice.AutoCirculateStart(mConfig.fOutputChannel);
634  }
635  else
636  badXfers++;
637 
638  // Signal that the frame has been "consumed"...
639  mFrameDataRing.EndConsumeNextBuffer ();
640  continue; // Back to top of while loop
641  } // if CanAcceptMoreOutputFrames
642 
643  // Wait for one or more buffers to become available on the device, which should occur at next VBI...
644  noRoomWaits++;
646  } // loop til quit signaled
647 
648  // Stop AutoCirculate...
649  mDevice.AutoCirculateStop(mConfig.fOutputChannel);
650  BURNNOTE("Thread completed: " << DEC(goodXfers) << " xfers, " << DEC(badXfers) << " failed, "
651  << DEC(starves) << " ring starves, " << DEC(noRoomWaits) << " device starves");
652 } // PlayFrames
653 
654 
656 
657 
658 
660 //
661 // This is where the capture thread gets started
662 //
664 {
665  // Create and start the capture thread...
666  mCaptureThread.Attach(CaptureThreadStatic, this);
667  mCaptureThread.SetPriority(AJA_ThreadPriority_High);
668  mCaptureThread.Start();
669 
670 } // StartCaptureThread
671 
672 
673 //
674 // The static capture thread function
675 //
676 void NTV2Burn::CaptureThreadStatic (AJAThread * pThread, void * pContext) // static
677 { (void) pThread;
678  // Grab the NTV2Burn instance pointer from the pContext parameter,
679  // then call its CaptureFrames method...
680  NTV2Burn * pApp (reinterpret_cast<NTV2Burn*>(pContext));
681  pApp->CaptureFrames();
682 } // CaptureThreadStatic
683 
684 
685 //
686 // Repeatedly captures frames until told to stop
687 //
689 {
690  AUTOCIRCULATE_TRANSFER inputXferInfo;
691  const ULWord acOptions ((mConfig.WithTimecode() ? AUTOCIRCULATE_WITH_RP188 : 0)
692  | (mConfig.WithAnc() && !mConfig.WithTallVANC() ? AUTOCIRCULATE_WITH_ANC : 0));
693  ULWord goodXfers(0), badXfers(0), ringFulls(0), devWaits(0);
694  Bouncer<UWord> yPercent (85/*upperLimit*/, 1/*lowerLimit*/, 1/*startValue*/); // "Bounces" timecode up & down in raster
695  BURNNOTE("Thread started");
696 
697  // Stop AutoCirculate on this channel, just in case some other app left it running...
698  mDevice.AutoCirculateStop(mConfig.fInputChannel);
699 
700  // Initialize AutoCirculate...
701  if (!mDevice.AutoCirculateInitForInput (mConfig.fInputChannel, // channel
702  mConfig.fInputFrames, // frame count/range
703  mAudioSystem, // audio system
704  acOptions)) // flags
705  {BURNFAIL("AutoCirculateInitForInput failed"); mGlobalQuit = true;}
706  else
707  // Start AutoCirculate running...
708  mDevice.AutoCirculateStart (mConfig.fInputChannel);
709 
710  while (!mGlobalQuit)
711  {
712  AUTOCIRCULATE_STATUS acStatus;
713  mDevice.AutoCirculateGetStatus (mConfig.fInputChannel, acStatus);
714 
715  if (mDevice.features().HasSDIRelays())
716  mDevice.KickSDIWatchdog(); // Prevent watchdog from timing out and putting the relays into bypass mode
717 
718  if (acStatus.IsRunning() && acStatus.HasAvailableInputFrame())
719  {
720  // At this point, there's at least one fully-formed frame available in the device's frame buffer
721  // memory waiting to be transferred to the host. Reserve an NTV2FrameData to fill ("produce"),
722  // and use it in the next frame transferred from the device...
723  NTV2FrameData * pFrameData (mFrameDataRing.StartProduceNextBuffer ());
724  if (!pFrameData)
725  {ringFulls++; continue;} // Ring full -- consumer thread isn't consuming frames fast enough
726 
727  if (pFrameData->VideoBuffer())
728  inputXferInfo.SetVideoBuffer (pFrameData->VideoBuffer(), pFrameData->VideoBufferSize());
729  if (pFrameData->AudioBuffer())
730  inputXferInfo.SetAudioBuffer (pFrameData->AudioBuffer(), pFrameData->AudioBufferSize());
731  if (pFrameData->AncBuffer() || pFrameData->AncBuffer2())
732  inputXferInfo.SetAncBuffers (pFrameData->AncBuffer(), pFrameData->AncBufferSize(), pFrameData->AncBuffer2(), pFrameData->AncBuffer2Size());
733 
734  // Transfer the frame from the device into our host buffers...
735  if (mDevice.AutoCirculateTransfer (mConfig.fInputChannel, inputXferInfo)) goodXfers++;
736  else badXfers++;
737 
738  // Remember the amount, in bytes, of captured audio & anc data...
739  pFrameData->fNumAudioBytes = pFrameData->AudioBuffer() ? inputXferInfo.GetCapturedAudioByteCount() : 0;
740  pFrameData->fNumAncBytes = pFrameData->AncBuffer() ? inputXferInfo.GetCapturedAncByteCount(false/*F1*/): 0;
741  pFrameData->fNumAnc2Bytes = pFrameData->AncBuffer2() ? inputXferInfo.GetCapturedAncByteCount(true/*F2*/) : 0;
742  if (pFrameData->AncBuffer())
743  { // Zero F1 anc buffer memory past last byte written by anc extractor
744  NTV2Buffer stale (pFrameData->fAncBuffer.GetHostAddress(pFrameData->fNumAncBytes),
745  pFrameData->fAncBuffer.GetByteCount() - pFrameData->fNumAncBytes);
746  stale.Fill(uint8_t(0));
747  }
748  if (pFrameData->AncBuffer2())
749  { // Zero F2 anc buffer memory past last byte written by anc extractor
750  NTV2Buffer stale (pFrameData->AncBuffer2().GetHostAddress(pFrameData->fNumAnc2Bytes),
751  pFrameData->AncBuffer2().GetByteCount() - pFrameData->fNumAnc2Bytes);
752  stale.Fill(uint8_t(0));
753  }
754 
755  if (pFrameData->AncBuffer() && !mConfig.WithHanc())
756  AJAAncList::StripNativeInserterGUMPPackets (pFrameData->AncBuffer(), pFrameData->AncBuffer());
757  if (pFrameData->AncBuffer2() && !mConfig.WithHanc())
758  AJAAncList::StripNativeInserterGUMPPackets (pFrameData->AncBuffer2(), pFrameData->AncBuffer2());
759 
760  // Determine which timecode value should be burned in to the video frame
761  string timeCodeString;
762  NTV2_RP188 timecodeValue;
764  {
765  // Use the embedded input time code...
766  mDevice.GetRP188Data (mConfig.fInputChannel, timecodeValue);
767  CRP188 inputRP188Info (timecodeValue);
768  inputRP188Info.GetRP188Str(timeCodeString);
769  }
771  {
772  // Use the analog input time code...
773  mDevice.ReadAnalogLTCInput (mConfig.fTimecodeSource == NTV2_TCINDEX_LTC1 ? 0 : 1, timecodeValue);
774  CRP188 analogRP188Info (timecodeValue);
775  analogRP188Info.GetRP188Str(timeCodeString);
776  }
777  else
778  {
779  // Invent a timecode (based on the number of frames procesed)...
781  const TimecodeFormat tcFormat (CNTV2DemoCommon::NTV2FrameRate2TimecodeFormat(ntv2FrameRate));
782  const CRP188 frameRP188Info (inputXferInfo.GetTransferStatus().GetProcessedFrameCount(), 0, 0, 10, tcFormat);
783 
784  frameRP188Info.GetRP188Reg(timecodeValue);
785  frameRP188Info.GetRP188Str(timeCodeString);
786  }
787 
788  // Get a timecode to use for burn-in...
789  NTV2_RP188 thisFrameTC;
790  inputXferInfo.GetInputTimeCodes (pFrameData->fTimecodes, mConfig.fInputChannel);
791  if (pFrameData->HasValidTimecode(mConfig.fTimecodeSource))
792  {
793  thisFrameTC = pFrameData->fTimecodes[mConfig.fTimecodeSource];
794  }
795  else
796  { // Invent a timecode (based on frame count)...
798  const TimecodeFormat tcFormat (CNTV2DemoCommon::NTV2FrameRate2TimecodeFormat(ntv2FrameRate));
799  const CRP188 inventedTC (inputXferInfo.GetTransferStatus().GetProcessedFrameCount(), 0, 0, 10, tcFormat);
800  inventedTC.GetRP188Reg(thisFrameTC);
801  }
802 
803  // While this NTV2FrameData's buffers are locked, "burn" timecode into the raster...
804  NTV2Buffer visibleRgn (mFormatDesc.GetTopVisibleRowAddress(pFrameData->VideoBuffer()),
805  mFormatDesc.GetVisibleRasterBytes());
806  mTCBurner.BurnTimeCode (visibleRgn, timeCodeString.c_str(), yPercent.Next());
807 
808  // Signal that we're done "producing" this frame, making it available for future "consumption"...
809  mFrameDataRing.EndProduceNextBuffer();
810  } // if A/C running and frame(s) are available for transfer
811  else
812  {
813  // Either AutoCirculate is not running, or there were no frames available on the device to transfer.
814  // Rather than waste CPU cycles spinning, waiting until a frame becomes available, it's far more
815  // efficient to wait for the next input vertical interrupt event to get signaled...
816  devWaits++;
817  mDevice.WaitForInputFieldID (NTV2_FIELD0, mConfig.fInputChannel);
818  }
819  } // loop til quit signaled
820 
821  // Stop AutoCirculate...
822  mDevice.AutoCirculateStop (mConfig.fInputChannel);
823  BURNNOTE("Thread completed: " << DEC(goodXfers) << " xfers, " << DEC(badXfers) << " failed, "
824  << DEC(ringFulls) << " ring full(s), " << DEC(devWaits) << " device waits");
825 
826 } // CaptureFrames
827 
828 
830 
831 
832 void NTV2Burn::GetStatus (AUTOCIRCULATE_STATUS & outInputStatus, AUTOCIRCULATE_STATUS & outOutputStatus)
833 {
834  mDevice.AutoCirculateGetStatus (mConfig.fInputChannel, outInputStatus);
835  mDevice.AutoCirculateGetStatus (mConfig.fOutputChannel, outOutputStatus);
836 
837 } // GetStatus
838 
839 
840 static ULWord GetRP188RegisterForInput (const NTV2InputSource inInputSource)
841 {
842  switch (inInputSource)
843  {
844  case NTV2_INPUTSOURCE_SDI1: return kRegRP188InOut1DBB; // reg 29
845  case NTV2_INPUTSOURCE_SDI2: return kRegRP188InOut2DBB; // reg 64
846  case NTV2_INPUTSOURCE_SDI3: return kRegRP188InOut3DBB; // reg 268
847  case NTV2_INPUTSOURCE_SDI4: return kRegRP188InOut4DBB; // reg 273
848  case NTV2_INPUTSOURCE_SDI5: return kRegRP188InOut5DBB; // reg 342
849  case NTV2_INPUTSOURCE_SDI6: return kRegRP188InOut6DBB; // reg 418
850  case NTV2_INPUTSOURCE_SDI7: return kRegRP188InOut7DBB; // reg 427
851  case NTV2_INPUTSOURCE_SDI8: return kRegRP188InOut8DBB; // reg 436
852  default: return 0;
853  } // switch on input source
854 
855 } // GetRP188RegisterForInput
856 
857 
859 {
860  const ULWord regNum (::GetRP188RegisterForInput(mConfig.fInputSource));
861  ULWord regValue(0);
862 
863  // Bit 16 of the RP188 DBB register will be set if there is timecode embedded in the input signal...
864  return regNum && mDevice.ReadRegister(regNum, regValue) && regValue & BIT(16);
865 
866 } // InputSignalHasTimecode
867 
868 
870 {
872  return false;
874  bool result(false);
875  mDevice.driverInterface().ReadRegister(kRegLTCStatusControl, result, regMask);
876  return result;
877 
878 } // AnalogLTCInputHasTimecode
NTV2Channel NTV2InputSourceToChannel(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2Channel value.
Definition: ntv2utils.cpp:5051
bool SetOutputTimeCodes(const NTV2TimeCodes &inValues)
Intended for playout, replaces the contents of my acOutputTimeCodes member.
The invalid video input.
Definition: ntv2enums.h:1281
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:1272
#define NTV2_IS_VALID_TASK_MODE(__m__)
Identifies the 5th SDI video input.
Definition: ntv2enums.h:1277
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:337
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:869
Specifies SDI input/output kinds.
Definition: ntv2enums.h:1296
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:676
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:4983
virtual bool SetAudioLoopBack(const NTV2AudioLoopBack inMode, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Enables or disables NTV2AudioLoopBack mode for the given NTV2AudioSystem.
Definition: ntv2audio.cpp:301
virtual void StartCaptureThread(void)
Starts my capture thread.
Definition: ntv2burn.cpp:663
std::string ODstStr(void) const
Specifies the device&#39;s internal clock.
Definition: ntv2enums.h:1464
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:5456
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:1270
#define NTV2_IS_SDI_TIMECODE_INDEX(__x__)
Definition: ntv2enums.h:4003
#define BIT(_x_)
Definition: ajatypes.h:496
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:226
ULWord GetCapturedAudioByteCount(void) const
virtual ~NTV2Burn()
Definition: ntv2burn.cpp:44
virtual bool IsDeviceReady(const bool inCheckValid=(0))
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
Identifies the 1st HDMI video input.
Definition: ntv2enums.h:1269
NTV2OutputDestination NTV2ChannelToOutputDestination(const NTV2Channel inChannel, const NTV2IOKinds inKinds=NTV2_IOKINDS_SDI)
Converts the given NTV2Channel value into its ordinary equivalent NTV2OutputDestination.
Definition: ntv2utils.cpp:5171
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:551
Declares the NTV2TestPatternGen class.
virtual bool SubscribeOutputVerticalEvent(const NTV2Channel inChannel=NTV2_CHANNEL1)
Causes me to be notified when an output vertical blanking interrupt is generated for the given output...
Definition: ntv2card.h:2763
NTV2EmbeddedAudioInput NTV2InputSourceToEmbeddedAudioInput(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2EmbeddedAudioInput value.
Definition: ntv2utils.cpp:4881
NTV2InputSource NTV2ChannelToInputSource(const NTV2Channel inChannel, const NTV2IOKinds inKinds=NTV2_IOKINDS_SDI)
Definition: ntv2utils.cpp:5136
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:5075
Declares the AJATime class.
virtual AJAStatus SetPriority(AJAThreadPriority priority)
Definition: thread.cpp:133
Analog LTC 2.
Definition: ntv2enums.h:3967
Specifies HDMI input/output kinds.
Definition: ntv2enums.h:1297
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:1351
This identifies the mode in which there are some + extra VANC lines in the frame buffer.
Definition: ntv2enums.h:3807
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:206
virtual AJAStatus Start()
Definition: thread.cpp:91
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:236
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:1361
mVideoFormat
Definition: ntv2vcam.cpp:801
Identifies the 8th SDI video input.
Definition: ntv2enums.h:1280
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 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:562
Identifies the 2nd SDI video input.
Definition: ntv2enums.h:1274
bool IsProgressivePicture(const NTV2VideoFormat format)
Definition: ntv2utils.cpp:5395
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:4966
#define NTV2_IS_ANALOG_TIMECODE_INDEX(__x__)
Definition: ntv2enums.h:3992
#define NTV2_AUDIOSIZE_MAX
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:486
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:416
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:6540
Analog LTC 1.
Definition: ntv2enums.h:3966
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:858
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)
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:51
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:1275
NTV2InputXptID GetCSCInputXptFromChannel(const NTV2Channel inCSC, const bool inIsKeyInput=false)
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...
Definition: ntv2card.h:2787
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:3138
static ULWord GetRP188RegisterForInput(const NTV2InputSource inInputSource)
Definition: ntv2burn.cpp:840
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:6750
virtual void CaptureFrames(void)
Repeatedly captures frames using AutoCirculate (until global quit flag set).
Definition: ntv2burn.cpp:688
Embeds silence (zeroes) into the data stream.
Definition: ntv2enums.h:2035
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:1370
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:1364
virtual NTV2DeviceID GetDeviceID(void)
std::string NTV2TCIndexToString(const NTV2TCIndex inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:6398
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:832
Declares the CNTV2DeviceScanner class.
bool IsVerbose(void) const
Identifies the 4th SDI video input.
Definition: ntv2enums.h:1276
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:1350
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:1375
Declares the AJAProcess class.
virtual void RouteInputSignal(void)
Sets up board routing for capture.
Definition: ntv2burn.cpp:454
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).
std::string OChStr(void) const
uint16_t GetEndFrame(void) const
NTV2InputSource
Identifies a specific video input source.
Definition: ntv2enums.h:1266
bool IsRGBFormat(const NTV2FrameBufferFormat format)
Definition: ntv2utils.cpp:5414
Identifies the 6th SDI video input.
Definition: ntv2enums.h:1278
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:250
#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:537
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:1288
Identifies the 7th SDI video input.
Definition: ntv2enums.h:1279
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:2532
NTV2InputCrosspointID
Identifies a widget input that potentially can accept a signal emitted from another widget&#39;s output (...
Definition: ntv2enums.h:2757
Identifies the "normal" Field 2 ancillary data region.
Definition: ntv2enums.h:4236
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
ULWord GetFrameCount(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:2914
NTV2ACFrameRange fInputFrames
Ingest frame count or range.
bool fSuppressVideo
If true, suppress video; otherwise include video.
uint16_t UWord
Definition: ajatypes.h:234
Specifies channel or FrameStore 1 (or the first item).
Definition: ntv2enums.h:1363
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...
Definition: ntv2card.h:2837
virtual bool AutoCirculateStart(const NTV2Channel inChannel, const ULWord64 inStartTime=0)
Starts AutoCirculate streaming for the specified channel that was previously initialized by CNTV2Card...
bool CanDoFrameBufferFormat(const NTV2PixelFormat inPF)
ULWord appSignature(0)
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 playback streaming, designating a contiguous block of frame buf...
#define xHEX0N(__x__, __n__)
bool CanDoWidget(const NTV2WidgetID inWgtID)
TimecodeFormat
Definition: ntv2rp188.h:22
#define NTV2_IS_VALID_AUDIO_SYSTEM(__x__)
Definition: ntv2enums.h:3920
Identifies the 3rd HDMI video input.
Definition: ntv2enums.h:1271
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:6940
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:1366
NTV2InputSource NTV2TimecodeIndexToInputSource(const NTV2TCIndex inTCIndex)
Converts the given NTV2TCIndex value into the appropriate NTV2InputSource value.
Definition: ntv2utils.cpp:4992
NTV2Channel fInputChannel
The input channel to use.
enum NTV2InputCrosspointID NTV2InputXptID
Specifies channel or FrameStore 5 (or the 5th item).
Definition: ntv2enums.h:1367
Identifies the first analog video input.
Definition: ntv2enums.h:1268
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:4905
virtual AJAStatus SetupVideo(void)
Sets up everything I need for capturing and playing video.
Definition: ntv2burn.cpp:155
Identifies the first field in time for an interlaced video frame, or the first and only field in a pr...
Definition: ntv2enums.h:1847
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:3904
ULWord GetCapturedAncByteCount(const bool inField2=false) const
Specifies channel or FrameStore 6 (or the 6th item).
Definition: ntv2enums.h:1368
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
Definition: ntv2burn.cpp:71
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 streaming, designating a contiguous block of frame buffe...
#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:1369
bool GetRP188Str(std::string &sRP188) const
Definition: ntv2rp188.cpp:918
std::string & lower(std::string &str)
Definition: common.cpp:436
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:572
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:869
Identifies the 1st SDI video input.
Definition: ntv2enums.h:1273
#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:147
virtual void RouteOutputSignal(void)
Sets up board routing for playout.
Definition: ntv2burn.cpp:477
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:3805
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:1365
bool ODstIsSDI(void) const
See 8-Bit YCbCr Format.
Definition: ntv2enums.h:227
virtual AJAStatus SetupHostBuffers(void)
Sets up my circular buffers.
Definition: ntv2burn.cpp:382
NTV2InputSource fInputSource
The device input connector to use.
virtual bool EnableChannel(const NTV2Channel inChannel)
Enables the given FrameStore.