AJA NTV2 SDK  17.0.1.1246
NTV2 SDK 17.0.1.1246
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 // Convenience macros for EZ logging:
23 #define TCFAIL(_expr_) AJA_sERROR (AJA_DebugUnit_TimecodeGeneric, AJAFUNC << ": " << _expr_)
24 #define TCWARN(_expr_) AJA_sWARNING(AJA_DebugUnit_TimecodeGeneric, AJAFUNC << ": " << _expr_)
25 #define TCNOTE(_expr_) AJA_sNOTICE (AJA_DebugUnit_TimecodeGeneric, AJAFUNC << ": " << _expr_)
26 #define TCINFO(_expr_) AJA_sINFO (AJA_DebugUnit_TimecodeGeneric, AJAFUNC << ": " << _expr_)
27 #define TCDBG(_expr_) AJA_sDEBUG (AJA_DebugUnit_TimecodeGeneric, AJAFUNC << ": " << _expr_)
28 
34 static ULWord gAncMaxSizeBytes (NTV2_ANCSIZE_MAX); // Max per-frame anc buffer size, in bytes
35 
44 static const uint32_t gAudMaxSizeBytes (256 * 1024); // Max per-frame audio buffer size, in bytes
45 
46 static const bool BUFFER_PAGE_ALIGNED (true);
47 
48 // Audio tone generator data
49 static const double gFrequencies [] = {250.0, 500.0, 1000.0, 2000.0};
50 static const ULWord gNumFrequencies (sizeof(gFrequencies) / sizeof(double));
51 // Unlike NTV2Player, this demo uses the same waveform amplitude in each audio channel
52 
53 
55  : mConfig (inConfig),
56  mConsumerThread (),
57  mProducerThread (),
58  mDevice (),
59  mDeviceID (DEVICE_ID_INVALID),
60  mSavedTaskMode (NTV2_TASK_MODE_INVALID),
61  mCurrentFrame (0),
62  mCurrentSample (0),
63  mToneFrequency (440.0),
64  mAudioSystem (NTV2_AUDIOSYSTEM_INVALID),
65  mFormatDesc (),
66  mGlobalQuit (false),
67  mTCBurner (),
68  mHostBuffers (),
69  mFrameDataRing (),
70  mTestPatRasters ()
71 {
72 }
73 
74 
76 {
77  // Stop my playout and producer threads, then destroy them...
78  Quit();
79 
80  mDevice.UnsubscribeOutputVerticalEvent(mConfig.fOutputChannel); // Unsubscribe from output VBI event
81 } // destructor
82 
83 
84 void NTV2Player8K::Quit (void)
85 {
86  // Set the global 'quit' flag, and wait for the threads to go inactive...
87  mGlobalQuit = true;
88 
89  while (mProducerThread.Active())
90  AJATime::Sleep(10);
91 
92  while (mConsumerThread.Active())
93  AJATime::Sleep(10);
94 
95 #if defined(NTV2_BUFFER_LOCKING)
96  mDevice.DMABufferUnlockAll();
97 #endif // NTV2_BUFFER_LOCKING
98  if (!mConfig.fDoMultiFormat && mDevice.IsOpen())
99  {
101  if (NTV2_IS_VALID_TASK_MODE(mSavedTaskMode))
102  mDevice.SetEveryFrameServices(mSavedTaskMode); // Restore prior task mode
103  }
104 } // Quit
105 
106 
108 {
109  AJAStatus status (AJA_STATUS_SUCCESS);
110 
111  // Open the device...
113  {cerr << "## ERROR: Device '" << mConfig.fDeviceSpec << "' not found" << endl; return AJA_STATUS_OPEN;}
114  mDeviceID = mDevice.GetDeviceID(); // Keep this ID handy -- it's used frequently
115 
116  if (!mDevice.IsDeviceReady(false))
117  {cerr << "## ERROR: Device '" << mConfig.fDeviceSpec << "' not ready" << endl; return AJA_STATUS_INITIALIZE;}
118  if (!::NTV2DeviceCanDoPlayback(mDeviceID))
119  {cerr << "## ERROR: '" << mDevice.GetDisplayName() << "' is capture-only" << endl; return AJA_STATUS_FEATURE;}
120 
121  const UWord maxNumChannels (::NTV2DeviceGetNumFrameStores(mDeviceID));
122 
123  // Check for an invalid configuration
125  {cerr << "## ERROR: HFR RGB output not supported" << endl; return AJA_STATUS_BAD_PARAM;}
126 
127  // Check for valid channel...
128  if (UWord(mConfig.fOutputChannel) >= maxNumChannels)
129  {
130  cerr << "## ERROR: Cannot use channel '" << DEC(mConfig.fOutputChannel+1) << "' -- device only supports channel 1"
131  << (maxNumChannels > 1 ? string(" thru ") + string(1, char(maxNumChannels+'0')) : "") << endl;
132  return AJA_STATUS_UNSUPPORTED;
133  }
134  if (mConfig.fOutputChannel != NTV2_CHANNEL1 && mConfig.fOutputChannel != NTV2_CHANNEL3)
135  {
136  cerr << "## ERROR: 8K/UHD2 requires Ch1 or Ch3, not Ch" << DEC(mConfig.fOutputChannel) << endl;
137  return AJA_STATUS_BAD_PARAM;
138  }
139 
140  if (!mConfig.fDoMultiFormat)
141  {
142  mDevice.GetEveryFrameServices(mSavedTaskMode); // Save the current task mode
144  return AJA_STATUS_BUSY; // Device is in use by another app -- fail
145  }
146  mDevice.SetEveryFrameServices(NTV2_OEM_TASKS); // Set OEM service level
147 
148  if (::NTV2DeviceCanDoMultiFormat(mDeviceID))
149  mDevice.SetMultiFormatMode(mConfig.fDoMultiFormat);
150  else
151  mConfig.fDoMultiFormat = false;
152 
153  // Set up the video and audio...
154  status = SetUpVideo();
155  if (AJA_FAILURE(status))
156  return status;
157  status = mConfig.WithAudio() ? SetUpAudio() : AJA_STATUS_SUCCESS;
158  if (AJA_FAILURE(status))
159  return status;
160 
161  // Set up the circular buffers, and the test pattern buffers...
162  status = SetUpHostBuffers();
163  if (AJA_FAILURE(status))
164  return status;
165  status = SetUpTestPatternBuffers();
166  if (AJA_FAILURE(status))
167  return status;
168 
169  // Set up the device signal routing...
171 
172  // Lastly, prepare my AJATimeCodeBurn instance...
173  if (!mTCBurner.RenderTimeCodeFont (CNTV2DemoCommon::GetAJAPixelFormat(mConfig.fPixelFormat), mFormatDesc.numPixels, mFormatDesc.numLines))
174  {cerr << "## ERROR: RenderTimeCodeFont failed for: " << mFormatDesc << endl; return AJA_STATUS_UNSUPPORTED;}
175 
176  // Ready to go...
177  #if defined(_DEBUG)
178  cerr << mConfig;
179  if (mDevice.IsRemote())
180  cerr << "Device Description: " << mDevice.GetDescription() << endl;
181  cerr << endl;
182  #endif // defined(_DEBUG)
183  return AJA_STATUS_SUCCESS;
184 
185 } // Init
186 
187 
189 {
190  // Configure the device to output the requested video format...
191  if (mConfig.fVideoFormat == NTV2_FORMAT_UNKNOWN)
192  return AJA_STATUS_BAD_PARAM;
193  if (!::NTV2DeviceCanDoVideoFormat (mDeviceID, mConfig.fVideoFormat))
194  { cerr << "## ERROR: '" << mDevice.GetDisplayName() << "' doesn't support "
195  << ::NTV2VideoFormatToString(mConfig.fVideoFormat) << endl;
196  return AJA_STATUS_UNSUPPORTED;
197  }
198  if (!::NTV2DeviceCanDoFrameBufferFormat (mDeviceID, mConfig.fPixelFormat))
199  { cerr << "## ERROR: '" << mDevice.GetDisplayName() << "' doesn't support "
200  << ::NTV2FrameBufferFormatString(mConfig.fPixelFormat) << endl;
201  return AJA_STATUS_UNSUPPORTED;
202  }
203 
204  NTV2ChannelSet channels13, frameStores;
205  channels13.insert(NTV2_CHANNEL1); channels13.insert(NTV2_CHANNEL3);
206  if (mConfig.fDoTsiRouting)
207  { // "Tsi" routing requires 2 FrameStores
208  if (channels13.find(mConfig.fOutputChannel) == channels13.end())
209  return AJA_STATUS_BAD_PARAM; // fOutputChannel not Ch1 or Ch3
210  frameStores = ::NTV2MakeChannelSet (mConfig.fOutputChannel, 2); // 2 FrameStores starting at fOutputChannel
211  }
212  else
213  { // "Squares" routing requires 4 FrameStores
214  if (mConfig.fOutputChannel != NTV2_CHANNEL1)
215  return AJA_STATUS_BAD_PARAM; // fOutputChannel not Ch1
216  frameStores = ::NTV2MakeChannelSet (mConfig.fOutputChannel, 4); // 4 FrameStores starting at fOutputChannel
217  }
218 
219  // Keep the raster description handy...
220  mFormatDesc = NTV2FormatDescriptor(mConfig.fVideoFormat, mConfig.fPixelFormat);
221  if (!mFormatDesc.IsValid())
222  return AJA_STATUS_FAIL;
223 
224  // Turn on the FrameStores (to read frame buffer memory and transmit video)...
225  mDevice.EnableChannels (frameStores, /*disableOthers=*/!mConfig.fDoMultiFormat);
226 
227  // This demo requires VANC be disabled...
228  mDevice.SetVANCMode (frameStores, NTV2_VANCMODE_OFF); // VANC is incompatible with 8K/UHD2 formats
229 
230  // Set the FrameStore video format...
231  mDevice.SetVideoFormat (mConfig.fVideoFormat, false, false, mConfig.fOutputChannel);
232  mDevice.SetQuadQuadFrameEnable (true, mConfig.fOutputChannel);
233  mDevice.SetQuadQuadSquaresEnable (!mConfig.fDoTsiRouting, mConfig.fOutputChannel);
234 
235  // Set the frame buffer pixel format for the device FrameStore(s)...
236  mDevice.SetFrameBufferFormat (frameStores, mConfig.fPixelFormat);
237 
238  // The output interrupt is Enabled by default, but on some platforms, you must subscribe to it
239  // in order to be able to wait on its event/semaphore...
241 
242  // Check if HDR anc is permissible...
244  {cerr << "## WARNING: HDR Anc requested, but device can't do custom anc" << endl;
246 
247  // Get current per-field maximum Anc buffer size...
250 
251  // Set output clock reference...
253 
254  // At this point, video setup is complete (except for widget signal routing).
255  return AJA_STATUS_SUCCESS;
256 
257 } // SetUpVideo
258 
259 
261 {
262  uint16_t numAudioChannels (::NTV2DeviceGetMaxAudioChannels(mDeviceID));
263 
264  // If there are 8192 pixels on a line instead of 7680, reduce the number of audio channels
265  // This is because HANC is narrower, and has space for only 8 channels
266  if (NTV2_IS_UHD2_FULL_VIDEO_FORMAT(mConfig.fVideoFormat) && numAudioChannels > 8)
267  numAudioChannels = 8;
268 
269  // Use the NTV2AudioSystem that has the same ordinal value as the output FrameStore/Channel...
270  mAudioSystem = ::NTV2ChannelToAudioSystem(mConfig.fOutputChannel);
271 
272  if (mConfig.fNumAudioLinks > 1) // For users that want to send 32 or 64 audio channels on 2 or 4 SDI links
273  switch (mAudioSystem)
274  {
275  default:
276  case NTV2_AUDIOSYSTEM_1:
277  { const UWord numChan(NTV2_IS_QUAD_QUAD_HFR_VIDEO_FORMAT(mConfig.fVideoFormat) ? 4 : 2);
278  const NTV2AudioSystemSet audSystems (::NTV2MakeAudioSystemSet (mAudioSystem, numChan));
279  for (UWord chan(0); chan < numChan; chan++)
280  mDevice.SetSDIOutputAudioSystem (NTV2Channel(chan), NTV2AudioSystem(chan));
281  mDevice.SetNumberAudioChannels (numAudioChannels, audSystems);
282  mDevice.SetAudioBufferSize (NTV2_AUDIO_BUFFER_BIG, audSystems);
283  mDevice.SetAudioLoopBack (NTV2_AUDIO_LOOPBACK_OFF, audSystems);
284  break;
285  }
286  case NTV2_AUDIOSYSTEM_3:
289  break;
290  }
291  else
292  {
293  mDevice.SetSDIOutputAudioSystem (::NTV2MakeChannelSet (NTV2_CHANNEL1, 4), mAudioSystem);
294  mDevice.SetNumberAudioChannels (numAudioChannels, mAudioSystem);
295  mDevice.SetAudioBufferSize (NTV2_AUDIO_BUFFER_BIG, mAudioSystem);
296  mDevice.SetAudioLoopBack (NTV2_AUDIO_LOOPBACK_OFF, mAudioSystem);
297  }
298 
299  if (mConfig.fDoHDMIOutput)
300  {
304  }
305 
306  return AJA_STATUS_SUCCESS;
307 
308 } // SetUpAudio
309 
310 
312 {
313  CNTV2DemoCommon::SetDefaultPageSize(); // Set host-specific page size
314 
315  // Let my circular buffer know when it's time to quit...
316  mFrameDataRing.SetAbortFlag (&mGlobalQuit);
317 
318  // Multi-link audio uses stacked buffers for transferring to the board,
319  // the first byte after the end of the first audio link buffer is the start of the second audio link buffer.
320  const size_t audioBufferSize (gAudMaxSizeBytes * uint32_t(mConfig.fNumAudioLinks));
321 
322  // Allocate and add each in-host NTV2FrameData to my circular buffer member variable...
323  mHostBuffers.reserve(CIRCULAR_BUFFER_SIZE);
324  while (mHostBuffers.size() < CIRCULAR_BUFFER_SIZE)
325  {
326  mHostBuffers.push_back(NTV2FrameData()); // Make a new NTV2FrameData...
327  NTV2FrameData & frameData(mHostBuffers.back()); // ...and get a reference to it
328 
329  // Don't allocate a page-aligned video buffer here.
330  // Instead, the test pattern buffers are used (and re-used) in the consumer thread.
331  // This saves a LOT of memory and time spent copying data with these large 4K/UHD rasters.
332  // NOTE: This differs substantially from the NTV2Player demo, which pre-allocates the ring of video buffers
333  // here, then in its producer thread, copies a fresh, unmodified test pattern raster into the video
334  // buffer, blits timecode into it, then transfers it to the hardware in its consumer thread.
335 
336  // Allocate a page-aligned audio buffer (if transmitting audio)
337  if (mConfig.WithAudio())
338  if (!frameData.fAudioBuffer.Allocate (audioBufferSize, BUFFER_PAGE_ALIGNED))
339  {
340  PLFAIL("Failed to allocate " << xHEX0N(audioBufferSize,8) << "-byte audio buffer");
341  return AJA_STATUS_MEMORY;
342  }
343  if (frameData.fAudioBuffer)
344  {
345  frameData.fAudioBuffer.Fill(ULWord(0));
346  #ifdef NTV2_BUFFER_LOCKING
347  mDevice.DMABufferLock(frameData.fAudioBuffer, /*alsoPreLockSGL*/true);
348  #endif
349  }
350  mFrameDataRing.Add (&frameData);
351  } // for each NTV2FrameData
352 
353  return AJA_STATUS_SUCCESS;
354 
355 } // SetUpHostBuffers
356 
357 
359 {
360  vector<NTV2TestPatternSelect> testPatIDs;
361  testPatIDs.push_back(NTV2_TestPatt_ColorBars100);
362  testPatIDs.push_back(NTV2_TestPatt_ColorBars75);
363  testPatIDs.push_back(NTV2_TestPatt_Ramp);
364  testPatIDs.push_back(NTV2_TestPatt_MultiBurst);
365  testPatIDs.push_back(NTV2_TestPatt_LineSweep);
366  testPatIDs.push_back(NTV2_TestPatt_CheckField);
367  testPatIDs.push_back(NTV2_TestPatt_FlatField);
368  testPatIDs.push_back(NTV2_TestPatt_MultiPattern);
369  testPatIDs.push_back(NTV2_TestPatt_Black);
370  testPatIDs.push_back(NTV2_TestPatt_White);
371  testPatIDs.push_back(NTV2_TestPatt_Border);
372  testPatIDs.push_back(NTV2_TestPatt_LinearRamp);
373  testPatIDs.push_back(NTV2_TestPatt_SlantRamp);
374  testPatIDs.push_back(NTV2_TestPatt_ZonePlate);
375  testPatIDs.push_back(NTV2_TestPatt_ColorQuadrant);
376  testPatIDs.push_back(NTV2_TestPatt_ColorQuadrantBorder);
377 
378  mTestPatRasters.clear();
379  for (size_t tpNdx(0); tpNdx < testPatIDs.size(); tpNdx++)
380  mTestPatRasters.push_back(NTV2Buffer());
381 
382  if (!mFormatDesc.IsValid())
383  {PLFAIL("Bad format descriptor"); return AJA_STATUS_FAIL;}
384  if (mFormatDesc.IsVANC())
385  {PLFAIL("VANC incompatible with UHD2/8K: " << mFormatDesc); return AJA_STATUS_FAIL;}
386 
387  // Set up one video buffer for each test pattern...
388  for (size_t tpNdx(0); tpNdx < testPatIDs.size(); tpNdx++)
389  {
390  // Allocate the buffer memory...
391  if (!mTestPatRasters.at(tpNdx).Allocate (mFormatDesc.GetVideoWriteSize(), BUFFER_PAGE_ALIGNED))
392  { PLFAIL("Test pattern buffer " << DEC(tpNdx+1) << " of " << DEC(testPatIDs.size()) << ": "
393  << xHEX0N(mFormatDesc.GetVideoWriteSize(),8) << "-byte page-aligned alloc failed");
394  return AJA_STATUS_MEMORY;
395  }
396 
397  // Fill the buffer with test pattern...
398  NTV2TestPatternGen testPatternGen;
399  if (!testPatternGen.DrawTestPattern (testPatIDs.at(tpNdx), mFormatDesc, mTestPatRasters.at(tpNdx)))
400  {
401  cerr << "## ERROR: DrawTestPattern " << DEC(tpNdx) << " failed: " << mFormatDesc << endl;
402  return AJA_STATUS_FAIL;
403  }
404 
405  #ifdef NTV2_BUFFER_LOCKING
406  // Try to prelock the memory, including its scatter-gather list...
407  if (!mDevice.DMABufferLock(mTestPatRasters.at(tpNdx), /*alsoLockSegmentMap=*/true))
408  PLWARN("Test pattern buffer " << DEC(tpNdx+1) << " of " << DEC(testPatIDs.size()) << ": failed to pre-lock");
409  #endif
410  } // loop for each predefined pattern
411 
412  return AJA_STATUS_SUCCESS;
413 
414 } // SetUpTestPatternBuffers
415 
416 
418 {
419  NTV2XptConnections connections; // Routing connections to make
420 
421  if (mConfig.fDoTsiRouting)
422  {
423  if (::IsRGBFormat(mConfig.fPixelFormat))
424  {
425  if (mConfig.fOutputChannel < NTV2_CHANNEL3)
426  {
431  if (mConfig.fDoHDMIOutput)
433  }
434  else
435  {
440  if (mConfig.fDoHDMIOutput)
442  }
451  mDevice.SetSDITransmitEnable (NTV2_CHANNEL1, true);
452  mDevice.SetSDITransmitEnable (NTV2_CHANNEL2, true);
453  mDevice.SetSDITransmitEnable (NTV2_CHANNEL3, true);
454  mDevice.SetSDITransmitEnable (NTV2_CHANNEL4, true);
463  }
464  else
465  {
466  if (mConfig.fOutputChannel < NTV2_CHANNEL3)
467  {
469  {
474  mDevice.SetSDITransmitEnable (NTV2_CHANNEL1, true);
475  mDevice.SetSDITransmitEnable (NTV2_CHANNEL2, true);
476  mDevice.SetSDITransmitEnable (NTV2_CHANNEL3, true);
477  mDevice.SetSDITransmitEnable (NTV2_CHANNEL4, true);
486  if (mConfig.fDoHDMIOutput)
488  }
489  else
490  {
495  mDevice.SetSDITransmitEnable (NTV2_CHANNEL1, true);
496  mDevice.SetSDITransmitEnable (NTV2_CHANNEL2, true);
501  if (mConfig.fDoHDMIOutput)
503  }
504  }
505  else
506  {
508  {
513  mDevice.SetSDITransmitEnable (NTV2_CHANNEL1, true);
514  mDevice.SetSDITransmitEnable (NTV2_CHANNEL2, true);
515  mDevice.SetSDITransmitEnable (NTV2_CHANNEL3, true);
516  mDevice.SetSDITransmitEnable (NTV2_CHANNEL4, true);
525  if (mConfig.fDoHDMIOutput)
527  }
528  else
529  {
534  mDevice.SetSDITransmitEnable (NTV2_CHANNEL3, true);
535  mDevice.SetSDITransmitEnable (NTV2_CHANNEL4, true);
540  if (mConfig.fDoHDMIOutput)
542  }
543  }
544  }
545  }
546  else
547  {
548  if (::IsRGBFormat(mConfig.fPixelFormat))
549  {
562  mDevice.SetSDITransmitEnable (NTV2_CHANNEL1, true);
563  mDevice.SetSDITransmitEnable (NTV2_CHANNEL2, true);
564  mDevice.SetSDITransmitEnable (NTV2_CHANNEL3, true);
565  mDevice.SetSDITransmitEnable (NTV2_CHANNEL4, true);
574  }
575  else
576  {
581  mDevice.SetSDITransmitEnable (NTV2_CHANNEL1, true);
582  mDevice.SetSDITransmitEnable (NTV2_CHANNEL2, true);
583  mDevice.SetSDITransmitEnable (NTV2_CHANNEL3, true);
584  mDevice.SetSDITransmitEnable (NTV2_CHANNEL4, true);
593  }
594  }
595  return mDevice.ApplySignalRoute(connections, /*replaceExistingRouting?*/!mConfig.fDoMultiFormat);
596 
597 } // RouteOutputSignal
598 
599 
601 {
602  // Start my consumer and producer threads...
605  return AJA_STATUS_SUCCESS;
606 
607 } // Run
608 
609 
610 
612 // This is where the play thread starts
613 
615 {
616  // Create and start the playout thread...
617  mConsumerThread.Attach (ConsumerThreadStatic, this);
618  mConsumerThread.SetPriority(AJA_ThreadPriority_High);
619  mConsumerThread.Start();
620 
621 } // StartConsumerThread
622 
623 
624 // The playout thread function
625 void NTV2Player8K::ConsumerThreadStatic (AJAThread * pThread, void * pContext) // static
626 { (void) pThread;
627  // Grab the NTV2Player8K instance pointer from the pContext parameter,
628  // then call its PlayFrames method...
629  NTV2Player8K * pApp (reinterpret_cast<NTV2Player8K*>(pContext));
630  if (pApp)
631  pApp->ConsumeFrames();
632 
633 } // ConsumerThreadStatic
634 
635 
637 {
638  ULWord acOptions (AUTOCIRCULATE_WITH_RP188);
639  AUTOCIRCULATE_TRANSFER outputXfer;
640  AUTOCIRCULATE_STATUS outputStatus;
641  AJAAncillaryData * pPkt (AJA_NULL);
642  ULWord goodXfers(0), badXfers(0), prodWaits(0), noRoomWaits(0);
643  const UWord numACFramesPerChannel(7);
644 
645  // Stop AutoCirculate, just in case someone else left it running...
646  mDevice.AutoCirculateStop(mConfig.fOutputChannel);
647  mDevice.WaitForOutputVerticalInterrupt(mConfig.fOutputChannel, 4); // Let it stop
648  PLNOTE("Thread started");
649 
651  { // HDR anc doesn't change per-frame, so fill outputXfer.acANCBuffer with the packet data...
652  static AJAAncillaryData_HDR_SDR sdrPkt;
653  static AJAAncillaryData_HDR_HDR10 hdr10Pkt;
654  static AJAAncillaryData_HDR_HLG hlgPkt;
655 
656  switch (mConfig.fTransmitHDRType)
657  {
658  case AJAAncDataType_HDR_SDR: pPkt = &sdrPkt; break;
659  case AJAAncDataType_HDR_HDR10: pPkt = &hdr10Pkt; break;
660  case AJAAncDataType_HDR_HLG: pPkt = &hlgPkt; break;
661  default: break;
662  }
663  }
664  if (pPkt)
665  { // Allocate page-aligned host Anc buffer...
666  uint32_t hdrPktSize (0);
667  if (!outputXfer.acANCBuffer.Allocate(gAncMaxSizeBytes, BUFFER_PAGE_ALIGNED) || !outputXfer.acANCBuffer.Fill(0LL))
668  PLWARN("Anc buffer " << xHEX0N(gAncMaxSizeBytes,8) << "(" << DEC(gAncMaxSizeBytes) << ")-byte allocate failed -- HDR anc insertion disabled");
669  else if (AJA_FAILURE(pPkt->GenerateTransmitData (outputXfer.acANCBuffer, outputXfer.acANCBuffer, hdrPktSize)))
670  {
671  PLWARN("HDR anc insertion disabled -- GenerateTransmitData failed");
672  outputXfer.acANCBuffer.Deallocate();
673  }
674  else
675  acOptions |= AUTOCIRCULATE_WITH_ANC;
676  }
677 #ifdef NTV2_BUFFER_LOCKING
678  if (outputXfer.acANCBuffer)
679  mDevice.DMABufferLock(outputXfer.acANCBuffer, /*alsoLockSGL*/true);
680 #endif
681 
682  // Calculate start & end frame numbers...
683  const UWord startNum (mConfig.fOutputChannel < 2 ? 0 : numACFramesPerChannel); // Ch1: frames 0-6
684  const UWord endNum (mConfig.fOutputChannel < 2 ? numACFramesPerChannel-1 : numACFramesPerChannel*2-1); // Ch5: frames 7-13
685  if (mConfig.fNumAudioLinks > 1)
686  {
689  {
692  }
693  }
694 
695  // Initialize & start AutoCirculate...
696  bool initOK (mDevice.AutoCirculateInitForOutput (mConfig.fOutputChannel, 0, mAudioSystem, acOptions,
697  1 /*numChannels*/, startNum, endNum));
698  if (!initOK)
699  {PLFAIL("AutoCirculateInitForOutput failed"); mGlobalQuit = true;}
700 
701  while (!mGlobalQuit)
702  {
703  mDevice.AutoCirculateGetStatus (mConfig.fOutputChannel, outputStatus);
704 
705  // Check if there's room for another frame on the card...
706  if (outputStatus.CanAcceptMoreOutputFrames())
707  {
708  // Device has at least one free frame buffer that can be filled.
709  // Wait for the next frame in our ring to become ready to "consume"...
710  NTV2FrameData * pFrameData (mFrameDataRing.StartConsumeNextBuffer());
711  if (!pFrameData)
712  {prodWaits++; continue;}
713 
714  // Unlike in the NTV2Player demo, I now burn the current timecode into the test pattern buffer that was noted
715  // earlier into this FrameData in my Producer thread. This is done to avoid copying large 8K/UHD2 rasters.
716  const NTV2FrameRate ntv2FrameRate (::GetNTV2FrameRateFromVideoFormat(mConfig.fVideoFormat));
717  const TimecodeFormat tcFormat (CNTV2DemoCommon::NTV2FrameRate2TimecodeFormat(ntv2FrameRate));
718  const CRP188 rp188Info (mCurrentFrame++, 0, 0, 10, tcFormat);
719  NTV2_RP188 tcData;
720  string timeCodeString;
721 
722  rp188Info.GetRP188Reg (tcData);
723  rp188Info.GetRP188Str (timeCodeString);
724  mTCBurner.BurnTimeCode (pFrameData->fVideoBuffer, timeCodeString.c_str(), 80);
725 
726  // Transfer the timecode-burned frame (plus audio) to the device for playout...
727  outputXfer.acVideoBuffer.Set (pFrameData->fVideoBuffer, pFrameData->fVideoBuffer);
728  outputXfer.acAudioBuffer.Set (pFrameData->fAudioBuffer, pFrameData->fNumAudioBytes);
729  outputXfer.SetOutputTimeCode (tcData, ::NTV2ChannelToTimecodeIndex(mConfig.fOutputChannel, /*LTC=*/false, /*F2=*/false));
730  outputXfer.SetOutputTimeCode (tcData, ::NTV2ChannelToTimecodeIndex(mConfig.fOutputChannel, /*LTC=*/true, /*F2=*/false));
731 
732  // Perform the DMA transfer to the device...
733  if (mDevice.AutoCirculateTransfer (mConfig.fOutputChannel, outputXfer))
734  goodXfers++;
735  else
736  badXfers++;
737 
738  if (goodXfers == 3)
739  mDevice.AutoCirculateStart(mConfig.fOutputChannel);
740 
741  // Signal that the frame has been "consumed"...
742  mFrameDataRing.EndConsumeNextBuffer();
743  continue; // Back to top of while loop
744  }
745 
746  // Wait for one or more buffers to become available on the device, which should occur at next VBI...
747  noRoomWaits++;
749  } // loop til quit signaled
750 
751  // Stop AutoCirculate...
752  mDevice.AutoCirculateStop(mConfig.fOutputChannel);
753  PLNOTE("Thread completed: " << DEC(goodXfers) << " xfers, " << DEC(badXfers) << " failed, "
754  << DEC(prodWaits) << " starves, " << DEC(noRoomWaits) << " VBI waits");
755 
756 } // ConsumeFrames
757 
758 
759 
761 // This is where the producer thread starts
762 
764 {
765  // Create and start the producer thread...
766  mProducerThread.Attach(ProducerThreadStatic, this);
767  mProducerThread.SetPriority(AJA_ThreadPriority_High);
768  mProducerThread.Start();
769 
770 } // StartProducerThread
771 
772 
773 void NTV2Player8K::ProducerThreadStatic (AJAThread * pThread, void * pContext) // static
774 {
775  (void) pThread;
776  NTV2Player8K * pApp (reinterpret_cast<NTV2Player8K*>(pContext));
777  if (pApp)
778  pApp->ProduceFrames();
779 
780 } // ProducerThreadStatic
781 
782 
784 {
785  ULWord freqNdx(0), testPatNdx(0), badTally(0);
786  double timeOfLastSwitch (0.0);
787 
790 
791  PLNOTE("Thread started");
792  while (!mGlobalQuit)
793  {
794  NTV2FrameData * pFrameData (mFrameDataRing.StartProduceNextBuffer());
795  if (!pFrameData)
796  { badTally++; // No frame available!
797  AJATime::Sleep(10); // Wait a bit for the consumer thread to free one up for me...
798  continue; // ...then try again
799  }
800 
801  // Unlike NTV2Player::ProduceFrames, NTV2Player8K::ProduceFrames doesn't touch this frame's video buffer.
802  // Instead, to avoid wasting time copying large 8K/UHD2 rasters, in this thread we simply note which test
803  // pattern buffer is to be modified and subsequently transferred to the hardware. This happens later, in
804  // NTV2Player8K::ConsumeFrames...
805  NTV2Buffer & testPatVidBuffer(mTestPatRasters.at(testPatNdx));
806  pFrameData->fVideoBuffer.Set(testPatVidBuffer.GetHostPointer(), testPatVidBuffer.GetByteCount());
807 
808  // If also playing audio...
809  if (pFrameData->AudioBuffer()) // ...then generate audio tone data for this frame...
810  pFrameData->fNumAudioBytes = AddTone(pFrameData->fAudioBuffer); // ...and remember number of audio bytes to xfer
811 
812  // Every few seconds, change the test pattern and tone frequency...
813  const double currentTime (timeBase.FramesToSeconds(mCurrentFrame++));
814  if (currentTime > timeOfLastSwitch + 4.0)
815  {
816  freqNdx = (freqNdx + 1) % gNumFrequencies;
817  testPatNdx = (testPatNdx + 1) % ULWord(mTestPatRasters.size());
818  mToneFrequency = gFrequencies[freqNdx];
819  timeOfLastSwitch = currentTime;
820  PLINFO("F" << DEC0N(mCurrentFrame,6) << ": tone=" << mToneFrequency << "Hz, pattern='" << tpNames.at(testPatNdx) << "'");
821  } // if time to switch test pattern & tone frequency
822 
823  // Signal that I'm done producing this FrameData, making it immediately available for transfer/playout...
824  mFrameDataRing.EndProduceNextBuffer();
825 
826  } // loop til mGlobalQuit goes true
827  PLNOTE("Thread completed: " << DEC(mCurrentFrame) << " frame(s) produced, " << DEC(badTally) << " failed");
828 
829 } // ProduceFrames
830 
831 
832 uint32_t NTV2Player8K::AddTone (ULWord * audioBuffer)
833 {
836  ULWord numChannels (0);
837 
838  mDevice.GetFrameRate (frameRate, mConfig.fOutputChannel);
839  mDevice.GetAudioRate (audioRate, mAudioSystem);
840  mDevice.GetNumberAudioChannels (numChannels, mAudioSystem);
841 
842  // Since audio on AJA devices use fixed sample rates (typically 48KHz), certain video frame rates will
843  // necessarily result in some frames having more audio samples than others. GetAudioSamplesPerFrame is
844  // called to calculate the correct sample count for the current frame...
845  const ULWord numSamples (::GetAudioSamplesPerFrame (frameRate, audioRate, mCurrentFrame));
846  const double sampleRateHertz (::GetAudioSamplesPerSecond(audioRate));
847 
848  // Unlike NTV2Player::AddTone, NTV2Player8K::AddTone handles multi-link audio:
849  ULWord bytesWritten(0), startSample(mCurrentSample);
850  for (UWord linkNdx(0); linkNdx < mConfig.fNumAudioLinks; linkNdx++)
851  {
852  mCurrentSample = startSample;
853  bytesWritten += ::AddAudioTone (audioBuffer + (bytesWritten/4), // audio buffer to fill
854  mCurrentSample, // which sample for continuing the waveform
855  numSamples, // number of samples to generate
856  sampleRateHertz, // sample rate [Hz]
857  0.5, // amplitude
858  mToneFrequency, // tone frequency [Hz]
859  31, // bits per sample
860  false, // don't byte swap
861  numChannels); // number of audio channels to generate
862  } // for each SDI audio link
863  return bytesWritten;
864 
865 } // AddTone
866 
867 
869 {
870  mDevice.AutoCirculateGetStatus (mConfig.fOutputChannel, outStatus);
871 }
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:2656
NTV2_XptFrameBuffer4YUV
@ NTV2_XptFrameBuffer4YUV
Definition: ntv2enums.h:2517
NTV2Player8K::StartConsumerThread
virtual void StartConsumerThread(void)
Starts my consumer thread.
Definition: ntv2player8k.cpp:614
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
NTV2_XptHDMIOutInput
@ NTV2_XptHDMIOutInput
Definition: ntv2enums.h:2788
gNumFrequencies
static const ULWord gNumFrequencies(sizeof(gFrequencies)/sizeof(double))
PlayerConfig::fDoHDMIOutput
bool fDoHDMIOutput
If true, enable HDMI output; otherwise, disable HDMI output.
Definition: ntv2democommon.h:328
NTV2_AUDIO_LOOPBACK_OFF
@ NTV2_AUDIO_LOOPBACK_OFF
Embeds silence (zeroes) into the data stream.
Definition: ntv2enums.h:1971
NTV2FormatDescriptor::GetVideoWriteSize
ULWord GetVideoWriteSize(ULWord inPageSize=4096UL) const
Definition: ntv2formatdescriptor.cpp:862
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:659
NTV2_TestPatt_CheckField
@ NTV2_TestPatt_CheckField
Definition: ntv2testpatterngen.h:32
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:1413
NTV2Player8K::SetUpHostBuffers
virtual AJAStatus SetUpHostBuffers(void)
Sets up my host video & audio buffers.
Definition: ntv2player8k.cpp:311
NTV2_XptFrameBuffer1_DS2YUV
@ NTV2_XptFrameBuffer1_DS2YUV
Definition: ntv2enums.h:2605
NTV2_IS_VALID_TASK_MODE
#define NTV2_IS_VALID_TASK_MODE(__m__)
Definition: ntv2publicinterface.h:4265
NTV2_XptSDIOut4InputDS2
@ NTV2_XptSDIOut4InputDS2
Definition: ntv2enums.h:2739
NTV2_CHANNEL2
@ NTV2_CHANNEL2
Specifies channel or Frame Store 2 (or the 2nd item).
Definition: ntv2enums.h:1308
AJA_ThreadPriority_High
@ AJA_ThreadPriority_High
Definition: thread.h:44
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:832
NTV2_XptFrameBuffer2RGB
@ NTV2_XptFrameBuffer2RGB
Definition: ntv2enums.h:2489
NTV2_TestPatt_MultiBurst
@ NTV2_TestPatt_MultiBurst
Definition: ntv2testpatterngen.h:30
NTV2_AUDIO_BUFFER_BIG
@ NTV2_AUDIO_BUFFER_BIG
Definition: ntv2enums.h:1864
NTV2Player8K::SetUpAudio
virtual AJAStatus SetUpAudio(void)
Performs all audio setup.
Definition: ntv2player8k.cpp:260
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:2737
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:64
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:1241
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
NTV2Buffer
A generic user-space buffer object that has an address and a length. Used most often to share an arbi...
Definition: ntv2publicinterface.h:5967
NTV2_XptDuallinkOut1
@ NTV2_XptDuallinkOut1
Definition: ntv2enums.h:2485
AJA_STATUS_SUCCESS
@ AJA_STATUS_SUCCESS
Definition: types.h:368
ntv2player8k.h
Header file for NTV2Player8K demonstration class.
NTV2Buffer::GetByteCount
ULWord GetByteCount(void) const
Definition: ntv2publicinterface.h:6040
NTV2_AUDIOSYSTEM_4
@ NTV2_AUDIOSYSTEM_4
This identifies the 4th Audio System.
Definition: ntv2enums.h:3814
GetNTV2FrameRateFromVideoFormat
NTV2FrameRate GetNTV2FrameRateFromVideoFormat(const NTV2VideoFormat inVideoFormat)
Definition: ntv2utils.cpp:3530
NTV2_XptFrameBuffer3_DS2YUV
@ NTV2_XptFrameBuffer3_DS2YUV
Definition: ntv2enums.h:2609
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:785
NTV2_AUDIO_48K
@ NTV2_AUDIO_48K
Definition: ntv2enums.h:1875
NTV2Player8K::Quit
virtual void Quit(void)
Gracefully stops me from running.
Definition: ntv2player8k.cpp:84
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:2611
NTV2_XptFrameBuffer3YUV
@ NTV2_XptFrameBuffer3YUV
Definition: ntv2enums.h:2515
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:1588
NTV2Player8K::StartProducerThread
virtual void StartProducerThread(void)
Starts my producer thread.
Definition: ntv2player8k.cpp:763
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
NTV2_FRAMERATE_INVALID
@ NTV2_FRAMERATE_INVALID
Definition: ntv2enums.h:425
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
NTV2Player8K::SetUpTestPatternBuffers
virtual AJAStatus SetUpTestPatternBuffers(void)
Creates my test pattern buffers.
Definition: ntv2player8k.cpp:358
NTV2DeviceCanDoMultiFormat
bool NTV2DeviceCanDoMultiFormat(const NTV2DeviceID inDeviceID)
Definition: ntv2devicefeatures.hpp:4065
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:7919
NTV2_TestPatt_ColorBars100
@ NTV2_TestPatt_ColorBars100
Definition: ntv2testpatterngen.h:26
NTV2XptConnection
std::pair< NTV2InputXptID, NTV2OutputXptID > NTV2XptConnection
Definition: ntv2signalrouter.h:38
DEC0N
#define DEC0N(__x__, __n__)
Definition: ntv2publicinterface.h:5581
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
NTV2_AncRgn_Field2
@ NTV2_AncRgn_Field2
Identifies the "normal" Field 2 ancillary data region.
Definition: ntv2enums.h:4141
AJA_STATUS_MEMORY
@ AJA_STATUS_MEMORY
Definition: types.h:384
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
NTV2_XptFrameBuffer1RGB
@ NTV2_XptFrameBuffer1RGB
Definition: ntv2enums.h:2480
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_XptSDIOut2InputDS2
@ NTV2_XptSDIOut2InputDS2
Definition: ntv2enums.h:2735
PlayerConfig::fDoMultiFormat
bool fDoMultiFormat
If true, enable device-sharing; otherwise take exclusive control of device.
Definition: ntv2democommon.h:323
TimecodeFormat
TimecodeFormat
Definition: ntv2rp188.h:27
NTV2_AUDIO_FORMAT_LPCM
@ NTV2_AUDIO_FORMAT_LPCM
Definition: ntv2enums.h:1894
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:303
NTV2DeviceCanDoFrameBufferFormat
bool NTV2DeviceCanDoFrameBufferFormat(const NTV2DeviceID inDeviceID, const NTV2FrameBufferFormat inFBFormat)
Definition: ntv2devicefeatures.hpp:15330
NTV2_XptSDIOut4Input
@ NTV2_XptSDIOut4Input
Definition: ntv2enums.h:2738
NTV2_CHANNEL1
@ NTV2_CHANNEL1
Specifies channel or Frame Store 1 (or the first item).
Definition: ntv2enums.h:1307
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:2653
ntv2debug.h
NTV2FrameBufferFormatString
const char * NTV2FrameBufferFormatString(NTV2FrameBufferFormat fmt)
Definition: ntv2debug.cpp:201
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::CanAcceptMoreOutputFrames
bool CanAcceptMoreOutputFrames(void) const
Definition: ntv2publicinterface.h:7176
NTV2_XptFrameBuffer3RGB
@ NTV2_XptFrameBuffer3RGB
Definition: ntv2enums.h:2516
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
NTV2FrameRate
NTV2FrameRate
Identifies a particular video frame rate.
Definition: ntv2enums.h:396
AJAAncillaryData_HDR_HDR10
This class handles "5251" Frame Status Information packets.
Definition: ancillarydata_hdr_hdr10.h:21
NTV2DeviceCanDoVideoFormat
bool NTV2DeviceCanDoVideoFormat(const NTV2DeviceID inDeviceID, const NTV2VideoFormat inVideoFormat)
Definition: ntv2devicefeatures.hpp:18535
NTV2_IS_UHD2_FULL_VIDEO_FORMAT
#define NTV2_IS_UHD2_FULL_VIDEO_FORMAT(__f__)
Definition: ntv2enums.h:847
NTV2_CHANNEL4
@ NTV2_CHANNEL4
Specifies channel or Frame Store 4 (or the 4th item).
Definition: ntv2enums.h:1310
NTV2_XptFrameBuffer2_DS2YUV
@ NTV2_XptFrameBuffer2_DS2YUV
Definition: ntv2enums.h:2607
PlayerConfig::fDoTsiRouting
bool fDoTsiRouting
If true, enable TSI routing; otherwise route for square division (4K/8K)
Definition: ntv2democommon.h:329
AUTOCIRCULATE_WITH_MULTILINK_AUDIO1
#define AUTOCIRCULATE_WITH_MULTILINK_AUDIO1
Use this to AutoCirculate with base audiosystem controlling base AudioSystem + 1.
Definition: ntv2publicinterface.h:5500
PlayerConfig::fTransmitHDRType
AJAAncDataType fTransmitHDRType
Specifies the HDR anc data packet to transmit, if any.
Definition: ntv2democommon.h:321
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::DMABufferUnlockAll
virtual bool DMABufferUnlockAll()
Unlocks all previously-locked buffers used for DMA transfers.
Definition: ntv2dma.cpp:515
CNTV2Card::GetDisplayName
virtual std::string GetDisplayName(void)
Answers with this device's display name.
Definition: ntv2card.cpp:84
NTV2_XptFrameBuffer4_DS2RGB
@ NTV2_XptFrameBuffer4_DS2RGB
Definition: ntv2enums.h:2612
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:365
NTV2_TestPatt_White
@ NTV2_TestPatt_White
Definition: ntv2testpatterngen.h:36
NTV2_XptFrameBuffer1_DS2RGB
@ NTV2_XptFrameBuffer1_DS2RGB
Definition: ntv2enums.h:2606
NTV2Player8K::ConsumeFrames
virtual void ConsumeFrames(void)
My consumer thread that repeatedly plays frames using AutoCirculate (until quit).
Definition: ntv2player8k.cpp:636
NTV2_XptFrameBuffer2_DS2RGB
@ NTV2_XptFrameBuffer2_DS2RGB
Definition: ntv2enums.h:2608
NTV2FormatDescriptor::numPixels
ULWord numPixels
Width – total number of pixels per line.
Definition: ntv2formatdescriptor.h:349
process.h
Declares the AJAProcess class.
NTV2Player8K::SetUpVideo
virtual AJAStatus SetUpVideo(void)
Performs all video setup.
Definition: ntv2player8k.cpp:188
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:2530
NTV2_TestPatt_Ramp
@ NTV2_TestPatt_Ramp
Definition: ntv2testpatterngen.h:29
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
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: ntv2audio.cpp:573
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:183
AJATimeBase
Definition: timebase.h:18
AJA_STATUS_FEATURE
@ AJA_STATUS_FEATURE
Definition: types.h:380
AJA_STATUS_FAIL
@ AJA_STATUS_FAIL
Definition: types.h:369
ULWord
uint32_t ULWord
Definition: ajatypes.h:246
NTV2_TestPatt_FlatField
@ NTV2_TestPatt_FlatField
Definition: ntv2testpatterngen.h:33
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.
AJAAncillaryData
I am the principal class that stores a single SMPTE-291 SDI ancillary data packet OR the digitized co...
Definition: ancillarydata.h:550
NTV2FormatDescriptor::numLines
ULWord numLines
Height – total number of lines.
Definition: ntv2formatdescriptor.h:348
NTV2_XptFrameBuffer1YUV
@ NTV2_XptFrameBuffer1YUV
Definition: ntv2enums.h:2479
NTV2_XptSDIOut2Input
@ NTV2_XptSDIOut2Input
Definition: ntv2enums.h:2734
NTV2_XptDuallinkOut2DS2
@ NTV2_XptDuallinkOut2DS2
Definition: ntv2enums.h:2520
NTV2_XptDuallinkOut1DS2
@ NTV2_XptDuallinkOut1DS2
Definition: ntv2enums.h:2519
CNTV2DemoCommon::SetDefaultPageSize
static size_t SetDefaultPageSize(void)
Definition: ntv2democommon.cpp:1505
NTV2_XptDuallinkOut4DS2
@ NTV2_XptDuallinkOut4DS2
Definition: ntv2enums.h:2533
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:5020
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:773
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
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:4249
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:322
NTV2_TestPatt_ColorQuadrant
@ NTV2_TestPatt_ColorQuadrant
Definition: ntv2testpatterngen.h:41
NTV2_TestPatt_ColorQuadrantBorder
@ NTV2_TestPatt_ColorQuadrantBorder
Definition: ntv2testpatterngen.h:42
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
PlayerConfig::fVideoFormat
NTV2VideoFormat fVideoFormat
The video format to use.
Definition: ntv2democommon.h:319
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:1404
NTV2_XptDualLinkOut4Input
@ NTV2_XptDualLinkOut4Input
Definition: ntv2enums.h:2767
AUTOCIRCULATE_TRANSFER
This object specifies the information that will be transferred to or from the AJA device in the CNTV2...
Definition: ntv2publicinterface.h:7904
PlayerConfig::fOutputChannel
NTV2Channel fOutputChannel
The device channel to use.
Definition: ntv2democommon.h:315
NTV2VideoFormatToString
std::string NTV2VideoFormatToString(const NTV2VideoFormat inValue, const bool inUseFrameRate=false)
Definition: ntv2utils.cpp:6750
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:35
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
NTV2_TestPatt_SlantRamp
@ NTV2_TestPatt_SlantRamp
Definition: ntv2testpatterngen.h:39
NTV2_XptSDIOut1InputDS2
@ NTV2_XptSDIOut1InputDS2
Definition: ntv2enums.h:2733
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
NTV2_TestPatt_ColorBars75
@ NTV2_TestPatt_ColorBars75
Definition: ntv2testpatterngen.h:28
NTV2_TASK_MODE_INVALID
@ NTV2_TASK_MODE_INVALID
Definition: ntv2publicinterface.h:4262
CNTV2DriverInterface::IsDeviceReady
virtual bool IsDeviceReady(const bool inCheckValid=(0))
Definition: ntv2driverinterface.cpp:1228
NTV2_TestPatt_ZonePlate
@ NTV2_TestPatt_ZonePlate
Definition: ntv2testpatterngen.h:40
DEVICE_ID_INVALID
@ DEVICE_ID_INVALID
Definition: ntv2enums.h:91
NTV2DeviceCanDoPlayback
bool NTV2DeviceCanDoPlayback(const NTV2DeviceID inDeviceID)
Definition: ntv2devicefeatures.hpp:4438
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:783
NTV2ChannelSet
std::set< NTV2Channel > NTV2ChannelSet
A set of distinct NTV2Channel values.
Definition: ntv2publicinterface.h:3823
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
BUFFER_PAGE_ALIGNED
static const bool BUFFER_PAGE_ALIGNED(true)
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:381
CNTV2Card::SetHDMIOutAudioRate
virtual bool SetHDMIOutAudioRate(const NTV2AudioRate inNewValue)
Sets the HDMI output's audio rate.
Definition: ntv2audio.cpp:1082
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:190
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:4478
NTV2Player8K::RouteOutputSignal
virtual bool RouteOutputSignal(void)
Performs all widget/signal routing for playout.
Definition: ntv2player8k.cpp:417
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:1022
NTV2TestPatternGen
The NTV2 test pattern generator.
Definition: ntv2testpatterngen.h:67
NTV2Buffer::GetHostPointer
void * GetHostPointer(void) const
Definition: ntv2publicinterface.h:6023
AJAAncDataType_HDR_SDR
@ AJAAncDataType_HDR_SDR
Definition: ancillarydata.h:57
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
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:37
NTV2AudioRate
NTV2AudioRate
Definition: ntv2enums.h:1873
AJA_STATUS_INITIALIZE
@ AJA_STATUS_INITIALIZE
Definition: types.h:373
NTV2Player8K::Run
virtual AJAStatus Run(void)
Runs me.
Definition: ntv2player8k.cpp:600
PlayerConfig::fDoRGBOnWire
bool fDoRGBOnWire
If true, produce RGB on the wire; otherwise output YUV.
Definition: ntv2democommon.h:330
DEC
#define DEC(__x__)
Definition: ntv2publicinterface.h:5579
NTV2_AUDIOSYSTEM_3
@ NTV2_AUDIOSYSTEM_3
This identifies the 3rd Audio System.
Definition: ntv2enums.h:3813
NTV2Player8K::~NTV2Player8K
virtual ~NTV2Player8K(void)
Definition: ntv2player8k.cpp:75
false
#define false
Definition: ntv2devicefeatures.h:25
NTV2_XptFrameBuffer4RGB
@ NTV2_XptFrameBuffer4RGB
Definition: ntv2enums.h:2518
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
ancillarydata_hdr_hdr10.h
Declares the AJAAncillaryData_HDR_HDR10 class.
PlayerConfig::fDeviceSpec
std::string fDeviceSpec
The AJA device to use.
Definition: ntv2democommon.h:313
NTV2_XptDualLinkOut3Input
@ NTV2_XptDualLinkOut3Input
Definition: ntv2enums.h:2766
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
NTV2_XptFrameBuffer2YUV
@ NTV2_XptFrameBuffer2YUV
Definition: ntv2enums.h:2488
NTV2_RP188
This struct replaces the old RP188_STRUCT.
Definition: ntv2publicinterface.h:6705
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:7912
IsRGBFormat
bool IsRGBFormat(const NTV2FrameBufferFormat format)
Definition: ntv2utils.cpp:5442
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:625
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
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:2789
NTV2Player8K::NTV2Player8K
NTV2Player8K(const PlayerConfig &inConfig)
Constructs me using the given configuration settings.
Definition: ntv2player8k.cpp:54
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
CNTV2Card::EnableChannels
virtual bool EnableChannels(const NTV2ChannelSet &inChannels, const bool inDisableOthers=false)
Enables the given FrameStore(s).
Definition: ntv2register.cpp:2123
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
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:665
NTV2_XptDualLinkOut2Input
@ NTV2_XptDualLinkOut2Input
Definition: ntv2enums.h:2765
NTV2_AudioChannel1_8
@ NTV2_AudioChannel1_8
This selects audio channels 1 thru 8.
Definition: ntv2enums.h:3242
CNTV2DriverInterface::GetDeviceID
virtual NTV2DeviceID GetDeviceID(void)
Definition: ntv2driverinterface.cpp:371
NTV2Player8K::Init
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
Definition: ntv2player8k.cpp:107
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:229
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:1024
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:868
GetAudioSamplesPerSecond
double GetAudioSamplesPerSecond(const NTV2AudioRate inAudioRate)
Returns the audio sample rate as a number of audio samples per second.
Definition: ntv2utils.cpp:3203
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:34
PlayerConfig
Configures an NTV2Player instance.
Definition: ntv2democommon.h:310
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:1127
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:1024
PlayerConfig::fPixelFormat
NTV2PixelFormat fPixelFormat
The pixel format to use.
Definition: ntv2democommon.h:318
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:1182
NTV2Buffer::Fill
bool Fill(const T &inValue)
Fills me with the given scalar value.
Definition: ntv2publicinterface.h:6192
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:2610
NTV2DeviceCanDoCustomAnc
bool NTV2DeviceCanDoCustomAnc(const NTV2DeviceID inDeviceID)
Definition: ntv2devicefeatures.hpp:2087
PLNOTE
#define PLNOTE(_xpr_)
Definition: ntv2democommon.h:36
AJA_STATUS_OPEN
@ AJA_STATUS_OPEN
Definition: types.h:375
AJATimeBase::FramesToSeconds
double FramesToSeconds(int64_t frames) const
Definition: timebase.cpp:197
CNTV2DemoCommon::NTV2FrameRate2TimecodeFormat
static TimecodeFormat NTV2FrameRate2TimecodeFormat(const NTV2FrameRate inFrameRate)
Definition: ntv2democommon.cpp:1000
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
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:149
NTV2_TestPatt_LineSweep
@ NTV2_TestPatt_LineSweep
Definition: ntv2testpatterngen.h:31
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:252
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
CNTV2DemoCommon::GetAJAPixelFormat
static AJA_PixelFormat GetAJAPixelFormat(const NTV2FrameBufferFormat inFormat)
Definition: ntv2democommon.cpp:1054
xHEX0N
#define xHEX0N(__x__, __n__)
Definition: ntv2publicinterface.h:5578
NTV2AudioSystem
NTV2AudioSystem
Used to identify an Audio System on an NTV2 device. See Audio System Operation for more information.
Definition: ntv2enums.h:3809
AJA_FAILURE
#define AJA_FAILURE(_status_)
Definition: types.h:358
NTV2_AUDIO_RATE_INVALID
@ NTV2_AUDIO_RATE_INVALID
Definition: ntv2enums.h:1879
gFrequencies
static const double gFrequencies[]
Definition: ntv2player8k.cpp:49
NTV2DeviceCanDo2110
bool NTV2DeviceCanDo2110(const NTV2DeviceID inDeviceID)
Definition: ntv2devicefeatures.hpp:467
NTV2_TestPatt_LinearRamp
@ NTV2_TestPatt_LinearRamp
Definition: ntv2testpatterngen.h:38
CNTV2Card::SetHDMIOutAudioFormat
virtual bool SetHDMIOutAudioFormat(const NTV2AudioFormat inNewValue)
Sets the HDMI output's audio format.
Definition: ntv2audio.cpp:1094
NTV2ChannelToAudioSystem
NTV2AudioSystem NTV2ChannelToAudioSystem(const NTV2Channel inChannel)
Converts the given NTV2Channel value into its equivalent NTV2AudioSystem.
Definition: ntv2utils.cpp:4927
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:7930
NTV2FormatDescriptor::IsValid
bool IsValid(void) const
Definition: ntv2formatdescriptor.h:94
PLINFO
#define PLINFO(_xpr_)
Definition: ntv2democommon.h:37
NTV2_ANCSIZE_MAX
#define NTV2_ANCSIZE_MAX
Definition: ntv2democommon.h:47
NTV2_XptSDIOut1Input
@ NTV2_XptSDIOut1Input
Definition: ntv2enums.h:2732
PLWARN
#define PLWARN(_xpr_)
Definition: ntv2democommon.h:35
NTV2DeviceGetMaxAudioChannels
UWord NTV2DeviceGetMaxAudioChannels(const NTV2DeviceID inDeviceID)
Definition: ntv2devicefeatures.hpp:8796
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:4217
CRP188::GetRP188Str
bool GetRP188Str(std::string &sRP188) const
Definition: ntv2rp188.cpp:918
NTV2_OEM_TASKS
@ NTV2_OEM_TASKS
2: OEM: Device is configured by controlling application(s), with minimal driver involvement.
Definition: ntv2publicinterface.h:4261
NTV2_XptSDIOut3Input
@ NTV2_XptSDIOut3Input
Definition: ntv2enums.h:2736
NTV2_XptDuallinkOut4
@ NTV2_XptDuallinkOut4
Definition: ntv2enums.h:2532
NTV2TestPatternNames
NTV2StringList NTV2TestPatternNames
A list (std::vector) of pattern names.
Definition: ntv2testpatterngen.h:19
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:1538
NTV2_XptDuallinkOut2
@ NTV2_XptDuallinkOut2
Definition: ntv2enums.h:2505
NTV2_XptDualLinkOut1Input
@ NTV2_XptDualLinkOut1Input
Definition: ntv2enums.h:2764
NTV2_XptDuallinkOut3DS2
@ NTV2_XptDuallinkOut3DS2
Definition: ntv2enums.h:2531
NTV2_AUDIOSYSTEM_INVALID
@ NTV2_AUDIOSYSTEM_INVALID
Definition: ntv2enums.h:3821
timebase.h
Declares the AJATimeBase class.