AJA NTV2 SDK  17.5.0.1492
NTV2 SDK 17.5.0.1492
ntv2player8k.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #include "ntv2player8k.h"
9 #include "ntv2debug.h"
10 #include "ntv2devicescanner.h"
11 #include "ntv2testpatterngen.h"
13 #include "ajabase/system/process.h"
17 
18 using namespace std;
19 
20 #define NTV2_BUFFER_LOCKING // IMPORTANT FOR 8K: Define this to pre-lock video/audio buffers in kernel
21 
22 
28 static ULWord gAncMaxSizeBytes (NTV2_ANCSIZE_MAX); // Max per-frame anc buffer size, in bytes
29 
38 static const uint32_t gAudMaxSizeBytes (256 * 1024); // Max per-frame audio buffer size, in bytes
39 
40 static const bool BUFFER_PAGE_ALIGNED (true);
41 
42 // Audio tone generator data
43 static const double gFrequencies [] = {250.0, 500.0, 1000.0, 2000.0};
44 static const ULWord gNumFrequencies (sizeof(gFrequencies) / sizeof(double));
45 // Unlike NTV2Player, this demo uses the same waveform amplitude in each audio channel
46 
47 
49  : mConfig (inConfig),
50  mConsumerThread (),
51  mProducerThread (),
52  mDevice (),
53  mDeviceID (DEVICE_ID_INVALID),
54  mSavedTaskMode (NTV2_TASK_MODE_INVALID),
55  mCurrentFrame (0),
56  mCurrentSample (0),
57  mToneFrequency (440.0),
58  mAudioSystem (NTV2_AUDIOSYSTEM_INVALID),
59  mFormatDesc (),
60  mGlobalQuit (false),
61  mTCBurner (),
62  mHostBuffers (),
63  mFrameDataRing (),
64  mTestPatRasters ()
65 {
66 }
67 
68 
70 {
71  // Stop my playout and producer threads, then destroy them...
72  Quit();
73 
74  mDevice.UnsubscribeOutputVerticalEvent(mConfig.fOutputChannel); // Unsubscribe from output VBI event
75 } // destructor
76 
77 
78 void NTV2Player8K::Quit (void)
79 {
80  // Set the global 'quit' flag, and wait for the threads to go inactive...
81  mGlobalQuit = true;
82 
83  while (mProducerThread.Active())
84  AJATime::Sleep(10);
85 
86  while (mConsumerThread.Active())
87  AJATime::Sleep(10);
88 
89 #if defined(NTV2_BUFFER_LOCKING)
90  mDevice.DMABufferUnlockAll();
91 #endif // NTV2_BUFFER_LOCKING
92  if (!mConfig.fDoMultiFormat && mDevice.IsOpen())
93  {
95  if (NTV2_IS_VALID_TASK_MODE(mSavedTaskMode))
96  mDevice.SetEveryFrameServices(mSavedTaskMode); // Restore prior task mode
97  }
98 } // Quit
99 
100 
102 {
103  AJAStatus status (AJA_STATUS_SUCCESS);
104 
105  // Open the device...
107  {cerr << "## ERROR: Device '" << mConfig.fDeviceSpec << "' not found" << endl; return AJA_STATUS_OPEN;}
108  mDeviceID = mDevice.GetDeviceID(); // Keep this ID handy -- it's used frequently
109 
110  if (!mDevice.IsDeviceReady(false))
111  {cerr << "## ERROR: Device '" << mConfig.fDeviceSpec << "' not ready" << endl; return AJA_STATUS_INITIALIZE;}
112  if (!mDevice.features().CanDoPlayback())
113  {cerr << "## ERROR: '" << mDevice.GetDisplayName() << "' is capture-only" << endl; return AJA_STATUS_FEATURE;}
114 
115  const UWord maxNumChannels (mDevice.features().GetNumFrameStores());
116 
117  // Check for an invalid configuration
119  {cerr << "## ERROR: HFR RGB output not supported" << endl; return AJA_STATUS_BAD_PARAM;}
120 
121  // Check for valid channel...
122  if (UWord(mConfig.fOutputChannel) >= maxNumChannels)
123  {
124  cerr << "## ERROR: Cannot use channel '" << DEC(mConfig.fOutputChannel+1) << "' -- device only supports channel 1"
125  << (maxNumChannels > 1 ? string(" thru ") + string(1, char(maxNumChannels+'0')) : "") << endl;
126  return AJA_STATUS_UNSUPPORTED;
127  }
128  if (mConfig.fOutputChannel != NTV2_CHANNEL1 && mConfig.fOutputChannel != NTV2_CHANNEL3)
129  {
130  cerr << "## ERROR: 8K/UHD2 requires Ch1 or Ch3, not Ch" << DEC(mConfig.fOutputChannel) << endl;
131  return AJA_STATUS_BAD_PARAM;
132  }
133 
134  if (!mConfig.fDoMultiFormat)
135  {
136  mDevice.GetEveryFrameServices(mSavedTaskMode); // Save the current task mode
138  return AJA_STATUS_BUSY; // Device is in use by another app -- fail
139  }
140  mDevice.SetEveryFrameServices(NTV2_OEM_TASKS); // Set OEM service level
141 
142  if (mDevice.features().CanDoMultiFormat())
143  mDevice.SetMultiFormatMode(mConfig.fDoMultiFormat);
144  else
145  mConfig.fDoMultiFormat = false;
146 
147  // Set up the video and audio...
148  status = SetUpVideo();
149  if (AJA_FAILURE(status))
150  return status;
151  status = mConfig.WithAudio() ? SetUpAudio() : AJA_STATUS_SUCCESS;
152  if (AJA_FAILURE(status))
153  return status;
154 
155  // Set up the circular buffers, and the test pattern buffers...
156  status = SetUpHostBuffers();
157  if (AJA_FAILURE(status))
158  return status;
159  status = SetUpTestPatternBuffers();
160  if (AJA_FAILURE(status))
161  return status;
162 
163  // Set up the device signal routing...
165 
166  // Lastly, prepare my AJATimeCodeBurn instance...
167  if (!mTCBurner.RenderTimeCodeFont (CNTV2DemoCommon::GetAJAPixelFormat(mConfig.fPixelFormat), mFormatDesc.numPixels, mFormatDesc.numLines))
168  {cerr << "## ERROR: RenderTimeCodeFont failed for: " << mFormatDesc << endl; return AJA_STATUS_UNSUPPORTED;}
169 
170  // Ready to go...
171  #if defined(_DEBUG)
172  cerr << mConfig;
173  if (mDevice.IsRemote())
174  cerr << "Device Description: " << mDevice.GetDescription() << endl;
175  cerr << endl;
176  #endif // defined(_DEBUG)
177  return AJA_STATUS_SUCCESS;
178 
179 } // Init
180 
181 
183 {
184  // Configure the device to output the requested video format...
185  if (mConfig.fVideoFormat == NTV2_FORMAT_UNKNOWN)
186  return AJA_STATUS_BAD_PARAM;
187  if (!mDevice.features().CanDoVideoFormat(mConfig.fVideoFormat))
188  { cerr << "## ERROR: '" << mDevice.GetDisplayName() << "' doesn't support "
189  << ::NTV2VideoFormatToString(mConfig.fVideoFormat) << endl;
190  return AJA_STATUS_UNSUPPORTED;
191  }
192  if (!mDevice.features().CanDoFrameBufferFormat(mConfig.fPixelFormat))
193  { cerr << "## ERROR: '" << mDevice.GetDisplayName() << "' doesn't support "
194  << ::NTV2FrameBufferFormatString(mConfig.fPixelFormat) << endl;
195  return AJA_STATUS_UNSUPPORTED;
196  }
197  if (::IsRGBFormat(mConfig.fPixelFormat) != mConfig.fDoRGBOnWire && mDevice.features().GetNumCSCs() == 0)
198  { cerr << "## ERROR: '" << mDevice.GetDisplayName() << "' has no CSCs, and '--pixelFormat' \""
199  << ::NTV2FrameBufferFormatToString(mConfig.fPixelFormat, true) << "\" contradicts '--rgb' setting" << endl;
200  return AJA_STATUS_UNSUPPORTED;
201  }
202 
203  NTV2ChannelSet channels13, frameStores;
204  channels13.insert(NTV2_CHANNEL1); channels13.insert(NTV2_CHANNEL3);
205  if (mConfig.fDoTsiRouting)
206  { // "Tsi" routing requires 2 FrameStores
207  if (channels13.find(mConfig.fOutputChannel) == channels13.end())
208  return AJA_STATUS_BAD_PARAM; // fOutputChannel not Ch1 or Ch3
209  frameStores = ::NTV2MakeChannelSet (mConfig.fOutputChannel, 2); // 2 FrameStores starting at fOutputChannel
210  }
211  else
212  { // "Squares" routing requires 4 FrameStores
213  if (mConfig.fOutputChannel != NTV2_CHANNEL1)
214  return AJA_STATUS_BAD_PARAM; // fOutputChannel not Ch1
215  frameStores = ::NTV2MakeChannelSet (mConfig.fOutputChannel, 4); // 4 FrameStores starting at fOutputChannel
216  }
217 
218  // Keep the raster description handy...
219  mFormatDesc = NTV2FormatDescriptor(mConfig.fVideoFormat, mConfig.fPixelFormat);
220  if (!mFormatDesc.IsValid())
221  return AJA_STATUS_FAIL;
222 
223  // Turn on the FrameStores (to read frame buffer memory and transmit video)...
224  mDevice.EnableChannels (frameStores, /*disableOthers=*/!mConfig.fDoMultiFormat);
225 
226  // This demo requires VANC be disabled...
227  mDevice.SetVANCMode (frameStores, NTV2_VANCMODE_OFF); // VANC is incompatible with 8K/UHD2 formats
228 
229  // Set the FrameStore video format...
230  mDevice.SetVideoFormat (mConfig.fVideoFormat, false, false, mConfig.fOutputChannel);
231  mDevice.SetQuadQuadFrameEnable (true, mConfig.fOutputChannel);
232  mDevice.SetQuadQuadSquaresEnable (!mConfig.fDoTsiRouting, mConfig.fOutputChannel);
233 
234  // Set the frame buffer pixel format for the device FrameStore(s)...
235  mDevice.SetFrameBufferFormat (frameStores, mConfig.fPixelFormat);
236 
237  // The output interrupt is Enabled by default, but on some platforms, you must subscribe to it
238  // in order to be able to wait on its event/semaphore...
240 
241  // Check if HDR anc is permissible...
242  if (IS_KNOWN_AJAAncDataType(mConfig.fTransmitHDRType) && !mDevice.features().CanDoCustomAnc())
243  {cerr << "## WARNING: HDR Anc requested, but device can't do custom anc" << endl;
245 
246  // Get current per-field maximum Anc buffer size...
249 
250  // Set output clock reference...
251  mDevice.SetReference(mDevice.features().CanDo2110() ? NTV2_REFERENCE_SFP1_PTP : NTV2_REFERENCE_FREERUN);
252 
253  // At this point, video setup is complete (except for widget signal routing).
254  return AJA_STATUS_SUCCESS;
255 
256 } // SetUpVideo
257 
258 
260 {
261  uint16_t numAudioChannels (mDevice.features().GetMaxAudioChannels());
262 
263  // If there are 8192 pixels on a line instead of 7680, reduce the number of audio channels
264  // This is because HANC is narrower, and has space for only 8 channels
265  if (NTV2_IS_UHD2_FULL_VIDEO_FORMAT(mConfig.fVideoFormat) && numAudioChannels > 8)
266  numAudioChannels = 8;
267 
268  // Use the NTV2AudioSystem that has the same ordinal value as the output FrameStore/Channel...
269  mAudioSystem = ::NTV2ChannelToAudioSystem(mConfig.fOutputChannel);
270 
271  if (mConfig.fNumAudioLinks > 1) // For users that want to send 32 or 64 audio channels on 2 or 4 SDI links
272  switch (mAudioSystem)
273  {
274  default:
275  case NTV2_AUDIOSYSTEM_1:
276  { const UWord numChan(NTV2_IS_QUAD_QUAD_HFR_VIDEO_FORMAT(mConfig.fVideoFormat) ? 4 : 2);
277  const NTV2AudioSystemSet audSystems (::NTV2MakeAudioSystemSet (mAudioSystem, numChan));
278  for (UWord chan(0); chan < numChan; chan++)
279  mDevice.SetSDIOutputAudioSystem (NTV2Channel(chan), NTV2AudioSystem(chan));
280  mDevice.SetNumberAudioChannels (numAudioChannels, audSystems);
281  mDevice.SetAudioBufferSize (NTV2_AUDIO_BUFFER_BIG, audSystems);
282  mDevice.SetAudioLoopBack (NTV2_AUDIO_LOOPBACK_OFF, audSystems);
283  break;
284  }
285  case NTV2_AUDIOSYSTEM_3:
288  break;
289  }
290  else
291  {
292  mDevice.SetSDIOutputAudioSystem (::NTV2MakeChannelSet (NTV2_CHANNEL1, 4), mAudioSystem);
293  mDevice.SetNumberAudioChannels (numAudioChannels, mAudioSystem);
294  mDevice.SetAudioBufferSize (NTV2_AUDIO_BUFFER_BIG, mAudioSystem);
295  mDevice.SetAudioLoopBack (NTV2_AUDIO_LOOPBACK_OFF, mAudioSystem);
296  }
297 
298  if (mConfig.fDoHDMIOutput)
299  {
303  }
304 
305  return AJA_STATUS_SUCCESS;
306 
307 } // SetUpAudio
308 
309 
311 {
312  CNTV2DemoCommon::SetDefaultPageSize(); // Set host-specific page size
313 
314  // Let my circular buffer know when it's time to quit...
315  mFrameDataRing.SetAbortFlag (&mGlobalQuit);
316 
317  // Multi-link audio uses stacked buffers for transferring to the board,
318  // the first byte after the end of the first audio link buffer is the start of the second audio link buffer.
319  const size_t audioBufferSize (gAudMaxSizeBytes * uint32_t(mConfig.fNumAudioLinks));
320 
321  // Allocate and add each in-host NTV2FrameData to my circular buffer member variable...
322  mHostBuffers.reserve(CIRCULAR_BUFFER_SIZE);
323  while (mHostBuffers.size() < CIRCULAR_BUFFER_SIZE)
324  {
325  mHostBuffers.push_back(NTV2FrameData()); // Make a new NTV2FrameData...
326  NTV2FrameData & frameData(mHostBuffers.back()); // ...and get a reference to it
327 
328  // Don't allocate a page-aligned video buffer here.
329  // Instead, the test pattern buffers are used (and re-used) in the consumer thread.
330  // This saves a LOT of memory and time spent copying data with these large 4K/UHD rasters.
331  // NOTE: This differs substantially from the NTV2Player demo, which pre-allocates the ring of video buffers
332  // here, then in its producer thread, copies a fresh, unmodified test pattern raster into the video
333  // buffer, blits timecode into it, then transfers it to the hardware in its consumer thread.
334 
335  // Allocate a page-aligned audio buffer (if transmitting audio)
336  if (mConfig.WithAudio())
337  if (!frameData.fAudioBuffer.Allocate (audioBufferSize, BUFFER_PAGE_ALIGNED))
338  {
339  PLFAIL("Failed to allocate " << xHEX0N(audioBufferSize,8) << "-byte audio buffer");
340  return AJA_STATUS_MEMORY;
341  }
342  if (frameData.fAudioBuffer)
343  {
344  frameData.fAudioBuffer.Fill(ULWord(0));
345  #ifdef NTV2_BUFFER_LOCKING
346  mDevice.DMABufferLock(frameData.fAudioBuffer, /*alsoPreLockSGL*/true);
347  #endif
348  }
349  mFrameDataRing.Add (&frameData);
350  } // for each NTV2FrameData
351  return AJA_STATUS_SUCCESS;
352 
353 } // SetUpHostBuffers
354 
355 
357 {
358  vector<NTV2TestPatternSelect> testPatIDs;
359  testPatIDs.push_back(NTV2_TestPatt_ColorBars100);
360  testPatIDs.push_back(NTV2_TestPatt_ColorBars75);
361  testPatIDs.push_back(NTV2_TestPatt_Ramp);
362  testPatIDs.push_back(NTV2_TestPatt_MultiBurst);
363  testPatIDs.push_back(NTV2_TestPatt_LineSweep);
364  testPatIDs.push_back(NTV2_TestPatt_CheckField);
365  testPatIDs.push_back(NTV2_TestPatt_FlatField);
366  testPatIDs.push_back(NTV2_TestPatt_MultiPattern);
367  testPatIDs.push_back(NTV2_TestPatt_Black);
368  testPatIDs.push_back(NTV2_TestPatt_White);
369  testPatIDs.push_back(NTV2_TestPatt_Border);
370  testPatIDs.push_back(NTV2_TestPatt_LinearRamp);
371  testPatIDs.push_back(NTV2_TestPatt_SlantRamp);
372  testPatIDs.push_back(NTV2_TestPatt_ZonePlate);
373  testPatIDs.push_back(NTV2_TestPatt_ColorQuadrant);
374  testPatIDs.push_back(NTV2_TestPatt_ColorQuadrantBorder);
375 
376  mTestPatRasters.clear();
377  for (size_t tpNdx(0); tpNdx < testPatIDs.size(); tpNdx++)
378  mTestPatRasters.push_back(NTV2Buffer());
379 
380  if (!mFormatDesc.IsValid())
381  {PLFAIL("Bad format descriptor"); return AJA_STATUS_FAIL;}
382  if (mFormatDesc.IsVANC())
383  {PLFAIL("VANC incompatible with UHD2/8K: " << mFormatDesc); return AJA_STATUS_FAIL;}
384 
385  // Set up one video buffer for each test pattern...
386  for (size_t tpNdx(0); tpNdx < testPatIDs.size(); tpNdx++)
387  {
388  // Allocate the buffer memory...
389  if (!mTestPatRasters.at(tpNdx).Allocate (mFormatDesc.GetVideoWriteSize(), BUFFER_PAGE_ALIGNED))
390  { PLFAIL("Test pattern buffer " << DEC(tpNdx+1) << " of " << DEC(testPatIDs.size()) << ": "
391  << xHEX0N(mFormatDesc.GetVideoWriteSize(),8) << "-byte page-aligned alloc failed");
392  return AJA_STATUS_MEMORY;
393  }
394 
395  // Fill the buffer with test pattern...
396  NTV2TestPatternGen testPatternGen;
397  if (!testPatternGen.DrawTestPattern (testPatIDs.at(tpNdx), mFormatDesc, mTestPatRasters.at(tpNdx)))
398  {
399  cerr << "## ERROR: DrawTestPattern " << DEC(tpNdx) << " failed: " << mFormatDesc << endl;
400  return AJA_STATUS_FAIL;
401  }
402 
403  #ifdef NTV2_BUFFER_LOCKING
404  // Try to prelock the memory, including its scatter-gather list...
405  if (!mDevice.DMABufferLock(mTestPatRasters.at(tpNdx), /*alsoLockSegmentMap=*/true))
406  PLWARN("Test pattern buffer " << DEC(tpNdx+1) << " of " << DEC(testPatIDs.size()) << ": failed to pre-lock");
407  #endif
408  } // loop for each predefined pattern
409  PLNOTE(DEC(testPatIDs.size()) << " test pattern buffers created, " << DEC(mFormatDesc.GetVideoWriteSize() / 1024 / 1024)
410  << "MB each, " << DEC(mFormatDesc.GetVideoWriteSize() / 1024 / 1024 * testPatIDs.size()) << "MB total");
411  return AJA_STATUS_SUCCESS;
412 
413 } // SetUpTestPatternBuffers
414 
415 
417 {
418  NTV2XptConnections connections; // Routing connections to make
419 
420  if (mConfig.fDoTsiRouting)
421  {
422  if (::IsRGBFormat(mConfig.fPixelFormat))
423  { // RGB on wire requires DualLinkOut widgets
424  if (mConfig.fOutputChannel < NTV2_CHANNEL3)
425  {
430  if (mConfig.fDoHDMIOutput)
432  }
433  else
434  {
439  if (mConfig.fDoHDMIOutput)
441  }
450  mDevice.SetSDITransmitEnable (NTV2_CHANNEL1, true);
451  mDevice.SetSDITransmitEnable (NTV2_CHANNEL2, true);
452  mDevice.SetSDITransmitEnable (NTV2_CHANNEL3, true);
453  mDevice.SetSDITransmitEnable (NTV2_CHANNEL4, true);
462  }
463  else
464  {
465  if (mConfig.fOutputChannel < NTV2_CHANNEL3)
466  {
468  {
473  mDevice.SetSDITransmitEnable (NTV2_CHANNEL1, true);
474  mDevice.SetSDITransmitEnable (NTV2_CHANNEL2, true);
475  mDevice.SetSDITransmitEnable (NTV2_CHANNEL3, true);
476  mDevice.SetSDITransmitEnable (NTV2_CHANNEL4, true);
485  if (mConfig.fDoHDMIOutput)
487  }
488  else
489  {
494  mDevice.SetSDITransmitEnable (NTV2_CHANNEL1, true);
495  mDevice.SetSDITransmitEnable (NTV2_CHANNEL2, true);
500  if (mConfig.fDoHDMIOutput)
502  }
503  }
504  else
505  {
507  {
512  mDevice.SetSDITransmitEnable (NTV2_CHANNEL1, true);
513  mDevice.SetSDITransmitEnable (NTV2_CHANNEL2, true);
514  mDevice.SetSDITransmitEnable (NTV2_CHANNEL3, true);
515  mDevice.SetSDITransmitEnable (NTV2_CHANNEL4, true);
524  if (mConfig.fDoHDMIOutput)
526  }
527  else
528  {
533  mDevice.SetSDITransmitEnable (NTV2_CHANNEL3, true);
534  mDevice.SetSDITransmitEnable (NTV2_CHANNEL4, true);
539  if (mConfig.fDoHDMIOutput)
541  }
542  }
543  }
544  }
545  else
546  {
547  if (::IsRGBFormat(mConfig.fPixelFormat))
548  { // RGB on wire requires DualLinkOut widgets
561  mDevice.SetSDITransmitEnable (NTV2_CHANNEL1, true);
562  mDevice.SetSDITransmitEnable (NTV2_CHANNEL2, true);
563  mDevice.SetSDITransmitEnable (NTV2_CHANNEL3, true);
564  mDevice.SetSDITransmitEnable (NTV2_CHANNEL4, true);
573  }
574  else
575  {
580  mDevice.SetSDITransmitEnable (NTV2_CHANNEL1, true);
581  mDevice.SetSDITransmitEnable (NTV2_CHANNEL2, true);
582  mDevice.SetSDITransmitEnable (NTV2_CHANNEL3, true);
583  mDevice.SetSDITransmitEnable (NTV2_CHANNEL4, true);
592  }
593  }
594  return mDevice.ApplySignalRoute(connections, /*replaceExistingRouting?*/!mConfig.fDoMultiFormat);
595 
596 } // RouteOutputSignal
597 
598 
600 {
601  // Start my consumer and producer threads...
604  return AJA_STATUS_SUCCESS;
605 
606 } // Run
607 
608 
609 
611 // This is where the play thread starts
612 
614 {
615  // Create and start the playout thread...
616  mConsumerThread.Attach (ConsumerThreadStatic, this);
617  mConsumerThread.SetPriority(AJA_ThreadPriority_High);
618  mConsumerThread.Start();
619 
620 } // StartConsumerThread
621 
622 
623 // The playout thread function
624 void NTV2Player8K::ConsumerThreadStatic (AJAThread * pThread, void * pContext) // static
625 { (void) pThread;
626  // Grab the NTV2Player8K instance pointer from the pContext parameter,
627  // then call its PlayFrames method...
628  NTV2Player8K * pApp (reinterpret_cast<NTV2Player8K*>(pContext));
629  if (pApp)
630  pApp->ConsumeFrames();
631 
632 } // ConsumerThreadStatic
633 
634 
636 {
637  ULWord acOptions (AUTOCIRCULATE_WITH_RP188);
638  AUTOCIRCULATE_TRANSFER outputXfer;
639  AUTOCIRCULATE_STATUS outputStatus;
640  AJAAncillaryData * pPkt (AJA_NULL);
641  ULWord goodXfers(0), badXfers(0), prodWaits(0), noRoomWaits(0);
642  const UWord numACFramesPerChannel(7);
643 
644  // Stop AutoCirculate, just in case someone else left it running...
645  mDevice.AutoCirculateStop(mConfig.fOutputChannel);
646  mDevice.WaitForOutputVerticalInterrupt(mConfig.fOutputChannel, 4); // Let it stop
647  PLNOTE("Thread started");
648 
650  { // HDR anc doesn't change per-frame, so fill outputXfer.acANCBuffer with the packet data...
651  static AJAAncillaryData_HDR_SDR sdrPkt;
652  static AJAAncillaryData_HDR_HDR10 hdr10Pkt;
653  static AJAAncillaryData_HDR_HLG hlgPkt;
654 
655  switch (mConfig.fTransmitHDRType)
656  {
657  case AJAAncDataType_HDR_SDR: pPkt = &sdrPkt; break;
658  case AJAAncDataType_HDR_HDR10: pPkt = &hdr10Pkt; break;
659  case AJAAncDataType_HDR_HLG: pPkt = &hlgPkt; break;
660  default: break;
661  }
662  }
663  if (pPkt)
664  { // Allocate page-aligned host Anc buffer...
665  uint32_t hdrPktSize (0);
666  if (!outputXfer.acANCBuffer.Allocate(gAncMaxSizeBytes, BUFFER_PAGE_ALIGNED) || !outputXfer.acANCBuffer.Fill(0LL))
667  PLWARN("Anc buffer " << xHEX0N(gAncMaxSizeBytes,8) << "(" << DEC(gAncMaxSizeBytes) << ")-byte allocate failed -- HDR anc insertion disabled");
668  else if (AJA_FAILURE(pPkt->GenerateTransmitData (outputXfer.acANCBuffer, outputXfer.acANCBuffer, hdrPktSize)))
669  {
670  PLWARN("HDR anc insertion disabled -- GenerateTransmitData failed");
671  outputXfer.acANCBuffer.Deallocate();
672  }
673  else
674  acOptions |= AUTOCIRCULATE_WITH_ANC;
675  }
676 #ifdef NTV2_BUFFER_LOCKING
677  if (outputXfer.acANCBuffer)
678  mDevice.DMABufferLock(outputXfer.acANCBuffer, /*alsoLockSGL*/true);
679 #endif
680 
681  // Calculate start & end frame numbers...
682  const UWord startNum (mConfig.fOutputChannel < 2 ? 0 : numACFramesPerChannel); // Ch1: frames 0-6
683  const UWord endNum (mConfig.fOutputChannel < 2 ? numACFramesPerChannel-1 : numACFramesPerChannel*2-1); // Ch5: frames 7-13
684  if (mConfig.fNumAudioLinks > 1)
685  {
688  {
691  }
692  }
693 
694  // Initialize & start AutoCirculate...
695  bool initOK (mDevice.AutoCirculateInitForOutput (mConfig.fOutputChannel, 0, mAudioSystem, acOptions,
696  1 /*numChannels*/, startNum, endNum));
697  if (!initOK)
698  {PLFAIL("AutoCirculateInitForOutput failed"); mGlobalQuit = true;}
699 
700  while (!mGlobalQuit)
701  {
702  mDevice.AutoCirculateGetStatus (mConfig.fOutputChannel, outputStatus);
703 
704  // Check if there's room for another frame on the card...
705  if (outputStatus.CanAcceptMoreOutputFrames())
706  {
707  // Device has at least one free frame buffer that can be filled.
708  // Wait for the next frame in our ring to become ready to "consume"...
709  NTV2FrameData * pFrameData (mFrameDataRing.StartConsumeNextBuffer());
710  if (!pFrameData)
711  {prodWaits++; continue;}
712 
713  // Unlike in the NTV2Player demo, I now burn the current timecode into the test pattern buffer that was noted
714  // earlier into this FrameData in my Producer thread. This is done to avoid copying large 8K/UHD2 rasters.
715  const NTV2FrameRate ntv2FrameRate (::GetNTV2FrameRateFromVideoFormat(mConfig.fVideoFormat));
716  const TimecodeFormat tcFormat (CNTV2DemoCommon::NTV2FrameRate2TimecodeFormat(ntv2FrameRate));
717  const CRP188 rp188Info (mCurrentFrame++, 0, 0, 10, tcFormat);
718  NTV2_RP188 tcData;
719  string timeCodeString;
720 
721  rp188Info.GetRP188Reg (tcData);
722  rp188Info.GetRP188Str (timeCodeString);
723  mTCBurner.BurnTimeCode (pFrameData->fVideoBuffer, timeCodeString.c_str(), 80);
724 
725  // Transfer the timecode-burned frame (plus audio) to the device for playout...
726  outputXfer.acVideoBuffer.Set (pFrameData->fVideoBuffer, pFrameData->fVideoBuffer);
727  outputXfer.acAudioBuffer.Set (pFrameData->fAudioBuffer, pFrameData->fNumAudioBytes);
728  outputXfer.SetOutputTimeCode (tcData, ::NTV2ChannelToTimecodeIndex(mConfig.fOutputChannel, /*LTC=*/false, /*F2=*/false));
729  outputXfer.SetOutputTimeCode (tcData, ::NTV2ChannelToTimecodeIndex(mConfig.fOutputChannel, /*LTC=*/true, /*F2=*/false));
730 
731  // Perform the DMA transfer to the device...
732  if (mDevice.AutoCirculateTransfer (mConfig.fOutputChannel, outputXfer))
733  goodXfers++;
734  else
735  badXfers++;
736 
737  if (goodXfers == 3)
738  mDevice.AutoCirculateStart(mConfig.fOutputChannel);
739 
740  // Signal that the frame has been "consumed"...
741  mFrameDataRing.EndConsumeNextBuffer();
742  continue; // Back to top of while loop
743  }
744 
745  // Wait for one or more buffers to become available on the device, which should occur at next VBI...
746  noRoomWaits++;
748  } // loop til quit signaled
749 
750  // Stop AutoCirculate...
751  mDevice.AutoCirculateStop(mConfig.fOutputChannel);
752  PLNOTE("Thread completed: " << DEC(goodXfers) << " xfers, " << DEC(badXfers) << " failed, "
753  << DEC(prodWaits) << " starves, " << DEC(noRoomWaits) << " VBI waits");
754 
755 } // ConsumeFrames
756 
757 
758 
760 // This is where the producer thread starts
761 
763 {
764  // Create and start the producer thread...
765  mProducerThread.Attach(ProducerThreadStatic, this);
766  mProducerThread.SetPriority(AJA_ThreadPriority_High);
767  mProducerThread.Start();
768 
769 } // StartProducerThread
770 
771 
772 void NTV2Player8K::ProducerThreadStatic (AJAThread * pThread, void * pContext) // static
773 {
774  (void) pThread;
775  NTV2Player8K * pApp (reinterpret_cast<NTV2Player8K*>(pContext));
776  if (pApp)
777  pApp->ProduceFrames();
778 
779 } // ProducerThreadStatic
780 
781 
783 {
784  ULWord freqNdx(0), testPatNdx(0), badTally(0);
785  double timeOfLastSwitch (0.0);
786 
789 
790  PLNOTE("Thread started");
791  while (!mGlobalQuit)
792  {
793  NTV2FrameData * pFrameData (mFrameDataRing.StartProduceNextBuffer());
794  if (!pFrameData)
795  { badTally++; // No frame available!
796  AJATime::Sleep(10); // Wait a bit for the consumer thread to free one up for me...
797  continue; // ...then try again
798  }
799 
800  // Unlike NTV2Player::ProduceFrames, NTV2Player8K::ProduceFrames doesn't touch this frame's video buffer.
801  // Instead, to avoid wasting time copying large 8K/UHD2 rasters, in this thread we simply note which test
802  // pattern buffer is to be modified and subsequently transferred to the hardware. This happens later, in
803  // NTV2Player8K::ConsumeFrames...
804  NTV2Buffer & testPatVidBuffer(mTestPatRasters.at(testPatNdx));
805  pFrameData->fVideoBuffer.Set(testPatVidBuffer.GetHostPointer(), testPatVidBuffer.GetByteCount());
806 
807  // If also playing audio...
808  if (pFrameData->AudioBuffer()) // ...then generate audio tone data for this frame...
809  pFrameData->fNumAudioBytes = AddTone(pFrameData->fAudioBuffer); // ...and remember number of audio bytes to xfer
810 
811  // Every few seconds, change the test pattern and tone frequency...
812  const double currentTime (timeBase.FramesToSeconds(mCurrentFrame++));
813  if (currentTime > timeOfLastSwitch + 4.0)
814  {
815  freqNdx = (freqNdx + 1) % gNumFrequencies;
816  testPatNdx = (testPatNdx + 1) % ULWord(mTestPatRasters.size());
817  mToneFrequency = gFrequencies[freqNdx];
818  timeOfLastSwitch = currentTime;
819  PLINFO("F" << DEC0N(mCurrentFrame,6) << ": tone=" << mToneFrequency << "Hz, pattern='" << tpNames.at(testPatNdx) << "'");
820  } // if time to switch test pattern & tone frequency
821 
822  // Signal that I'm done producing this FrameData, making it immediately available for transfer/playout...
823  mFrameDataRing.EndProduceNextBuffer();
824 
825  } // loop til mGlobalQuit goes true
826  PLNOTE("Thread completed: " << DEC(mCurrentFrame) << " frame(s) produced, " << DEC(badTally) << " failed");
827 
828 } // ProduceFrames
829 
830 
831 uint32_t NTV2Player8K::AddTone (ULWord * audioBuffer)
832 {
835  ULWord numChannels (0);
836 
837  mDevice.GetFrameRate (frameRate, mConfig.fOutputChannel);
838  mDevice.GetAudioRate (audioRate, mAudioSystem);
839  mDevice.GetNumberAudioChannels (numChannels, mAudioSystem);
840 
841  // Since audio on AJA devices use fixed sample rates (typically 48KHz), certain video frame rates will
842  // necessarily result in some frames having more audio samples than others. GetAudioSamplesPerFrame is
843  // called to calculate the correct sample count for the current frame...
844  const ULWord numSamples (::GetAudioSamplesPerFrame (frameRate, audioRate, mCurrentFrame));
845  const double sampleRateHertz (::GetAudioSamplesPerSecond(audioRate));
846 
847  // Unlike NTV2Player::AddTone, NTV2Player8K::AddTone handles multi-link audio:
848  ULWord bytesWritten(0), startSample(mCurrentSample);
849  for (UWord linkNdx(0); linkNdx < mConfig.fNumAudioLinks; linkNdx++)
850  {
851  mCurrentSample = startSample;
852  bytesWritten += ::AddAudioTone (audioBuffer + (bytesWritten/4), // audio buffer to fill
853  mCurrentSample, // which sample for continuing the waveform
854  numSamples, // number of samples to generate
855  sampleRateHertz, // sample rate [Hz]
856  0.5, // amplitude
857  mToneFrequency, // tone frequency [Hz]
858  31, // bits per sample
859  false, // don't byte swap
860  numChannels); // number of audio channels to generate
861  } // for each SDI audio link
862  return bytesWritten;
863 
864 } // AddTone
865 
866 
868 {
869  mDevice.AutoCirculateGetStatus (mConfig.fOutputChannel, outStatus);
870 }
NTV2TestPatternGen::DrawTestPattern
virtual bool DrawTestPattern(const std::string &inTPName, const NTV2FormatDescriptor &inFormatDesc, NTV2Buffer &inBuffer)
Renders the given test pattern or color into a host raster buffer.
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
NTV2_XptFrameBuffer4YUV
@ NTV2_XptFrameBuffer4YUV
Definition: ntv2enums.h:2563
NTV2Player8K::StartConsumerThread
virtual void StartConsumerThread(void)
Starts my consumer thread.
Definition: ntv2player8k.cpp:613
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:4365
NTV2_XptHDMIOutInput
@ NTV2_XptHDMIOutInput
Definition: ntv2enums.h:2841
gNumFrequencies
static const ULWord gNumFrequencies(sizeof(gFrequencies)/sizeof(double))
DeviceCapabilities::CanDoVideoFormat
bool CanDoVideoFormat(const NTV2VideoFormat inVF)
Definition: ntv2devicecapabilities.h:254
PlayerConfig::fDoHDMIOutput
bool fDoHDMIOutput
If true, enable HDMI output; otherwise, disable HDMI output.
Definition: ntv2democommon.h:337
NTV2_AUDIO_LOOPBACK_OFF
@ NTV2_AUDIO_LOOPBACK_OFF
Embeds silence (zeroes) into the data stream.
Definition: ntv2enums.h:2016
NTV2FormatDescriptor::GetVideoWriteSize
ULWord GetVideoWriteSize(ULWord inPageSize=4096UL) const
Definition: ntv2formatdescriptor.cpp:957
CNTV2Card::GetAncRegionOffsetFromBottom
virtual bool GetAncRegionOffsetFromBottom(ULWord &outByteOffsetFromBottom, const NTV2AncillaryDataRegion inAncRegion=NTV2_AncRgn_All)
Answers with the byte offset to the start of an ancillary data region within a device frame buffer,...
Definition: ntv2dma.cpp:601
NTV2_TestPatt_CheckField
@ NTV2_TestPatt_CheckField
Definition: ntv2testpatterngen.h:34
ancillarydata_hdr_hlg.h
Declares the AJAAncillaryData_HDR_HLG class.
NTV2_REFERENCE_SFP1_PTP
@ NTV2_REFERENCE_SFP1_PTP
Specifies the PTP source on SFP 1.
Definition: ntv2enums.h:1454
NTV2Player8K::SetUpHostBuffers
virtual AJAStatus SetUpHostBuffers(void)
Sets up my host video & audio buffers.
Definition: ntv2player8k.cpp:310
NTV2_XptFrameBuffer1_DS2YUV
@ NTV2_XptFrameBuffer1_DS2YUV
Definition: ntv2enums.h:2651
NTV2_IS_VALID_TASK_MODE
#define NTV2_IS_VALID_TASK_MODE(__m__)
Definition: ntv2publicinterface.h:4354
NTV2_XptSDIOut4InputDS2
@ NTV2_XptSDIOut4InputDS2
Definition: ntv2enums.h:2792
NTV2_CHANNEL2
@ NTV2_CHANNEL2
Specifies channel or FrameStore 2 (or the 2nd item).
Definition: ntv2enums.h:1346
AJA_ThreadPriority_High
@ AJA_ThreadPriority_High
Definition: thread.h:44
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
AJATimeCodeBurn::RenderTimeCodeFont
AJA_EXPORT bool RenderTimeCodeFont(AJA_PixelFormat pixelFormat, uint32_t numPixels, uint32_t numLines)
Definition: timecodeburn.cpp:447
NTV2Player8K::AddTone
virtual uint32_t AddTone(ULWord *audioBuffer)
Inserts audio tone (based on my current tone frequency) into the given audio buffer.
Definition: ntv2player8k.cpp:831
NTV2_XptFrameBuffer2RGB
@ NTV2_XptFrameBuffer2RGB
Definition: ntv2enums.h:2535
NTV2_TestPatt_MultiBurst
@ NTV2_TestPatt_MultiBurst
Definition: ntv2testpatterngen.h:32
NTV2_AUDIO_BUFFER_BIG
@ NTV2_AUDIO_BUFFER_BIG
Definition: ntv2enums.h:1905
NTV2Player8K::SetUpAudio
virtual AJAStatus SetUpAudio(void)
Performs all audio setup.
Definition: ntv2player8k.cpp:259
AJAAncDataType_Unknown
@ AJAAncDataType_Unknown
Includes data that is valid, but we don't recognize.
Definition: ancillarydata.h:46
NTV2_XptSDIOut3InputDS2
@ NTV2_XptSDIOut3InputDS2
Definition: ntv2enums.h:2790
NTV2FormatDescriptor
Describes a video frame for a given video standard or format and pixel format, including the total nu...
Definition: ntv2formatdescriptor.h:41
IS_KNOWN_AJAAncDataType
#define IS_KNOWN_AJAAncDataType(_x_)
Definition: ancillarydata.h:65
NTV2FrameData
I encapsulate the video, audio and anc host buffers used in the AutoCirculate demos....
Definition: ntv2democommon.h:79
CRP188::GetRP188Reg
bool GetRP188Reg(RP188_STRUCT &outRP188) const
Definition: ntv2rp188.cpp:1240
NTV2Channel
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
Definition: ntv2enums.h:1343
NTV2Buffer
Describes a user-space buffer on the host computer. I have an address and a length,...
Definition: ntv2publicinterface.h:6094
NTV2_XptDuallinkOut1
@ NTV2_XptDuallinkOut1
Definition: ntv2enums.h:2531
AJA_STATUS_SUCCESS
@ AJA_STATUS_SUCCESS
Definition: types.h:381
ntv2player8k.h
Header file for NTV2Player8K demonstration class.
NTV2Buffer::GetByteCount
ULWord GetByteCount(void) const
Definition: ntv2publicinterface.h:6168
NTV2_AUDIOSYSTEM_4
@ NTV2_AUDIOSYSTEM_4
This identifies the 4th Audio System.
Definition: ntv2enums.h:3870
GetNTV2FrameRateFromVideoFormat
NTV2FrameRate GetNTV2FrameRateFromVideoFormat(const NTV2VideoFormat inVideoFormat)
Definition: ntv2utils.cpp:3534
NTV2_XptFrameBuffer3_DS2YUV
@ NTV2_XptFrameBuffer3_DS2YUV
Definition: ntv2enums.h:2655
AJAThread::Attach
virtual AJAStatus Attach(AJAThreadFunction *pThreadFunction, void *pUserContext)
Definition: thread.cpp:169
NTV2_IS_QUAD_QUAD_HFR_VIDEO_FORMAT
#define NTV2_IS_QUAD_QUAD_HFR_VIDEO_FORMAT(__f__)
Definition: ntv2enums.h:817
NTV2_AUDIO_48K
@ NTV2_AUDIO_48K
Definition: ntv2enums.h:1916
NTV2Player8K::Quit
virtual void Quit(void)
Gracefully stops me from running.
Definition: ntv2player8k.cpp:78
AJATimeCodeBurn::BurnTimeCode
AJA_EXPORT bool BurnTimeCode(void *pBaseVideoAddress, const std::string &inTimeCodeStr, const uint32_t inYPercent)
Definition: timecodeburn.cpp:45
NTV2_XptFrameBuffer4_DS2YUV
@ NTV2_XptFrameBuffer4_DS2YUV
Definition: ntv2enums.h:2657
NTV2_XptFrameBuffer3YUV
@ NTV2_XptFrameBuffer3YUV
Definition: ntv2enums.h:2561
NTV2Buffer::Deallocate
bool Deallocate(void)
Deallocates my user-space storage (if I own it – i.e. from a prior call to Allocate).
Definition: ntv2publicinterface.cpp:1803
NTV2Player8K::StartProducerThread
virtual void StartProducerThread(void)
Starts my producer thread.
Definition: ntv2player8k.cpp:762
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:329
NTV2_FRAMERATE_INVALID
@ NTV2_FRAMERATE_INVALID
Definition: ntv2enums.h:432
NTV2_AUDIOSYSTEM_1
@ NTV2_AUDIOSYSTEM_1
This identifies the first Audio System.
Definition: ntv2enums.h:3867
AJACircularBuffer::StartConsumeNextBuffer
FrameDataPtr StartConsumeNextBuffer(void)
The thread that's responsible for processing incoming frames – the consumer – calls this function to ...
Definition: circularbuffer.h:153
NTV2Player8K::SetUpTestPatternBuffers
virtual AJAStatus SetUpTestPatternBuffers(void)
Creates my test pattern buffers.
Definition: ntv2player8k.cpp:356
ntv2testpatterngen.h
Declares the NTV2TestPatternGen class.
AUTOCIRCULATE_TRANSFER::acAudioBuffer
NTV2Buffer acAudioBuffer
The host audio buffer. This field is owned by the client application, and thus is responsible for all...
Definition: ntv2publicinterface.h:8176
NTV2_TestPatt_ColorBars100
@ NTV2_TestPatt_ColorBars100
Definition: ntv2testpatterngen.h:28
NTV2XptConnection
std::pair< NTV2InputXptID, NTV2OutputXptID > NTV2XptConnection
Definition: ntv2signalrouter.h:38
DEC0N
#define DEC0N(__x__, __n__)
Definition: ntv2publicinterface.h:5649
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
BUFFER_PAGE_ALIGNED
static const bool BUFFER_PAGE_ALIGNED((!(0)))
NTV2_AncRgn_Field2
@ NTV2_AncRgn_Field2
Identifies the "normal" Field 2 ancillary data region.
Definition: ntv2enums.h:4199
AJA_STATUS_MEMORY
@ AJA_STATUS_MEMORY
Definition: types.h:397
AUTOCIRCULATE_WITH_MULTILINK_AUDIO3
#define AUTOCIRCULATE_WITH_MULTILINK_AUDIO3
Use this to AutoCirculate with base audiosystem controlling base AudioSystem + 3.
Definition: ntv2publicinterface.h:5593
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
NTV2_XptFrameBuffer1RGB
@ NTV2_XptFrameBuffer1RGB
Definition: ntv2enums.h:2526
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:1769
NTV2_XptSDIOut2InputDS2
@ NTV2_XptSDIOut2InputDS2
Definition: ntv2enums.h:2788
PlayerConfig::fDoMultiFormat
bool fDoMultiFormat
If true, enable device-sharing; otherwise take exclusive control of device.
Definition: ntv2democommon.h:332
CNTV2Card::ApplySignalRoute
virtual bool ApplySignalRoute(const CNTV2SignalRouter &inRouter, const bool inReplace=(0))
Applies the given routing table to the AJA device.
Definition: ntv2regroute.cpp:277
TimecodeFormat
TimecodeFormat
Definition: ntv2rp188.h:27
NTV2_AUDIO_FORMAT_LPCM
@ NTV2_AUDIO_FORMAT_LPCM
Definition: ntv2enums.h:1939
CNTV2Card::SetAudioLoopBack
virtual bool SetAudioLoopBack(const NTV2AudioLoopBack inMode, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Enables or disables NTV2AudioLoopBack mode for the given NTV2AudioSystem.
Definition: ntv2audio.cpp:300
NTV2_XptSDIOut4Input
@ NTV2_XptSDIOut4Input
Definition: ntv2enums.h:2791
NTV2_CHANNEL1
@ NTV2_CHANNEL1
Specifies channel or FrameStore 1 (or the first item).
Definition: ntv2enums.h:1345
AUTOCIRCULATE_TRANSFER::SetOutputTimeCode
bool SetOutputTimeCode(const NTV2_RP188 &inTimecode, const NTV2TCIndex inTCIndex=NTV2_TCINDEX_SDI1)
Intended for playout, sets one element of my acOutputTimeCodes member.
Definition: ntv2publicinterface.cpp:2898
ntv2debug.h
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
NTV2FrameBufferFormatString
const char * NTV2FrameBufferFormatString(NTV2FrameBufferFormat fmt)
Definition: ntv2debug.cpp:205
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::CanAcceptMoreOutputFrames
bool CanAcceptMoreOutputFrames(void) const
Definition: ntv2publicinterface.h:7345
NTV2_XptFrameBuffer3RGB
@ NTV2_XptFrameBuffer3RGB
Definition: ntv2enums.h:2562
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
NTV2FrameRate
NTV2FrameRate
Identifies a particular video frame rate.
Definition: ntv2enums.h:403
AJAAncillaryData_HDR_HDR10
This class handles "5251" Frame Status Information packets.
Definition: ancillarydata_hdr_hdr10.h:21
NTV2_IS_UHD2_FULL_VIDEO_FORMAT
#define NTV2_IS_UHD2_FULL_VIDEO_FORMAT(__f__)
Definition: ntv2enums.h:879
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
NTV2_CHANNEL4
@ NTV2_CHANNEL4
Specifies channel or FrameStore 4 (or the 4th item).
Definition: ntv2enums.h:1348
NTV2_XptFrameBuffer2_DS2YUV
@ NTV2_XptFrameBuffer2_DS2YUV
Definition: ntv2enums.h:2653
PlayerConfig::fDoTsiRouting
bool fDoTsiRouting
If true, enable TSI routing; otherwise route for square division (4K/8K)
Definition: ntv2democommon.h:338
AUTOCIRCULATE_WITH_MULTILINK_AUDIO1
#define AUTOCIRCULATE_WITH_MULTILINK_AUDIO1
Use this to AutoCirculate with base audiosystem controlling base AudioSystem + 1.
Definition: ntv2publicinterface.h:5591
PlayerConfig::fTransmitHDRType
AJAAncDataType fTransmitHDRType
Specifies the HDR anc data packet to transmit, if any.
Definition: ntv2democommon.h:330
NTV2MakeAudioSystemSet
NTV2AudioSystemSet NTV2MakeAudioSystemSet(const NTV2AudioSystem inFirstAudioSystem, const UWord inCount=1)
Definition: ntv2publicinterface.cpp:3555
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:5587
AJAThread::Active
virtual bool Active()
Definition: thread.cpp:116
CNTV2Card::DMABufferUnlockAll
virtual bool DMABufferUnlockAll()
Unlocks all previously-locked buffers used for DMA transfers.
Definition: ntv2dma.cpp:457
CNTV2Card::GetDisplayName
virtual std::string GetDisplayName(void)
Answers with this device's display name.
Definition: ntv2card.cpp:86
NTV2_XptFrameBuffer4_DS2RGB
@ NTV2_XptFrameBuffer4_DS2RGB
Definition: ntv2enums.h:2658
NTV2Player8K
I am an object that can play out an 8K or UHD2 test pattern (with timecode) to 4 x 12G SDI outputs of...
Definition: ntv2player8k.h:24
AJAStatus
AJAStatus
Definition: types.h:378
NTV2_TestPatt_White
@ NTV2_TestPatt_White
Definition: ntv2testpatterngen.h:38
NTV2_XptFrameBuffer1_DS2RGB
@ NTV2_XptFrameBuffer1_DS2RGB
Definition: ntv2enums.h:2652
NTV2Player8K::ConsumeFrames
virtual void ConsumeFrames(void)
My consumer thread that repeatedly plays frames using AutoCirculate (until quit).
Definition: ntv2player8k.cpp:635
NTV2_XptFrameBuffer2_DS2RGB
@ NTV2_XptFrameBuffer2_DS2RGB
Definition: ntv2enums.h:2654
NTV2FormatDescriptor::numPixels
ULWord numPixels
Width – total number of pixels per line.
Definition: ntv2formatdescriptor.h:367
process.h
Declares the AJAProcess class.
NTV2Player8K::SetUpVideo
virtual AJAStatus SetUpVideo(void)
Performs all video setup.
Definition: ntv2player8k.cpp:182
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_XptDuallinkOut3
@ NTV2_XptDuallinkOut3
Definition: ntv2enums.h:2576
NTV2_TestPatt_Ramp
@ NTV2_TestPatt_Ramp
Definition: ntv2testpatterngen.h:31
NTV2_VANCMODE_OFF
@ NTV2_VANCMODE_OFF
This identifies the mode in which there are no VANC lines in the frame buffer.
Definition: ntv2enums.h:3769
CNTV2Card::SetSDIOutputAudioSystem
virtual bool SetSDIOutputAudioSystem(const NTV2Channel inSDIOutputConnector, const NTV2AudioSystem inAudioSystem)
Sets the device's NTV2AudioSystem that will provide audio for the given SDI output's audio embedder....
Definition: ntv2register.cpp:3951
CNTV2Card::GetNumberAudioChannels
virtual bool GetNumberAudioChannels(ULWord &outNumChannels, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Returns the current number of audio channels being captured or played by a given Audio System on the ...
Definition: ntv2audio.cpp:180
AJATimeBase
Definition: timebase.h:18
AJA_STATUS_FEATURE
@ AJA_STATUS_FEATURE
Definition: types.h:393
AJA_STATUS_FAIL
@ AJA_STATUS_FAIL
Definition: types.h:382
ULWord
uint32_t ULWord
Definition: ajatypes.h:255
NTV2_TestPatt_FlatField
@ NTV2_TestPatt_FlatField
Definition: ntv2testpatterngen.h:35
CNTV2Card::EnableChannels
virtual bool EnableChannels(const NTV2ChannelSet &inChannels, const bool inDisableOthers=(0))
Enables the given FrameStore(s).
Definition: ntv2register.cpp:2107
CNTV2Card::GetDescription
virtual std::string GetDescription(void) const
Definition: ntv2card.cpp:143
NTV2FrameData::fVideoBuffer
NTV2Buffer fVideoBuffer
Host video buffer.
Definition: ntv2democommon.h:82
AUTOCIRCULATE_STATUS
This is returned from the CNTV2Card::AutoCirculateGetStatus function.
Definition: ntv2publicinterface.h:7274
ntv2devicescanner.h
Declares the CNTV2DeviceScanner class.
AJAAncillaryData
I am the principal class that stores a single SMPTE-291 SDI ancillary data packet OR the digitized co...
Definition: ancillarydata.h:552
NTV2FormatDescriptor::numLines
ULWord numLines
Height – total number of lines.
Definition: ntv2formatdescriptor.h:366
NTV2_XptFrameBuffer1YUV
@ NTV2_XptFrameBuffer1YUV
Definition: ntv2enums.h:2525
NTV2_XptSDIOut2Input
@ NTV2_XptSDIOut2Input
Definition: ntv2enums.h:2787
NTV2_XptDuallinkOut2DS2
@ NTV2_XptDuallinkOut2DS2
Definition: ntv2enums.h:2566
NTV2_XptDuallinkOut1DS2
@ NTV2_XptDuallinkOut1DS2
Definition: ntv2enums.h:2565
CNTV2DemoCommon::SetDefaultPageSize
static size_t SetDefaultPageSize(void)
Definition: ntv2democommon.cpp:1553
NTV2_XptDuallinkOut4DS2
@ NTV2_XptDuallinkOut4DS2
Definition: ntv2enums.h:2579
NTV2ChannelToTimecodeIndex
NTV2TCIndex NTV2ChannelToTimecodeIndex(const NTV2Channel inChannel, const bool inEmbeddedLTC=false, const bool inIsF2=false)
Converts the given NTV2Channel value into the equivalent NTV2TCIndex value.
Definition: ntv2utils.cpp:5027
NTV2Player8K::ProducerThreadStatic
static void ProducerThreadStatic(AJAThread *pThread, void *pContext)
This is the producer thread's static callback function that gets called when the producer thread star...
Definition: ntv2player8k.cpp:772
NTV2AudioSystemSet
std::set< NTV2AudioSystem > NTV2AudioSystemSet
A set of distinct NTV2AudioSystem values. New in SDK 16.2.
Definition: ntv2publicinterface.h:3915
CNTV2Card::SetSDIOutRGBLevelAConversion
virtual bool SetSDIOutRGBLevelAConversion(const UWord inOutputSpigot, const bool inEnable)
Enables or disables an RGB-over-3G-level-A conversion at the SDI output widget (assuming the AJA devi...
Definition: ntv2register.cpp:4333
AJAProcess::GetPid
static uint64_t GetPid()
Definition: process.cpp:35
PlayerConfig::fNumAudioLinks
UWord fNumAudioLinks
The number of audio systems to control for multi-link audio (4K/8K)
Definition: ntv2democommon.h:331
NTV2_TestPatt_ColorQuadrant
@ NTV2_TestPatt_ColorQuadrant
Definition: ntv2testpatterngen.h:43
NTV2_TestPatt_ColorQuadrantBorder
@ NTV2_TestPatt_ColorQuadrantBorder
Definition: ntv2testpatterngen.h:44
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 FrameStore 3 (or the 3rd item).
Definition: ntv2enums.h:1347
UWord
uint16_t UWord
Definition: ajatypes.h:253
PlayerConfig::fVideoFormat
NTV2VideoFormat fVideoFormat
The video format to use.
Definition: ntv2democommon.h:328
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::fNumAudioBytes
ULWord fNumAudioBytes
Actual number of captured audio bytes.
Definition: ntv2democommon.h:88
NTV2_REFERENCE_FREERUN
@ NTV2_REFERENCE_FREERUN
Specifies the device's internal clock.
Definition: ntv2enums.h:1445
NTV2_XptDualLinkOut4Input
@ NTV2_XptDualLinkOut4Input
Definition: ntv2enums.h:2820
AUTOCIRCULATE_TRANSFER
This object specifies the information that will be transferred to or from the AJA device in the CNTV2...
Definition: ntv2publicinterface.h:8161
PlayerConfig::fOutputChannel
NTV2Channel fOutputChannel
The device channel to use.
Definition: ntv2democommon.h:324
NTV2VideoFormatToString
std::string NTV2VideoFormatToString(const NTV2VideoFormat inValue, const bool inUseFrameRate=false)
Definition: ntv2utils.cpp:6798
AJAAncillaryData_HDR_HLG
This class handles "5251" Frame Status Information packets.
Definition: ancillarydata_hdr_hlg.h:21
NTV2FrameData::AudioBuffer
NTV2Buffer & AudioBuffer(void)
Definition: ntv2democommon.h:109
NTV2_TestPatt_Black
@ NTV2_TestPatt_Black
Definition: ntv2testpatterngen.h:37
NTV2_TestPatt_SlantRamp
@ NTV2_TestPatt_SlantRamp
Definition: ntv2testpatterngen.h:41
NTV2_XptSDIOut1InputDS2
@ NTV2_XptSDIOut1InputDS2
Definition: ntv2enums.h:2786
NTV2_TestPatt_ColorBars75
@ NTV2_TestPatt_ColorBars75
Definition: ntv2testpatterngen.h:30
NTV2_TASK_MODE_INVALID
@ NTV2_TASK_MODE_INVALID
Definition: ntv2publicinterface.h:4351
CNTV2DriverInterface::IsDeviceReady
virtual bool IsDeviceReady(const bool inCheckValid=(0))
Definition: ntv2driverinterface.cpp:1316
NTV2_TestPatt_ZonePlate
@ NTV2_TestPatt_ZonePlate
Definition: ntv2testpatterngen.h:42
DEVICE_ID_INVALID
@ DEVICE_ID_INVALID
Definition: ntv2enums.h:93
kDemoAppSignature
static const ULWord kDemoAppSignature((((uint32_t)( 'D'))<< 24)|(((uint32_t)( 'E'))<< 16)|(((uint32_t)( 'M'))<< 8)|(((uint32_t)( 'O'))<< 0))
NTV2Player8K::ProduceFrames
virtual void ProduceFrames(void)
My producer thread that repeatedly produces video frames.
Definition: ntv2player8k.cpp:782
NTV2ChannelSet
std::set< NTV2Channel > NTV2ChannelSet
A set of distinct NTV2Channel values.
Definition: ntv2publicinterface.h:3869
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
CRP188
Definition: ntv2rp188.h:55
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
CNTV2Card::SetHDMIOutAudioRate
virtual bool SetHDMIOutAudioRate(const NTV2AudioRate inNewValue)
Sets the HDMI output's audio rate.
Definition: ntv2audio.cpp:972
AJAAncillaryData_HDR_SDR
This class handles "5251" Frame Status Information packets.
Definition: ancillarydata_hdr_sdr.h:21
AJA_NULL
#define AJA_NULL
Definition: ajatypes.h:199
AddAudioTone
bool AddAudioTone(ULWord &outNumBytesWritten, NTV2Buffer &inAudioBuffer, ULWord &inOutCurrentSample, const ULWord inNumSamples, const double inSampleRate, const double inAmplitude, const double inFrequency, const ULWord inNumBits, const bool inByteSwap, const ULWord inNumChannels)
Fills the given buffer with 32-bit (ULWord) audio tone samples.
Definition: ntv2utils.cpp:4483
NTV2Player8K::RouteOutputSignal
virtual bool RouteOutputSignal(void)
Performs all widget/signal routing for playout.
Definition: ntv2player8k.cpp:416
gAudMaxSizeBytes
static const uint32_t gAudMaxSizeBytes(256 *1024)
The maximum number of bytes of 48KHz audio that can be transferred for a single frame....
CNTV2DemoCommon::GetAJAFrameRate
static AJA_FrameRate GetAJAFrameRate(const NTV2FrameRate inFrameRate)
Definition: ntv2democommon.cpp:1080
NTV2TestPatternGen
The NTV2 test pattern generator.
Definition: ntv2testpatterngen.h:69
NTV2Buffer::GetHostPointer
void * GetHostPointer(void) const
Definition: ntv2publicinterface.h:6151
AJAAncDataType_HDR_SDR
@ AJAAncDataType_HDR_SDR
Definition: ancillarydata.h:57
NTV2_FORMAT_UNKNOWN
@ NTV2_FORMAT_UNKNOWN
Definition: ntv2enums.h:525
NTV2FrameData::fAudioBuffer
NTV2Buffer fAudioBuffer
Host audio buffer.
Definition: ntv2democommon.h:84
gAncMaxSizeBytes
static ULWord gAncMaxSizeBytes(NTV2_ANCSIZE_MAX)
The maximum number of bytes of ancillary data that can be transferred for a single field....
NTV2_TestPatt_Border
@ NTV2_TestPatt_Border
Definition: ntv2testpatterngen.h:39
NTV2AudioRate
NTV2AudioRate
Definition: ntv2enums.h:1914
AJA_STATUS_INITIALIZE
@ AJA_STATUS_INITIALIZE
Definition: types.h:386
NTV2Player8K::Run
virtual AJAStatus Run(void)
Runs me.
Definition: ntv2player8k.cpp:599
PlayerConfig::fDoRGBOnWire
bool fDoRGBOnWire
If true, produce RGB on the wire; otherwise output YUV.
Definition: ntv2democommon.h:339
DEC
#define DEC(__x__)
Definition: ntv2publicinterface.h:5647
NTV2_AUDIOSYSTEM_3
@ NTV2_AUDIOSYSTEM_3
This identifies the 3rd Audio System.
Definition: ntv2enums.h:3869
NTV2Player8K::~NTV2Player8K
virtual ~NTV2Player8K(void)
Definition: ntv2player8k.cpp:69
false
#define false
Definition: ntv2devicefeatures.h:25
NTV2_XptFrameBuffer4RGB
@ NTV2_XptFrameBuffer4RGB
Definition: ntv2enums.h:2564
AUTOCIRCULATE_WITH_MULTILINK_AUDIO2
#define AUTOCIRCULATE_WITH_MULTILINK_AUDIO2
Use this to AutoCirculate with base audiosystem controlling base AudioSystem + 2.
Definition: ntv2publicinterface.h:5592
AUTOCIRCULATE_WITH_RP188
#define AUTOCIRCULATE_WITH_RP188
Use this to AutoCirculate with RP188.
Definition: ntv2publicinterface.h:5581
ancillarydata_hdr_hdr10.h
Declares the AJAAncillaryData_HDR_HDR10 class.
NTV2FrameBufferFormatToString
std::string NTV2FrameBufferFormatToString(const NTV2FrameBufferFormat inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:6988
PlayerConfig::fDeviceSpec
std::string fDeviceSpec
The AJA device to use.
Definition: ntv2democommon.h:322
NTV2_XptDualLinkOut3Input
@ NTV2_XptDualLinkOut3Input
Definition: ntv2enums.h:2819
NTV2XptConnections
std::map< NTV2InputXptID, NTV2OutputXptID > NTV2XptConnections
Definition: ntv2signalrouter.h:39
AJA_STATUS_BAD_PARAM
@ AJA_STATUS_BAD_PARAM
Definition: types.h:392
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:3500
NTV2_XptFrameBuffer2YUV
@ NTV2_XptFrameBuffer2YUV
Definition: ntv2enums.h:2534
std
Definition: json.hpp:5362
NTV2_RP188
This struct replaces the old RP188_STRUCT.
Definition: ntv2publicinterface.h:6871
AUTOCIRCULATE_TRANSFER::acVideoBuffer
NTV2Buffer acVideoBuffer
The host video buffer. This field is owned by the client application, and thus is responsible for all...
Definition: ntv2publicinterface.h:8169
IsRGBFormat
bool IsRGBFormat(const NTV2FrameBufferFormat format)
Definition: ntv2utils.cpp:5475
NTV2Player8K::ConsumerThreadStatic
static void ConsumerThreadStatic(AJAThread *pThread, void *pContext)
This is the consumer thread's static callback function that gets called when the consumer thread star...
Definition: ntv2player8k.cpp:624
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
CNTV2DemoCommon::GetAJAPixelFormat
static AJA_PixelFormat GetAJAPixelFormat(const NTV2PixelFormat inFormat)
Definition: ntv2democommon.cpp:1112
GetAudioSamplesPerFrame
ULWord GetAudioSamplesPerFrame(const NTV2FrameRate inFrameRate, const NTV2AudioRate inAudioRate, ULWord inCadenceFrame=0, bool inIsSMPTE372Enabled=false)
Returns the number of audio samples for a given video frame rate, audio sample rate,...
Definition: ntv2utils.cpp:2793
NTV2Player8K::NTV2Player8K
NTV2Player8K(const PlayerConfig &inConfig)
Constructs me using the given configuration settings.
Definition: ntv2player8k.cpp:48
CNTV2Card::AutoCirculateInitForOutput
virtual bool AutoCirculateInitForOutput(const NTV2Channel inChannel, const UWord inFrameCount=7, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_INVALID, const ULWord inOptionFlags=0, const UByte inNumChannels=1, const UWord inStartFrameNumber=0, const UWord inEndFrameNumber=0)
Prepares for subsequent AutoCirculate playout, designating a contiguous block of frame buffers on the...
Definition: ntv2autocirculate.cpp:353
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
AJAAncillaryData::GenerateTransmitData
virtual AJAStatus GenerateTransmitData(uint8_t *pBuffer, const size_t inMaxBytes, uint32_t &outPacketSize)
Generates "raw" ancillary data from my internal ancillary data (playback) – see SDI Anc Buffer Data F...
Definition: ancillarydata.cpp:767
NTV2_XptDualLinkOut2Input
@ NTV2_XptDualLinkOut2Input
Definition: ntv2enums.h:2818
NTV2_AudioChannel1_8
@ NTV2_AudioChannel1_8
This selects audio channels 1 thru 8.
Definition: ntv2enums.h:3295
CNTV2DriverInterface::GetDeviceID
virtual NTV2DeviceID GetDeviceID(void)
Definition: ntv2driverinterface.cpp:411
NTV2Player8K::Init
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
Definition: ntv2player8k.cpp:101
CNTV2Card::GetEveryFrameServices
virtual bool GetEveryFrameServices(NTV2EveryFrameTaskMode &outMode)
Retrieves the device's current "retail service" task mode.
Definition: ntv2register.cpp:184
CNTV2Card::GetAudioRate
virtual bool GetAudioRate(NTV2AudioRate &outRate, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Returns the current NTV2AudioRate for the given Audio System.
Definition: ntv2audio.cpp:226
CNTV2Card::GetFrameRate
virtual bool GetFrameRate(NTV2FrameRate &outValue, NTV2Channel inChannel=NTV2_CHANNEL1)
Returns the AJA device's currently configured frame rate via its "value" parameter.
Definition: ntv2register.cpp:1022
AJAAncDataType_HDR_HLG
@ AJAAncDataType_HDR_HLG
Definition: ancillarydata.h:59
NTV2Player8K::GetACStatus
virtual void GetACStatus(AUTOCIRCULATE_STATUS &outStatus)
Provides status information about my output (playout) process.
Definition: ntv2player8k.cpp:867
GetAudioSamplesPerSecond
double GetAudioSamplesPerSecond(const NTV2AudioRate inAudioRate)
Returns the audio sample rate as a number of audio samples per second.
Definition: ntv2utils.cpp:3207
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_TestPatt_MultiPattern
@ NTV2_TestPatt_MultiPattern
Definition: ntv2testpatterngen.h:36
PlayerConfig
Configures an NTV2Player instance.
Definition: ntv2democommon.h:319
CNTV2Card::SetQuadQuadFrameEnable
virtual bool SetQuadQuadFrameEnable(const bool inValue, const NTV2Channel inChannel=NTV2_CHANNEL1)
Enables or disables "quad-quad" 8K frame mode on the device.
Definition: ntv2register.cpp:1125
CNTV2Card::SetHDMIOutAudioSource8Channel
virtual bool SetHDMIOutAudioSource8Channel(const NTV2Audio8ChannelSelect inNewValue, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Changes the HDMI output's 8-channel audio source.
Definition: ntv2audio.cpp:914
PlayerConfig::fPixelFormat
NTV2PixelFormat fPixelFormat
The pixel format to use.
Definition: ntv2democommon.h:327
CNTV2Card::SetQuadQuadSquaresEnable
virtual bool SetQuadQuadSquaresEnable(const bool inValue, const NTV2Channel inChannel=NTV2_CHANNEL1)
Enables or disables quad-quad-frame (8K) squares mode on the device.
Definition: ntv2register.cpp:1180
NTV2Buffer::Fill
bool Fill(const T &inValue)
Fills me with the given scalar value.
Definition: ntv2publicinterface.h:6320
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
NTV2TestPatternGen::getTestPatternNames
static NTV2TestPatternNames getTestPatternNames(void)
Definition: ntv2testpatterngen.cpp:2542
NTV2_XptFrameBuffer3_DS2RGB
@ NTV2_XptFrameBuffer3_DS2RGB
Definition: ntv2enums.h:2656
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
PLNOTE
#define PLNOTE(_xpr_)
Definition: ntv2democommon.h:36
AJA_STATUS_OPEN
@ AJA_STATUS_OPEN
Definition: types.h:388
AJATimeBase::FramesToSeconds
double FramesToSeconds(int64_t frames) const
Definition: timebase.cpp:197
CNTV2DemoCommon::NTV2FrameRate2TimecodeFormat
static TimecodeFormat NTV2FrameRate2TimecodeFormat(const NTV2FrameRate inFrameRate)
Definition: ntv2democommon.cpp:1058
CNTV2Card::SetNumberAudioChannels
virtual bool SetNumberAudioChannels(const ULWord inNumChannels, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Sets the number of audio channels to be concurrently captured or played for a given Audio System on t...
Definition: ntv2audio.cpp:146
NTV2_TestPatt_LineSweep
@ NTV2_TestPatt_LineSweep
Definition: ntv2testpatterngen.h:33
CNTV2Card::SetAudioBufferSize
virtual bool SetAudioBufferSize(const NTV2AudioBufferSize inValue, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Changes the size of the audio buffer that is used for a given Audio System in the AJA device.
Definition: ntv2audio.cpp:249
ancillarydata_hdr_sdr.h
Declares the AJAAncillaryData_HDR_SDR class.
AJAThread::Start
virtual AJAStatus Start()
Definition: thread.cpp:91
PLFAIL
#define PLFAIL(_xpr_)
Definition: ntv2democommon.h:34
xHEX0N
#define xHEX0N(__x__, __n__)
Definition: ntv2publicinterface.h:5646
NTV2AudioSystem
NTV2AudioSystem
Used to identify an Audio System on an NTV2 device. See Audio System Operation for more information.
Definition: ntv2enums.h:3865
AJA_FAILURE
#define AJA_FAILURE(_status_)
Definition: types.h:371
NTV2_AUDIO_RATE_INVALID
@ NTV2_AUDIO_RATE_INVALID
Definition: ntv2enums.h:1920
gFrequencies
static const double gFrequencies[]
Definition: ntv2player8k.cpp:43
DeviceCapabilities::CanDoFrameBufferFormat
bool CanDoFrameBufferFormat(const NTV2PixelFormat inPF)
Definition: ntv2devicecapabilities.h:226
NTV2_TestPatt_LinearRamp
@ NTV2_TestPatt_LinearRamp
Definition: ntv2testpatterngen.h:40
CNTV2Card::SetHDMIOutAudioFormat
virtual bool SetHDMIOutAudioFormat(const NTV2AudioFormat inNewValue)
Sets the HDMI output's audio format.
Definition: ntv2audio.cpp:984
NTV2ChannelToAudioSystem
NTV2AudioSystem NTV2ChannelToAudioSystem(const NTV2Channel inChannel)
Converts the given NTV2Channel value into its equivalent NTV2AudioSystem.
Definition: ntv2utils.cpp:4934
AUTOCIRCULATE_TRANSFER::acANCBuffer
NTV2Buffer acANCBuffer
The host ancillary data buffer. This field is owned by the client application, and thus is responsibl...
Definition: ntv2publicinterface.h:8187
NTV2FormatDescriptor::IsValid
bool IsValid(void) const
Definition: ntv2formatdescriptor.h:112
PLINFO
#define PLINFO(_xpr_)
Definition: ntv2democommon.h:37
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
NTV2_ANCSIZE_MAX
#define NTV2_ANCSIZE_MAX
Definition: ntv2democommon.h:47
NTV2_XptSDIOut1Input
@ NTV2_XptSDIOut1Input
Definition: ntv2enums.h:2785
PLWARN
#define PLWARN(_xpr_)
Definition: ntv2democommon.h:35
CNTV2Card::SetSDIOutLevelAtoLevelBConversion
virtual bool SetSDIOutLevelAtoLevelBConversion(const UWord inOutputSpigot, const bool inEnable)
Enables or disables 3G level A to 3G level B conversion at the SDI output widget (assuming the AJA de...
Definition: ntv2register.cpp:4301
CRP188::GetRP188Str
bool GetRP188Str(std::string &sRP188) const
Definition: ntv2rp188.cpp:917
NTV2_OEM_TASKS
@ NTV2_OEM_TASKS
2: OEM (recommended): device configured by client application(s) with some driver involvement.
Definition: ntv2publicinterface.h:4350
NTV2_XptSDIOut3Input
@ NTV2_XptSDIOut3Input
Definition: ntv2enums.h:2789
NTV2_XptDuallinkOut4
@ NTV2_XptDuallinkOut4
Definition: ntv2enums.h:2578
NTV2TestPatternNames
NTV2StringList NTV2TestPatternNames
An ordered sequence of pattern names.
Definition: ntv2testpatterngen.h:21
AJAAncDataType_HDR_HDR10
@ AJAAncDataType_HDR_HDR10
Definition: ancillarydata.h:58
NTV2Buffer::Set
bool Set(const void *pInUserPointer, const size_t inByteCount)
Sets (or resets) me from a client-supplied address and size.
Definition: ntv2publicinterface.cpp:1753
NTV2_XptDuallinkOut2
@ NTV2_XptDuallinkOut2
Definition: ntv2enums.h:2551
NTV2_XptDualLinkOut1Input
@ NTV2_XptDualLinkOut1Input
Definition: ntv2enums.h:2817
NTV2_XptDuallinkOut3DS2
@ NTV2_XptDuallinkOut3DS2
Definition: ntv2enums.h:2577
NTV2_AUDIOSYSTEM_INVALID
@ NTV2_AUDIOSYSTEM_INVALID
Definition: ntv2enums.h:3877
timebase.h
Declares the AJATimeBase class.