18 #if defined(NTV2_ANCSIZE_MAX) 19 #undef NTV2_ANCSIZE_MAX 21 #define NTV2_ANCSIZE_MAX (256 * 1024) // Super Size Me! 0x40000 27 #define AsULWordPtr(_p_) reinterpret_cast<ULWord*>(_p_) 28 #define AsCU8Ptr(_p_) reinterpret_cast<const uint8_t*>(_p_) 40 mAudioInLastAddress (0),
41 mAudioOutLastAddress (0),
74 while (mRunThread.
Active())
95 {cerr <<
"## ERROR: Device cannot both capture & play video" << endl;
return AJA_STATUS_BAD_PARAM; }
105 cerr <<
"## ERROR: Unable to acquire device because another app (pid " <<
appPID <<
") owns it" << endl;
137 {cerr <<
"## WARNING: Device doesn't support custom Anc, '-a -h' option ignored" << endl; mConfig.
fWithAnc =
false; mConfig.
fWithHanc =
false;}
171 {cerr <<
"## ERROR: This device cannot receive input from the specified source" << endl;
return AJA_STATUS_BAD_PARAM;}
242 bool isTransmit (
false);
253 cerr <<
"## WARNING: Non-SDI input source, no Anc capture possible" << endl;
259 cerr <<
"## ERROR: The specified input has no signal, or the device cannot handle the signal format" << endl;
272 cerr <<
"## WARNING: Non-SDI output destination, no Anc playout possible" << endl;
324 bool isBypassEnabled (
false);
401 #define HOST_AUDIO_BUFFER_SIZE 4194304 414 if (!mpHostVideoBuffer || !mpHostAudioBuffer || (mConfig.
WithAnc() && !mpHostF1AncBuffer) || (mConfig.
WithAnc() && !mpHostF2AncBuffer))
416 cerr <<
"## ERROR: Unable to allocate host buffer(s)" << endl;
438 mDevice.
Connect (cscVideoInputXpt, inputOutputXpt);
439 mDevice.
Connect (fbInputXpt, cscOutputXpt);
442 mDevice.
Connect (fbInputXpt, inputOutputXpt);
453 mRP188Outputs.clear();
460 mDevice.
Connect (cscVidInputXpt, fbOutputXpt);
461 mDevice.
Connect (outputInputXpt, cscVidOutputXpt);
462 outputXpt = cscVidOutputXpt;
465 mDevice.
Connect (outputInputXpt, outputXpt);
479 mRP188Outputs.insert(chan);
530 NTV2LLBurn * pApp (reinterpret_cast <NTV2LLBurn *> (pContext));
549 uint32_t currentInFrame (mInputStartFrame);
550 uint32_t currentOutFrame (mOutputStartFrame);
551 uint32_t currentAudioInAddress (0);
552 uint32_t audioReadOffset (0);
553 uint32_t audioInWrapAddress (0);
554 uint32_t audioOutWrapAddress (0);
555 uint32_t audioBytesCaptured (0);
556 uint32_t ancBytesCapturedF1 (0);
557 uint32_t ancBytesCapturedF2 (0);
558 bool audioIsReset (
true);
560 string timeCodeString;
571 ULWord savedF1ByteCapacity(0), savedF2ByteCapacity(0), offset(0);
631 mFramesProcessed = mFramesDropped = 0;
638 mDevice.
DMAWriteAnc (0, zeroesBuffer, zeroesBuffer);
639 mDevice.
DMAWriteAnc (1, zeroesBuffer, zeroesBuffer);
640 mDevice.
DMAWriteAnc (2, zeroesBuffer, zeroesBuffer);
641 mDevice.
DMAWriteAnc (3, zeroesBuffer, zeroesBuffer);
646 currentOutFrame ^= 1;
651 if (doAncInput && isInterlace)
661 mAudioInLastAddress = audioReadOffset;
662 audioInWrapAddress = audioOutWrapAddress + audioReadOffset;
663 mAudioOutLastAddress = 0;
666 currentOutFrame ^= 1;
671 if (doAncInput && isInterlace)
683 currentOutFrame ^= 1;
689 currentAudioInAddress &= ~0x3UL;
690 currentAudioInAddress += audioReadOffset;
692 if (audioIsReset && mAudioOutLastAddress)
696 audioIsReset =
false;
699 if (currentAudioInAddress < mAudioInLastAddress)
703 audioBytesCaptured = audioInWrapAddress - mAudioInLastAddress;
705 mDevice.
DMAReadAudio (mAudioSystem, mpHostAudioBuffer, mAudioInLastAddress, audioBytesCaptured);
709 audioReadOffset, currentAudioInAddress - audioReadOffset);
711 audioBytesCaptured += currentAudioInAddress - audioReadOffset;
715 audioBytesCaptured = currentAudioInAddress - mAudioInLastAddress;
718 mDevice.
DMAReadAudio (mAudioSystem, mpHostAudioBuffer, mAudioInLastAddress, audioBytesCaptured);
721 mAudioInLastAddress = currentAudioInAddress;
736 mpHostF1AncBuffer.
Fill(0);
738 mpHostF2AncBuffer.
Fill(0);
741 mDevice.
DMAReadAnc (currentInFrame, mpHostF1AncBuffer, mpHostF2AncBuffer);
749 mDevice.
DMAWriteAnc (currentInFrame, zeroesBuffer, zeroesBuffer);
758 CRP188 inputRP188Info (timecodeValue);
766 CRP188 analogRP188Info (timecodeValue);
775 const CRP188 frameRP188Info (mFramesProcessed, tcFormat);
788 if ((mAudioOutLastAddress + audioBytesCaptured) > audioOutWrapAddress)
791 mDevice.
DMAWriteAudio (mAudioSystem, mpHostAudioBuffer, mAudioOutLastAddress, audioOutWrapAddress - mAudioOutLastAddress);
795 0, audioBytesCaptured - (audioOutWrapAddress - mAudioOutLastAddress));
797 mAudioOutLastAddress = audioBytesCaptured - (audioOutWrapAddress - mAudioOutLastAddress);
802 mDevice.
DMAWriteAudio (mAudioSystem, mpHostAudioBuffer, mAudioOutLastAddress, audioBytesCaptured);
804 mAudioOutLastAddress += audioBytesCaptured;
827 pktData =
ULWord(pktData << 16) |
ULWord(pktData >> 16);
835 mDevice.
DMAWriteAnc (currentOutFrame, mpHostF1AncBuffer, mpHostF2AncBuffer);
845 uint32_t readBackOut;
849 if ((readBackIn == currentInFrame) || (readBackOut == currentOutFrame))
851 cerr <<
"## WARNING: Drop detected: current in " << currentInFrame <<
", readback in " << readBackIn
852 <<
", current out " << currentOutFrame <<
", readback out " << readBackOut << endl;
862 if (doAncInput && isInterlace)
868 if (doAncOutput && isInterlace)
872 if (mFramesProcessed == 1)
882 if (doAncInput && mConfig.
WithHanc())
887 BURNNOTE(
"Thread completed, will exit");
897 outFramesProcessed = mFramesProcessed;
898 outFramesDropped = mFramesDropped;
905 switch (inInputSource)
928 if (regNum && mDevice.
ReadRegister(regNum, regValue) && regValue &
BIT(16))
943 default:
return false;
946 return regValue ?
true :
false;
NTV2Channel NTV2InputSourceToChannel(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2Channel value.
NTV2FrameRate GetNTV2FrameRateFromVideoFormat(const NTV2VideoFormat inVideoFormat)
virtual bool SetTaskMode(const NTV2TaskMode inMode)
Sets the device's task mode.
bool fWithAnc
If true, capture & play anc data (LLBurn). Defaults to false.
virtual AJAStatus GetTransmitData(NTV2Buffer &F1Buffer, NTV2Buffer &F2Buffer, const bool inIsProgressive=true, const uint32_t inF2StartLine=0)
Encodes my AJAAncillaryData packets into the given buffers in the default SDI Anc Buffer Data Format ...
virtual bool WaitForInputFieldID(const NTV2FieldID inFieldID, const NTV2Channel inChannel=NTV2_CHANNEL1)
Efficiently sleeps the calling thread/process until the next input VBI for the given field and input ...
Identifies the 4th HDMI video input.
Identifies the 5th SDI video input.
virtual bool GetSDITransmitEnable(const NTV2Channel inChannel, bool &outEnabled)
Answers whether or not the specified SDI connector is currently acting as a transmitter (i...
virtual bool GetAudioWrapAddress(ULWord &outWrapAddress, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
For the given Audio System, answers with the wrap address, the threshold at which input/record or out...
NTV2AudioSystem
Used to identify an Audio System on an NTV2 device. See Audio System Operation for more information...
virtual bool SetSDIWatchdogEnable(const bool inEnable, const UWord inIndex0)
Sets the connector pair relays to be under watchdog timer control or manual control.
virtual uint32_t CountAncillaryData(void) const
Answers with the number of AJAAncillaryData objects I contain (any/all types).
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...
Declares common types used in the ajabase library.
virtual bool SetAudioLoopBack(const NTV2AudioLoopBack inMode, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Enables or disables NTV2AudioLoopBack mode for the given NTV2AudioSystem.
Header file for the low latency NTV2Burn demonstration class.
static ULWord GetRP188DBBRegNumForInput(const NTV2InputSource inInputSource)
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 AJAStatus SetupHostBuffers(void)
Sets up my circular buffers.
virtual bool ReleaseStreamForApplication(ULWord inApplicationType, int32_t inProcessID)
Releases exclusive use of the AJA device for the given process, permitting other processes to acquire...
bool Is8BitFrameBufferFormat(const NTV2FrameBufferFormat fbFormat)
virtual AJAStatus SetSID(const uint8_t inSID)
Sets my Secondary Data ID (SID) - (aka the Data Block Number (DBN) for "Type 1" SMPTE-291 packets)...
virtual AJAStatus SetupAudio(void)
Sets up everything I need for capturing and playing audio.
virtual bool AncInsertInit(const UWord inSDIOutput, const NTV2Channel inChannel=NTV2_CHANNEL_INVALID, const NTV2Standard inStandard=NTV2_STANDARD_INVALID)
Initializes the given SDI output's Anc inserter for custom Anc packet insertion. (Call NTV2DeviceCanD...
Identifies the 2nd HDMI video input.
virtual bool AncSetFrameBufferSize(const ULWord inF1Size, const ULWord inF2Size)
Sets the capacity of the SDI ANC or HDMI AUX buffers in device frame memory. (Call NTV2DeviceCanDoCus...
NTV2ChannelSet::const_iterator NTV2ChannelSetConstIter
A handy const iterator into an NTV2ChannelSet.
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 SetDID(const uint8_t inDataID)
Sets my Data ID (DID).
Ancillary data found between SAV and EAV (.
virtual bool SetRP188Mode(const NTV2Channel inChannel, const NTV2_RP188Mode inMode)
Sets the current RP188 mode – NTV2_RP188_INPUT or NTV2_RP188_OUTPUT – for the given channel...
virtual bool SetAudioCaptureEnable(const NTV2AudioSystem inAudioSystem, const bool inEnable)
Enables or disables the writing of incoming audio into the given Audio System's capture buffer...
virtual bool IsDeviceReady(const bool inCheckValid=(0))
virtual bool AncExtractGetField1Size(const UWord inSDIInput, ULWord &outF1Size)
Answers with the number of bytes of field 1 ANC extracted. (Call NTV2DeviceCanDoCustomAnc to determin...
Used to describe Start of Active Video (SAV) location and field dominance for a given NTV2Standard...
Identifies the 1st HDMI video input.
NTV2OutputDestination NTV2ChannelToOutputDestination(const NTV2Channel inChannel, const NTV2IOKinds inKinds=NTV2_IOKINDS_SDI)
Converts the given NTV2Channel value into its ordinary equivalent NTV2OutputDestination.
#define AJA_FAILURE(_status_)
virtual bool AncExtractSetEnable(const UWord inSDIInput, const bool inIsEnabled)
Enables or disables the given SDI input's Anc extractor. (Call NTV2DeviceCanDoCustomAnc to determine ...
#define NTV2_VIDEO_FORMAT_HAS_PROGRESSIVE_PICTURE(__f__)
NTV2EmbeddedAudioInput NTV2InputSourceToEmbeddedAudioInput(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2EmbeddedAudioInput value.
ULWord GetByteCount(void) const
virtual bool DMAWriteFrame(const ULWord inFrameNumber, const ULWord *pInFrameBuffer, const ULWord inByteCount)
Transfers a single frame from the host to the AJA device.
virtual bool GetOutputFrame(const NTV2Channel inChannel, ULWord &outValue)
Answers with the current output frame number for the given FrameStore (expressed as an NTV2Channel)...
Capture (input) mode, which writes into device SDRAM.
NTV2AudioSystem NTV2InputSourceToAudioSystem(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2AudioSystem value.
LWord acStartFrame
First frame to circulate. FIXFIXFIX Why is this signed? CHANGE TO ULWord??
bool fSuppressAudio
If true, suppress audio; otherwise include audio.
virtual void ProcessFrames(void)
Repeatedly captures, burns, and plays frames without using AutoCirculate (until global quit flag set)...
virtual AJAStatus SetPriority(AJAThreadPriority priority)
#define NTV2_FOURCC(_a_, _b_, _c_, _d_)
Defines a number of handy byte-swapping macros.
NTV2LLBurn(const BurnConfig &inConfig)
Constructs me using the given configuration settings.
virtual std::ostream & Print(std::ostream &oss, const bool inDetailed=true) const
Dumps a human-readable description of every packet in my list to the given output stream...
virtual bool SetAudioRate(const NTV2AudioRate inRate, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Sets the NTV2AudioRate for the given Audio System.
virtual AJAStatus Start()
virtual bool EnableInputInterrupt(const NTV2Channel channel=NTV2_CHANNEL1)
Allows the CNTV2Card instance to wait for and respond to input vertical blanking interrupts originati...
virtual bool SubscribeInputVerticalEvent(const NTV2Channel inChannel=NTV2_CHANNEL1)
Causes me to be notified when an input vertical blanking interrupt occurs on the given input channel...
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...
ULWord GetLastLine(const NTV2FieldID inRasterFieldID=NTV2_FIELD0) const
Identifies the 8th SDI video input.
virtual class DeviceCapabilities & features(void)
bool CanDoInputSource(const NTV2InputSource inSrc)
virtual bool EnableOutputInterrupt(const NTV2Channel channel=NTV2_CHANNEL1)
Allows the CNTV2Card instance to wait for and respond to output vertical blanking interrupts originat...
virtual bool AncInsertSetField2ReadParams(const UWord inSDIOutput, const ULWord inFrameNumber, const ULWord inF2Size, const NTV2Channel inChannel=NTV2_CHANNEL_INVALID, const NTV2Framesize inFrameSize=NTV2_FRAMESIZE_INVALID)
Configures the Anc inserter for the next frame's F2 Anc data to embed/transmit. (Call NTV2DeviceCanDo...
virtual bool SetMultiFormatMode(const bool inEnable)
Enables or disables multi-format (per channel) device operation. If enabled, each device channel can ...
uint16_t GetLineNumber(void) const
virtual bool DMAReadAnc(const ULWord inFrameNumber, NTV2Buffer &outAncF1Buffer, NTV2Buffer &outAncF2Buffer=NULL_POINTER, const NTV2Channel inChannel=NTV2_CHANNEL1)
Transfers the contents of the ancillary data buffer(s) from a given frame on the AJA device to the ho...
bool CanDoCustomAnc(void)
virtual AJAStatus SetupVideo(void)
Sets up everything I need for capturing and playing video.
Identifies the 2nd SDI video input.
virtual bool StartAudioOutput(const NTV2AudioSystem inAudioSystem, const bool inWaitForVBI=(0))
Starts the playout side of the given NTV2AudioSystem, reading outgoing audio samples from the Audio S...
#define NTV2_ASSERT(_expr_)
Defines where the ancillary data can be found within a video stream.
virtual bool ClearRouting(void)
Removes all existing signal path connections between any and all widgets on the AJA device...
virtual void RouteInputSignal(void)
Sets up board routing for capture.
virtual bool GetRP188Data(const NTV2Channel inSDIInput, NTV2_RP188 &outRP188Data)
Reads the raw RP188 data from the DBB/Low/Hi registers for the given SDI input. On newer devices with...
This struct replaces the old RP188_STRUCT.
virtual bool AncExtractGetField2Size(const UWord inSDIInput, ULWord &outF2Size)
Answers with the number of bytes of field 2 ANC extracted. (Call NTV2DeviceCanDoCustomAnc to determin...
ULWord GetNumVideoChannels(void)
A handy class that makes it easy to "bounce" an unsigned integer value between a minimum and maximum ...
#define NTV2_IS_ANALOG_TIMECODE_INDEX(__x__)
UWord GetNumAudioSystems(void)
virtual bool DMAWriteAudio(const NTV2AudioSystem inAudioSystem, const ULWord *pInAudioBuffer, const ULWord inOffsetBytes, const ULWord inByteCount)
Synchronously transfers audio data from the specified host buffer to the given Audio System's buffer ...
bool Fill(const T &inValue)
Fills me with the given scalar value.
virtual bool GetTaskMode(NTV2TaskMode &outMode)
Retrieves the device's current task mode.
virtual AJAStatus Run(void)
Runs me.
virtual bool SetAudioSystemInputSource(const NTV2AudioSystem inAudioSystem, const NTV2AudioSource inAudioSource, const NTV2EmbeddedAudioInput inEmbeddedInput)
Sets the audio source for the given NTV2AudioSystem on the device.
AutoCirculate Frame Range.
virtual bool KickSDIWatchdog(void)
Restarts the countdown timer to prevent the watchdog timer from timing out.
NTV2OutputXptID GetInputSourceOutputXpt(const NTV2InputSource inInputSource, const bool inIsSDI_DS2=false, const bool inIsHDMI_RGB=false, const UWord inHDMI_Quadrant=0)
NTV2PixelFormat fPixelFormat
The pixel format to use.
static AJA_PixelFormat GetAJAPixelFormat(const NTV2PixelFormat inFormat)
NTV2Channel NTV2OutputDestinationToChannel(const NTV2OutputDestination inOutputDest)
Converts a given NTV2OutputDestination to its equivalent NTV2Channel value.
NTV2Channel fOutputChannel
The output channel to use.
NTV2FrameRate
Identifies a particular video frame rate.
virtual bool SetLTCInputEnable(const bool inEnable)
Enables or disables the ability for the device to read analog LTC on the reference input connector...
virtual bool SetOutputFrame(const NTV2Channel inChannel, const ULWord inValue)
Sets the output frame index number for the given FrameStore. This identifies which frame in device SD...
virtual bool AncExtractSetFilterDIDs(const UWord inSDIInput, const NTV2DIDSet &inDIDs)
Replaces the DIDs to be excluded (filtered) by the given SDI input's Anc extractor. (Call NTV2DeviceCanDoCustomAnc to determine if the device supports Anc extractor firmware.)
NTV2Standard
Identifies a particular video standard.
0: Disabled (never recommended): device configured exclusively by client application(s).
Playout (output) mode, which reads from device SDRAM.
virtual bool AncExtractGetFilterDIDs(const UWord inSDIInput, NTV2DIDSet &outDIDs)
Answers with the DIDs currently being excluded (filtered) by the SDI input's Anc extractor. (Call NTV2DeviceCanDoCustomAnc to determine if the device supports Anc extractor firmware.)
virtual bool SetMode(const NTV2Channel inChannel, const NTV2Mode inNewValue, const bool inIsRetail=(!(0)))
Determines if a given FrameStore on the AJA device will be used to capture or playout video...
virtual bool SetRP188Data(const NTV2Channel inSDIOutput, const NTV2_RP188 &inRP188Data)
Writes the raw RP188 data into the DBB/Low/Hi registers for the given SDI output. These values are la...
static TimecodeFormat NTV2FrameRate2TimecodeFormat(const NTV2FrameRate inFrameRate)
NTV2InputXptID GetOutputDestInputXpt(const NTV2OutputDestination inOutputDest, const bool inIsSDI_DS2=false, const UWord inHDMI_Quadrant=99)
#define HOST_AUDIO_BUFFER_SIZE
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 SetRP188SourceFilter(const NTV2Channel inSDIInput, const UWord inFilterValue)
Sets the RP188 DBB filter for the given SDI input.
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 ...
Identifies the last (second) field in time for an interlaced video frame.
virtual bool ReadAnalogLTCInput(const UWord inLTCInput, RP188_STRUCT &outRP188Data)
Reads the current contents of the device's analog LTC input registers.
Identifies the 3rd SDI video input.
virtual bool StartAudioInput(const NTV2AudioSystem inAudioSystem, const bool inWaitForVBI=(0))
Starts the capture side of the given NTV2AudioSystem, writing incoming audio samples into the Audio S...
NTV2InputXptID GetCSCInputXptFromChannel(const NTV2Channel inCSC, const bool inIsKeyInput=false)
bool WithHanc(void) const
virtual NTV2VideoFormat GetInputVideoFormat(const NTV2InputSource inVideoSource=NTV2_INPUTSOURCE_SDI1, const bool inIsProgressive=(0))
Returns the video format of the signal that is present on the given input source. ...
AJAAncDataLoc & SetLineNumber(const uint16_t inLineNum)
Sets my anc data line number value.
static void Sleep(const int32_t inMilliseconds)
Suspends execution of the current thread for a given number of milliseconds.
virtual void Quit(void)
Gracefully stops me from running.
virtual bool DMAWriteAnc(const ULWord inFrameNumber, NTV2Buffer &inAncF1Buffer, NTV2Buffer &inAncF2Buffer=NULL_POINTER, const NTV2Channel inChannel=NTV2_CHANNEL1)
Transfers the contents of the ancillary data buffer(s) from the host to a given frame on the AJA devi...
2: OEM (recommended): device configured by client application(s) with some driver involvement...
The ancillary data is associated with the luminance (Y) channel of the video stream.
static AJAStatus SetFromDeviceAncBuffers(const NTV2Buffer &inF1AncBuffer, const NTV2Buffer &inF2AncBuffer, AJAAncillaryList &outPackets, const uint32_t inFrameNum=0)
Returns all ancillary data packets found in the given F1 and F2 ancillary data buffers.
NTV2InputXptID GetFrameStoreInputXptFromChannel(const NTV2Channel inFrameStore, const bool inIsBInput=false)
virtual bool AncExtractSetField2WriteParams(const UWord inSDIInput, const ULWord inFrameNumber, const NTV2Channel inChannel=NTV2_CHANNEL_INVALID, const NTV2Framesize inFrameSize=NTV2_FRAMESIZE_INVALID)
Configures the given SDI input's Anc extractor to receive the next frame's F2 Anc data...
const uint32_t kAppSignature(((((uint32_t)( 'L'))<< 24)|(((uint32_t)( 'l'))<< 16)|(((uint32_t)( 'b'))<< 8)|(((uint32_t)( 'u'))<< 0)))
virtual bool ReadAudioLastIn(ULWord &outValue, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
For the given Audio System, answers with the byte offset to the last byte of the latest chunk of 4-by...
virtual AJAStatus AddAncillaryData(const AJAAncillaryList &inPackets)
Appends a copy of the given list's packets to me.
static size_t DefaultPageSize(void)
virtual bool GetInputFrame(const NTV2Channel inChannel, ULWord &outValue)
Answers with the current input frame index number for the given FrameStore. This identifies which par...
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...
ULWord GetIndexForNTV2InputSource(const NTV2InputSource inValue)
virtual AJAStatus SetDataCoding(const AJAAncDataCoding inCodingType)
Sets my ancillary data coding type (e.g. digital or analog/raw waveform).
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 AncExtractSetWriteParams(const UWord inSDIInput, const ULWord inFrameNumber, const NTV2Channel inChannel=NTV2_CHANNEL_INVALID, const NTV2Framesize inFrameSize=NTV2_FRAMESIZE_INVALID)
Configures the given SDI input's Anc extractor to receive the next frame's F1 Anc data...
Configures an NTV2Burn or NTV2FieldBurn instance.
Specifies channel or FrameStore 8 (or the 8th item).
virtual bool InputSignalHasTimecode(void)
Returns true if the current input signal has timecode embedded in it; otherwise returns false...
AJA_EXPORT bool RenderTimeCodeFont(AJA_PixelFormat pixelFormat, uint32_t numPixels, uint32_t numLines)
#define AUTOCIRCULATE_WITH_ANC
Use this to AutoCirculate with ancillary data.
Specifies channel or FrameStore 2 (or the 2nd item).
virtual NTV2DeviceID GetDeviceID(void)
LWord acEndFrame
Last frame to circulate. FIXFIXFIX Why is this signed? CHANGE TO ULWord??
virtual bool GetAncRegionOffsetAndSize(ULWord &outByteOffset, ULWord &outByteCount, const NTV2AncillaryDataRegion inAncRegion=NTV2_AncRgn_All)
Answers with the offset and size of an ancillary data region within a device frame buffer...
virtual bool AncInsertSetComponents(const UWord inSDIOutput, const bool inVancY, const bool inVancC, const bool inHancY, const bool inHancC)
Enables or disables individual Anc insertion components for the given SDI output. (Call NTV2DeviceCan...
static void RunThreadStatic(AJAThread *pThread, void *pContext)
This is the worker thread's static callback function that gets called when the thread runs...
UWord GetNumFrameStores(void)
Identifies the 4th SDI video input.
virtual bool ReadRegister(const ULWord inRegNum, ULWord &outValue, const ULWord inMask=0xFFFFFFFF, const ULWord inShift=0)
Reads all or part of the 32-bit contents of a specific register (real or virtual) on the AJA device...
std::string fDeviceSpec
The AJA device to use.
#define NTV2_OUTPUT_DEST_IS_SDI(_dest_)
virtual AJAStatus SetDataLocation(const AJAAncDataLoc &inLoc)
Sets my ancillary data "location" within the video stream.
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...
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 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).
virtual bool GetAudioReadOffset(ULWord &outReadOffset, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
For the given Audio System, answers with the byte offset from the start of the audio buffer to the fi...
virtual bool UnsubscribeInputVerticalEvent(const NTV2Channel inChannel=NTV2_CHANNEL1)
Unregisters me so I'm no longer notified when an input VBI is signaled on the given input channel...
NTV2InputSource
Identifies a specific video input source.
virtual bool AnalogLTCInputHasTimecode(void)
Returns true if there is a valid LTC signal on my device's primary analog LTC input port; otherwise r...
bool IsRGBFormat(const NTV2FrameBufferFormat format)
Identifies the 6th SDI video input.
virtual void RouteOutputSignal(void)
Sets up board routing for playout.
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 AncInsertSetReadParams(const UWord inSDIOutput, const ULWord inFrameNumber, const ULWord inF1Size, const NTV2Channel inChannel=NTV2_CHANNEL_INVALID, const NTV2Framesize inFrameSize=NTV2_FRAMESIZE_INVALID)
Configures the Anc inserter for the next frame's F1 Anc data to embed/transmit. (Call NTV2DeviceCanDo...
static const bool CLEAR_DEVICE_ANC_BUFFER_AFTER_READ((0))
static bool GetWidgetForInput(const NTV2InputXptID inInputXpt, NTV2WidgetID &outWidgetID, const NTV2DeviceID inDeviceID=DEVICE_ID_NOTFOUND)
Returns the widget that "owns" the specified input crosspoint.
virtual void GetStatus(ULWord &outFramesProcessed, ULWord &outFramesDropped)
Provides status information about my input (capture) and output (playout) processes.
This identifies the first Audio System.
bool WithAudio(void) const
NTV2SmpteLineNumber GetSmpteLineNumber(const NTV2Standard inStandard)
For the given video standard, returns the SMPTE-designated line numbers for Field 1 and Field 2 that ...
Identifies the 7th SDI video input.
virtual bool SetSDIWatchdogTimeout(const ULWord inValue)
Specifies the amount of time that must elapse before the watchdog timer times out.
virtual AJAStatus Attach(AJAThreadFunction *pThreadFunction, void *pUserContext)
NTV2OutputCrosspointID
Identifies a widget output, a signal source, that potentially can drive another widget's input (ident...
NTV2InputCrosspointID
Identifies a widget input that potentially can accept a signal emitted from another widget's output (...
The ancillary data is associated with Link A of the video stream.
Identifies the "normal" Field 2 ancillary data region.
bool fDoMultiFormat
If true, enables device-sharing; otherwise takes exclusive control of the device. ...
ULWord GetFirstActiveLine(const NTV2FieldID inRasterFieldID=NTV2_FIELD0) const
virtual bool DMAReadAudio(const NTV2AudioSystem inAudioSystem, ULWord *pOutAudioBuffer, const ULWord inOffsetBytes, const ULWord inByteCount)
Synchronously transfers audio data from a given Audio System's buffer memory on the AJA device to the...
This is returned from the CNTV2Card::AutoCirculateGetStatus function.
NTV2OutputXptID GetFrameStoreOutputXptFromChannel(const NTV2Channel inFrameStore, const bool inIsRGB=false, const bool inIs425=false)
virtual AJAStatus SetPayloadData(const uint8_t *pInData, const uint32_t inByteCount)
Copy data from external memory into my local payload memory.
Specifies channel or FrameStore 1 (or the first item).
virtual bool SetInputFrame(const NTV2Channel inChannel, const ULWord inValue)
Sets the input frame index number for the given FrameStore. This identifies which frame in device SDR...
bool CanDoFrameBufferFormat(const NTV2PixelFormat inPF)
virtual bool SubscribeOutputVerticalEvent(const NTV2Channel inChannel)
Causes me to be notified when an output vertical blanking interrupt is generated for the given output...
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...
static const bool PRINT_ANC_PACKETS_AFTER_READ((0))
static const bool REPLACE_OUTGOING_ANC_WITH_CUSTOM_PACKETS((0))
bool CanDoWidget(const NTV2WidgetID inWgtID)
Identifies the 3rd HDMI video input.
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
#define NTV2_INPUT_SOURCE_IS_ANALOG(_inpSrc_)
virtual bool SetSDIOutputAudioEnabled(const NTV2Channel inSDIOutput, const bool &inEnable)
Enables or disables the audio output embedder for the given SDI output connector (specified as a chan...
AJA_EXPORT bool BurnTimeCode(void *pBaseVideoAddress, const std::string &inTimeCodeStr, const uint32_t inYPercent)
Specifies channel or FrameStore 4 (or the 4th item).
NTV2Channel fInputChannel
The input channel to use.
Specifies channel or FrameStore 5 (or the 5th item).
Identifies the first analog video input.
NTV2TCIndex fTimecodeSource
Timecode source to use.
NTV2Standard GetNTV2StandardFromVideoFormat(const NTV2VideoFormat inVideoFormat)
virtual bool DMAReadFrame(const ULWord inFrameNumber, ULWord *pOutFrameBuffer, const ULWord inByteCount)
Transfers a single frame from the AJA device to the host.
bool GetRP188Reg(RP188_STRUCT &outRP188) const
virtual void StartRunThread(void)
Starts my main worker thread.
virtual bool AncExtractSetComponents(const UWord inSDIInput, const bool inVancY, const bool inVancC, const bool inHancY, const bool inHancC)
Enables or disables the Anc extraction components for the given SDI input. (Call NTV2DeviceCanDoCusto...
void * GetHostPointer(void) const
NTV2AudioSource NTV2InputSourceToAudioSource(const NTV2InputSource inInputSource)
Identifies the first field in time for an interlaced video frame, or the first and only field in a pr...
static size_t SetDefaultPageSize(void)
virtual bool DisableRP188Bypass(const NTV2Channel inSDIOutput)
Configures the SDI output's embedder to embed SMPTE 12M timecode specified in calls to CNTV2Card::Set...
This identifies the 2nd Audio System.
virtual bool AncInsertSetEnable(const UWord inSDIOutput, const bool inIsEnabled)
Enables or disables the given SDI output's Anc inserter frame buffer reads. (Call NTV2DeviceCanDoCust...
Specifies channel or FrameStore 6 (or the 6th item).
UWord GetMaxAudioChannels(void)
I am the principal class that stores a single SMPTE-291 SDI ancillary data packet OR the digitized co...
virtual bool AutoCirculateInitForInput(const NTV2Channel inChannel, const UWord inFrameCount=7, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_INVALID, const ULWord inOptionFlags=0, const UByte inNumChannels=1, const UWord inStartFrameNumber=0, const UWord inEndFrameNumber=0)
Prepares for subsequent AutoCirculate ingest, designating a contiguous block of frame buffers on the ...
bool fWithHanc
If true, capture & play HANC data, including audio (LLBurn). Defaults to false.
#define AUTOCIRCULATE_WITH_RP188
Use this to AutoCirculate with RP188.
std::string NTV2ChannelToString(const NTV2Channel inValue, const bool inForRetailDisplay=false)
UWord GetNumVideoOutputs(void)
Specifies channel or FrameStore 7 (or the 7th item).
#define NTV2_INPUT_SOURCE_IS_SDI(_inpSrc_)
bool GetRP188Str(std::string &sRP188) const
const uint32_t kNumFrameBuffers(2)
Declares the AJAAncillaryList class.
static const bool CLEAR_HOST_ANC_BUFFER_BEFORE_READ((0))
void * GetHostAddress(const ULWord inByteOffset, const bool inFromEnd=false) const
Identifies the "normal" Field 1 ancillary data region.
Identifies the 1st SDI video input.
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 StopAudioOutput(const NTV2AudioSystem inAudioSystem)
Stops the playout side of the given NTV2AudioSystem, parking the "Read Head" at the start of the play...
virtual bool GetStreamingApplication(ULWord &outAppType, int32_t &outProcessID)
Answers with the four-CC type and process ID of the application that currently "owns" the AJA device ...
virtual bool AncExtractInit(const UWord inSDIInput, const NTV2Channel inChannel=NTV2_CHANNEL_INVALID, const NTV2Standard inStandard=NTV2_STANDARD_INVALID)
Initializes the given SDI input's Anc extractor for custom Anc packet detection and de-embedding...
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 StopAudioInput(const NTV2AudioSystem inAudioSystem)
Stops the capture side of the given NTV2AudioSystem, and resets the capture position (i...
#define NTV2EndianSwap32(__val__)
NTV2OutputXptID GetCSCOutputXptFromChannel(const NTV2Channel inCSC, const bool inIsKey=false, const bool inIsRGB=false)
virtual bool WaitForInputVerticalInterrupt(const NTV2Channel inChannel=NTV2_CHANNEL1, UWord inRepeatCount=1)
Efficiently sleeps the calling thread/process until the next one or more field (interlaced video) or ...
virtual bool IsRP188BypassEnabled(const NTV2Channel inSDIOutput, bool &outIsBypassEnabled)
Answers if the SDI output's RP-188 bypass mode is enabled or not.
I am an ordered collection of AJAAncillaryData instances which represent one or more SMPTE 291 data p...
The ancillary data is associated with DS1 of the video stream (Link A).
bool CanDoMultiFormat(void)
This identifies the mode in which there are no VANC lines in the frame buffer.
std::set< UByte > NTV2DIDSet
A set of distinct NTV2DID values.
Specifies channel or FrameStore 3 (or the 3rd item).
Captures video and audio from a signal provided to an input of an AJA device, burns timecode into the...
The ancillary data is in the form of a SMPTE-291 Ancillary Packet.
NTV2ReferenceSource NTV2InputSourceToReferenceSource(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2ReferenceSource value.
NTV2InputSource fInputSource
The device input connector to use.
virtual bool EnableChannel(const NTV2Channel inChannel)
Enables the given FrameStore.