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_) 49 static const double gFrequencies [] = {250.0, 500.0, 1000.0, 2000.0};
62 mToneFrequency (440.0),
88 while (mProducerThread.
Active())
91 while (mConsumerThread.
Active())
94 #if defined(NTV2_BUFFER_LOCKING) 96 #endif // NTV2_BUFFER_LOCKING 113 cerr <<
"## ERROR: Device '" << mConfig.
fDeviceSpec <<
"' not found" << endl;
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;
137 cerr <<
"## WARNING: '--tsi' option used with device that has 12G FrameStores with integral Tsi muxers" << endl;
150 cerr <<
"## ERROR: Squares requires Ch1 or Ch5, not Ch" <<
DEC(mConfig.
fOutputChannel) << endl;
189 {cerr <<
"## ERROR: RenderTimeCodeFont failed for: " << mFormatDesc << endl;
return AJA_STATUS_UNSUPPORTED;}
196 #endif // defined(_DEBUG) 208 { cerr <<
"## ERROR: '" << mDevice.
GetDescription() <<
"' doesn't support " 213 { cerr <<
"## ERROR: '" << mDevice.
GetDescription() <<
"' doesn't support " 225 if (channels1357.find(mConfig.
fOutputChannel) == channels1357.end())
277 if (numAudioChannels > 8)
280 numAudioChannels = 8;
286 switch (mAudioSystem)
292 for (
UWord chan(0); chan < numChan; chan++)
358 PLFAIL(
"Failed to allocate " <<
xHEX0N(audioBufferSize,8) <<
"-byte audio buffer");
361 if (frameData.fAudioBuffer)
363 frameData.fAudioBuffer.Fill(
ULWord(0));
364 #ifdef NTV2_BUFFER_LOCKING 368 mFrameDataRing.
Add (&frameData);
378 vector<NTV2TestPatternSelect> testPatIDs;
396 mTestPatRasters.clear();
397 for (
size_t tpNdx(0); tpNdx < testPatIDs.size(); tpNdx++)
406 for (
size_t tpNdx(0); tpNdx < testPatIDs.size(); tpNdx++)
410 {
PLFAIL(
"Test pattern buffer " <<
DEC(tpNdx+1) <<
" of " <<
DEC(testPatIDs.size()) <<
": " 417 if (!testPatternGen.
DrawTestPattern (testPatIDs.at(tpNdx), mFormatDesc, mTestPatRasters.at(tpNdx)))
419 cerr <<
"## ERROR: DrawTestPattern " <<
DEC(tpNdx) <<
" failed: " << mFormatDesc << endl;
423 #ifdef NTV2_BUFFER_LOCKING 426 PLWARN(
"Test pattern buffer " <<
DEC(tpNdx+1) <<
" of " <<
DEC(testPatIDs.size()) <<
": failed to pre-lock");
438 bool useLinkGrouping =
false;
459 useLinkGrouping =
true;
590 return failures == 0;
609 UWord connectFailures (0);
658 return connectFailures == 0;
667 UWord connectFailures (0);
780 return connectFailures == 0;
788 UWord connectFailures (0);
803 return connectFailures == 0;
810 UWord connectFailures (0);
845 return connectFailures == 0;
852 UWord connectFailures (0);
877 return connectFailures == 0;
884 UWord connectFailures (0);
936 return connectFailures == 0;
943 UWord connectFailures (0);
966 return connectFailures == 0;
973 UWord connectFailures (0);
988 return connectFailures == 0;
995 UWord connectFailures (0);
1010 return connectFailures == 0;
1017 UWord connectFailures (0);
1032 return connectFailures == 0;
1039 UWord connectFailures (0);
1061 return connectFailures == 0;
1068 UWord connectFailures (0);
1120 return connectFailures == 0;
1127 UWord connectFailures (0);
1149 return connectFailures == 0;
1156 UWord connectFailures (0);
1178 return connectFailures == 0;
1201 mConsumerThread.
Start();
1211 NTV2Player4K * pApp (reinterpret_cast<NTV2Player4K*>(pContext));
1224 ULWord goodXfers(0), badXfers(0), prodWaits(0), noRoomWaits(0), startFrm(3);
1225 const UWord numACFramesPerChannel(7);
1230 PLNOTE(
"Thread started");
1234 uint32_t hdrPktSize (0);
1239 PLWARN(
"HDR anc insertion disabled -- GenerateTransmitData failed");
1245 #ifdef NTV2_BUFFER_LOCKING 1251 UWord startNum(0), endNum(0);
1266 case NTV2_CHANNEL2: startNum = numACFramesPerChannel * 0;
break;
1271 case NTV2_CHANNEL4: startNum = numACFramesPerChannel * 1;
break;
1274 case NTV2_CHANNEL6: startNum = numACFramesPerChannel * 2;
break;
1277 case NTV2_CHANNEL8: startNum = numACFramesPerChannel * 3;
break;
1279 endNum = startNum + numACFramesPerChannel - 1;
1288 1 , startNum, endNum);
1290 {
PLFAIL(
"AutoCirculateInitForOutput failed"); mGlobalQuit =
true;}
1298 while (!mGlobalQuit)
1309 {prodWaits++;
continue;}
1315 const CRP188 rp188Info (mCurrentFrame++, 0, 0, 10, tcFormat);
1317 string timeCodeString;
1321 mTCBurner.
BurnTimeCode (pFrameData->fVideoBuffer, timeCodeString.c_str(), 80);
1324 outputXfer.
acVideoBuffer.
Set (pFrameData->fVideoBuffer, pFrameData->fVideoBuffer);
1325 outputXfer.
acAudioBuffer.
Set (pFrameData->fAudioBuffer, pFrameData->fNumAudioBytes);
1331 {
if (++goodXfers == startFrm)
1349 PLNOTE(
"Thread completed: " <<
DEC(goodXfers) <<
" xfers, " <<
DEC(badXfers) <<
" failed, " 1350 <<
DEC(prodWaits) <<
" starves, " <<
DEC(noRoomWaits) <<
" VBI waits");
1364 mProducerThread.
Start();
1372 NTV2Player4K * pApp (reinterpret_cast<NTV2Player4K*>(pContext));
1381 ULWord freqNdx(0), testPatNdx(0), badTally(0);
1382 double timeOfLastSwitch (0.0);
1387 PLNOTE(
"Thread started");
1388 while (!mGlobalQuit)
1401 NTV2Buffer & testPatVidBuffer(mTestPatRasters.at(testPatNdx));
1402 pFrameData->fVideoBuffer.
Set(testPatVidBuffer.GetHostPointer(), testPatVidBuffer.GetByteCount());
1405 if (pFrameData->AudioBuffer())
1406 pFrameData->fNumAudioBytes =
AddTone(pFrameData->AudioBuffer());
1410 if (currentTime > timeOfLastSwitch + 4.0)
1413 testPatNdx = (testPatNdx + 1) %
ULWord(mTestPatRasters.size());
1415 timeOfLastSwitch = currentTime;
1416 PLINFO(
"F" <<
DEC0N(mCurrentFrame,6) <<
": tone=" << mToneFrequency <<
"Hz, pattern='" << tpNames.at(testPatNdx) <<
"'");
1423 PLNOTE(
"Thread completed: " <<
DEC(mCurrentFrame) <<
" frame(s) produced, " <<
DEC(badTally) <<
" failed");
1445 ULWord bytesWritten(0), startSample(mCurrentSample);
1448 mCurrentSample = startSample;
1459 return bytesWritten;
static const bool BUFFER_PAGE_ALIGNED((!(0)))
NTV2FrameRate GetNTV2FrameRateFromVideoFormat(const NTV2VideoFormat inVideoFormat)
Declares the AJAAncillaryData_HDR_HDR10 class.
double FramesToSeconds(int64_t frames) const
virtual bool SetTaskMode(const NTV2TaskMode inMode)
Sets the device's task mode.
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
#define NTV2_IS_VALID_TASK_MODE(__m__)
NTV2AudioSystem
Used to identify an Audio System on an NTV2 device. See Audio System Operation for more information...
virtual bool SetHDMIV2Mode(const NTV2HDMIV2Mode inMode)
Sets HDMI V2 mode for the device.
bool CanDo12gRouting(void)
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 ...
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...
virtual bool SetAudioLoopBack(const NTV2AudioLoopBack inMode, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Enables or disables NTV2AudioLoopBack mode for the given NTV2AudioSystem.
#define AUTOCIRCULATE_WITH_MULTILINK_AUDIO3
Use this to AutoCirculate with base audiosystem controlling base AudioSystem + 3. ...
Specifies the device's internal clock.
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...
virtual bool ReleaseStreamForApplication(ULWord inApplicationType, int32_t inProcessID)
Releases exclusive use of the AJA device for the given process, permitting other processes to acquire...
AJAStatus Add(FrameDataPtr pInFrameData)
Appends a new frame buffer to me, increasing my frame storage capacity by one frame.
The NTV2 test pattern generator.
virtual bool RouteDLOutToSDIOut(void)
Sets up board routing from the Dual Link outputs to the SDI outputs.
virtual bool SetLHIHDMIOutColorSpace(const NTV2LHIHDMIColorSpace inNewValue, const NTV2Channel inWhichHDMIOut=NTV2_CHANNEL1)
Sets the color space to use for the given HDMI output.
#define DEC0N(__x__, __n__)
virtual AJAStatus SetUpAudio(void)
Performs all audio setup.
virtual bool RouteFsToSDIOut(void)
Sets up board routing from the Frame Stores to the SDI outputs.
virtual void GetACStatus(AUTOCIRCULATE_STATUS &outStatus)
Provides status information about my output (playout) process.
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.
virtual AJAStatus SetUpHostBuffers(void)
Sets up my host video & audio buffers.
virtual bool Set4kSquaresEnable(const bool inIsEnabled, const NTV2Channel inChannel)
Enables or disables SMPTE 425 "2K quadrants" mode for the given FrameStore bank on the device...
virtual bool SetSDIOut6GEnable(const NTV2Channel inChannel, const bool inEnable)
virtual bool IsDeviceReady(const bool inCheckValid=(0))
static void ConsumerThreadStatic(AJAThread *pThread, void *pContext)
This is the consumer thread's static callback function that gets called when the consumer thread star...
virtual bool RouteCscToDLOut(void)
Sets up board routing from the Color Space Converters to the Dual Link outputs.
#define AJA_FAILURE(_status_)
Declares the NTV2TestPatternGen class.
virtual bool SubscribeOutputVerticalEvent(const NTV2Channel inChannel=NTV2_CHANNEL1)
Causes me to be notified when an output vertical blanking interrupt is generated for the given output...
virtual bool GetAudioRate(NTV2AudioRate &outRate, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Returns the current NTV2AudioRate for the given Audio System.
bool fDoLinkGrouping
If true, enables 6/12G output mode on IoX3/Kona5 (4K/8K)
NTV2AudioSystemSet NTV2MakeAudioSystemSet(const NTV2AudioSystem inFirstAudioSystem, const UWord inCount=1)
NTV2Buffer acVideoBuffer
The host video buffer. This field is owned by the client application, and thus is responsible for all...
static const ULWord gNumFrequencies(sizeof(gFrequencies)/sizeof(double))
virtual AJAStatus SetPriority(AJAThreadPriority priority)
FrameDataPtr StartConsumeNextBuffer(void)
The thread that's responsible for processing incoming frames – the consumer – calls this function t...
bool CanAcceptMoreOutputFrames(void) const
bool SetOutputTimeCode(const NTV2_RP188 &inTimecode, const NTV2TCIndex inTCIndex=NTV2_TCINDEX_SDI1)
Intended for playout, sets one element of my acOutputTimeCodes member.
Declares the AJAAncillaryData_HDR_HLG class.
virtual void Quit(void)
Gracefully stops me from running.
UWord firstFrame(void) const
Header file for NTV2Player4K demonstration class.
virtual AJAStatus Start()
This identifies the 3rd Audio System.
virtual void ProduceFrames(void)
My producer thread that repeatedly produces video frames.
void EndConsumeNextBuffer(void)
The consumer thread calls this function to signal that it has finished processing the frame it obtain...
std::string fDeviceSpec
The AJA device to use.
virtual bool AutoCirculateGetStatus(const NTV2Channel inChannel, AUTOCIRCULATE_STATUS &outStatus)
Returns the current AutoCirculate status for the given channel.
virtual bool SetFrameBufferFormat(NTV2Channel inChannel, NTV2FrameBufferFormat inNewFormat, bool inIsAJARetail=(!(0)), NTV2HDRXferChars inXferChars=NTV2_VPID_TC_SDR_TV, NTV2HDRColorimetry inColorimetry=NTV2_VPID_Color_Rec709, NTV2HDRLuminance inLuminance=NTV2_VPID_Luminance_YCbCr)
Sets the frame buffer format for the given FrameStore on the AJA device.
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
virtual bool SetHDMIV2TxBypass(const bool inBypass)
virtual class DeviceCapabilities & features(void)
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...
virtual bool SetMultiFormatMode(const bool inEnable)
Enables or disables multi-format (per channel) device operation. If enabled, each device channel can ...
#define AUTOCIRCULATE_WITH_MULTILINK_AUDIO1
Use this to AutoCirculate with base audiosystem controlling base AudioSystem + 1. ...
virtual void StartProducerThread(void)
Starts my producer thread.
virtual bool ClearRouting(void)
Removes all existing signal path connections between any and all widgets on the AJA device...
Declares the AJATimeBase class.
virtual bool RouteTsiMuxToDLOut(void)
Sets up board routing from the Two Sample Interleave muxes to the Dual Link outputs.
This struct replaces the old RP188_STRUCT.
NTV2TCIndex NTV2ChannelToTimecodeIndex(const NTV2Channel inChannel, const bool inEmbeddedLTC=false, const bool inIsF2=false)
Converts the given NTV2Channel value into the equivalent NTV2TCIndex value.
bool Fill(const T &inValue)
Fills me with the given scalar value.
virtual bool GetTaskMode(NTV2TaskMode &outMode)
Retrieves the device's current task mode.
bool WithAudio(void) const
virtual bool SetHDMIOutAudioRate(const NTV2AudioRate inNewValue, const NTV2Channel inWhichHDMIOut=NTV2_CHANNEL1)
Sets the HDMI output's audio rate.
bool Deallocate(void)
Deallocates my user-space storage (if I own it – i.e. from a prior call to Allocate).
virtual bool RouteTsiMuxToCsc(void)
Sets up board routing from the Two Sample Interleave muxes to the color Space Converters.
static AJA_PixelFormat GetAJAPixelFormat(const NTV2PixelFormat inFormat)
This selects audio channels 1 thru 8.
static const uint32_t gAudMaxSizeBytes(256 *1024)
The maximum number of bytes of 48KHz audio that can be transferred for a single frame. Worst case, assuming 16 channels of audio (max), 4 bytes per sample, and 67 msec per frame (assuming the lowest possible frame rate of 14.98 fps)... 48,000 samples per second requires 3,204 samples x 4 bytes/sample x 16 = 205,056 bytes 201K min will suffice, with 768 bytes to spare But it could be more efficient for page-aligned (and page-locked) memory to round to 256K.
NTV2FrameRate
Identifies a particular video frame rate.
virtual bool RouteOutputSignal(void)
Performs all widget/signal routing for playout.
static void ProducerThreadStatic(AJAThread *pThread, void *pContext)
This is the producer thread's static callback function that gets called when the producer thread star...
static const double gFrequencies[]
virtual bool DrawTestPattern(const std::string &inTPName, const NTV2FormatDescriptor &inFormatDesc, NTV2Buffer &inBuffer)
Renders the given test pattern or color into a host raster buffer.
virtual bool EnableChannels(const NTV2ChannelSet &inChannels, const bool inDisableOthers=(0))
Enables the given FrameStore(s).
virtual std::string GetDescription(void) const
UWord fNumAudioLinks
The number of audio systems to control for multi-link audio (4K/8K)
static TimecodeFormat NTV2FrameRate2TimecodeFormat(const NTV2FrameRate inFrameRate)
virtual bool RouteTsiMuxTo4xSDIOut(void)
Sets up board routing from the Two Sample Interleave muxes to the 4xSDI outputs.
virtual bool IsOpen(void) const
virtual void StartConsumerThread(void)
Starts my consumer thread.
static bool GetFirstDeviceFromArgument(const std::string &inArgument, CNTV2Card &outDevice)
Rescans the host, and returns an open CNTV2Card instance for the AJA device that matches a command li...
virtual bool SetSDITransmitEnable(const NTV2Channel inChannel, const bool inEnable)
Sets the specified bidirectional SDI connector to act as an input or an output.
bool HasBiDirectionalSDI(void)
virtual bool AutoCirculateTransfer(const NTV2Channel inChannel, AUTOCIRCULATE_TRANSFER &transferInfo)
Transfers all or part of a frame as specified in the given AUTOCIRCULATE_TRANSFER object to/from the ...
virtual bool AcquireStreamForApplication(ULWord inApplicationType, int32_t inProcessID)
Reserves exclusive use of the AJA device for a given process, preventing other processes on the host ...
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.
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...
static void Sleep(const int32_t inMilliseconds)
Suspends execution of the current thread for a given number of milliseconds.
virtual bool RouteTsiMuxTo2xSDIOut(void)
Sets up board routing from the Two Sample Interleave muxes to the 2xSDI outputs.
NTV2PixelFormat fPixelFormat
The pixel format to use.
2: OEM (recommended): device configured by client application(s) with some driver involvement...
virtual bool Enable4KDCRGBMode(bool inEnable)
Sets 4K Down Convert RGB mode.
virtual bool SetHDMIOutVideoStandard(const NTV2Standard inNewValue, const NTV2Channel inWhichHDMIOut=NTV2_CHANNEL1)
Sets the video standard to use for the given HDMI output.
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...
virtual AJAStatus SetUpTestPatternBuffers(void)
Creates my test pattern buffers.
std::set< NTV2AudioSystem > NTV2AudioSystemSet
A set of distinct NTV2AudioSystem values. New in SDK 16.2.
NTV2VideoFormat fVideoFormat
The video format to use.
std::string NTV2VideoFormatToString(const NTV2VideoFormat inValue, const bool inUseFrameRate=false)
Embeds silence (zeroes) into the data stream.
virtual bool SetVANCShiftMode(NTV2Channel inChannel, NTV2VANCDataShiftMode inMode)
Enables or disables the "VANC Shift Mode" feature for the given channel.
virtual bool SetTsiFrameEnable(const bool inIsEnabled, const NTV2Channel inChannel)
Enables or disables SMPTE 425 two-sample interleave (Tsi) frame mode on the device.
Specifies channel or FrameStore 8 (or the 8th item).
AJA_EXPORT bool RenderTimeCodeFont(AJA_PixelFormat pixelFormat, uint32_t numPixels, uint32_t numLines)
virtual bool DMABufferUnlockAll()
Unlocks all previously-locked buffers used for DMA transfers.
Specifies the PTP source on SFP 1.
bool fDoRGBOnWire
If true, produce RGB on the wire; otherwise output YUV.
#define AUTOCIRCULATE_WITH_ANC
Use this to AutoCirculate with ancillary data.
Specifies channel or FrameStore 2 (or the 2nd item).
virtual bool RouteHDMIOutput(void)
Sets up board routing output via the HDMI (if available).
#define NTV2_IS_4K_HFR_VIDEO_FORMAT(__f__)
virtual ~NTV2Player4K(void)
UWord GetNumFrameStores(void)
Declares the CNTV2DeviceScanner class.
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...
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.
Declares the AJAProcess class.
Describes a user-space buffer on the host computer. I have an address and a length, plus some optional attributes (allocated by SDK?, page-aligned? etc.).
virtual bool UnsubscribeOutputVerticalEvent(const NTV2Channel inChannel)
Unregisters me so I'm no longer notified when an output VBI is signaled on the given output channel...
virtual bool Connect(const NTV2InputCrosspointID inInputXpt, const NTV2OutputCrosspointID inOutputXpt, const bool inValidate=(0))
Connects the given widget signal input (sink) to the given widget signal output (source).
bool fDoMultiFormat
If true, enable device-sharing; otherwise take exclusive control of device.
static NTV2TestPatternNames getTestPatternNames(void)
bool IsRGBFormat(const NTV2FrameBufferFormat format)
This object specifies the information that will be transferred to or from the AJA device in the CNTV2...
virtual bool SetAudioBufferSize(const NTV2AudioBufferSize inValue, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Changes the size of the audio buffer that is used for a given Audio System in the AJA device...
virtual bool RouteFsToDLOut(void)
Sets up board routing from the Frame Stores to the Dual Link out.
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 ...
static ULWord gAncMaxSizeBytes(NTV2_ANCSIZE_MAX)
The maximum number of bytes of ancillary data that can be transferred for a single field...
bool fDoTsiRouting
If true, enable TSI routing; otherwise route for square division (4K/8K)
std::set< NTV2Channel > NTV2ChannelSet
A set of distinct NTV2Channel values.
void EndProduceNextBuffer(void)
The producer thread calls this function to signal that it has finished populating the frame it obtain...
This identifies the first Audio System.
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 ...
virtual uint32_t AddTone(ULWord *audioBuffer)
Inserts audio tone (based on my current tone frequency) into the given audio buffer.
NTV2Channel fOutputChannel
The device channel to use.
static const size_t CIRCULAR_BUFFER_SIZE(10)
Number of NTV2FrameData's in our ring.
static const ULWord kDemoAppSignature((((uint32_t)( 'D'))<< 24)|(((uint32_t)( 'E'))<< 16)|(((uint32_t)( 'M'))<< 8)|(((uint32_t)( 'O'))<< 0))
I am an object that can play out a 4K or UHD test pattern (with timecode) to an output of an AJA devi...
virtual AJAStatus Attach(AJAThreadFunction *pThreadFunction, void *pUserContext)
bool Set(const void *pInUserPointer, const size_t inByteCount)
Sets (or resets) me from a client-supplied address and size.
FrameDataPtr StartProduceNextBuffer(void)
The thread that's responsible for providing frames – the producer – calls this function to populate...
double GetAudioSamplesPerSecond(const NTV2AudioRate inAudioRate)
Returns the audio sample rate as a number of audio samples per second.
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...
Identifies the "normal" Field 2 ancillary data region.
This identifies the 4th Audio System.
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...
virtual bool SetHDMIOutAudioSource8Channel(const NTV2Audio8ChannelSelect inNewValue, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1, const NTV2Channel inWhichHDMIOut=NTV2_CHANNEL1)
Changes the HDMI output's 8-channel audio source.
ULWord GetFrameCount(void) const
This is returned from the CNTV2Card::AutoCirculateGetStatus function.
NTV2OutputXptID GetFrameStoreOutputXptFromChannel(const NTV2Channel inFrameStore, const bool inIsRGB=false, const bool inIs425=false)
virtual bool SetHDMIOutAudioFormat(const NTV2AudioFormat inNewValue, const NTV2Channel inWhichHDMIOut=NTV2_CHANNEL1)
Sets the HDMI output's audio format.
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, and frame number. This is useful since AJA devices use fixed audio sample rates (typically 48KHz), and some video frame rates will necessarily result in some frames having more audio samples than others.
Declares the AJAAncillaryData_HDR_SDR class.
virtual bool SetHDMIOutVideoFPS(const NTV2FrameRate inNewValue, const NTV2Channel inWhichHDMIOut=NTV2_CHANNEL1)
Sets the video frame rate to use for the given HDMI output.
Specifies channel or FrameStore 1 (or the first item).
virtual bool RouteFsToTsiMux(void)
Sets up board routing from the Frame Stores to the Two Sample Interleave muxes.
virtual bool AutoCirculateStart(const NTV2Channel inChannel, const ULWord64 inStartTime=0)
Starts AutoCirculate streaming for the specified channel that was previously initialized by CNTV2Card...
bool CanDoFrameBufferFormat(const NTV2PixelFormat inPF)
virtual bool AutoCirculateInitForOutput(const NTV2Channel inChannel, const UWord inFrameCount=7, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_INVALID, const ULWord inOptionFlags=0, const UByte inNumChannels=1, const UWord inStartFrameNumber=0, const UWord inEndFrameNumber=0)
Prepares for subsequent AutoCirculate playback streaming, designating a contiguous block of frame buf...
#define xHEX0N(__x__, __n__)
virtual AJAStatus Run(void)
Runs me.
bool CanDoWidget(const NTV2WidgetID inWgtID)
virtual bool GetFrameRate(NTV2FrameRate &outValue, NTV2Channel inChannel=NTV2_CHANNEL1)
Returns the AJA device's currently configured frame rate via its "value" parameter.
static AJA_FrameRate GetAJAFrameRate(const NTV2FrameRate inFrameRate)
AJA_EXPORT bool BurnTimeCode(void *pBaseVideoAddress, const std::string &inTimeCodeStr, const uint32_t inYPercent)
I encapsulate the video, audio and anc host buffers used in the AutoCirculate demos. I'm a more modern version of the AVDataBuffer.
NTV2AudioSystem NTV2ChannelToAudioSystem(const NTV2Channel inChannel)
Converts the given NTV2Channel value into its equivalent NTV2AudioSystem.
Specifies channel or FrameStore 4 (or the 4th item).
NTV2ChannelSet NTV2MakeChannelSet(const NTV2Channel inFirstChannel, const UWord inNumChannels=1)
Specifies channel or FrameStore 5 (or the 5th item).
NTV2ACFrameRange fFrames
AutoCirculate frame count or range.
NTV2Standard GetNTV2StandardFromVideoFormat(const NTV2VideoFormat inVideoFormat)
Configures an NTV2Player instance.
bool GetRP188Reg(RP188_STRUCT &outRP188) const
NTV2StringList NTV2TestPatternNames
An ordered sequence of pattern names.
#define AUTOCIRCULATE_WITH_MULTILINK_AUDIO2
Use this to AutoCirculate with base audiosystem controlling base AudioSystem + 2. ...
virtual void ConsumeFrames(void)
My consumer thread that repeatedly plays frames using AutoCirculate (until quit). ...
static size_t SetDefaultPageSize(void)
NTV2Buffer acAudioBuffer
The host audio buffer. This field is owned by the client application, and thus is responsible for all...
Specifies channel or FrameStore 6 (or the 6th item).
UWord GetMaxAudioChannels(void)
bool CanDoVideoFormat(const NTV2VideoFormat inVF)
UWord lastFrame(void) const
I am the principal class that stores a single SMPTE-291 SDI ancillary data packet OR the digitized co...
virtual bool RouteCscTo2xSDIOut(void)
Sets up board routing from the Color Space Converters to the 2xSDI outputs.
bool HasCrosspointConnectROM(void)
#define AUTOCIRCULATE_WITH_RP188
Use this to AutoCirculate with RP188.
const char * NTV2FrameBufferFormatString(NTV2FrameBufferFormat fmt)
Specifies channel or FrameStore 7 (or the 7th item).
bool GetRP188Str(std::string &sRP188) const
std::string & lower(std::string &str)
NTV2Buffer acANCBuffer
The host ancillary data buffer. This field is owned by the client application, and thus is responsibl...
virtual bool Route4KDownConverter(void)
Sets up board routing for the 4K DownConverter to SDI Monitor (if available).
NTV2InputXptID GetSDIOutputInputXpt(const NTV2Channel inSDIOutput, const bool inIsDS2=false)
virtual bool SetVANCMode(const NTV2VANCMode inVancMode, const NTV2Channel inChannel=NTV2_CHANNEL1)
Sets the VANC mode for the given FrameStore.
virtual bool SetSDIOut12GEnable(const NTV2Channel inChannel, const bool inEnable)
virtual bool RouteCscTo4xSDIOut(void)
Sets up board routing from the Color Space Converters to the 4xSDI outputs.
NTV2Player4K(const PlayerConfig &inConfig)
Constructs me using the given configuration settings.
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...
virtual bool RouteFsToCsc(void)
Sets up board routing from the Frame Stores to the Color Space Converters.
bool fDoHDMIOutput
If true, enable HDMI output; otherwise, disable HDMI output.
bool CanDoMultiFormat(void)
virtual AJAStatus SetUpVideo(void)
Performs all video setup.
This identifies the mode in which there are no VANC lines in the frame buffer.
Specifies channel or FrameStore 3 (or the 3rd item).
virtual void SetupSDITransmitters(const NTV2Channel inFirstSDI, const UWord inNumSDIs)
Sets up bi-directional SDI transmitters.
#define NTV2_IS_4K_4096_VIDEO_FORMAT(__f__)