AJA NTV2 SDK  17.1.1.1245
NTV2 SDK 17.1.1.1245
ntv2capture.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 //#define AJA_RAW_AUDIO_RECORD // Uncomment to record captured raw audio into binary data file
9 //#define AJA_WAV_AUDIO_RECORD // Uncomment to record captured audio into WAV file
10 #include "ntv2capture.h"
11 #include "ntv2devicescanner.h"
12 #include "ntv2utils.h"
13 #include "ntv2devicefeatures.h"
14 #include "ajabase/system/process.h"
15 #include <iterator> // for inserter
16 #include <fstream> // for ofstream
17 
18 using namespace std;
19 
20 #define NTV2_BUFFER_LOCK
21 
22 
24 
26  : mConsumerThread (AJAThread()),
27  mProducerThread (AJAThread()),
28  mDeviceID (DEVICE_ID_NOTFOUND),
29  mConfig (inConfig),
30  mVideoFormat (NTV2_FORMAT_UNKNOWN),
31  mSavedTaskMode (NTV2_DISABLE_TASKS),
32  mAudioSystem (inConfig.fWithAudio ? NTV2_AUDIOSYSTEM_1 : NTV2_AUDIOSYSTEM_INVALID),
33  mHostBuffers (),
34  mAVCircularBuffer (),
35  mGlobalQuit (false)
36 {
37 } // constructor
38 
39 
41 {
42  // Stop my capture and consumer threads, then destroy them...
43  Quit();
44 
45  // Unsubscribe from VBI events...
48 
49 } // destructor
50 
51 
52 void NTV2Capture::Quit (void)
53 {
54  // Set the global 'quit' flag, and wait for the threads to go inactive...
55  mGlobalQuit = true;
56 
57  while (mConsumerThread.Active())
58  AJATime::Sleep(10);
59 
60  while (mProducerThread.Active())
61  AJATime::Sleep(10);
62 
63  // Restore some of the device's former state...
64  if (!mConfig.fDoMultiFormat)
65  {
67  mDevice.SetEveryFrameServices(mSavedTaskMode); // Restore prior task mode
68  }
69 
70 } // Quit
71 
72 
74 {
76 
77  // Open the device...
79  {cerr << "## ERROR: Device '" << mConfig.fDeviceSpec << "' not found" << endl; return AJA_STATUS_OPEN;}
80 
81  if (!mDevice.IsDeviceReady())
82  {cerr << "## ERROR: '" << mDevice.GetDisplayName() << "' not ready" << endl; return AJA_STATUS_INITIALIZE;}
83 
84  mDeviceID = mDevice.GetDeviceID(); // Keep the device ID handy, as it's used frequently
85  const bool isKonaHDMI (mDevice.features().GetNumHDMIVideoInputs() > 1);
86  const NTV2IOKinds inputType (isKonaHDMI ? NTV2_IOKINDS_HDMI : NTV2_IOKINDS_SDI);
87  if (!mDevice.features().CanDoCapture())
88  {cerr << "## ERROR: '" << mDevice.GetDisplayName() << "' is playback-only" << endl; return AJA_STATUS_FEATURE;}
89 
90  if (!mDevice.features().CanDoFrameBufferFormat(mConfig.fPixelFormat))
91  { cerr << "## ERROR: '" << mDevice.GetDisplayName() << "' doesn't support '"
92  << ::NTV2FrameBufferFormatToString(mConfig.fPixelFormat, true) << "' ("
93  << ::NTV2FrameBufferFormatToString(mConfig.fPixelFormat, false) << ", " << DEC(mConfig.fPixelFormat) << ")" << endl;
95  }
96 
97  ULWord appSignature (0);
98  int32_t appPID (0);
99  mDevice.GetStreamingApplication (appSignature, appPID); // Who currently "owns" the device?
100  mDevice.GetEveryFrameServices(mSavedTaskMode); // Save the current device state
101  if (!mConfig.fDoMultiFormat)
102  {
104  {
105  cerr << "## ERROR: Unable to acquire '" << mDevice.GetDisplayName() << "' because another app (pid " << appPID << ") owns it" << endl;
106  return AJA_STATUS_BUSY; // Another app is using the device
107  }
108  mDevice.GetEveryFrameServices(mSavedTaskMode); // Save the current state before we change it
109  }
110  mDevice.SetEveryFrameServices(NTV2_OEM_TASKS); // Prevent interference from AJA retail services
111 
112  if (mDevice.features().CanDoMultiFormat())
113  mDevice.SetMultiFormatMode(mConfig.fDoMultiFormat);
114 
115  // This demo permits input source and channel to be specified independently.
117  mConfig.fInputChannel = NTV2_CHANNEL1; // Neither -i or -c specified: default to Ch1
119  mConfig.fInputChannel = ::NTV2InputSourceToChannel(mConfig.fInputSource); // Only -i specified: use that channel
121  mConfig.fInputSource = ::NTV2ChannelToInputSource ( mConfig.fInputChannel, inputType); // Only -c specified: use that input source
122  // On KonaHDMI, map specified SDI input to equivalent HDMI input...
123  if (isKonaHDMI && NTV2_INPUT_SOURCE_IS_SDI(mConfig.fInputSource))
125  if (!mDevice.features().CanDoInputSource(mConfig.fInputSource))
126  {
127  cerr << "## ERROR: No such input '" << ::NTV2InputSourceToString(mConfig.fInputSource, /*compact?*/true)
128  << "' on '" << mDevice.GetDisplayName() << "'" << endl;
129  return AJA_STATUS_UNSUPPORTED;
130  }
131  if (mConfig.fWithAnc && !mDevice.features().CanDoCustomAnc())
132  {cerr << "## ERROR: Anc capture requested, but '" << mDevice.GetDisplayName() << "' has no anc extractors"; return AJA_STATUS_UNSUPPORTED;}
133 
134  // Set up the video and audio...
135  status = SetupVideo();
136  if (AJA_FAILURE(status))
137  return status;
138 
139  if (mConfig.fWithAudio)
140  status = SetupAudio();
141  if (AJA_FAILURE(status))
142  return status;
143 
144  // Set up the circular buffers, the device signal routing, and both playout and capture AutoCirculate...
146  if (!RouteInputSignal())
147  return AJA_STATUS_FAIL;
148 
149  #if defined(_DEBUG)
150  cerr << mConfig;
151  if (mDevice.IsRemote())
152  cerr << "Device Description: " << mDevice.GetDescription() << endl;
153  cerr << endl;
154  #endif // defined(_DEBUG)
155  return AJA_STATUS_SUCCESS;
156 
157 } // Init
158 
159 
161 {
162  // Enable the FrameStore we intend to use...
163  mDevice.EnableChannel(mConfig.fInputChannel);
164 
165  // Enable and subscribe to VBIs (critical on Windows)...
166  mDevice.EnableInputInterrupt(mConfig.fInputChannel);
169 
170  // If the device supports bi-directional SDI and the requested input is SDI,
171  // ensure the SDI connector(s) are configured to receive...
172  if (mDevice.features().HasBiDirectionalSDI() && NTV2_INPUT_SOURCE_IS_SDI(mConfig.fInputSource))
173  {
174  mDevice.SetSDITransmitEnable (mConfig.fInputChannel, false); // Set SDI connector(s) to receive
175  mDevice.WaitForOutputVerticalInterrupt (NTV2_CHANNEL1, 10); // Wait 10 VBIs to allow reciever to lock
176  }
177 
178  // Determine the input video signal format...
179  mVideoFormat = mDevice.GetInputVideoFormat(mConfig.fInputSource);
180  if (mVideoFormat == NTV2_FORMAT_UNKNOWN)
181  {cerr << "## ERROR: No input signal or unknown format" << endl; return AJA_STATUS_NOINPUT;}
182  if (!mDevice.features().CanDoVideoFormat(mVideoFormat))
183  {
184  cerr << "## ERROR: '" << mDevice.GetDisplayName() << "' cannot handle " << ::NTV2VideoFormatToString(mVideoFormat) << endl;
185  return AJA_STATUS_UNSUPPORTED; // Device can't handle this format
186  }
187  if (NTV2_IS_4K_VIDEO_FORMAT(mVideoFormat) || NTV2_IS_QUAD_QUAD_FORMAT(mVideoFormat))
188  {
189  cerr << "## ERROR: 'ntv2capture' cannot handle " << ::NTV2VideoFormatToString(mVideoFormat)
190  << " input signal -- try 'ntv2capture4k' or 'ntv2capture8k' demo" << endl;
191  return AJA_STATUS_UNSUPPORTED; // This demo can't handle this format
192  }
193  CAPNOTE(::NTV2VideoFormatToString(mVideoFormat) << " detected on " << ::NTV2InputSourceToString(mConfig.fInputSource,true) << " on " << mDevice.GetDisplayName());
194  mFormatDesc = NTV2FormatDescriptor(mVideoFormat, mConfig.fPixelFormat);
195 
196  // Setting SDI output clock timing/reference is unimportant for capture-only apps...
197  if (!mConfig.fDoMultiFormat) // ...if not sharing the device...
198  mDevice.SetReference(NTV2_REFERENCE_FREERUN); // ...let it free-run
199 
200  // Set the device video format to whatever was detected at the input...
201  mDevice.SetVideoFormat (mVideoFormat, false, false, mConfig.fInputChannel);
202  mDevice.SetVANCMode (NTV2_VANCMODE_OFF, mConfig.fInputChannel); // Disable VANC
203 
204  // Set the frame buffer pixel format for the FrameStore to be used on the device...
205  mDevice.SetFrameBufferFormat (mConfig.fInputChannel, mConfig.fPixelFormat);
206  return AJA_STATUS_SUCCESS;
207 
208 } // SetupVideo
209 
210 
212 {
213  // In multiformat mode, base the audio system on the channel...
214  if (mConfig.fDoMultiFormat)
215  if (mDevice.features().GetNumAudioSystems() > 1)
216  if (UWord(mConfig.fInputChannel) < mDevice.features().GetNumAudioSystems())
217  mAudioSystem = ::NTV2ChannelToAudioSystem(mConfig.fInputChannel);
218 
219  NTV2AudioSystemSet audSystems (::NTV2MakeAudioSystemSet (mAudioSystem, 1));
220  CNTV2DemoCommon::ConfigureAudioSystems (mDevice, mConfig, audSystems);
221  return AJA_STATUS_SUCCESS;
222 
223 } // SetupAudio
224 
225 
227 {
228  // Let my circular buffer know when it's time to quit...
229  mAVCircularBuffer.SetAbortFlag(&mGlobalQuit);
230 
231  ULWord F1AncSize(0), F2AncSize(0);
232  if (mConfig.fWithAnc)
233  { // Use the max anc size stipulated by the AncFieldOffset VReg values...
234  ULWord F1OffsetFromEnd(0), F2OffsetFromEnd(0);
235  mDevice.ReadRegister(kVRegAncField1Offset, F1OffsetFromEnd); // # bytes from end of 8MB/16MB frame
236  mDevice.ReadRegister(kVRegAncField2Offset, F2OffsetFromEnd); // # bytes from end of 8MB/16MB frame
237  // Based on the offsets, calculate the max anc capacity
238  F1AncSize = F2OffsetFromEnd > F1OffsetFromEnd ? 0 : F1OffsetFromEnd - F2OffsetFromEnd;
239  F2AncSize = F2OffsetFromEnd > F1OffsetFromEnd ? F2OffsetFromEnd - F1OffsetFromEnd : F2OffsetFromEnd;
240  }
241 
242  // Allocate and add each in-host NTV2FrameData to my circular buffer member variable...
243  const size_t audioBufferSize (NTV2_AUDIOSIZE_MAX);
244  mHostBuffers.reserve(size_t(CIRCULAR_BUFFER_SIZE));
245  while (mHostBuffers.size() < size_t(CIRCULAR_BUFFER_SIZE))
246  {
247  mHostBuffers.push_back(NTV2FrameData());
248  NTV2FrameData & frameData(mHostBuffers.back());
249  frameData.fVideoBuffer.Allocate(mFormatDesc.GetVideoWriteSize());
250  frameData.fAudioBuffer.Allocate(NTV2_IS_VALID_AUDIO_SYSTEM(mAudioSystem) ? audioBufferSize : 0);
251  frameData.fAncBuffer.Allocate(F1AncSize);
252  frameData.fAncBuffer2.Allocate(F2AncSize);
253  mAVCircularBuffer.Add(&frameData);
254 
255 #ifdef NTV2_BUFFER_LOCK
256  // Page lock the memory
257  if (frameData.fVideoBuffer)
258  mDevice.DMABufferLock(frameData.fVideoBuffer, true);
259  if (frameData.fAudioBuffer)
260  mDevice.DMABufferLock(frameData.fAudioBuffer, true);
261  if (frameData.fAncBuffer)
262  mDevice.DMABufferLock(frameData.fAncBuffer, true);
263 #endif
264  } // for each NTV2FrameData
265 
266 } // SetupHostBuffers
267 
268 
270 {
273  mDevice.GetHDMIInputColor (inputColorSpace, mConfig.fInputChannel);
274 
275  const bool isInputRGB (inputColorSpace == NTV2_LHIHDMIColorSpaceRGB);
276  NTV2XptConnections connections;
277 
278  return CNTV2DemoCommon::GetInputRouting (connections, mConfig, isInputRGB)
279  && mDevice.ApplySignalRoute(connections, !mConfig.fDoMultiFormat);
280 
281 } // RouteInputSignal
282 
283 
285 {
286  // Start the playout and capture threads...
289  return AJA_STATUS_SUCCESS;
290 
291 } // Run
292 
293 
295 
296 // This starts the consumer thread
298 {
299  // Create and start the consumer thread...
300  mConsumerThread.Attach(ConsumerThreadStatic, this);
301  mConsumerThread.SetPriority(AJA_ThreadPriority_High);
302  mConsumerThread.Start();
303 
304 } // StartConsumerThread
305 
306 
307 // The consumer thread function
308 void NTV2Capture::ConsumerThreadStatic (AJAThread * pThread, void * pContext) // static
309 {
310  (void) pThread;
311 
312  // Grab the NTV2Capture instance pointer from the pContext parameter,
313  // then call its ConsumeFrames method...
314  NTV2Capture * pApp (reinterpret_cast<NTV2Capture*>(pContext));
315  pApp->ConsumeFrames();
316 
317 } // ConsumerThreadStatic
318 
319 
321 {
322  CAPNOTE("Thread started");
323  AJA_NTV2_AUDIO_RECORD_BEGIN // Active when AJA_RAW_AUDIO_RECORD or AJA_WAV_AUDIO_RECORD defined
324  uint64_t ancTally(0);
325  ofstream * pOFS(mConfig.fAncDataFilePath.empty() ? AJA_NULL : new ofstream(mConfig.fAncDataFilePath.c_str(), ios::binary));
326  while (!mGlobalQuit)
327  {
328  // Wait for the next frame to become ready to "consume"...
329  NTV2FrameData * pFrameData(mAVCircularBuffer.StartConsumeNextBuffer());
330  if (pFrameData)
331  {
332  // Do something useful with the frame data...
333  // . . . . . . . . . . . .
334  // . . . . . . . . . . . .
335  // . . . . . . . . . . . .
336  AJA_NTV2_AUDIO_RECORD_DO // Active when AJA_RAW_AUDIO_RECORD or AJA_WAV_AUDIO_RECORD defined
337  if (pOFS && !ancTally++)
338  cerr << "Writing raw anc to '" << mConfig.fAncDataFilePath << "', "
339  << DEC(pFrameData->AncBufferSize() + pFrameData->AncBuffer2Size())
340  << " bytes per frame" << endl;
341  if (pOFS && pFrameData->AncBuffer())
342  pOFS->write(pFrameData->AncBuffer(), streamsize(pFrameData->AncBufferSize()));
343  if (pOFS && pFrameData->AncBuffer2())
344  pOFS->write(pFrameData->AncBuffer2(), streamsize(pFrameData->AncBuffer2Size()));
345 
346  // Now release and recycle the buffer...
347  mAVCircularBuffer.EndConsumeNextBuffer();
348  } // if pFrameData
349  } // loop til quit signaled
350  if (pOFS)
351  {delete pOFS; cerr << "Wrote " << DEC(ancTally) << " frames of raw anc data" << endl;}
352  AJA_NTV2_AUDIO_RECORD_END // Active when AJA_RAW_AUDIO_RECORD or AJA_WAV_AUDIO_RECORD defined
353  CAPNOTE("Thread completed, will exit");
354 
355 } // ConsumeFrames
356 
357 
359 
360 // This starts the capture (producer) thread
362 {
363  // Create and start the capture thread...
364  mProducerThread.Attach(ProducerThreadStatic, this);
365  mProducerThread.SetPriority(AJA_ThreadPriority_High);
366  mProducerThread.Start();
367 
368 } // StartProducerThread
369 
370 
371 // The capture thread function
372 void NTV2Capture::ProducerThreadStatic (AJAThread * pThread, void * pContext) // static
373 {
374  (void) pThread;
375 
376  // Grab the NTV2Capture instance pointer from the pContext parameter,
377  // then call its CaptureFrames method...
378  NTV2Capture * pApp (reinterpret_cast<NTV2Capture*>(pContext));
379  pApp->CaptureFrames ();
380 
381 } // ProducerThreadStatic
382 
383 
385 {
386  AUTOCIRCULATE_TRANSFER inputXfer; // AutoCirculate input transfer info
387  NTV2AudioChannelPairs nonPcmPairs, oldNonPcmPairs;
388  ULWord acOptions (AUTOCIRCULATE_WITH_RP188), overruns(0);
389  UWord sdiSpigot (UWord(::NTV2InputSourceToChannel(mConfig.fInputSource)));
390  if (mConfig.fWithAnc)
391  acOptions |= AUTOCIRCULATE_WITH_ANC;
392 
393  CAPNOTE("Thread started");
394  // Initialize and start capture AutoCirculate...
395  mDevice.AutoCirculateStop(mConfig.fInputChannel); // Just in case
396  if (!mDevice.AutoCirculateInitForInput (mConfig.fInputChannel, // primary channel
397  mConfig.fFrames.count(), // numFrames (zero if specifying range)
398  mAudioSystem, // audio system (if any)
399  acOptions, // AutoCirculate options
400  1, // numChannels to gang
401  mConfig.fFrames.firstFrame(), mConfig.fFrames.lastFrame()))
402  mGlobalQuit = true;
403  if (!mGlobalQuit && !mDevice.AutoCirculateStart(mConfig.fInputChannel))
404  mGlobalQuit = true;
405 
406  // Ingest frames til Quit signaled...
407  while (!mGlobalQuit)
408  {
409  AUTOCIRCULATE_STATUS acStatus;
410  mDevice.AutoCirculateGetStatus (mConfig.fInputChannel, acStatus);
411 
412  if (acStatus.IsRunning() && acStatus.HasAvailableInputFrame())
413  {
414  // At this point, there's at least one fully-formed frame available in the device's
415  // frame buffer to transfer to the host. Reserve an NTV2FrameData to "produce", and
416  // use it in the next transfer from the device...
417  NTV2FrameData * pFrameData (mAVCircularBuffer.StartProduceNextBuffer());
418  if (!pFrameData)
419  continue;
420 
421  NTV2FrameData & frameData (*pFrameData);
422  inputXfer.SetVideoBuffer (frameData.VideoBuffer(), frameData.VideoBufferSize());
423  if (acStatus.WithAudio())
424  inputXfer.SetAudioBuffer (frameData.AudioBuffer(), frameData.AudioBufferSize());
425  if (acStatus.WithCustomAnc())
426  inputXfer.SetAncBuffers (frameData.AncBuffer(), frameData.AncBufferSize(),
427  frameData.AncBuffer2(), frameData.AncBuffer2Size());
428 
429  // Transfer video/audio/anc from the device into our host buffers...
430  mDevice.AutoCirculateTransfer (mConfig.fInputChannel, inputXfer);
431 
432  // Remember the actual amount of audio captured...
433  if (acStatus.WithAudio())
434  frameData.fNumAudioBytes = inputXfer.GetCapturedAudioByteCount();
435 
436  // If capturing Anc, clear stale anc data from the anc buffers...
437  if (acStatus.WithCustomAnc() && frameData.AncBuffer())
438  { bool overrun(false);
439  mDevice.AncExtractGetBufferOverrun (sdiSpigot, overrun);
440  if (overrun)
441  {overruns++; CAPWARN(overruns << " anc overrun(s)");}
442  frameData.fNumAncBytes = inputXfer.GetCapturedAncByteCount(/*isF2*/false);
443  NTV2Buffer stale (frameData.fAncBuffer.GetHostAddress(frameData.fNumAncBytes),
444  frameData.fAncBuffer.GetByteCount() - frameData.fNumAncBytes);
445  stale.Fill(uint8_t(0));
446  }
447  if (acStatus.WithCustomAnc() && frameData.AncBuffer2())
448  {
449  frameData.fNumAnc2Bytes = inputXfer.GetCapturedAncByteCount(/*isF2*/true);
450  NTV2Buffer stale (frameData.fAncBuffer2.GetHostAddress(frameData.fNumAnc2Bytes),
451  frameData.fAncBuffer2.GetByteCount() - frameData.fNumAnc2Bytes);
452  stale.Fill(uint8_t(0));
453  }
454 
455  // Grab all valid timecodes that were captured...
456  inputXfer.GetInputTimeCodes (frameData.fTimecodes, mConfig.fInputChannel, /*ValidOnly*/ true);
457 
458  if (acStatus.WithAudio())
459  // Look for PCM/NonPCM changes in the audio stream...
460  if (mDevice.GetInputAudioChannelPairsWithoutPCM (mConfig.fInputChannel, nonPcmPairs))
461  {
462  NTV2AudioChannelPairs becomingNonPCM, becomingPCM;
463  set_difference (oldNonPcmPairs.begin(), oldNonPcmPairs.end(), nonPcmPairs.begin(), nonPcmPairs.end(), inserter(becomingPCM, becomingPCM.begin()));
464  set_difference (nonPcmPairs.begin(), nonPcmPairs.end(), oldNonPcmPairs.begin(), oldNonPcmPairs.end(), inserter(becomingNonPCM, becomingNonPCM.begin()));
465  if (!becomingNonPCM.empty())
466  CAPNOTE("Audio channel pair(s) '" << becomingNonPCM << "' now non-PCM");
467  if (!becomingPCM.empty())
468  CAPNOTE("Audio channel pair(s) '" << becomingPCM << "' now PCM");
469  oldNonPcmPairs = nonPcmPairs;
470  }
471 
472  // Signal that we're done "producing" the frame, making it available for future "consumption"...
473  mAVCircularBuffer.EndProduceNextBuffer();
474  } // if A/C running and frame(s) are available for transfer
475  else
476  {
477  // Either AutoCirculate is not running, or there were no frames available on the device to transfer.
478  // Rather than waste CPU cycles spinning, waiting until a frame becomes available, it's far more
479  // efficient to wait for the next input vertical interrupt event to get signaled...
481  }
482 
483  // Log SDI input CRC/VPID/TRS errors...
484  if (mDevice.features().CanDoSDIErrorChecks() && NTV2_INPUT_SOURCE_IS_SDI(mConfig.fInputSource))
485  {
486  NTV2SDIInStatistics sdiStats;
487  NTV2SDIInputStatus inputStatus;
488  if (mDevice.ReadSDIStatistics(sdiStats))
489  {
490  sdiStats.GetSDIInputStatus(inputStatus, UWord(::GetIndexForNTV2InputSource(mConfig.fInputSource)));
491  if (!inputStatus.mLocked)
492  CAPWARN(inputStatus);
493  }
494  }
495  } // loop til quit signaled
496 
497  // Stop AutoCirculate...
498  mDevice.AutoCirculateStop(mConfig.fInputChannel);
499  CAPNOTE("Thread completed, will exit");
500 
501 } // CaptureFrames
502 
503 
504 void NTV2Capture::GetACStatus (ULWord & outGoodFrames, ULWord & outDroppedFrames, ULWord & outBufferLevel)
505 {
506  AUTOCIRCULATE_STATUS status;
507  mDevice.AutoCirculateGetStatus(mConfig.fInputChannel, status);
508  outGoodFrames = status.GetProcessedFrameCount();
509  outDroppedFrames = status.GetDroppedFrameCount();
510  outBufferLevel = status.GetBufferLevel();
511 }
CNTV2Card::SubscribeOutputVerticalEvent
virtual bool SubscribeOutputVerticalEvent(const NTV2Channel inChannel)
Causes me to be notified when an output vertical blanking interrupt is generated for the given output...
Definition: ntv2subscriptions.cpp:25
CNTV2Card::SetVANCMode
virtual bool SetVANCMode(const NTV2VANCMode inVancMode, const NTV2Channel inChannel=NTV2_CHANNEL1)
Sets the VANC mode for the given FrameStore.
Definition: ntv2register.cpp:2640
CaptureConfig::fDoMultiFormat
bool fDoMultiFormat
If true, use multi-format/multi-channel mode, if device supports it; otherwise normal mode.
Definition: ntv2democommon.h:276
CNTV2Card::SetMultiFormatMode
virtual bool SetMultiFormatMode(const bool inEnable)
Enables or disables multi-format (per channel) device operation. If enabled, each device channel can ...
Definition: ntv2register.cpp:4379
ntv2capture.h
Declares the NTV2Capture class.
NTV2ChannelToInputSource
NTV2InputSource NTV2ChannelToInputSource(const NTV2Channel inChannel, const NTV2IOKinds inKinds=NTV2_IOKINDS_SDI)
Definition: ntv2utils.cpp:5190
NTV2InputSourceToChannel
NTV2Channel NTV2InputSourceToChannel(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2Channel value.
Definition: ntv2utils.cpp:5105
NTV2Capture::RouteInputSignal
virtual bool RouteInputSignal(void)
Sets up device routing for capture.
Definition: ntv2capture.cpp:269
DeviceCapabilities::CanDoVideoFormat
bool CanDoVideoFormat(const NTV2VideoFormat inVF)
Definition: ntv2devicecapabilities.h:251
NTV2FormatDescriptor::GetVideoWriteSize
ULWord GetVideoWriteSize(ULWord inPageSize=4096UL) const
Definition: ntv2formatdescriptor.cpp:862
AUTOCIRCULATE_TRANSFER::GetCapturedAudioByteCount
ULWord GetCapturedAudioByteCount(void) const
Definition: ntv2publicinterface.h:8336
NTV2Capture::NTV2Capture
NTV2Capture(const CaptureConfig &inConfig)
Constructs me using the given settings.
Definition: ntv2capture.cpp:25
AJA_ThreadPriority_High
@ AJA_ThreadPriority_High
Definition: thread.h:44
NTV2ACFrameRange::firstFrame
UWord firstFrame(void) const
Definition: ntv2utils.h:975
CNTV2Card::SetVideoFormat
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.
Definition: ntv2register.cpp:204
ntv2devicefeatures.h
Declares device capability functions.
NTV2LHIHDMIColorSpace
NTV2LHIHDMIColorSpace
Definition: ntv2enums.h:3597
CNTV2MacDriverInterface::ReadRegister
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....
Definition: ntv2macdriverinterface.cpp:389
NTV2FormatDescriptor
Describes a video frame for a given video standard or format and pixel format, including the total nu...
Definition: ntv2formatdescriptor.h:41
NTV2FrameData
I encapsulate the video, audio and anc host buffers used in the AutoCirculate demos....
Definition: ntv2democommon.h:79
AUTOCIRCULATE_TRANSFER::SetAudioBuffer
bool SetAudioBuffer(ULWord *pInAudioBuffer, const ULWord inAudioByteCount)
Sets my audio buffer for use in a subsequent call to CNTV2Card::AutoCirculateTransfer.
Definition: ntv2publicinterface.cpp:2716
NTV2AudioChannelPairs
std::set< NTV2AudioChannelPair > NTV2AudioChannelPairs
A set of distinct NTV2AudioChannelPair values.
Definition: ntv2publicinterface.h:58
NTV2FrameData::fNumAncBytes
ULWord fNumAncBytes
Actual number of captured F1 anc bytes.
Definition: ntv2democommon.h:89
NTV2Buffer
A generic user-space buffer object that has an address and a length. Used most often to share an arbi...
Definition: ntv2publicinterface.h:5993
AJA_STATUS_SUCCESS
@ AJA_STATUS_SUCCESS
Definition: types.h:381
NTV2Buffer::GetByteCount
ULWord GetByteCount(void) const
Definition: ntv2publicinterface.h:6066
AJA_NTV2_AUDIO_RECORD_BEGIN
#define AJA_NTV2_AUDIO_RECORD_BEGIN
Definition: ntv2democommon.h:872
AJAThread::Attach
virtual AJAStatus Attach(AJAThreadFunction *pThreadFunction, void *pUserContext)
Definition: thread.cpp:169
CNTV2Card::WaitForInputVerticalInterrupt
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 ...
Definition: ntv2subscriptions.cpp:149
CNTV2Card::EnableInputInterrupt
virtual bool EnableInputInterrupt(const NTV2Channel channel=NTV2_CHANNEL1)
Allows the CNTV2Card instance to wait for and respond to input vertical blanking interrupts originati...
Definition: ntv2interrupts.cpp:23
NTV2FrameData::AncBuffer2
NTV2Buffer & AncBuffer2(void)
Definition: ntv2democommon.h:117
CNTV2DemoCommon::GetInputRouting
static bool GetInputRouting(NTV2XptConnections &outConnections, const CaptureConfig &inConfig, const bool isInputRGB=(0))
Answers with the crosspoint connections needed to implement the given capture configuration.
Definition: ntv2democommon.cpp:1199
NTV2Capture::SetupVideo
virtual AJAStatus SetupVideo(void)
Sets up everything I need for capturing video.
Definition: ntv2capture.cpp:160
NTV2Capture::StartProducerThread
virtual void StartProducerThread(void)
Starts my capture thread.
Definition: ntv2capture.cpp:361
AJA_STATUS_BUSY
@ AJA_STATUS_BUSY
Definition: types.h:391
CNTV2DeviceScanner::GetFirstDeviceFromArgument
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...
Definition: ntv2devicescanner.cpp:366
AUTOCIRCULATE_STATUS::GetProcessedFrameCount
ULWord GetProcessedFrameCount(void) const
Definition: ntv2publicinterface.h:7216
NTV2Capture
Instances of me capture frames in real time from a video signal provided to an input of an AJA device...
Definition: ntv2capture.h:19
NTV2_AUDIOSYSTEM_1
@ NTV2_AUDIOSYSTEM_1
This identifies the first Audio System.
Definition: ntv2enums.h:3816
AJACircularBuffer::StartConsumeNextBuffer
FrameDataPtr StartConsumeNextBuffer(void)
The thread that's responsible for processing incoming frames – the consumer – calls this function to ...
Definition: circularbuffer.h:153
CaptureConfig::fPixelFormat
NTV2PixelFormat fPixelFormat
Pixel format to use.
Definition: ntv2democommon.h:273
NTV2ACFrameRange::count
UWord count(void) const
Definition: ntv2utils.h:974
AUTOCIRCULATE_STATUS::GetBufferLevel
ULWord GetBufferLevel(void) const
Definition: ntv2publicinterface.h:7221
CNTV2Card::AutoCirculateInitForInput
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 ...
Definition: ntv2autocirculate.cpp:221
CNTV2MacDriverInterface::ReleaseStreamForApplication
virtual bool ReleaseStreamForApplication(ULWord inApplicationType, int32_t inProcessID)
Releases exclusive use of the AJA device for the given process, permitting other processes to acquire...
Definition: ntv2macdriverinterface.cpp:516
NTV2_IOKINDS_HDMI
@ NTV2_IOKINDS_HDMI
Specifies HDMI input/output kinds.
Definition: ntv2enums.h:1252
NTV2FrameData::fAncBuffer2
NTV2Buffer fAncBuffer2
Additional "F2" host anc buffer.
Definition: ntv2democommon.h:86
AJACircularBuffer::EndProduceNextBuffer
void EndProduceNextBuffer(void)
The producer thread calls this function to signal that it has finished populating the frame it obtain...
Definition: circularbuffer.h:259
CaptureConfig::fAncDataFilePath
std::string fAncDataFilePath
Optional path to Anc binary data file.
Definition: ntv2democommon.h:269
NTV2Buffer::Allocate
bool Allocate(const size_t inByteCount, const bool inPageAligned=false)
Allocates (or re-allocates) my user-space storage using the given byte count. I assume full responsib...
Definition: ntv2publicinterface.cpp:1630
NTV2_LHIHDMIColorSpaceRGB
@ NTV2_LHIHDMIColorSpaceRGB
Definition: ntv2enums.h:3600
CNTV2Card::ApplySignalRoute
virtual bool ApplySignalRoute(const CNTV2SignalRouter &inRouter, const bool inReplace=(0))
Applies the given routing table to the AJA device.
Definition: ntv2regroute.cpp:242
AJA_NTV2_AUDIO_RECORD_END
#define AJA_NTV2_AUDIO_RECORD_END
Definition: ntv2democommon.h:874
NTV2IOKinds
enum NTV2InputSourceKinds NTV2IOKinds
AUTOCIRCULATE_TRANSFER::SetAncBuffers
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.
Definition: ntv2publicinterface.cpp:2724
NTV2FrameData::fAncBuffer
NTV2Buffer fAncBuffer
Host ancillary data buffer.
Definition: ntv2democommon.h:85
NTV2_CHANNEL1
@ NTV2_CHANNEL1
Specifies channel or Frame Store 1 (or the first item).
Definition: ntv2enums.h:1307
CNTV2Card::SetFrameBufferFormat
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.
Definition: ntv2register.cpp:1812
CNTV2Card::SetSDITransmitEnable
virtual bool SetSDITransmitEnable(const NTV2Channel inChannel, const bool inEnable)
Sets the specified bidirectional SDI connector to act as an input or an output.
Definition: ntv2register.cpp:3796
AUTOCIRCULATE_STATUS::WithAudio
bool WithAudio(void) const
Definition: ntv2publicinterface.h:7291
nlohmann::json_abiNLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON_v3_11_NLOHMANN_JSON_VERSION_PATCH::detail::void
j template void())
Definition: json.hpp:4893
NTV2SDIInputStatus
For devices that support it (see NTV2DeviceCanDoSDIErrorChecks ), this struct reports SDI input error...
Definition: ntv2publicinterface.h:6866
CaptureConfig::fWithAnc
bool fWithAnc
If true, also capture Anc.
Definition: ntv2democommon.h:277
NTV2FrameData::VideoBuffer
NTV2Buffer & VideoBuffer(void)
Definition: ntv2democommon.h:106
NTV2_IS_4K_VIDEO_FORMAT
#define NTV2_IS_4K_VIDEO_FORMAT(__f__)
Definition: ntv2enums.h:746
kVRegAncField2Offset
@ kVRegAncField2Offset
Anc Field2 byte offset from end of frame buffer (GUMP on all boards except RTP for SMPTE2022/IP)
Definition: ntv2virtualregisters.h:336
CNTV2Card::DMABufferLock
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
GetIndexForNTV2InputSource
ULWord GetIndexForNTV2InputSource(const NTV2InputSource inValue)
Definition: ntv2utils.cpp:5306
NTV2MakeAudioSystemSet
NTV2AudioSystemSet NTV2MakeAudioSystemSet(const NTV2AudioSystem inFirstAudioSystem, const UWord inCount=1)
Definition: ntv2publicinterface.cpp:3412
CNTV2Card::features
virtual class DeviceCapabilities & features(void)
Definition: ntv2card.h:141
AJAThread
Definition: thread.h:69
AUTOCIRCULATE_WITH_ANC
#define AUTOCIRCULATE_WITH_ANC
Use this to AutoCirculate with ancillary data.
Definition: ntv2publicinterface.h:5527
AJAThread::Active
virtual bool Active()
Definition: thread.cpp:116
CNTV2Card::GetDisplayName
virtual std::string GetDisplayName(void)
Answers with this device's display name.
Definition: ntv2card.cpp:86
AJA_STATUS_NOINPUT
@ AJA_STATUS_NOINPUT
Definition: types.h:400
AJAStatus
AJAStatus
Definition: types.h:378
NTV2Capture::Quit
virtual void Quit(void)
Gracefully stops me from running.
Definition: ntv2capture.cpp:52
NTV2InputSourceToString
std::string NTV2InputSourceToString(const NTV2InputSource inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:7215
process.h
Declares the AJAProcess class.
AJATime::Sleep
static void Sleep(const int32_t inMilliseconds)
Suspends execution of the current thread for a given number of milliseconds.
Definition: systemtime.cpp:284
AJACircularBuffer::Add
AJAStatus Add(FrameDataPtr pInFrameData)
Appends a new frame buffer to me, increasing my frame storage capacity by one frame.
Definition: circularbuffer.h:92
NTV2_VANCMODE_OFF
@ NTV2_VANCMODE_OFF
This identifies the mode in which there are no VANC lines in the frame buffer.
Definition: ntv2enums.h:3718
AJA_STATUS_FEATURE
@ AJA_STATUS_FEATURE
Definition: types.h:393
AJA_STATUS_FAIL
@ AJA_STATUS_FAIL
Definition: types.h:382
CNTV2DemoCommon::ConfigureAudioSystems
static bool ConfigureAudioSystems(CNTV2Card &inDevice, const CaptureConfig &inConfig, const NTV2AudioSystemSet inAudioSystems)
Configures capture audio systems.
Definition: ntv2democommon.cpp:1463
ULWord
uint32_t ULWord
Definition: ajatypes.h:253
CNTV2Card::GetDescription
virtual std::string GetDescription(void) const
Definition: ntv2card.cpp:124
NTV2FrameData::fVideoBuffer
NTV2Buffer fVideoBuffer
Host video buffer.
Definition: ntv2democommon.h:82
AUTOCIRCULATE_STATUS
This is returned from the CNTV2Card::AutoCirculateGetStatus function.
Definition: ntv2publicinterface.h:7160
ntv2devicescanner.h
Declares the CNTV2DeviceScanner class.
CaptureConfig
This class is used to configure an NTV2Capture instance.
Definition: ntv2democommon.h:265
NTV2FrameData::VideoBufferSize
ULWord VideoBufferSize(void) const
Definition: ntv2democommon.h:107
kVRegAncField1Offset
@ kVRegAncField1Offset
Anc Field1 byte offset from end of frame buffer (GUMP on all boards except RTP for SMPTE2022/IP)
Definition: ntv2virtualregisters.h:335
CNTV2MacDriverInterface::GetStreamingApplication
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 ...
Definition: ntv2macdriverinterface.cpp:651
CNTV2Card::GetInputAudioChannelPairsWithoutPCM
virtual bool GetInputAudioChannelPairsWithoutPCM(const NTV2Channel inSDIInputConnector, NTV2AudioChannelPairs &outChannelPairs)
For the given SDI input (specified as a channel number), returns the set of audio channel pairs that ...
Definition: ntv2audio.cpp:1530
NTV2AudioSystemSet
std::set< NTV2AudioSystem > NTV2AudioSystemSet
A set of distinct NTV2AudioSystem values. New in SDK 16.2.
Definition: ntv2publicinterface.h:3900
CNTV2Card::UnsubscribeInputVerticalEvent
virtual bool UnsubscribeInputVerticalEvent(const NTV2Channel inChannel=NTV2_CHANNEL1)
Unregisters me so I'm no longer notified when an input VBI is signaled on the given input channel.
Definition: ntv2subscriptions.cpp:75
AJAProcess::GetPid
static uint64_t GetPid()
Definition: process.cpp:35
NTV2FrameData::AncBufferSize
ULWord AncBufferSize(void) const
Definition: ntv2democommon.h:114
NTV2Capture::ProducerThreadStatic
static void ProducerThreadStatic(AJAThread *pThread, void *pContext)
This is the capture thread's static callback function that gets called when the capture thread runs....
Definition: ntv2capture.cpp:372
CNTV2Card::UnsubscribeOutputVerticalEvent
virtual bool UnsubscribeOutputVerticalEvent(const NTV2Channel inChannel)
Unregisters me so I'm no longer notified when an output VBI is signaled on the given output channel.
Definition: ntv2subscriptions.cpp:61
AUTOCIRCULATE_TRANSFER::GetCapturedAncByteCount
ULWord GetCapturedAncByteCount(const bool inField2=false) const
Definition: ntv2publicinterface.h:8346
UWord
uint16_t UWord
Definition: ajatypes.h:251
AJACircularBuffer::StartProduceNextBuffer
FrameDataPtr StartProduceNextBuffer(void)
The thread that's responsible for providing frames – the producer – calls this function to populate t...
Definition: circularbuffer.h:109
CNTV2Card::AutoCirculateGetStatus
virtual bool AutoCirculateGetStatus(const NTV2Channel inChannel, AUTOCIRCULATE_STATUS &outStatus)
Returns the current AutoCirculate status for the given channel.
Definition: ntv2autocirculate.cpp:646
NTV2FrameData::AudioBufferSize
ULWord AudioBufferSize(void) const
Definition: ntv2democommon.h:110
NTV2FrameData::AncBuffer2Size
ULWord AncBuffer2Size(void) const
Definition: ntv2democommon.h:118
NTV2FrameData::fNumAudioBytes
ULWord fNumAudioBytes
Actual number of captured audio bytes.
Definition: ntv2democommon.h:88
NTV2_IS_VALID_INPUT_SOURCE
#define NTV2_IS_VALID_INPUT_SOURCE(_inpSrc_)
Definition: ntv2enums.h:1243
NTV2_REFERENCE_FREERUN
@ NTV2_REFERENCE_FREERUN
Specifies the device's internal clock.
Definition: ntv2enums.h:1404
AUTOCIRCULATE_TRANSFER
This object specifies the information that will be transferred to or from the AJA device in the CNTV2...
Definition: ntv2publicinterface.h:7969
CaptureConfig::fDeviceSpec
std::string fDeviceSpec
The AJA device to use.
Definition: ntv2democommon.h:268
ntv2utils.h
Declares numerous NTV2 utility functions.
NTV2VideoFormatToString
std::string NTV2VideoFormatToString(const NTV2VideoFormat inValue, const bool inUseFrameRate=false)
Definition: ntv2utils.cpp:6750
NTV2_INPUT_SOURCE_IS_HDMI
#define NTV2_INPUT_SOURCE_IS_HDMI(_inpSrc_)
Definition: ntv2enums.h:1240
NTV2FrameData::AudioBuffer
NTV2Buffer & AudioBuffer(void)
Definition: ntv2democommon.h:109
AUTOCIRCULATE_TRANSFER::SetVideoBuffer
bool SetVideoBuffer(ULWord *pInVideoBuffer, const ULWord inVideoByteCount)
Sets my video buffer for use in a subsequent call to CNTV2Card::AutoCirculateTransfer.
Definition: ntv2publicinterface.cpp:2708
NTV2Capture::Run
virtual AJAStatus Run(void)
Runs me.
Definition: ntv2capture.cpp:284
CNTV2DriverInterface::IsDeviceReady
virtual bool IsDeviceReady(const bool inCheckValid=(0))
Definition: ntv2driverinterface.cpp:1284
kDemoAppSignature
static const ULWord kDemoAppSignature((((uint32_t)( 'D'))<< 24)|(((uint32_t)( 'E'))<< 16)|(((uint32_t)( 'M'))<< 8)|(((uint32_t)( 'O'))<< 0))
NTV2Capture::ConsumeFrames
virtual void ConsumeFrames(void)
Repeatedly consumes frames from the circular buffer (until global quit flag set).
Definition: ntv2capture.cpp:320
DeviceCapabilities::CanDoInputSource
bool CanDoInputSource(const NTV2InputSource inSrc)
Definition: ntv2devicecapabilities.h:233
AJACircularBuffer::EndConsumeNextBuffer
void EndConsumeNextBuffer(void)
The consumer thread calls this function to signal that it has finished processing the frame it obtain...
Definition: circularbuffer.h:266
NTV2Capture::ConsumerThreadStatic
static void ConsumerThreadStatic(AJAThread *pThread, void *pContext)
This is the consumer thread's static callback function that gets called when the consumer thread runs...
Definition: ntv2capture.cpp:308
CNTV2Card::GetInputVideoFormat
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.
Definition: ntv2register.cpp:3365
NTV2_AUDIOSIZE_MAX
#define NTV2_AUDIOSIZE_MAX
Definition: ntv2democommon.h:46
CNTV2Card::SetEveryFrameServices
virtual bool SetEveryFrameServices(const NTV2EveryFrameTaskMode inMode)
Sets the device's task mode.
Definition: ntv2register.cpp:179
AJA_STATUS_UNSUPPORTED
@ AJA_STATUS_UNSUPPORTED
Definition: types.h:394
AJA_NULL
#define AJA_NULL
Definition: ajatypes.h:197
NTV2_IS_VALID_CHANNEL
#define NTV2_IS_VALID_CHANNEL(__x__)
Definition: ntv2enums.h:1319
CaptureConfig::fFrames
NTV2ACFrameRange fFrames
AutoCirculate frame count or range.
Definition: ntv2democommon.h:272
NTV2_DISABLE_TASKS
@ NTV2_DISABLE_TASKS
0: Disabled: Device is completely configured by controlling application(s) – no driver involvement.
Definition: ntv2publicinterface.h:4290
CaptureConfig::fInputChannel
NTV2Channel fInputChannel
The device channel to use.
Definition: ntv2democommon.h:270
NTV2Buffer::GetHostAddress
void * GetHostAddress(const ULWord inByteOffset, const bool inFromEnd=false) const
Definition: ntv2publicinterface.cpp:1686
NTV2_FORMAT_UNKNOWN
@ NTV2_FORMAT_UNKNOWN
Definition: ntv2enums.h:498
NTV2FrameData::fAudioBuffer
NTV2Buffer fAudioBuffer
Host audio buffer.
Definition: ntv2democommon.h:84
NTV2Capture::StartConsumerThread
virtual void StartConsumerThread(void)
Starts my frame consumer thread.
Definition: ntv2capture.cpp:297
NTV2_IS_QUAD_QUAD_FORMAT
#define NTV2_IS_QUAD_QUAD_FORMAT(__f__)
Definition: ntv2enums.h:778
AJA_STATUS_INITIALIZE
@ AJA_STATUS_INITIALIZE
Definition: types.h:386
NTV2SDIInStatistics::GetSDIInputStatus
bool GetSDIInputStatus(NTV2SDIInputStatus &outStatus, const UWord inSDIInputIndex0=0)
Answers with the NTV2SDIInputStatus for the given SDI input spigot.
Definition: ntv2publicinterface.cpp:2334
NTV2_LHIHDMIColorSpaceYCbCr
@ NTV2_LHIHDMIColorSpaceYCbCr
Definition: ntv2enums.h:3599
NTV2Capture::SetupHostBuffers
virtual void SetupHostBuffers(void)
Sets up my circular buffers.
Definition: ntv2capture.cpp:226
DEC
#define DEC(__x__)
Definition: ntv2publicinterface.h:5605
NTV2SDIInStatistics
This is used by the CNTV2Card::ReadSDIStatistics function.
Definition: ntv2publicinterface.h:7678
false
#define false
Definition: ntv2devicefeatures.h:25
AUTOCIRCULATE_WITH_RP188
#define AUTOCIRCULATE_WITH_RP188
Use this to AutoCirculate with RP188.
Definition: ntv2publicinterface.h:5521
CAPWARN
#define CAPWARN(_expr_)
Definition: ntv2democommon.h:29
NTV2ACFrameRange::lastFrame
UWord lastFrame(void) const
Definition: ntv2utils.h:976
AUTOCIRCULATE_STATUS::IsRunning
bool IsRunning(void) const
Definition: ntv2publicinterface.h:7266
NTV2FrameBufferFormatToString
std::string NTV2FrameBufferFormatToString(const NTV2FrameBufferFormat inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:6940
NTV2XptConnections
std::map< NTV2InputXptID, NTV2OutputXptID > NTV2XptConnections
Definition: ntv2signalrouter.h:39
CNTV2Card::WaitForOutputVerticalInterrupt
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 ...
Definition: ntv2subscriptions.cpp:134
std
Definition: json.hpp:5362
NTV2Capture::GetACStatus
virtual void GetACStatus(ULWord &outGoodFrames, ULWord &outDroppedFrames, ULWord &outBufferLevel)
Provides status information about my input (capture) process.
Definition: ntv2capture.cpp:504
CNTV2Card::AutoCirculateTransfer
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 ...
Definition: ntv2autocirculate.cpp:695
AUTOCIRCULATE_STATUS::GetDroppedFrameCount
ULWord GetDroppedFrameCount(void) const
Definition: ntv2publicinterface.h:7211
NTV2FrameData::fNumAnc2Bytes
ULWord fNumAnc2Bytes
Actual number of captured F2 anc bytes.
Definition: ntv2democommon.h:90
NTV2Capture::~NTV2Capture
virtual ~NTV2Capture()
Definition: ntv2capture.cpp:40
CNTV2Card::GetHDMIInputColor
virtual bool GetHDMIInputColor(NTV2LHIHDMIColorSpace &outValue, const NTV2Channel inChannel=NTV2_CHANNEL1)
Answers with the current colorspace for the given HDMI input.
Definition: ntv2hdmi.cpp:52
AJA_NTV2_AUDIO_RECORD_DO
#define AJA_NTV2_AUDIO_RECORD_DO
Definition: ntv2democommon.h:873
CIRCULAR_BUFFER_SIZE
static const size_t CIRCULAR_BUFFER_SIZE(10)
Number of NTV2FrameData's in our ring.
CNTV2MacDriverInterface::AcquireStreamForApplication
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 ...
Definition: ntv2macdriverinterface.cpp:481
CNTV2DriverInterface::GetDeviceID
virtual NTV2DeviceID GetDeviceID(void)
Definition: ntv2driverinterface.cpp:381
AUTOCIRCULATE_STATUS::HasAvailableInputFrame
bool HasAvailableInputFrame(void) const
Definition: ntv2publicinterface.h:7236
CNTV2Card::GetEveryFrameServices
virtual bool GetEveryFrameServices(NTV2EveryFrameTaskMode &outMode)
Retrieves the device's current "retail service" task mode.
Definition: ntv2register.cpp:184
AUTOCIRCULATE_STATUS::WithCustomAnc
bool WithCustomAnc(void) const
Definition: ntv2publicinterface.h:7301
AJACircularBuffer::SetAbortFlag
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...
Definition: circularbuffer.h:51
NTV2_INPUT_SOURCE_IS_SDI
#define NTV2_INPUT_SOURCE_IS_SDI(_inpSrc_)
Definition: ntv2enums.h:1242
NTV2_IOKINDS_SDI
@ NTV2_IOKINDS_SDI
Specifies SDI input/output kinds.
Definition: ntv2enums.h:1251
NTV2Buffer::Fill
bool Fill(const T &inValue)
Fills me with the given scalar value.
Definition: ntv2publicinterface.h:6218
AJAThread::SetPriority
virtual AJAStatus SetPriority(AJAThreadPriority priority)
Definition: thread.cpp:133
CNTV2Card::AutoCirculateStart
virtual bool AutoCirculateStart(const NTV2Channel inChannel, const ULWord64 inStartTime=0)
Starts AutoCirculating the specified channel that was previously initialized by CNTV2Card::AutoCircul...
Definition: ntv2autocirculate.cpp:503
NTV2SDIInputStatus::mLocked
bool mLocked
If true, a valid SDI transport was detected in the received data stream. If false,...
Definition: ntv2publicinterface.h:6877
CNTV2Card::SetReference
virtual bool SetReference(const NTV2ReferenceSource inRefSource, const bool inKeepFramePulseSelect=(0))
Sets the device's clock reference source. See Video Output Clocking & Synchronization for more inform...
Definition: ntv2register.cpp:1484
NTV2Capture::CaptureFrames
virtual void CaptureFrames(void)
Repeatedly captures frames using AutoCirculate (until global quit flag set).
Definition: ntv2capture.cpp:384
AJA_STATUS_OPEN
@ AJA_STATUS_OPEN
Definition: types.h:388
AUTOCIRCULATE_TRANSFER::GetInputTimeCodes
bool GetInputTimeCodes(NTV2TimeCodeList &outValues) const
Intended for capture, answers with the timecodes captured in my acTransferStatus member's acFrameStam...
Definition: ntv2publicinterface.cpp:2834
NTV2Capture::SetupAudio
virtual AJAStatus SetupAudio(void)
Sets up everything I need for capturing audio.
Definition: ntv2capture.cpp:211
AJAThread::Start
virtual AJAStatus Start()
Definition: thread.cpp:91
CNTV2Card::SubscribeInputVerticalEvent
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: ntv2subscriptions.cpp:39
AJA_FAILURE
#define AJA_FAILURE(_status_)
Definition: types.h:371
NTV2_IS_VALID_AUDIO_SYSTEM
#define NTV2_IS_VALID_AUDIO_SYSTEM(__x__)
Definition: ntv2enums.h:3833
CNTV2Card::EnableChannel
virtual bool EnableChannel(const NTV2Channel inChannel)
Enables the given FrameStore.
Definition: ntv2register.cpp:2097
DeviceCapabilities::CanDoFrameBufferFormat
bool CanDoFrameBufferFormat(const NTV2PixelFormat inPF)
Definition: ntv2devicecapabilities.h:223
NTV2FrameData::AncBuffer
NTV2Buffer & AncBuffer(void)
Definition: ntv2democommon.h:113
NTV2ChannelToAudioSystem
NTV2AudioSystem NTV2ChannelToAudioSystem(const NTV2Channel inChannel)
Converts the given NTV2Channel value into its equivalent NTV2AudioSystem.
Definition: ntv2utils.cpp:4927
CNTV2Card::AutoCirculateStop
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...
Definition: ntv2autocirculate.cpp:519
DEVICE_ID_NOTFOUND
@ DEVICE_ID_NOTFOUND
Invalid or "not found".
Definition: ntv2enums.h:90
CNTV2Card::ReadSDIStatistics
virtual bool ReadSDIStatistics(NTV2SDIInStatistics &outStats)
For devices that support it (see the NTV2DeviceCanDoSDIErrorChecks function in "ntv2devicefeatures....
Definition: ntv2register.cpp:4648
CaptureConfig::fInputSource
NTV2InputSource fInputSource
The device input connector to use.
Definition: ntv2democommon.h:271
CAPNOTE
#define CAPNOTE(_expr_)
Definition: ntv2democommon.h:31
NTV2_OEM_TASKS
@ NTV2_OEM_TASKS
2: OEM: Device is configured by controlling application(s), with minimal driver involvement.
Definition: ntv2publicinterface.h:4292
CNTV2Card::AncExtractGetBufferOverrun
virtual bool AncExtractGetBufferOverrun(const UWord inSDIInput, bool &outIsOverrun, const UWord inField=0)
Answers whether or not the given SDI input's Anc extractor reached its buffer limits....
Definition: ntv2anc.cpp:1016
NTV2FrameData::fTimecodes
NTV2TimeCodes fTimecodes
Map of TC indexes to NTV2_RP188 values.
Definition: ntv2democommon.h:87
CaptureConfig::fWithAudio
bool fWithAudio
If true, also capture Audio.
Definition: ntv2democommon.h:278
NTV2_AUDIOSYSTEM_INVALID
@ NTV2_AUDIOSYSTEM_INVALID
Definition: ntv2enums.h:3826
NTV2Capture::Init
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
Definition: ntv2capture.cpp:73