AJA NTV2 SDK  17.0.1.1246
NTV2 SDK 17.0.1.1246
ntv2capture4k.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 //#define AJA_RECORD_MLAUDIO // Uncomment to record captured raw multilink audio into two binary data files
9 #include "ntv2capture4k.h"
10 #include "ntv2devicescanner.h"
11 #include "ntv2utils.h"
12 #include "ntv2devicefeatures.h"
13 #include "ajabase/system/process.h"
14 
15 using namespace std;
16 
17 #define NTV2_BUFFER_LOCK
18 
19 
21 
23  : mConsumerThread (AJAThread()),
24  mProducerThread (AJAThread()),
25  mDeviceID (DEVICE_ID_NOTFOUND),
26  mConfig (inConfig),
27  mVideoFormat (NTV2_FORMAT_UNKNOWN),
28  mSavedTaskMode (NTV2_DISABLE_TASKS),
29  mAudioSystem (inConfig.fWithAudio ? NTV2_AUDIOSYSTEM_1 : NTV2_AUDIOSYSTEM_INVALID),
30  mHostBuffers (),
31  mAVCircularBuffer (),
32  mGlobalQuit (false),
34 {
35 } // constructor
36 
37 
39 {
40  // Stop my capture and consumer threads, then destroy them...
41  Quit();
42 
43  // Unsubscribe from VBI events...
46 
47 } // destructor
48 
49 
51 {
52  // Set the global 'quit' flag, and wait for the threads to go inactive...
53  mGlobalQuit = true;
54 
55  while (mConsumerThread.Active())
56  AJATime::Sleep(10);
57 
58  while (mProducerThread.Active())
59  AJATime::Sleep(10);
60 
61  // Restore some of the device's former state...
62  if (!mConfig.fDoMultiFormat)
63  {
65  mDevice.SetEveryFrameServices(mSavedTaskMode); // Restore prior task mode
66  }
67 
68 } // Quit
69 
70 
72 {
74 
75  // Open the device...
77  {cerr << "## ERROR: Device '" << mConfig.fDeviceSpec << "' not found" << endl; return AJA_STATUS_OPEN;}
78 
79  if (!mDevice.IsDeviceReady())
80  {cerr << "## ERROR: '" << mDevice.GetDisplayName() << "' not ready" << endl; return AJA_STATUS_INITIALIZE;}
81 
82  mDeviceID = mDevice.GetDeviceID(); // Keep the device ID handy, as it's used frequently
83  const bool isKonaHDMI (::NTV2DeviceGetNumHDMIVideoInputs(mDeviceID) > 1);
84  if (!::NTV2DeviceCanDoCapture(mDeviceID))
85  {cerr << "## ERROR: '" << mDevice.GetDisplayName() << "' is playback-only" << endl; return AJA_STATUS_FEATURE;}
86 
87  if (!::NTV2DeviceCanDoFrameBufferFormat (mDeviceID, mConfig.fPixelFormat))
88  { cerr << "## ERROR: '" << mDevice.GetDisplayName() << "' doesn't support '"
89  << ::NTV2FrameBufferFormatToString(mConfig.fPixelFormat, true) << "' ("
90  << ::NTV2FrameBufferFormatToString(mConfig.fPixelFormat, false) << ", " << DEC(mConfig.fPixelFormat) << ")" << endl;
92  }
93 
94  ULWord appSignature (0);
95  int32_t appPID (0);
96  mDevice.GetStreamingApplication (appSignature, appPID); // Who currently "owns" the device?
97  mDevice.GetEveryFrameServices(mSavedTaskMode); // Save the current device state
98  if (!mConfig.fDoMultiFormat)
99  {
101  {
102  cerr << "## ERROR: Unable to acquire '" << mDevice.GetDisplayName() << "' because another app (pid " << appPID << ") owns it" << endl;
103  return AJA_STATUS_BUSY; // Another app is using the device
104  }
105  mDevice.GetEveryFrameServices(mSavedTaskMode); // Save the current state before we change it
106  }
107  mDevice.SetEveryFrameServices(NTV2_OEM_TASKS); // Prevent interference from AJA retail services
108 
109  if (::NTV2DeviceCanDoMultiFormat(mDeviceID))
110  mDevice.SetMultiFormatMode(mConfig.fDoMultiFormat);
111 
112  // This demo permits only the input channel/frameStore to be specified. Set the input source here...
113  const NTV2Channel origCh (mConfig.fInputChannel);
114  if (isKonaHDMI)
115  { // KonaHDMI gets special treatment...
116  if (!mConfig.fDoTSIRouting)
117  {cerr << "## ERROR: UHD/4K on '" << mDevice.GetDisplayName() << "' requires TSI: omit '--squares' option" << endl; return AJA_STATUS_BAD_PARAM;}
118  if (mConfig.fInputChannel != NTV2_CHANNEL1 && mConfig.fInputChannel != NTV2_CHANNEL3)
119  mConfig.fInputChannel = NTV2_CHANNEL3;
121  }
122  else if (::NTV2DeviceCanDo12gRouting(mDeviceID))
123  {
124  mConfig.fDoTSIRouting = false; // TSI Mux/Demux built-in to FrameStores
125  if (UWord(origCh) >= ::NTV2DeviceGetNumFrameStores(mDeviceID))
126  {
127  cerr << "## ERROR: No such channel Ch" << DEC(origCh) << " for '" << ::NTV2DeviceIDToString(mDeviceID,true) << "'";
128  return AJA_STATUS_BAD_PARAM;
129  }
131  }
132  else if (mConfig.fDoTSIRouting)
133  { // TSI: force even ordinal NTV2Channel values...
134  if (mConfig.fInputChannel < NTV2_CHANNEL3)
135  mConfig.fInputChannel = NTV2_CHANNEL1;
136  else if (mConfig.fInputChannel < NTV2_CHANNEL5)
137  mConfig.fInputChannel = NTV2_CHANNEL3;
138  else if (mConfig.fInputChannel < NTV2_CHANNEL7)
139  mConfig.fInputChannel = NTV2_CHANNEL5;
140  else
141  mConfig.fInputChannel = NTV2_CHANNEL7;
142  }
143  else // quad mode: force Ch1 (or Ch5 on Corvid88)
145 
148 
149  if (mConfig.fInputChannel != origCh)
150  cerr << "## WARNING: Specified channel Ch" << DEC(origCh+1) << " corrected to use Ch"
151  << DEC(mConfig.fInputChannel+1) << " to work for UHD/4K on '" << mDevice.GetDisplayName() << "'" << endl;
152 
153  // Determine input connectors and frameStores to be used...
154  const UWord numSpigots (::NTV2DeviceCanDo12gRouting(mDeviceID) ? 1 : (mConfig.fDoTSIRouting ? 2 : 4));
155  mActiveSDIs = ::NTV2MakeChannelSet (::NTV2InputSourceToChannel(mConfig.fInputSource), numSpigots);
156  mActiveFrameStores = ::NTV2MakeChannelSet (mConfig.fInputChannel, numSpigots);
157 
158  // Set up the video and audio...
159  status = SetupVideo();
160  if (AJA_FAILURE(status))
161  return status;
162 
163  if (mConfig.fWithAudio)
164  status = SetupAudio();
165  if (AJA_FAILURE(status))
166  return status;
167 
168  // Set up the circular buffers, the device signal routing, and both playout and capture AutoCirculate...
170  if (!RouteInputSignal())
171  return AJA_STATUS_FAIL;
172 
173  #if defined(_DEBUG)
174  cerr << mConfig << endl << "FrameStores: " << ::NTV2ChannelSetToStr(mActiveFrameStores) << endl
175  << "Inputs: " << ::NTV2ChannelSetToStr(mActiveSDIs) << endl;
176  if (mDevice.IsRemote())
177  cerr << "Device Description: " << mDevice.GetDescription() << endl << endl;
178  #endif // defined(_DEBUG)
179  return AJA_STATUS_SUCCESS;
180 
181 } // Init
182 
183 
185 {
186  // Enable the FrameStores we intend to use...
187  mDevice.EnableChannels (mActiveFrameStores, !mConfig.fDoMultiFormat); // Disable the rest if we own the device
188 
189  // Enable and subscribe to VBIs (critical on Windows)...
190  mDevice.EnableInputInterrupt(mConfig.fInputChannel);
193 
194  // If the device supports bi-directional SDI and the requested input is SDI,
195  // ensure the SDI connector(s) are configured to receive...
197  {
198  mDevice.SetSDITransmitEnable (mActiveSDIs, false); // Set SDI connector(s) to receive
199  mDevice.WaitForOutputVerticalInterrupt (NTV2_CHANNEL1, 10); // Wait 10 VBIs to allow reciever to lock
200  }
201 
202  // Determine the input video signal format...
203  mVideoFormat = mDevice.GetInputVideoFormat(mConfig.fInputSource);
204  if (mVideoFormat == NTV2_FORMAT_UNKNOWN)
205  {cerr << "## ERROR: No input signal or unknown format" << endl; return AJA_STATUS_NOINPUT;}
206  CNTV2DemoCommon::Get4KInputFormat(mVideoFormat); // Convert to 4K format
207  mFormatDesc = NTV2FormatDescriptor(mVideoFormat, mConfig.fPixelFormat);
208 
209  // Setting SDI output clock timing/reference is unimportant for capture-only apps...
210  if (!mConfig.fDoMultiFormat) // ...if not sharing the device...
211  mDevice.SetReference(NTV2_REFERENCE_FREERUN); // ...let it free-run
212 
213  // Set the device video format to whatever was detected at the input(s)...
214  mDevice.SetVideoFormat (mVideoFormat, false, false, mConfig.fInputChannel);
215  mDevice.SetVANCMode (mActiveFrameStores, NTV2_VANCMODE_OFF); // Disable VANC
216  if (::NTV2DeviceCanDo12gRouting(mDeviceID) || mConfig.fDoTSIRouting)
217  mDevice.SetTsiFrameEnable (true, mConfig.fInputChannel);
218  else
219  mDevice.Set4kSquaresEnable (true, mConfig.fInputChannel);
220 
221  // Set the frame buffer pixel format for the FrameStore(s) to be used on the device...
222  mDevice.SetFrameBufferFormat (mActiveFrameStores, mConfig.fPixelFormat);
223  return AJA_STATUS_SUCCESS;
224 
225 } // SetupVideo
226 
227 
229 {
230  // In multiformat mode, base the audio system on the channel...
231  if (mConfig.fDoMultiFormat)
232  if (::NTV2DeviceGetNumAudioSystems(mDeviceID) > 1)
233  if (UWord(mConfig.fInputChannel) < ::NTV2DeviceGetNumAudioSystems(mDeviceID))
234  mAudioSystem = ::NTV2ChannelToAudioSystem(mConfig.fInputChannel);
235 
236  NTV2AudioSystemSet audSystems (::NTV2MakeAudioSystemSet (mAudioSystem, 1));
237  if (mConfig.fNumAudioLinks > 1)
238  {
239  audSystems = ::NTV2MakeAudioSystemSet (NTV2_AUDIOSYSTEM_1, NTV2_IS_4K_HFR_VIDEO_FORMAT(mVideoFormat) ? 4 : 2);
240  if (mConfig.fInputChannel != NTV2_CHANNEL1)
241  {cerr << "## ERROR: Multi-Link audio demo only intended for input Ch1, not Ch" << DEC(mConfig.fInputChannel) << endl; return AJA_STATUS_UNSUPPORTED;}
242 
243  // Enable MultiLink audio...
245  if (NTV2_IS_4K_HFR_VIDEO_FORMAT(mVideoFormat))
246  {
249  }
250  }
251  CNTV2DemoCommon::ConfigureAudioSystems (mDevice, mConfig, audSystems);
252  return AJA_STATUS_SUCCESS;
253 
254 } // SetupAudio
255 
256 
258 {
259  // Let my circular buffer know when it's time to quit...
260  mAVCircularBuffer.SetAbortFlag(&mGlobalQuit);
261 
262  ULWord F1AncSize(0), F2AncSize(0);
263  if (mConfig.fWithAnc)
264  { // Use the max anc size stipulated by the AncFieldOffset VReg values...
265  ULWord F1OffsetFromEnd(0), F2OffsetFromEnd(0);
266  mDevice.ReadRegister(kVRegAncField1Offset, F1OffsetFromEnd); // # bytes from end of 8MB/16MB frame
267  mDevice.ReadRegister(kVRegAncField2Offset, F2OffsetFromEnd); // # bytes from end of 8MB/16MB frame
268  // Based on the offsets, calculate the max anc capacity
269  F1AncSize = F2OffsetFromEnd > F1OffsetFromEnd ? 0 : F1OffsetFromEnd - F2OffsetFromEnd;
270  F2AncSize = F2OffsetFromEnd > F1OffsetFromEnd ? F2OffsetFromEnd - F1OffsetFromEnd : F2OffsetFromEnd;
271  }
272 
273  // Allocate and add each in-host NTV2FrameData to my circular buffer member variable...
274  const size_t audioBufferSize (NTV2_AUDIOSIZE_MAX * mConfig.fNumAudioLinks);
275  mHostBuffers.reserve(size_t(CIRCULAR_BUFFER_SIZE));
276  while (mHostBuffers.size() < size_t(CIRCULAR_BUFFER_SIZE))
277  {
278  mHostBuffers.push_back(NTV2FrameData());
279  NTV2FrameData & frameData(mHostBuffers.back());
280  frameData.fVideoBuffer.Allocate(mFormatDesc.GetVideoWriteSize());
281  frameData.fAudioBuffer.Allocate(NTV2_IS_VALID_AUDIO_SYSTEM(mAudioSystem) ? audioBufferSize : 0);
282  frameData.fAncBuffer.Allocate(F1AncSize);
283  frameData.fAncBuffer2.Allocate(F2AncSize);
284  mAVCircularBuffer.Add(&frameData);
285 
286 #ifdef NTV2_BUFFER_LOCK
287  // Page lock the memory
288  if (frameData.fVideoBuffer)
289  mDevice.DMABufferLock(frameData.fVideoBuffer, true);
290  if (frameData.fAudioBuffer)
291  mDevice.DMABufferLock(frameData.fAudioBuffer, true);
292  if (frameData.fAncBuffer)
293  mDevice.DMABufferLock(frameData.fAncBuffer, true);
294 #endif
295  } // for each NTV2FrameData
296 
297 } // SetupHostBuffers
298 
299 
301 {
304  mDevice.GetHDMIInputColor (inputColorSpace, mConfig.fInputChannel);
305 
306  const bool isInputRGB (inputColorSpace == NTV2_LHIHDMIColorSpaceRGB);
307  NTV2XptConnections connections;
308 
309  return CNTV2DemoCommon::GetInputRouting4K (connections, mConfig, mDeviceID, isInputRGB)
310  && mDevice.ApplySignalRoute(connections, !mConfig.fDoMultiFormat);
311 
312 } // RouteInputSignal
313 
314 
316 {
317  // Start the playout and capture threads...
320  return AJA_STATUS_SUCCESS;
321 
322 } // Run
323 
324 
326 
327 // This starts the consumer thread
329 {
330  // Create and start the consumer thread...
331  mConsumerThread.Attach(ConsumerThreadStatic, this);
332  mConsumerThread.SetPriority(AJA_ThreadPriority_High);
333  mConsumerThread.Start();
334 
335 } // StartConsumerThread
336 
337 
338 // The consumer thread function
339 void NTV2Capture4K::ConsumerThreadStatic (AJAThread * pThread, void * pContext) // static
340 {
341  (void) pThread;
342 
343  // Grab the NTV2Capture instance pointer from the pContext parameter,
344  // then call its ConsumeFrames method...
345  NTV2Capture4K * pApp (reinterpret_cast<NTV2Capture4K*>(pContext));
346  pApp->ConsumeFrames();
347 
348 } // ConsumerThreadStatic
349 
350 
352 {
353  CAPNOTE("Thread started");
354  AJA_NTV2_MLAUDIO_RECORD_BEGIN // Active when AJA_RECORD_MLAUDIO defined
355 
356  while (!mGlobalQuit)
357  {
358  // Wait for the next frame to become ready to "consume"...
359  NTV2FrameData * pFrameData(mAVCircularBuffer.StartConsumeNextBuffer());
360  if (pFrameData)
361  {
362  // Do something useful with the frame data...
363  // . . . . . . . . . . . .
364  // . . . . . . . . . . . .
365  // . . . . . . . . . . . .
366  AJA_NTV2_MLAUDIO_RECORD_DO // Active when AJA_RECORD_MLAUDIO defined
367 
368  // Now release and recycle the buffer...
369  mAVCircularBuffer.EndConsumeNextBuffer();
370  } // if pFrameData
371  } // loop til quit signaled
372 
373  AJA_NTV2_MLAUDIO_RECORD_END // Active when AJA_RECORD_MLAUDIO defined
374  CAPNOTE("Thread completed, will exit");
375 
376 } // ConsumeFrames
377 
378 
380 
381 // This starts the capture (producer) thread
383 {
384  // Create and start the capture thread...
385  mProducerThread.Attach(ProducerThreadStatic, this);
386  mProducerThread.SetPriority(AJA_ThreadPriority_High);
387  mProducerThread.Start();
388 
389 } // StartProducerThread
390 
391 
392 // The capture thread function
393 void NTV2Capture4K::ProducerThreadStatic (AJAThread * pThread, void * pContext) // static
394 {
395  (void) pThread;
396 
397  // Grab the NTV2Capture instance pointer from the pContext parameter,
398  // then call its CaptureFrames method...
399  NTV2Capture4K * pApp (reinterpret_cast<NTV2Capture4K*>(pContext));
400  pApp->CaptureFrames ();
401 
402 } // ProducerThreadStatic
403 
404 
406 {
407  AUTOCIRCULATE_TRANSFER inputXfer; // AutoCirculate input transfer info
408 
409  // Have AutoCirculate use 7 device frame buffers...
410  static const UWord startFrame12g[] = {0, 7, 64, 71};
411  static const UWord startFrame[] = {0, 7, 14, 21};
412 
413  if (::NTV2DeviceCanDo12gRouting(mDeviceID))
414  mConfig.fFrames.setRangeWithCount(7, startFrame12g[mConfig.fInputChannel]);
415  else // TSI or Squares
416  mConfig.fFrames.setRangeWithCount(7, startFrame[mConfig.fInputChannel / 2]);
417 
418  CAPNOTE("Thread started");
419  // Initialize and start capture AutoCirculate...
420  mDevice.AutoCirculateStop(mActiveFrameStores); // Just in case
421  if (!mDevice.AutoCirculateInitForInput (mConfig.fInputChannel, // primary channel
422  mConfig.fFrames.count(), // numFrames (zero if specifying range)
423  mAudioSystem, // audio system (if any)
424  mACOptions, // AutoCirculate options
425  1, // numChannels to gang
426  mConfig.fFrames.firstFrame(), mConfig.fFrames.lastFrame()))
427  mGlobalQuit = true;
428  if (!mGlobalQuit && !mDevice.AutoCirculateStart(mConfig.fInputChannel))
429  mGlobalQuit = true;
430 
431  // Ingest frames til Quit signaled...
432  while (!mGlobalQuit)
433  {
434  AUTOCIRCULATE_STATUS acStatus;
435  mDevice.AutoCirculateGetStatus (mConfig.fInputChannel, acStatus);
436 
437  if (acStatus.IsRunning() && acStatus.HasAvailableInputFrame())
438  {
439  // At this point, there's at least one fully-formed frame available in the device's
440  // frame buffer to transfer to the host. Reserve an NTV2FrameData to "produce", and
441  // use it in the next transfer from the device...
442  NTV2FrameData * pFrameData (mAVCircularBuffer.StartProduceNextBuffer());
443  if (!pFrameData)
444  continue;
445 
446  NTV2FrameData & frameData (*pFrameData);
447  inputXfer.SetVideoBuffer (frameData.VideoBuffer(), frameData.VideoBufferSize());
448  if (acStatus.WithAudio())
449  inputXfer.SetAudioBuffer (frameData.AudioBuffer(), frameData.AudioBufferSize());
450  if (acStatus.WithCustomAnc())
451  inputXfer.SetAncBuffers (frameData.AncBuffer(), frameData.AncBufferSize(),
452  frameData.AncBuffer2(), frameData.AncBuffer2Size());
453 
454  // Transfer video/audio/anc from the device into our host buffers...
455  mDevice.AutoCirculateTransfer (mConfig.fInputChannel, inputXfer);
456 
457  // Remember the actual amount of audio captured...
458  if (acStatus.WithAudio())
459  frameData.fNumAudioBytes = inputXfer.GetCapturedAudioByteCount();
460 
461  // Grab all valid timecodes that were captured...
462  inputXfer.GetInputTimeCodes (frameData.fTimecodes, mConfig.fInputChannel, /*ValidOnly*/ true);
463 
464  // Signal that we're done "producing" the frame, making it available for future "consumption"...
465  mAVCircularBuffer.EndProduceNextBuffer();
466  } // if A/C running and frame(s) are available for transfer
467  else
468  {
469  // Either AutoCirculate is not running, or there were no frames available on the device to transfer.
470  // Rather than waste CPU cycles spinning, waiting until a frame becomes available, it's far more
471  // efficient to wait for the next input vertical interrupt event to get signaled...
473  }
474  } // loop til quit signaled
475 
476  // Stop AutoCirculate...
477  mDevice.AutoCirculateStop (mConfig.fInputChannel);
478  CAPNOTE("Thread completed, will exit");
479 
480 } // CaptureFrames
481 
482 
483 void NTV2Capture4K::GetACStatus (ULWord & outGoodFrames, ULWord & outDroppedFrames, ULWord & outBufferLevel)
484 {
485  AUTOCIRCULATE_STATUS status;
486  mDevice.AutoCirculateGetStatus(mConfig.fInputChannel, status);
487  outGoodFrames = status.GetProcessedFrameCount();
488  outDroppedFrames = status.GetDroppedFrameCount();
489  outBufferLevel = status.GetBufferLevel();
490 }
ntv2capture4k.h
Declares the NTV2Capture class.
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
AJA_NTV2_MLAUDIO_RECORD_BEGIN
#define AJA_NTV2_MLAUDIO_RECORD_BEGIN
Definition: ntv2democommon.h:900
CNTV2Card::SetVANCMode
virtual bool SetVANCMode(const NTV2VANCMode inVancMode, const NTV2Channel inChannel=NTV2_CHANNEL1)
Sets the VANC mode for the given FrameStore.
Definition: ntv2register.cpp:2656
NTV2DeviceCanDoCapture
bool NTV2DeviceCanDoCapture(const NTV2DeviceID inDeviceID)
Definition: ntv2devicefeatures.hpp:1907
CaptureConfig::fDoMultiFormat
bool fDoMultiFormat
If true, use multi-format/multi-channel mode, if device supports it; otherwise normal mode.
Definition: ntv2democommon.h:276
NTV2ChannelSetToStr
std::string NTV2ChannelSetToStr(const NTV2ChannelSet &inObj, const bool inCompact=true)
Definition: ntv2publicinterface.cpp:3288
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:4281
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
NTV2FormatDescriptor::GetVideoWriteSize
ULWord GetVideoWriteSize(ULWord inPageSize=4096UL) const
Definition: ntv2formatdescriptor.cpp:862
NTV2DeviceGetNumHDMIVideoInputs
UWord NTV2DeviceGetNumHDMIVideoInputs(const NTV2DeviceID inDeviceID)
Definition: ntv2devicefeatures.hpp:10766
AUTOCIRCULATE_TRANSFER::GetCapturedAudioByteCount
ULWord GetCapturedAudioByteCount(void) const
Definition: ntv2publicinterface.h:8270
AJA_NTV2_MLAUDIO_RECORD_DO
#define AJA_NTV2_MLAUDIO_RECORD_DO
Definition: ntv2democommon.h:901
AJA_ThreadPriority_High
@ AJA_ThreadPriority_High
Definition: thread.h:44
NTV2ACFrameRange::firstFrame
UWord firstFrame(void) const
Definition: ntv2utils.h:975
CNTV2Card::Set4kSquaresEnable
virtual bool Set4kSquaresEnable(const bool inIsEnabled, const NTV2Channel inChannel)
Enables or disables SMPTE 425 "2K quadrants" mode for the given FrameStore bank on the device....
Definition: ntv2register.cpp:1240
ntv2devicefeatures.h
Declares device capability functions.
NTV2LHIHDMIColorSpace
NTV2LHIHDMIColorSpace
Definition: ntv2enums.h:3592
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:709
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:2614
CNTV2Card::ApplySignalRoute
virtual bool ApplySignalRoute(const CNTV2SignalRouter &inRouter, const bool inReplace=false)
Applies the given routing table to the AJA device.
Definition: ntv2regroute.cpp:242
NTV2Channel
NTV2Channel
These enum values are mostly used to identify a specific Frame Store. They're also commonly used to i...
Definition: ntv2enums.h:1305
AJA_STATUS_SUCCESS
@ AJA_STATUS_SUCCESS
Definition: types.h:368
NTV2Capture4K::SetupHostBuffers
virtual void SetupHostBuffers(void)
Sets up my circular buffers.
Definition: ntv2capture4k.cpp:257
NTV2Capture4K::Quit
virtual void Quit(void)
Gracefully stops me from running.
Definition: ntv2capture4k.cpp:50
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
AJA_STATUS_BUSY
@ AJA_STATUS_BUSY
Definition: types.h:378
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:327
AUTOCIRCULATE_STATUS::GetProcessedFrameCount
ULWord GetProcessedFrameCount(void) const
Definition: ntv2publicinterface.h:7161
NTV2_AUDIOSYSTEM_1
@ NTV2_AUDIOSYSTEM_1
This identifies the first Audio System.
Definition: ntv2enums.h:3811
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
NTV2DeviceCanDoMultiFormat
bool NTV2DeviceCanDoMultiFormat(const NTV2DeviceID inDeviceID)
Definition: ntv2devicefeatures.hpp:4065
AUTOCIRCULATE_STATUS::GetBufferLevel
ULWord GetBufferLevel(void) const
Definition: ntv2publicinterface.h:7166
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:832
NTV2Capture4K::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: ntv2capture4k.cpp:339
NTV2FrameData::fAncBuffer2
NTV2Buffer fAncBuffer2
Additional "F2" host anc buffer.
Definition: ntv2democommon.h:86
AUTOCIRCULATE_WITH_MULTILINK_AUDIO3
#define AUTOCIRCULATE_WITH_MULTILINK_AUDIO3
Use this to AutoCirculate with base audiosystem controlling base AudioSystem + 3.
Definition: ntv2publicinterface.h:5502
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
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:1554
NTV2_LHIHDMIColorSpaceRGB
@ NTV2_LHIHDMIColorSpaceRGB
Definition: ntv2enums.h:3595
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:2622
NTV2FrameData::fAncBuffer
NTV2Buffer fAncBuffer
Host ancillary data buffer.
Definition: ntv2democommon.h:85
NTV2DeviceCanDoFrameBufferFormat
bool NTV2DeviceCanDoFrameBufferFormat(const NTV2DeviceID inDeviceID, const NTV2FrameBufferFormat inFBFormat)
Definition: ntv2devicefeatures.hpp:15330
NTV2_CHANNEL1
@ NTV2_CHANNEL1
Specifies channel or Frame Store 1 (or the first item).
Definition: ntv2enums.h:1307
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:3805
AUTOCIRCULATE_STATUS::WithAudio
bool WithAudio(void) const
Definition: ntv2publicinterface.h:7236
NTV2Capture4K::RouteInputSignal
virtual bool RouteInputSignal(void)
Sets up device routing for capture.
Definition: ntv2capture4k.cpp:300
CNTV2Card::SetVideoFormat
virtual bool SetVideoFormat(const NTV2VideoFormat inVideoFormat, const bool inIsAJARetail=true, const bool inKeepVancSettings=false, const NTV2Channel inChannel=NTV2_CHANNEL1)
Configures the AJA device to handle a specific video format.
Definition: ntv2register.cpp:204
CNTV2DemoCommon::Get4KInputFormat
static bool Get4KInputFormat(NTV2VideoFormat &inOutVideoFormat)
Given a video format, if all 4 inputs are the same and promotable to 4K, this function does the promo...
Definition: ntv2democommon.cpp:1099
CaptureConfig::fWithAnc
bool fWithAnc
If true, also capture Anc.
Definition: ntv2democommon.h:277
NTV2Capture4K::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: ntv2capture4k.cpp:393
NTV2FrameData::VideoBuffer
NTV2Buffer & VideoBuffer(void)
Definition: ntv2democommon.h:106
kVRegAncField2Offset
@ kVRegAncField2Offset
Anc Field2 byte offset from end of frame buffer (GUMP on all boards except RTP for SMPTE2022/IP)
Definition: ntv2virtualregisters.h:336
AUTOCIRCULATE_WITH_MULTILINK_AUDIO1
#define AUTOCIRCULATE_WITH_MULTILINK_AUDIO1
Use this to AutoCirculate with base audiosystem controlling base AudioSystem + 1.
Definition: ntv2publicinterface.h:5500
NTV2_CHANNEL5
@ NTV2_CHANNEL5
Specifies channel or Frame Store 5 (or the 5th item).
Definition: ntv2enums.h:1311
NTV2MakeAudioSystemSet
NTV2AudioSystemSet NTV2MakeAudioSystemSet(const NTV2AudioSystem inFirstAudioSystem, const UWord inCount=1)
Definition: ntv2publicinterface.cpp:3349
AJAThread
Definition: thread.h:69
AUTOCIRCULATE_WITH_ANC
#define AUTOCIRCULATE_WITH_ANC
Use this to AutoCirculate with ancillary data.
Definition: ntv2publicinterface.h:5496
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:84
AJA_STATUS_NOINPUT
@ AJA_STATUS_NOINPUT
Definition: types.h:387
AJAStatus
AJAStatus
Definition: types.h:365
NTV2Capture4K::Init
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
Definition: ntv2capture4k.cpp:71
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:3713
AJA_STATUS_FEATURE
@ AJA_STATUS_FEATURE
Definition: types.h:380
AJA_STATUS_FAIL
@ AJA_STATUS_FAIL
Definition: types.h:369
CNTV2DemoCommon::ConfigureAudioSystems
static bool ConfigureAudioSystems(CNTV2Card &inDevice, const CaptureConfig &inConfig, const NTV2AudioSystemSet inAudioSystems)
Configures capture audio systems.
Definition: ntv2democommon.cpp:1484
ULWord
uint32_t ULWord
Definition: ajatypes.h:246
NTV2FrameData::fVideoBuffer
NTV2Buffer fVideoBuffer
Host video buffer.
Definition: ntv2democommon.h:82
AUTOCIRCULATE_STATUS
This is returned from the CNTV2Card::AutoCirculateGetStatus function.
Definition: ntv2publicinterface.h:7105
ntv2devicescanner.h
Declares the CNTV2DeviceScanner class.
CaptureConfig
This class is used to configure an NTV2Capture instance.
Definition: ntv2democommon.h:265
NTV2_CHANNEL7
@ NTV2_CHANNEL7
Specifies channel or Frame Store 7 (or the 7th item).
Definition: ntv2enums.h:1313
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
NTV2DeviceHasBiDirectionalSDI
bool NTV2DeviceHasBiDirectionalSDI(const NTV2DeviceID inDeviceID)
Definition: ntv2devicefeatures.hpp:6454
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:944
NTV2DeviceIDToString
std::string NTV2DeviceIDToString(const NTV2DeviceID inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:4673
NTV2AudioSystemSet
std::set< NTV2AudioSystem > NTV2AudioSystemSet
A set of distinct NTV2AudioSystem values. New in SDK 16.2.
Definition: ntv2publicinterface.h:3869
CNTV2Card::SetReference
virtual bool SetReference(const NTV2ReferenceSource inRefSource, const bool inKeepFramePulseSelect=false)
Sets the device's clock reference source. See Device Clocking and Synchronization for more informatio...
Definition: ntv2register.cpp:1486
NTV2Capture4K
Instances of me capture frames in real time from a video signal provided to an input of an AJA device...
Definition: ntv2capture4k.h:19
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
AJA_NTV2_MLAUDIO_RECORD_END
#define AJA_NTV2_MLAUDIO_RECORD_END
Definition: ntv2democommon.h:902
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
NTV2_CHANNEL3
@ NTV2_CHANNEL3
Specifies channel or Frame Store 3 (or the 3rd item).
Definition: ntv2enums.h:1309
UWord
uint16_t UWord
Definition: ajatypes.h:244
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
NTV2_IS_4K_HFR_VIDEO_FORMAT
#define NTV2_IS_4K_HFR_VIDEO_FORMAT(__f__)
Definition: ntv2enums.h:753
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:7904
CaptureConfig::fDeviceSpec
std::string fDeviceSpec
The AJA device to use.
Definition: ntv2democommon.h:268
ntv2utils.h
Declares numerous NTV2 utility functions.
NTV2Capture4K::ConsumeFrames
virtual void ConsumeFrames(void)
Repeatedly consumes frames from the circular buffer (until global quit flag set).
Definition: ntv2capture4k.cpp:351
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:2606
CNTV2Card::DMABufferLock
virtual bool DMABufferLock(const NTV2Buffer &inBuffer, bool inMap=false, bool inRDMA=false)
Page-locks the given host buffer to reduce transfer time and CPU usage of DMA transfers.
Definition: ntv2dma.cpp:487
NTV2DeviceGetNumFrameStores
UWord NTV2DeviceGetNumFrameStores(const NTV2DeviceID inDeviceID)
Definition: ntv2devicefeatures.hpp:10487
CNTV2Card::AutoCirculateStop
virtual bool AutoCirculateStop(const NTV2Channel inChannel, const bool inAbort=false)
Stops AutoCirculate for the given channel, and releases the on-device frame buffers that were allocat...
Definition: ntv2autocirculate.cpp:519
CNTV2DriverInterface::IsDeviceReady
virtual bool IsDeviceReady(const bool inCheckValid=(0))
Definition: ntv2driverinterface.cpp:1228
kDemoAppSignature
static const ULWord kDemoAppSignature((((uint32_t)( 'D'))<< 24)|(((uint32_t)( 'E'))<< 16)|(((uint32_t)( 'M'))<< 8)|(((uint32_t)( 'O'))<< 0))
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
CNTV2Card::SetTsiFrameEnable
virtual bool SetTsiFrameEnable(const bool inIsEnabled, const NTV2Channel inChannel)
Enables or disables SMPTE 425 two-sample interleave (Tsi) frame mode on the device.
Definition: ntv2register.cpp:1313
NTV2_INPUTSOURCE_HDMI1
@ NTV2_INPUTSOURCE_HDMI1
Identifies the 1st HDMI video input.
Definition: ntv2enums.h:1224
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
NTV2Capture4K::GetACStatus
virtual void GetACStatus(ULWord &outGoodFrames, ULWord &outDroppedFrames, ULWord &outBufferLevel)
Provides status information about my input (capture) process.
Definition: ntv2capture4k.cpp:483
AJA_STATUS_UNSUPPORTED
@ AJA_STATUS_UNSUPPORTED
Definition: types.h:381
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:4259
NTV2DeviceGetNumAudioSystems
UWord NTV2DeviceGetNumAudioSystems(const NTV2DeviceID inDeviceID)
Definition: ntv2devicefeatures.hpp:9864
CaptureConfig::fInputChannel
NTV2Channel fInputChannel
The device channel to use.
Definition: ntv2democommon.h:270
NTV2_INPUTSOURCE_HDMI2
@ NTV2_INPUTSOURCE_HDMI2
Identifies the 2nd HDMI video input.
Definition: ntv2enums.h:1225
CNTV2DriverInterface::GetDescription
virtual std::string GetDescription(void) const
Definition: ntv2driverinterface.h:574
NTV2_FORMAT_UNKNOWN
@ NTV2_FORMAT_UNKNOWN
Definition: ntv2enums.h:498
NTV2FrameData::fAudioBuffer
NTV2Buffer fAudioBuffer
Host audio buffer.
Definition: ntv2democommon.h:84
NTV2DeviceCanDo12gRouting
bool NTV2DeviceCanDo12gRouting(const NTV2DeviceID inDeviceID)
Definition: ntv2devicefeatures.hpp:287
NTV2Capture4K::~NTV2Capture4K
virtual ~NTV2Capture4K()
Definition: ntv2capture4k.cpp:38
AJA_STATUS_INITIALIZE
@ AJA_STATUS_INITIALIZE
Definition: types.h:373
NTV2Capture4K::Run
virtual AJAStatus Run(void)
Runs me.
Definition: ntv2capture4k.cpp:315
NTV2_LHIHDMIColorSpaceYCbCr
@ NTV2_LHIHDMIColorSpaceYCbCr
Definition: ntv2enums.h:3594
DEC
#define DEC(__x__)
Definition: ntv2publicinterface.h:5579
false
#define false
Definition: ntv2devicefeatures.h:25
AUTOCIRCULATE_WITH_MULTILINK_AUDIO2
#define AUTOCIRCULATE_WITH_MULTILINK_AUDIO2
Use this to AutoCirculate with base audiosystem controlling base AudioSystem + 2.
Definition: ntv2publicinterface.h:5501
AUTOCIRCULATE_WITH_RP188
#define AUTOCIRCULATE_WITH_RP188
Use this to AutoCirculate with RP188.
Definition: ntv2publicinterface.h:5490
NTV2ACFrameRange::lastFrame
UWord lastFrame(void) const
Definition: ntv2utils.h:976
AUTOCIRCULATE_STATUS::IsRunning
bool IsRunning(void) const
Definition: ntv2publicinterface.h:7211
NTV2FrameBufferFormatToString
std::string NTV2FrameBufferFormatToString(const NTV2FrameBufferFormat inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:6940
CaptureConfig::fDoTSIRouting
bool fDoTSIRouting
If true, do TSI routing; otherwise squares.
Definition: ntv2democommon.h:279
NTV2XptConnections
std::map< NTV2InputXptID, NTV2OutputXptID > NTV2XptConnections
Definition: ntv2signalrouter.h:39
AJA_STATUS_BAD_PARAM
@ AJA_STATUS_BAD_PARAM
Definition: types.h:379
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
NTV2MakeChannelSet
NTV2ChannelSet NTV2MakeChannelSet(const NTV2Channel inFirstChannel, const UWord inNumChannels=1)
Definition: ntv2publicinterface.cpp:3294
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
NTV2Capture4K::StartConsumerThread
virtual void StartConsumerThread(void)
Starts my frame consumer thread.
Definition: ntv2capture4k.cpp:328
AUTOCIRCULATE_STATUS::GetDroppedFrameCount
ULWord GetDroppedFrameCount(void) const
Definition: ntv2publicinterface.h:7156
NTV2Capture4K::CaptureFrames
virtual void CaptureFrames(void)
Repeatedly captures frames using AutoCirculate (until global quit flag set).
Definition: ntv2capture4k.cpp:405
CNTV2Card::EnableChannels
virtual bool EnableChannels(const NTV2ChannelSet &inChannels, const bool inDisableOthers=false)
Enables the given FrameStore(s).
Definition: ntv2register.cpp:2123
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
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:808
CNTV2DriverInterface::GetDeviceID
virtual NTV2DeviceID GetDeviceID(void)
Definition: ntv2driverinterface.cpp:371
AUTOCIRCULATE_STATUS::HasAvailableInputFrame
bool HasAvailableInputFrame(void) const
Definition: ntv2publicinterface.h:7181
CNTV2Card::GetEveryFrameServices
virtual bool GetEveryFrameServices(NTV2EveryFrameTaskMode &outMode)
Retrieves the device's current "retail service" task mode.
Definition: ntv2register.cpp:184
NTV2Capture4K::SetupVideo
virtual AJAStatus SetupVideo(void)
Sets up everything I need for capturing video.
Definition: ntv2capture4k.cpp:184
CaptureConfig::fNumAudioLinks
UWord fNumAudioLinks
Number of audio links to capture.
Definition: ntv2democommon.h:274
CNTV2Card::GetInputVideoFormat
virtual NTV2VideoFormat GetInputVideoFormat(const NTV2InputSource inVideoSource=NTV2_INPUTSOURCE_SDI1, const bool inIsProgressive=false)
Returns the video format of the signal that is present on the given input source.
Definition: ntv2register.cpp:3381
AUTOCIRCULATE_STATUS::WithCustomAnc
bool WithCustomAnc(void) const
Definition: ntv2publicinterface.h:7246
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
NTV2ACFrameRange::setRangeWithCount
bool setRangeWithCount(const UWord inCount, const UWord inFirstFrame)
Definition: ntv2utils.h:997
NTV2_INPUT_SOURCE_IS_SDI
#define NTV2_INPUT_SOURCE_IS_SDI(_inpSrc_)
Definition: ntv2enums.h:1242
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
AJA_STATUS_OPEN
@ AJA_STATUS_OPEN
Definition: types.h:375
CNTV2Card::SetFrameBufferFormat
virtual bool SetFrameBufferFormat(NTV2Channel inChannel, NTV2FrameBufferFormat inNewFormat, bool inIsAJARetail=true, 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:1828
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:2732
NTV2Capture4K::NTV2Capture4K
NTV2Capture4K(const CaptureConfig &inConfig)
Constructs me using the given settings.
Definition: ntv2capture4k.cpp:22
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:358
NTV2_IS_VALID_AUDIO_SYSTEM
#define NTV2_IS_VALID_AUDIO_SYSTEM(__x__)
Definition: ntv2enums.h:3828
NTV2Capture4K::SetupAudio
virtual AJAStatus SetupAudio(void)
Sets up everything I need for capturing audio.
Definition: ntv2capture4k.cpp:228
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
DEVICE_ID_NOTFOUND
@ DEVICE_ID_NOTFOUND
Invalid or "not found".
Definition: ntv2enums.h:90
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:4261
NTV2Capture4K::StartProducerThread
virtual void StartProducerThread(void)
Starts my capture thread.
Definition: ntv2capture4k.cpp:382
CNTV2DemoCommon::GetInputRouting4K
static bool GetInputRouting4K(NTV2XptConnections &outConnections, const CaptureConfig &inConfig, const NTV2DeviceID inDevID=DEVICE_ID_INVALID, const bool isInputRGB=false)
Answers with the crosspoint connections needed to implement the given 4K/UHD capture configuration.
Definition: ntv2democommon.cpp:1249
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:3821