AJA NTV2 SDK  17.6.0.2675
NTV2 SDK 17.6.0.2675
ntv2vcam.cpp File Reference

Implementation of NTV2VCAM class. More...

#include "ntv2vcam.h"
Include dependency graph for ntv2vcam.cpp:

Go to the source code of this file.

Functions

static const ULWord gDemoAppSignature ((((uint32_t)( 'V'))<< 24)|(((uint32_t)( 'C'))<< 16)|(((uint32_t)( 'A'))<< 8)|(((uint32_t)( 'M'))<< 0))
 
static const uint32_t gAudMaxSizeBytes (256 *1024)
 
static bool gGlobalQuit ((0))
 
static void SignalHandler (int inSignal)
 
 if (mAjaDevice.empty())
 
 if (mInputType.empty())
 
 if (mPixelFormatStr.empty())
 
 if (mPixelFormatStr=="list")
 
 if (!((mPixelFormat) >=NTV2_FBF_10BIT_YCBCR &&(mPixelFormat)< NTV2_FBF_NUMFRAMEBUFFERFORMATS))
 
 if (!((mInputChannel) >=NTV2_CHANNEL1 &&(mInputChannel)< NTV2_MAX_NUM_CHANNELS))
 
 if (!CNTV2DeviceScanner::GetFirstDeviceFromArgument(mAjaDevice, mDevice))
 
 if (!mDevice.IsDeviceReady())
 
 if (!mDevice.features().CanDoCapture())
 
 if (mInputType=="hdmi")
 
 if (!mDevice.features().CanDoFrameBufferFormat(mPixelFormat))
 
ULWord appSignature (0)
 
int32_t appPID (0)
 
 if (!mDevice.GetStreamingApplication(appSignature, appPID))
 
 if (!mDoMultiFormat)
 
 if (!mDevice.GetEveryFrameServices(mSavedTaskMode))
 
 if ((((mVideoFormat) >=NTV2_FORMAT_FIRST_4K_DEF_FORMAT &&(mVideoFormat)< NTV2_FORMAT_END_4K_DEF_FORMATS)||((mVideoFormat) >=NTV2_FORMAT_FIRST_UHD_TSI_DEF_FORMAT &&(mVideoFormat)< NTV2_FORMAT_END_UHD_TSI_DEF_FORMAT)||((mVideoFormat) >=NTV2_FORMAT_FIRST_4K_TSI_DEF_FORMAT &&(mVideoFormat)< NTV2_FORMAT_END_4K_TSI_DEF_FORMATS)||((mVideoFormat) >=NTV2_FORMAT_FIRST_4K_DEF_FORMAT2 &&(mVideoFormat)< NTV2_FORMAT_END_4K_DEF_FORMATS2))||(((mVideoFormat) >=NTV2_FORMAT_FIRST_UHD2_DEF_FORMAT &&(mVideoFormat)< NTV2_FORMAT_END_UHD2_DEF_FORMATS)||((mVideoFormat) >=NTV2_FORMAT_FIRST_UHD2_FULL_DEF_FORMAT &&(mVideoFormat)< NTV2_FORMAT_END_UHD2_FULL_DEF_FORMATS))) Get4KInputFormat(mVideoFormat)
 
 if (mVideoFormat==NTV2_FORMAT_UNKNOWN)
 
 if (((mVideoFormat) !=NTV2_FORMAT_UNKNOWN &&(((mVideoFormat) >=NTV2_FORMAT_FIRST_HIGH_DEF_FORMAT &&(mVideoFormat)< NTV2_FORMAT_END_HIGH_DEF_FORMATS)||((mVideoFormat) >=NTV2_FORMAT_FIRST_HIGH_DEF_FORMAT2 &&(mVideoFormat)< NTV2_FORMAT_END_HIGH_DEF_FORMATS2))))
 
 if (!mDevice.EnableChannels(mActiveFrameStores, !mDoMultiFormat))
 
 if (!mDevice.EnableInputInterrupt(mInputChannel))
 
 if (!mDevice.SubscribeOutputVerticalEvent(NTV2_CHANNEL1))
 
 if (mDevice.features().HasBiDirectionalSDI() &&((mInputSource) >=NTV2_INPUTSOURCE_SDI1 &&(mInputSource)<=NTV2_INPUTSOURCE_SDI8))
 
 if (!mDevice.SetMode(mInputChannel, NTV2_MODE_CAPTURE))
 
 if (!mDevice.SetVideoFormat(mVideoFormat,(0),(0), mInputChannel))
 
 if (!mDevice.SetVANCMode(mActiveFrameStores, NTV2_VANCMODE_OFF))
 
 if (!mDevice.SetFrameBufferFormat(mActiveFrameStores, mPixelFormat))
 
mVideoBuffer Allocate (mFormatDesc.GetTotalRasterBytes())
 
mDevice DMABufferLock (mVideoBuffer,(!(0)))
 
 SetupAudio ()
 
NTV2LHIHDMIColorSpace inputColorSpace (NTV2_LHIHDMIColorSpaceYCbCr)
 
 if (((mInputSource) >=NTV2_INPUTSOURCE_HDMI1 &&(mInputSource)<=NTV2_INPUTSOURCE_HDMI4)) mDevice.GetHDMIInputColor(inputColorSpace
 
 if ((((mVideoFormat) >=NTV2_FORMAT_FIRST_UHD2_DEF_FORMAT &&(mVideoFormat)< NTV2_FORMAT_END_UHD2_FULL_DEF_FORMATS))) retVal
 
else if ((((mVideoFormat) >=NTV2_FORMAT_FIRST_4K_DEF_FORMAT &&(mVideoFormat)< NTV2_FORMAT_END_4K_DEF_FORMATS)||((mVideoFormat) >=NTV2_FORMAT_FIRST_UHD_TSI_DEF_FORMAT &&(mVideoFormat)< NTV2_FORMAT_END_UHD_TSI_DEF_FORMAT)||((mVideoFormat) >=NTV2_FORMAT_FIRST_4K_TSI_DEF_FORMAT &&(mVideoFormat)< NTV2_FORMAT_END_4K_TSI_DEF_FORMATS)||((mVideoFormat) >=NTV2_FORMAT_FIRST_4K_DEF_FORMAT2 &&(mVideoFormat)< NTV2_FORMAT_END_4K_DEF_FORMATS2)))
 
 return (!(0))
 

Variables

 mPixelFormat = mPixelFormatStr.empty() ? NTV2_FBF_8BIT_YCBCR : CNTV2DemoCommon::GetPixelFormatFromString(mPixelFormatStr)
 
 else
 
 mVideoFormat = mDevice.GetInputVideoFormat(NTV2ChannelToInputSource(mInputChannel, mIOKinds))
 
 mFormatDesc = NTV2FormatDescriptor(mVideoFormat, mPixelFormat)
 
 mInputChannel
 
NTV2XptConnections connections
 
else retVal = mFrames.setCountOnly(7)
 

Detailed Description

Implementation of NTV2VCAM class.

Definition in file ntv2vcam.cpp.

Function Documentation

◆ Allocate()

mVideoBuffer Allocate ( mFormatDesc.  GetTotalRasterBytes())

◆ appPID()

int32_t appPID ( )

◆ appSignature()

ULWord appSignature ( )

◆ DMABufferLock()

mDevice DMABufferLock ( mVideoBuffer  ,
(!(0))   
)

◆ gAudMaxSizeBytes()

static const uint32_t gAudMaxSizeBytes ( 256 *  1024)
static

◆ gDemoAppSignature()

static const ULWord gDemoAppSignature ( (((uint32_t)('V'))<< 24)|(((uint32_t)('C'))<< 16)|(((uint32_t)('A'))<< 8)|(((uint32_t)('M'))<< 0)  )
static

◆ gGlobalQuit()

static bool gGlobalQuit ( (0)  )
static

◆ if() [1/28]

if ( (mInputChannel) >=NTV2_CHANNEL1 &&(mInputChannel)< NTV2_MAX_NUM_CHANNELS)

Definition at line 718 of file ntv2vcam.cpp.

◆ if() [2/28]

if ( (mPixelFormat) >=NTV2_FBF_10BIT_YCBCR &&(mPixelFormat)< NTV2_FBF_NUMFRAMEBUFFERFORMATS)

Definition at line 711 of file ntv2vcam.cpp.

◆ if() [3/28]

if ( CNTV2DeviceScanner::GetFirstDeviceFromArgumentmAjaDevice, mDevice)

Definition at line 725 of file ntv2vcam.cpp.

◆ if() [4/28]

if ( !mDevice.  EnableChannelsmActiveFrameStores, !mDoMultiFormat)

Definition at line 898 of file ntv2vcam.cpp.

◆ if() [5/28]

if ( !mDevice.  EnableInputInterruptmInputChannel)

Definition at line 905 of file ntv2vcam.cpp.

◆ if() [6/28]

if ( !mDevice.  features).CanDoCapture()

Definition at line 739 of file ntv2vcam.cpp.

◆ if() [7/28]

if ( !mDevice.  features).CanDoFrameBufferFormat(mPixelFormat)

Definition at line 758 of file ntv2vcam.cpp.

◆ if() [8/28]

if ( !mDevice.  GetEveryFrameServicesmSavedTaskMode)

Definition at line 782 of file ntv2vcam.cpp.

◆ if() [9/28]

if ( !mDevice.  GetStreamingApplicationappSignature, appPID)

Definition at line 767 of file ntv2vcam.cpp.

◆ if() [10/28]

if ( !mDevice.  IsDeviceReady())

Definition at line 732 of file ntv2vcam.cpp.

◆ if() [11/28]

if ( !mDevice.  SetFrameBufferFormatmActiveFrameStores, mPixelFormat)

Definition at line 996 of file ntv2vcam.cpp.

◆ if() [12/28]

if ( !mDevice.  SetModemInputChannel, NTV2_MODE_CAPTURE)

Definition at line 944 of file ntv2vcam.cpp.

◆ if() [13/28]

if ( !mDevice.  SetVANCModemActiveFrameStores, NTV2_VANCMODE_OFF)

Definition at line 966 of file ntv2vcam.cpp.

◆ if() [14/28]

if ( !mDevice.  SetVideoFormatmVideoFormat,(0),(0), mInputChannel)

Definition at line 959 of file ntv2vcam.cpp.

◆ if() [15/28]

if ( !mDevice.  SubscribeOutputVerticalEventNTV2_CHANNEL1)

Definition at line 919 of file ntv2vcam.cpp.

◆ if() [16/28]

if ( mDoMultiFormat)

Definition at line 773 of file ntv2vcam.cpp.

◆ if() [17/28]

◆ if() [18/28]

◆ if() [19/28]

◆ if() [20/28]

if ( ((mInputSource) >=NTV2_INPUTSOURCE_HDMI1 &&(mInputSource)<=NTV2_INPUTSOURCE_HDMI4 )

◆ if() [21/28]

◆ if() [22/28]

if ( mAjaDevice.  empty())

Definition at line 679 of file ntv2vcam.cpp.

◆ if() [23/28]

if ( mDevice.  features).HasBiDirectionalSDI() &&((mInputSource) >=NTV2_INPUTSOURCE_SDI1 &&(mInputSource)<=NTV2_INPUTSOURCE_SDI8)

Definition at line 926 of file ntv2vcam.cpp.

◆ if() [24/28]

if ( mInputType.  empty())

Definition at line 685 of file ntv2vcam.cpp.

◆ if() [25/28]

if ( mInputType  = = "hdmi")

Definition at line 746 of file ntv2vcam.cpp.

◆ if() [26/28]

if ( mPixelFormatStr.  empty())

Definition at line 691 of file ntv2vcam.cpp.

◆ if() [27/28]

if ( mPixelFormatStr  = = "list")

Definition at line 705 of file ntv2vcam.cpp.

◆ if() [28/28]

Definition at line 804 of file ntv2vcam.cpp.

◆ inputColorSpace()

◆ return()

return ( 0)

◆ SetupAudio()

SetupAudio ( )

◆ SignalHandler()

static void SignalHandler ( int  inSignal)
static

Definition at line 14 of file ntv2vcam.cpp.

Variable Documentation

◆ connections

NTV2XptConnections connections

Definition at line 1011 of file ntv2vcam.cpp.

◆ else

else
Initial value:
{
{
cerr << "## ERROR: (" << errno << ") Unable to set device's retail service task mode to oem tasks" << endl;
mErrorCode = 41 ;
return (0) ;
}
}
if (mDevice.features().CanDoMultiFormat())
mDevice.SetMultiFormatMode(mDoMultiFormat)

Definition at line 789 of file ntv2vcam.cpp.

◆ mFormatDesc

Definition at line 942 of file ntv2vcam.cpp.

◆ mInputChannel

mInputChannel

Definition at line 1010 of file ntv2vcam.cpp.

◆ mPixelFormat

mPixelFormat = mPixelFormatStr.empty() ? NTV2_FBF_8BIT_YCBCR : CNTV2DemoCommon::GetPixelFormatFromString(mPixelFormatStr)

Definition at line 710 of file ntv2vcam.cpp.

◆ mVideoFormat

mVideoFormat = mDevice.GetInputVideoFormat(NTV2ChannelToInputSource(mInputChannel, mIOKinds))

Definition at line 801 of file ntv2vcam.cpp.

◆ retVal

else retVal = mFrames.setCountOnly(7)

Definition at line 1100 of file ntv2vcam.cpp.

CNTV2Card::SetMultiFormatMode
virtual bool SetMultiFormatMode(const bool inEnable)
Enables or disables multi-format (per channel) device operation. If enabled, each device channel can ...
Definition: ntv2register.cpp:4429
CNTV2Card::features
virtual class DeviceCapabilities & features(void)
Definition: ntv2card.h:148
CNTV2Card::SetEveryFrameServices
virtual bool SetEveryFrameServices(const NTV2EveryFrameTaskMode inMode)
Sets the device's task mode.
Definition: ntv2register.cpp:179
NTV2_OEM_TASKS
@ NTV2_OEM_TASKS
2: OEM (recommended): device configured by client application(s) with some driver involvement.
Definition: ntv2publicinterface.h:4466