📄 tmvi.c
字号:
* type (I) describes condition to check for
* state (O) receives current state of specified condition
* Function Result : resulting error condition
*/
extern tmLibdevErr_t
viGetStatus(Int instance, tmVideoStatusType_t type, UInt *state)
{
boardVIConfig_t *boardVIConfig = ((pviInstVars_t)instance)->boardVIConfig;
IS_VALID(instance);
tmAssert(boardVIConfig != Null, VI_ERR_UNINIT_DECODER);
if (boardVIConfig->getStatus)
return boardVIConfig->getStatus(&boardVIConfig->vDec, type, state);
else
return BOARD_ERR_NULL_FUNCTION;
}
/*
* Function : Get information about data services supported by the decoder's text slicer
* Parameters : instance (I) instance
* fieldOne (I) points to buffer receiving supoorted services for each line of field 1
* fieldTwo (I) points to buffer receiving supoorted services for each line of field 2
* tblSize (I) number of lines in fieldOne and fieldTwo
* Function Result : resulting error condition
*/
extern tmLibdevErr_t
viGetSupportedDataServices(Int instance, tmVideoDataService_t fieldOne[], tmVideoDataService_t fieldTwo[], UInt8 tblSize)
{
boardVIConfig_t *boardVIConfig = ((pviInstVars_t)instance)->boardVIConfig;
IS_VALID(instance);
tmAssert(boardVIConfig != Null, VI_ERR_UNINIT_DECODER);
if (boardVIConfig->getSupportedDataServices)
return boardVIConfig->getSupportedDataServices(fieldOne, fieldTwo, tblSize);
else
return BOARD_ERR_NULL_FUNCTION;
}
/*
* Function : Setup the decoder's text slicer for specific service in each line
* Parameters : instance (I) instance
* fieldOne (I) specifies the data service for each line of field 1
* fieldTwo (I) specifies the data service for each line of field 2
* tblSize (I) number of lines in fieldOne and fieldTwo
* Function Result : resulting error condition
*/
extern tmLibdevErr_t
viSetDataServices(Int instance, tmVideoDataService_t fieldOne[], tmVideoDataService_t fieldTwo[], UInt8 tblSize)
{
boardVIConfig_t *boardVIConfig = ((pviInstVars_t)instance)->boardVIConfig;
IS_VALID(instance);
tmAssert(boardVIConfig != Null, VI_ERR_UNINIT_DECODER);
if (boardVIConfig->setDataServices)
return boardVIConfig->setDataServices(&boardVIConfig->vDec, fieldOne, fieldTwo, tblSize);
else
return BOARD_ERR_NULL_FUNCTION;
}
/*
* Function : Get information from the decoder if specified data services have been found
* Parameters : instance (I) instance
* fieldOne (I) buffer receiving True for every line a service has been found
* fieldTwo (I) buffer receiving True for every line a service has been found
* tblSize (I) number of lines in fieldOne and fieldTwo
* Function Result : resulting error condition
*/
extern tmLibdevErr_t
viGetSlicerLineFlags(Int instance, Bool fieldOne[], Bool fieldTwo[], UInt8 tblSize)
{
boardVIConfig_t *boardVIConfig = ((pviInstVars_t)instance)->boardVIConfig;
IS_VALID(instance);
tmAssert(boardVIConfig != Null, VI_ERR_UNINIT_DECODER);
if (boardVIConfig->getSlicerLineFlags)
return boardVIConfig->getSlicerLineFlags(&boardVIConfig->vDec, fieldOne, fieldTwo, tblSize);
else
return BOARD_ERR_NULL_FUNCTION;
}
/*
* Function : Enable the decoder's text slicer
* Parameters : instance (I) instance
* enable (I) True: enable slicer, False otherwise
* Function Result : resulting error condition
* Note : If the decoder has no seperate enable for the slicer it gets turned on and
* off by set the data services (viSetDataServices)
*/
extern tmLibdevErr_t
viEnableSlicing(Int instance, Bool enable)
{
boardVIConfig_t *boardVIConfig = ((pviInstVars_t)instance)->boardVIConfig;
IS_VALID(instance);
tmAssert(boardVIConfig != Null, VI_ERR_UNINIT_DECODER);
if (boardVIConfig->enableSlicing)
return boardVIConfig->enableSlicing(&boardVIConfig->vDec, enable);
else
return BOARD_ERR_NULL_FUNCTION;
}
/*
* Function : Set the text slicer's video standard
* Parameters : instance (I) instance
* standard (I) video standard for the slicer
* Function Result : resulting error condition
* Note : In most decoders this has to match the standard for the active video
*/
extern tmLibdevErr_t
viSetSlicerVideoStandard(Int instance, tmVideoAnalogStandard_t standard)
{
boardVIConfig_t *boardVIConfig = ((pviInstVars_t)instance)->boardVIConfig;
IS_VALID(instance);
tmAssert(boardVIConfig != Null, VI_ERR_UNINIT_DECODER);
if (boardVIConfig->setSlicerVideoStandard)
return boardVIConfig->setSlicerVideoStandard(&boardVIConfig->vDec, standard);
else
return BOARD_ERR_NULL_FUNCTION;
}
/*
* Function : Get the text slicer's video standard
* Parameters : instance (I) instance
* standard (O) receives the slicer's video standard
* Function Result : resulting error condition
*/
extern tmLibdevErr_t
viGetSlicerVideoStandard(Int instance, tmVideoAnalogStandard_t *standard)
{
boardVIConfig_t *boardVIConfig = ((pviInstVars_t)instance)->boardVIConfig;
IS_VALID(instance);
tmAssert(boardVIConfig != Null, VI_ERR_UNINIT_DECODER);
if (boardVIConfig->getSlicerVideoStandard)
return boardVIConfig->getSlicerVideoStandard(&boardVIConfig->vDec, standard);
else
return BOARD_ERR_NULL_FUNCTION;
}
/*
* Function : Toggle the decoder's field ID
* Parameters : instance (I) instance
* toggle (I) True: invert field detection, False otherwise
* Function Result : resulting error condition
*/
extern tmLibdevErr_t
viToggleFieldID(Int instance, Bool toggle)
{
boardVIConfig_t *boardVIConfig = ((pviInstVars_t)instance)->boardVIConfig;
IS_VALID(instance);
tmAssert(boardVIConfig != Null, VI_ERR_UNINIT_DECODER);
if (boardVIConfig->toggleFieldID)
return boardVIConfig->toggleFieldID(&boardVIConfig->vDec, toggle);
else
return BOARD_ERR_NULL_FUNCTION;
}
/*
* Function : Set the slicer's video input
* Parameters : instance (I) instance
* num (I) Input mode for the decoder's slicer
* Function Result : resulting error condition
* Note : If the decoder does not support a different input for active video
* and the text slicer this function will return an error if 'num'
* differs from the current input for active video!
*/
extern tmLibdevErr_t
viSetSlicerInput(Int instance, tmVideoAnalogAdapter_t adapter, UInt adapterInstance)
{
boardVIConfig_t *boardVIConfig = ((pviInstVars_t)instance)->boardVIConfig;
IS_VALID(instance);
tmAssert(boardVIConfig != Null, VI_ERR_UNINIT_DECODER);
if (boardVIConfig->setSlicerInput)
return boardVIConfig->setSlicerInput(&boardVIConfig->vDec, adapter, adapterInstance);
else
return BOARD_ERR_NULL_FUNCTION;
}
/*
* Function : Get the slicer's video input
* Parameters : instance (I) instance
* num (I) receives the current input mode for the decoder's slicer
* Function Result : resulting error condition
*/
extern tmLibdevErr_t
viGetSlicerInput(Int instance, tmVideoAnalogAdapter_t *adapter, UInt *adapterInstance)
{
boardVIConfig_t *boardVIConfig = ((pviInstVars_t)instance)->boardVIConfig;
IS_VALID(instance);
tmAssert(boardVIConfig != Null, VI_ERR_UNINIT_DECODER);
if (boardVIConfig->getSlicerInput)
return boardVIConfig->getSlicerInput(&boardVIConfig->vDec, adapter, adapterInstance);
else
return BOARD_ERR_NULL_FUNCTION;
}
/*
* Function : Set brightness, contrast, saturation, or hue for video input
* Parameters : instance (I) instance
* color (I) defines which color parameter to change
* val (I) contains new value
* Function Result : resulting error condition
*/
extern tmLibdevErr_t
viSetVideoColor(Int instance, tmVideoColor_t color, UInt val)
{
boardVIConfig_t *boardVIConfig = ((pviInstVars_t)instance)->boardVIConfig;
IS_VALID(instance);
tmAssert(boardVIConfig != Null, VI_ERR_UNINIT_DECODER);
if (boardVIConfig->setVideoColor)
return boardVIConfig->setVideoColor(&boardVIConfig->vDec, color, val);
else
return BOARD_ERR_NULL_FUNCTION;
}
/*
* Function : Get brightness, contrast, saturation, or hue for video input
* Parameters : instance (I) instance
* color (I) defines which color parameter to get
* val (O) receives current value
* Function Result : resulting error condition
*/
extern tmLibdevErr_t
viGetVideoColor(Int instance, tmVideoColor_t color, UInt *val)
{
boardVIConfig_t *boardVIConfig = ((pviInstVars_t)instance)->boardVIConfig;
IS_VALID(instance);
tmAssert(boardVIConfig != Null, VI_ERR_UNINIT_DECODER);
if (boardVIConfig->getVideoColor)
return boardVIConfig->getVideoColor(&boardVIConfig->vDec, color, val);
else
return BOARD_ERR_NULL_FUNCTION;
}
/*
* Function : Set the decoder's video input
* Parameters : instance (I) instance
* num (I) defines the new video input
* Function Result : resulting error condition
*/
extern tmLibdevErr_t
viSetAnalogInput(Int instance, tmVideoAnalogAdapter_t adapter, UInt adapterInstance)
{
boardVIConfig_t *boardVIConfig = ((pviInstVars_t)instance)->boardVIConfig;
IS_VALID(instance);
tmAssert(boardVIConfig != Null, VI_ERR_UNINIT_DECODER);
if (boardVIConfig->setAnalogInput)
return boardVIConfig->setAnalogInput(&boardVIConfig->vDec, adapter, adapterInstance);
else
return BOARD_ERR_NULL_FUNCTION;
}
/*
* Function : Get the decoder's current video input
* Parameters : instance (I) instance
* num (O) receives the current video input
* Function Result : resulting error condition
*/
extern tmLibdevErr_t
viGetAnalogInput(Int instance, tmVideoAnalogAdapter_t *adapter, UInt *adapterInstance)
{
boardVIConfig_t *boardVIConfig = ((pviInstVars_t)instance)->boardVIConfig;
IS_VALID(instance);
tmAssert(boardVIConfig != Null, VI_ERR_UNINIT_DECODER);
if (boardVIConfig->getAnalogInput)
return boardVIConfig->getAnalogInput(&boardVIConfig->vDec, adapter, adapterInstance);
else
return BOARD_ERR_NULL_FUNCTION;
}
/*
* Function : Set the decoder's video input standard
* Parameters : instance (I) instance
* standard (I) new video input standard
* Function Result : resulting error condition
*/
extern tmLibdevErr_t
viSetStandard(Int instance, tmVideoAnalogStandard_t standard)
{
boardVIConfig_t *boardVIConfig = ((pviInstVars_t)instance)->boardVIConfig;
IS_VALID(instance);
tmAssert(boardVIConfig != Null, VI_ERR_UNINIT_DECODER);
if (boardVIConfig->setStandard)
return boardVIConfig->setStandard(&boardVIConfig->vDec, standard);
else
return BOARD_ERR_NULL_FUNCTION;
}
/*
* Function : Set the decoder's video source type (VCR, ...)
* Parameters : instance (I) instance
* type (I) new video source type
* Function Result : resulting error condition
*/
extern tmLibdevErr_t
viSetSourceType(Int instance, tmVideoSourceType_t type)
{
boardVIConfig_t *boardVIConfig = ((pviInstVars_t)instance)->boardVIConfig;
IS_VALID(instance);
tmAssert(boardVIConfig != Null, VI_ERR_UNINIT_DECODER);
if (boardVIConfig->setSourceType)
return boardVIConfig->setSourceType(&boardVIConfig->vDec, type);
else
return BOARD_ERR_NULL_FUNCTION;
}
/*
* Function : Get the decoder's video source type (VCR, ...)
* Parameters : instance (I) instance
* type (O) receives current video source type
* Function Result : resulting error condition
*/
extern tmLibdevErr_t
viGetSourceType(Int instance, tmVideoSourceType_t *type)
{
boardVIConfig_t *boardVIConfig = ((pviInstVars_t)instance)->boardVIConfig;
IS_VALID(instance);
tmAssert(boardVIConfig != Null, VI_ERR_UNINIT_DECODER);
if (boardVIConfig->getSourceType)
return boardVIConfig->getSourceType(&boardVIConfig->vDec, type);
else
return BOARD_ERR_NULL_FUNCTION;
}
/*
* Function : Set the decoder's video output format
* Parameters : instance (I) instance
* format (I) new video output format
* Function Result : resulting error condition
*/
extern tmLibdevErr_t
viSetOutputFormat(Int instance, tmVideoRGBYUVFormat_t format)
{
boardVIConfig_t *boardVIConfig = ((pviInstVars_t)instance)->boardVIConfig;
IS_VALID(instance);
tmAssert(boardVIConfig != Null, VI_ERR_UNINIT_DECODER);
if (boardVIConfig->setOutputFormat)
return boardVIConfig->setOutputFormat(&boardVIConfig->vDec, format);
else
return BOARD_ERR_NULL_FUNCTION;
}
/*
* Function : Get the decoder's video output format
* Parameters : instance (I) instance
* format (O) receives current video output format
* Function Result : resulting error condition
*/
extern tmLibdevErr_t
viGetOutputFormat(Int instance, tmVideoRGBYUVFormat_t *format)
{
boardVIConfig_t *boardVIConfig = ((pviInstVars_t)instance)->boardVIConfig;
IS_VALID(instance);
tmAssert(boardVIConfig != Null, VI_ERR_UNINIT_DECODER);
if (boardVIConfig->getOutputFormat)
return boardVIConfig->getOutputFormat(&boardVIConfig->vDec, format);
else
return BOARD_ERR_NULL_FUNCTION;
}
/*
* Function : Set the decoder's video acqusition window
* Parameters : instance (I) instance
* beginX (I) horizontal start of window
* beginY (I) vertical start of window
* endX (I) horizontal end of window
* endY (I) vertical end of window
* Function Result : resulting error condition
*/
extern tmLibdevErr_t
viSetAcquisitionWnd(Int instance, UInt beginX, UInt beginY, UInt endX, UInt endY)
{
boardVIConfig_t *boardVIConfig = ((pviInstVars_t)instance)->boardVIConfig;
IS_VALID(instance);
tmAssert(boardVIConfig != Null, VI_ERR_UNINIT_DECODER);
if (boardVIConfig->setAcquisitionWnd)
return boardVIConfig->setAcquisitionWnd(&boardVIConfig->vDec, beginX, beginY, endX, endY);
else
return BOARD_ERR_NULL_FUNCTION;
}
/*
* Function : Get the decoder's video acqusition window
* Parameters : instance (I) instance
* beginX (O) receives current horizontal start of window
* beginY (O) receives current vertical start of window
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -