18 #define NTV2_AUDIOSIZE_MAX (401 * 1024) 25 const bool inQuadMode,
26 const uint32_t inAudioChannels,
27 const bool inTimeCodeBurn,
28 const bool inInfoData,
29 const uint32_t inMaxFrames)
40 mDeviceSpecifier (inDeviceSpecifier),
41 mWithAudio (inAudioChannels != 0),
51 mWithInfo (inInfoData),
52 mWithAnc (inTimeCodeBurn),
55 mNumAudioChannels (0),
56 mFileAudioChannels (inAudioChannels),
57 mMaxFrames (inMaxFrames),
59 mLastFrameInput (
false),
60 mLastFrameRaw (
false),
61 mLastFrameHevc (
false),
62 mLastFrameVideo (
false),
63 mLastFrameAudio (
false),
65 mVideoInputFrameCount (0),
66 mVideoProcessFrameCount (0),
67 mCodecRawFrameCount (0),
68 mCodecHevcFrameCount (0),
69 mVideoFileFrameCount (0),
70 mAudioFileFrameCount (0)
72 ::memset (mVideoInputBuffer, 0x0,
sizeof (mVideoInputBuffer));
73 ::memset (mVideoRawBuffer, 0x0,
sizeof (mVideoRawBuffer));
74 ::memset (mVideoHevcBuffer, 0x0,
sizeof (mVideoHevcBuffer));
75 ::memset (mAudioInputBuffer, 0x0,
sizeof (mAudioInputBuffer));
103 if (mVideoInputBuffer[bufferNdx].pVideoBuffer)
108 if (mVideoInputBuffer[bufferNdx].pInfoBuffer)
110 delete [] mVideoInputBuffer[bufferNdx].
pInfoBuffer;
113 if (mVideoInputBuffer[bufferNdx].pAudioBuffer)
119 if (mVideoRawBuffer[bufferNdx].pVideoBuffer)
124 if (mVideoRawBuffer[bufferNdx].pInfoBuffer)
129 if (mVideoRawBuffer[bufferNdx].pAudioBuffer)
135 if (mVideoHevcBuffer[bufferNdx].pVideoBuffer)
140 if (mVideoHevcBuffer[bufferNdx].pInfoBuffer)
145 if (mVideoHevcBuffer[bufferNdx].pAudioBuffer)
156 if (mAudioInputBuffer[bufferNdx].pVideoBuffer)
161 if (mAudioInputBuffer[bufferNdx].pInfoBuffer)
163 delete [] mAudioInputBuffer[bufferNdx].
pInfoBuffer;
166 if (mAudioInputBuffer[bufferNdx].pAudioBuffer)
178 if (mM31 && !mLastFrame && !mGlobalQuit)
186 for (i = 0; i < timeout; i++)
188 if (mLastFrameVideo && (!mWithAudio || mLastFrameAudio))
break;
192 { cerr <<
"## ERROR: Wait for last frame timeout" << endl; }
196 { cerr <<
"## ERROR: ChangeEHState ready to stop failed" << endl; }
199 { cerr <<
"## ERROR: ChangeEHState stop failed" << endl; }
203 { cerr <<
"## ERROR: ChangeVInState stop failed" << endl; }
209 { cerr <<
"## ERROR: ChangeMainState to init failed" << endl; }
216 while (mVideoInputThread.
Active())
219 while (mVideoProcessThread.
Active())
222 while (mCodecRawThread.
Active())
225 while (mCodecHevcThread.
Active())
228 while (mVideoFileThread.
Active())
231 while (mAudioFileThread.
Active())
260 { cerr <<
"## ERROR: Device '" << mDeviceSpecifier <<
"' not found" << endl;
return AJA_STATUS_OPEN; }
276 cerr <<
"## ERROR: M31 not found" << endl;
281 mM31 =
new CNTV2m31 (&mDevice);
293 if (CNTV2m31::IsPresetVIF(mPreset))
297 mVideoFormat = CNTV2m31::GetPresetVideoFormat(mPreset);
298 mPixelFormat = CNTV2m31::GetPresetFrameBufferFormat(mPreset);
299 mQuad = CNTV2m31::IsPresetUHD(mPreset);
300 mInterlaced = CNTV2m31::IsPresetInterlaced(mPreset);
317 switch (mInputChannel)
339 if(!CNTV2m31::ConvertVideoFormatToPreset(mVideoFormat, mPixelFormat,
false, mPreset))
342 mQuad = CNTV2m31::IsPresetUHD(mPreset);
343 mInterlaced = CNTV2m31::IsPresetInterlaced(mPreset);
363 status = mHevcCommon->
SetupHEVC (mM31, mPreset, mEncodeChannel, mMultiStream, mWithInfo);
372 ostringstream fileName;
374 fileName <<
"raw_" << (mInputChannel+1) <<
".hevc";
376 fileName <<
"raw.hevc";
377 status = mHevcCommon->
CreateHevcFile (fileName.str(), mMaxFrames);
385 ostringstream fileName;
387 fileName <<
"raw_" << (mInputChannel+1) <<
".txt";
389 fileName <<
"raw.txt";
390 status = mHevcCommon->
CreateEncFile (fileName.str(), mMaxFrames);
398 ostringstream fileName;
400 fileName <<
"raw_" << (mInputChannel+1) <<
".aiff";
402 fileName <<
"raw.aiff";
467 else if (mMultiStream)
474 mDevice.
SetVideoFormat (mVideoFormat,
false,
false, mInputChannel);
576 for (
unsigned bufferNdx = 0; bufferNdx <
VIDEO_RING_SIZE; bufferNdx++ )
579 mVideoInputBuffer[bufferNdx].
pVideoBuffer =
new uint32_t [mVideoBufferSize/4];
583 mVideoInputBuffer[bufferNdx].
pInfoBuffer =
new uint32_t [mPicInfoBufferSize/4];
587 mVideoInputCircularBuffer.
Add (& mVideoInputBuffer[bufferNdx]);
592 for (
unsigned bufferNdx = 0; bufferNdx <
VIDEO_RING_SIZE; bufferNdx++ )
595 mVideoRawBuffer[bufferNdx].
pVideoBuffer =
new uint32_t [mVideoBufferSize/4];
599 mVideoRawBuffer[bufferNdx].
pInfoBuffer =
new uint32_t [mPicInfoBufferSize/4];
603 mVideoRawCircularBuffer.
Add (& mVideoRawBuffer[bufferNdx]);
608 for (
unsigned bufferNdx = 0; bufferNdx <
VIDEO_RING_SIZE; bufferNdx++ )
611 mVideoHevcBuffer[bufferNdx].
pVideoBuffer =
new uint32_t [mVideoBufferSize/4];
615 mVideoHevcBuffer[bufferNdx].
pInfoBuffer =
new uint32_t [mEncInfoBufferSize/4];
619 mVideoHevcCircularBuffer.
Add (& mVideoHevcBuffer[bufferNdx]);
626 for (
unsigned bufferNdx = 0; bufferNdx <
AUDIO_RING_SIZE; bufferNdx++ )
629 mAudioInputBuffer[bufferNdx].
pAudioBuffer =
new uint32_t [mAudioBufferSize/4];
632 mAudioInputCircularBuffer.
Add (& mAudioInputBuffer[bufferNdx]);
709 cout << endl <<
"## WARNING: No video signal present on the input connector" << endl;
732 mVideoInputThread.
Start();
755 { cerr <<
"## ERROR: Device '" << mDeviceSpecifier <<
"' not found" << endl;
return; }
793 pVideoData->videoDataSize = pVideoData->videoBufferSize;
794 pVideoData->audioDataSize = 0;
795 pVideoData->lastFrame = mLastFrame;
797 if (mWithAudio && pAudioData)
809 pVideoData->timeCodeDBB = timecode.
fDBB;
810 pVideoData->timeCodeLow = timecode.
fLo;
811 pVideoData->timeCodeHigh = timecode.
fHi;
821 memset(pInfo, 0, pVideoData->infoBufferSize);
827 pPicData->serialNumber = mVideoInputFrameCount;
828 pPicData->ptsValueLow = (uint32_t)(pts & 0xffffffff);
829 pPicData->ptsValueHigh = (uint32_t)((pts >> 32) & 0x1);
830 pPicData->pictureNumber = mVideoInputFrameCount + 1;
837 pPicData->serialNumber = mVideoInputFrameCount*2;
838 pPicData->pictureNumber = mVideoInputFrameCount*2 + 1;
848 pPicData->serialNumber = mVideoInputFrameCount*2 + 1;
849 pPicData->ptsValueLow = (uint32_t)(pts & 0xffffffff);
850 pPicData->ptsValueHigh = (uint32_t)((pts >> 32) & 0x1);
851 pPicData->pictureNumber = mVideoInputFrameCount*2 + 2;
858 if(pVideoData->lastFrame && !mLastFrameInput)
860 printf (
"\nCapture last frame number %d\n", mVideoInputFrameCount );
861 mLastFrameInput =
true;
864 mVideoInputFrameCount++;
866 if (mWithAudio && pAudioData)
897 mVideoProcessThread.
Start();
928 mVideoProcessFrameCount++;
948 mCodecRawThread.
Start();
971 { cerr <<
"## ERROR: Device '" << mDeviceSpecifier <<
"' not found" << endl;
return; }
974 m31 =
new CNTV2m31 (&ntv2Device);
989 m31->RawTransfer(mPreset, mEncodeChannel,
990 (uint8_t*)pFrameData->pVideoBuffer,
991 pFrameData->videoDataSize,
992 (uint8_t*)pFrameData->pInfoBuffer,
993 pFrameData->infoDataSize,
996 m31->RawTransfer(mPreset, mEncodeChannel,
997 (uint8_t*)pFrameData->pVideoBuffer,
998 pFrameData->videoDataSize,
1000 pFrameData->infoDataSize2,
1001 true, pFrameData->lastFrame);
1005 m31->RawTransfer(mPreset, mEncodeChannel,
1006 (uint8_t*)pFrameData->pVideoBuffer,
1007 pFrameData->videoDataSize,
1010 m31->RawTransfer(mPreset, mEncodeChannel,
1011 (uint8_t*)pFrameData->pVideoBuffer,
1012 pFrameData->videoDataSize,
1013 true, pFrameData->lastFrame);
1020 m31->RawTransfer(mEncodeChannel,
1021 (uint8_t*)pFrameData->pVideoBuffer,
1022 pFrameData->videoDataSize,
1023 (uint8_t*)pFrameData->pInfoBuffer,
1024 pFrameData->infoDataSize,
1025 pFrameData->lastFrame);
1029 m31->RawTransfer(mEncodeChannel,
1030 (uint8_t*)pFrameData->pVideoBuffer,
1031 pFrameData->videoDataSize,
1032 pFrameData->lastFrame);
1035 if (pFrameData->lastFrame)
1037 mLastFrameRaw =
true;
1040 mCodecRawFrameCount++;
1057 mCodecHevcThread.
Start();
1080 { cerr <<
"## ERROR: Device '" << mDeviceSpecifier <<
"' not found" << endl;
return; }
1083 m31 =
new CNTV2m31 (&ntv2Device);
1085 while (!mGlobalQuit)
1091 if (!mLastFrameHevc)
1096 uint8_t* pVideoBuffer = (uint8_t*)pFrameData->
pVideoBuffer;
1097 uint8_t* pInfoBuffer = (uint8_t*)pFrameData->pInfoBuffer;
1098 uint32_t videoBufferSize = pFrameData->videoBufferSize;
1102 m31->EncTransfer(mEncodeChannel,
1107 pFrameData->videoDataSize,
1108 pFrameData->infoDataSize,
1109 pFrameData->lastFrame);
1112 pFrameData->videoDataSize = mHevcCommon->
AlignDataBuffer(pVideoBuffer,
1114 pFrameData->videoDataSize,
1119 pFrameData->infoDataSize,
1123 pVideoBuffer = ((uint8_t*)pFrameData->pVideoBuffer) + pFrameData->videoDataSize;
1124 pInfoBuffer = ((uint8_t*)pFrameData->pInfoBuffer) +
sizeof(
HevcEncodedInfo);
1125 videoBufferSize = pFrameData->videoBufferSize - pFrameData->videoDataSize;
1129 m31->EncTransfer(mEncodeChannel,
1134 pFrameData->videoDataSize2,
1135 pFrameData->infoDataSize2,
1136 pFrameData->lastFrame);
1139 pFrameData->videoDataSize2 = mHevcCommon->
AlignDataBuffer(pVideoBuffer,
1141 pFrameData->videoDataSize2,
1146 pFrameData->infoDataSize2,
1152 m31->EncTransfer(mEncodeChannel,
1153 (uint8_t*)pFrameData->pVideoBuffer,
1154 pFrameData->videoBufferSize,
1155 (uint8_t*)pFrameData->pInfoBuffer,
1156 pFrameData->infoBufferSize,
1157 pFrameData->videoDataSize,
1158 pFrameData->infoDataSize,
1159 pFrameData->lastFrame);
1162 pFrameData->videoDataSize = mHevcCommon->
AlignDataBuffer(pFrameData->pVideoBuffer,
1163 pFrameData->videoBufferSize,
1164 pFrameData->videoDataSize,
1167 pFrameData->infoDataSize = mHevcCommon->
AlignDataBuffer(pFrameData->pInfoBuffer,
1168 pFrameData->infoBufferSize,
1169 pFrameData->infoDataSize,
1173 if (pFrameData->lastFrame)
1175 mLastFrameHevc =
true;
1178 mCodecHevcFrameCount++;
1195 mVideoFileThread.
Start();
1213 while (!mGlobalQuit)
1219 if (!mLastFrameVideo)
1222 mHevcCommon->
WriteHevcData(pFrameData->pVideoBuffer, pFrameData->videoDataSize + pFrameData->videoDataSize2);
1227 mHevcCommon->
WriteEncData(pFrameData->pInfoBuffer, pFrameData->infoDataSize);
1232 if (pFrameData->lastFrame)
1234 printf (
"Video file last frame number %d\n", mVideoFileFrameCount );
1235 mLastFrameVideo =
true;
1238 mVideoFileFrameCount++;
1254 mAudioFileThread.
Start();
1272 while (!mGlobalQuit)
1278 if (!mLastFrameAudio)
1281 mHevcCommon->
WriteAiffData(pFrameData->pAudioBuffer, mNumAudioChannels, pFrameData->audioDataSize/mNumAudioChannels/4);
1283 if (pFrameData->lastFrame)
1285 printf (
"Audio file last frame number %d\n", mAudioFileFrameCount );
1286 mLastFrameAudio =
true;
1290 mAudioFileFrameCount++;
1332 std::string timeString;
1333 mTimeCode.
Set(frameNumber);
1335 mTimeCode.
QueryString(timeString, mTimeBase,
false);
1338 mTimeCode.
QueryString(timeString, mTimeBase,
false);
static void CodecRawThreadStatic(AJAThread *pThread, void *pContext)
This is the codec raw thread's static callback function that gets called when the thread starts...
virtual void RouteInputSignal(void)
Sets up device routing for capture.
NTV2FrameRate GetNTV2FrameRateFromVideoFormat(const NTV2VideoFormat inVideoFormat)
virtual NTV2VideoFormat GetSDIInputVideoFormat(NTV2Channel inChannel, bool inIsProgressive=(0))
Returns the video format of the signal that is present on the given SDI input source.
virtual AJAStatus SetupAudio(void)
Sets up everything I need for capturing audio.
virtual void StartVideoProcessThread(void)
Start the video process thread.
static void VideoInputThreadStatic(AJAThread *pThread, void *pContext)
This is the video input thread's static callback function that gets called when the thread starts...
virtual void VideoInputWorker(void)
Repeatedly captures video frames using AutoCirculate and add them to the video input ring...
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...
void SetAJAFrameRate(AJA_FrameRate ajaFrameRate)
virtual bool AddConnection(const NTV2InputXptID inSignalInput, const NTV2OutputXptID inSignalOutput=NTV2_XptBlack)
Adds a connection between a widget's signal input (sink) and another widget's signal output (source)...
AJAStatus Add(FrameDataPtr pInFrameData)
Appends a new frame buffer to me, increasing my frame storage capacity by one frame.
uint32_t * pAudioBuffer
Pointer to host audio buffer.
I interrogate and control an AJA video/audio capture/playout device.
NTV2FrameBufferFormat
Identifies a particular video frame buffer pixel format. See Device Frame Buffer Formats for details...
bool SetBuffers(ULWord *pInVideoBuffer, const ULWord inVideoByteCount, ULWord *pInAudioBuffer, const ULWord inAudioByteCount, ULWord *pInANCBuffer, const ULWord inANCByteCount, ULWord *pInANCF2Buffer=NULL, const ULWord inANCF2ByteCount=0)
Sets my buffers for use in a subsequent call to CNTV2Card::AutoCirculateTransfer. ...
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.
ULWord GetCapturedAudioByteCount(void) const
virtual AJAStatus ProcessVideoFrame(AVHevcDataBuffer *pSrcFrame, AVHevcDataBuffer *pDstFrame, uint32_t frameNumber)
Default do-nothing function for processing the captured frames.
ULWord GetBufferLevel(void) const
virtual void StartVideoFileThread(void)
Start the video file writer thread.
#define AJA_FAILURE(_status_)
NTV2InputSource NTV2ChannelToInputSource(const NTV2Channel inChannel, const NTV2IOKinds inKinds=NTV2_IOKINDS_SDI)
Capture (input) mode, which writes into device SDRAM.
static void CodecHevcThreadStatic(AJAThread *pThread, void *pContext)
This is the codec hevc thread's static callback function that gets called when the thread starts...
uint32_t videoBufferSize
Size of host video buffer (bytes)
struct HevcEncodedInfo HevcEncodedInfo
virtual void SetupAutoCirculate(void)
Initializes AutoCirculate.
Declares the AJATime class.
virtual AJAStatus SetPriority(AJAThreadPriority priority)
virtual bool GetSDIInput3GbPresent(bool &outValue, const NTV2Channel channel)
FrameDataPtr StartConsumeNextBuffer(void)
The thread that's responsible for processing incoming frames – the consumer – calls this function t...
Obtain audio samples from the audio that's embedded in the video HANC.
AJAStatus CreateAiffFile(const std::string &inFileName, uint32_t numChannels, uint32_t maxFrames, uint32_t bufferSize)
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...
void EndConsumeNextBuffer(void)
The consumer thread calls this function to signal that it has finished processing the frame it obtain...
virtual bool AutoCirculateGetStatus(const NTV2Channel inChannel, AUTOCIRCULATE_STATUS &outStatus)
Returns the current AutoCirculate status for the given channel.
virtual void SetupHostBuffers(void)
Sets up my circular buffers.
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.
NTV2EmbeddedAudioInput NTV2ChannelToEmbeddedAudioInput(const NTV2Channel inChannel)
Converts the given NTV2Channel value into its equivalent NTV2EmbeddedAudioInput.
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
Instances of me capture frames in real time from a video signal provided to an input of an AJA device...
This class is a collection of widget input-to-output connections that can be applied all-at-once to a...
virtual class DeviceCapabilities & features(void)
virtual bool SetMultiFormatMode(const bool inEnable)
Enables or disables multi-format (per channel) device operation. If enabled, each device channel can ...
AJA_FrameRate GetAJAFrameRate(NTV2FrameRate frameRate)
AJAStatus DetermineInputFormat(NTV2VideoFormat sdiFormat, bool quad, NTV2VideoFormat &videoFormat)
int64_t FramesToMicroseconds(int64_t frames, bool round=false) const
uint32_t timeCodeHigh
Time code data high.
ULWord GetProcessedFrameCount(void) const
uint32_t audioBufferSize
Size of host audio buffer (bytes)
virtual void StartCodecRawThread(void)
Start the codec raw thread.
uint32_t infoBufferSize
Size of the host information buffer (bytes)
This struct replaces the old RP188_STRUCT.
virtual void VideoFileWorker(void)
Repeatedly removes hevc frame from the hevc ring and writes them to the hevc output file...
UWord GetNumAudioSystems(void)
NTV2EncodeHEVCFileAc(const std::string inDeviceSpecifier="0", const NTV2Channel inChannel=NTV2_CHANNEL1, const M31VideoPreset inM31Preset=M31_FILE_1280X720_420_8_5994p, const NTV2FrameBufferFormat inPixelFormat=NTV2_FBF_10BIT_YCBCR_420PL2, const bool inQuadMode=(0), const uint32_t inAudioChannels=0, const bool inTimeCodeBurn=(0), const bool inInfoData=(0), const uint32_t inMaxFrames=0xffffffff)
Constructs me using the given settings.
virtual bool SetAudioSystemInputSource(const NTV2AudioSystem inAudioSystem, const NTV2AudioSource inAudioSource, const NTV2EmbeddedAudioInput inEmbeddedInput)
Sets the audio source for the given NTV2AudioSystem on the device.
HevcPictureData pictureData
struct HevcPictureData HevcPictureData
Playout (output) mode, which reads from device SDRAM.
ULWord GetDisplayHeight(const NTV2VideoFormat videoFormat)
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...
AJAStatus CreateEncFile(const std::string &inFileName, uint32_t maxFrames)
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.
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 ...
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...
AJAStatus SetupHEVC(CNTV2m31 *pM31, M31VideoPreset preset, M31Channel encodeChannel, bool multiStream, bool withInfo)
ULWord GetVideoActiveSize(const NTV2VideoFormat inVideoFormat, const NTV2FrameBufferFormat inFBFormat, const NTV2VANCMode inVancMode=NTV2_VANCMODE_OFF)
virtual bool SetEveryFrameServices(const NTV2TaskMode m)
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. ...
AJA_PixelFormat GetAJAPixelFormat(NTV2FrameBufferFormat pixelFormat)
static void Sleep(const int32_t inMilliseconds)
Suspends execution of the current thread for a given number of milliseconds.
void WriteEncData(void *pBuffer, uint32_t bufferSize)
virtual ~NTV2EncodeHEVCFileAc()
2: OEM (recommended): device configured by client application(s) with some driver involvement...
uint32_t AlignDataBuffer(void *pBuffer, uint32_t bufferSize, uint32_t dataSize, uint32_t alignBytes, uint8_t fill)
static void VideoFileThreadStatic(AJAThread *pThread, void *pContext)
This is the video file writer thread's static callback function that gets called when the thread star...
virtual bool ApplySignalRoute(const CNTV2SignalRouter &inRouter, const bool inReplace=(0))
Applies the given routing table to the AJA device.
virtual AJAStatus SetupVideo(void)
Sets up everything I need for capturing video.
virtual void Quit(void)
Gracefully stops me from running.
void WriteAiffData(void *pBuffer, uint32_t numChannels, uint32_t numSamples)
ULWord GetDroppedFrameCount(void) const
Specifies channel or FrameStore 8 (or the 8th item).
struct HevcPictureInfo HevcPictureInfo
AJA_EXPORT bool RenderTimeCodeFont(AJA_PixelFormat pixelFormat, uint32_t numPixels, uint32_t numLines)
uint32_t timeCodeLow
Time code data low.
Specifies channel or FrameStore 2 (or the 2nd item).
virtual NTV2DeviceID GetDeviceID(void)
void WriteHevcData(void *pBuffer, uint32_t bufferSize)
virtual AJAStatus Run(void)
Runs me.
uint32_t audioDataSize
Size of audio data (bytes)
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...
Declares the AJAProcess class.
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...
This object specifies the information that will be transferred to or from the AJA device in the CNTV2...
virtual void CodecRawWorker(void)
Repeatedly removes video frames from the raw video ring and transfers them to the codec...
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 GetEveryFrameServices(NTV2TaskMode &m)
#define NTV2_AUDIOSIZE_MAX
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 ...
static const ULWord kDemoAppSignature((((uint32_t)( 'D'))<< 24)|(((uint32_t)( 'E'))<< 16)|(((uint32_t)( 'M'))<< 8)|(((uint32_t)( 'O'))<< 0))
Declares numerous NTV2 utility functions.
uint32_t videoDataSize2
Size of field 2 video data (bytes)
virtual AJAStatus Attach(AJAThreadFunction *pThreadFunction, void *pUserContext)
FrameDataPtr StartProduceNextBuffer(void)
The thread that's responsible for providing frames – the producer – calls this function to populate...
virtual void CodecHevcWorker(void)
Repeatedly transfers hevc frames from the codec and adds them to the hevc ring.
void SetStdTimecodeForHfr(bool bStdTc)
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...
This is returned from the CNTV2Card::AutoCirculateGetStatus function.
bool lastFrame
Indicates last captured frame.
void QueryString(std::string &str, const AJATimeBase &timeBase, bool bDropFrame, bool bStdTcForHfr, AJATimecodeNotation notation=AJA_TIMECODE_LEGACY)
virtual void AudioFileWorker(void)
Repeatedly removes audio samples from the audio input ring and writes them to the audio output file...
1: Standard/Retail: device configured by AJA ControlPanel, service/daemon, and driver.
Specifies channel or FrameStore 1 (or the first item).
virtual bool AutoCirculateStart(const NTV2Channel inChannel, const ULWord64 inStartTime=0)
Starts AutoCirculating the specified channel that was previously initialized by CNTV2Card::AutoCircul...
Declares the NTV2EncodeHEVCFileAc class.
static void AudioFileThreadStatic(AJAThread *pThread, void *pContext)
This is the audio file writer thread's static callback function that gets called when the thread star...
virtual bool SetSDIInLevelBtoLevelAConversion(const NTV2ChannelSet &inSDIInputs, const bool inEnable)
Enables or disables 3G level B to 3G level A conversion at the SDI input(s).
uint32_t * pVideoBuffer
Pointer to host video buffer.
virtual void StartCodecHevcThread(void)
Start the codec hevc thread.
virtual M31VideoPreset GetCodecPreset(void)
Get the codec preset.
ULWord GetDisplayWidth(const NTV2VideoFormat videoFormat)
virtual void VideoProcessWorker(void)
Repeatedly removes video frames from the video input ring, calls a custom video process method and ad...
bool GetInputTimeCode(NTV2_RP188 &outTimeCode, const NTV2TCIndex inTCIndex=NTV2_TCINDEX_SDI1) const
Intended for capture, answers with a specific timecode captured in my acTransferStatus member's acFra...
This structure encapsulates the video and audio buffers used by the HEVC demo applications. The demo programs that employ producer/consumer threads use a fixed number of these buffers.
AJA_EXPORT bool BurnTimeCode(void *pBaseVideoAddress, const std::string &inTimeCodeStr, const uint32_t inYPercent)
virtual void GetStatus(AVHevcStatus &outStatus)
Provides status information about my input (capture) process.
NTV2AudioSystem NTV2ChannelToAudioSystem(const NTV2Channel inChannel)
Converts the given NTV2Channel value into its equivalent NTV2AudioSystem.
uint32_t * pInfoBuffer
Picture information (raw) or encode information (hevc)
bool HasAvailableInputFrame(void) const
Specifies channel or FrameStore 4 (or the 4th item).
Specifies channel or FrameStore 5 (or the 5th item).
bool IsRunning(void) const
uint32_t videoDataSize
Size of video data (bytes)
ULWord fLo
| BG 4 | Secs10 | BG 3 | Secs 1 | BG 2 | Frms10 | BG 1 | Frms 1 |
Specifies channel or FrameStore 6 (or the 6th item).
UWord GetMaxAudioChannels(void)
uint32_t infoDataSize2
Size of the field 2 information data (bytes)
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 ...
static void VideoProcessThreadStatic(AJAThread *pThread, void *pContext)
This is the video process thread's static callback function that gets called when the thread starts...
#define AUTOCIRCULATE_WITH_RP188
Use this to AutoCirculate with RP188.
Specifies channel or FrameStore 7 (or the 7th item).
bool SetAudioBuffer(ULWord *pInAudioBuffer, const ULWord inAudioByteCount)
Sets my audio buffer for use in a subsequent call to CNTV2Card::AutoCirculateTransfer.
8-Bit 4:2:0 2-Plane YCbCr
Identifies the 1st SDI video input.
uint32_t infoDataSize
Size of the information data (bytes)
AJAStatus CreateHevcFile(const std::string &inFileName, uint32_t maxFrames)
virtual void StartAudioFileThread(void)
Start the audio file writer thread.
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...
ULWord fHi
| BG 8 | Hrs 10 | BG 7 | Hrs 1 | BG 6 | Mins10 | BG 5 | Mins 1 |
Declares device capability functions.
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 ...
bool CanDoMultiFormat(void)
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 StartVideoInputThread(void)
Start the video input thread.
NTV2ReferenceSource NTV2InputSourceToReferenceSource(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2ReferenceSource value.
Audio clock derived from the video input.
virtual bool SetEmbeddedAudioClock(const NTV2EmbeddedAudioClock inValue, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Sets the NTV2EmbeddedAudioClock setting for the given NTV2AudioSystem.
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
uint32_t timeCodeDBB
Time code data dbb.
void SetRP188(const uint32_t inDBB, const uint32_t inLo, const uint32_t inHi, const AJATimeBase &inTimeBase)
virtual bool EnableChannel(const NTV2Channel inChannel)
Enables the given FrameStore.