3.3. API Reference¶
MMF system control implements system initialization, System Bindingunbind, Videobuffer poolInitialize, CreateVideobuffer pool, GetMMFversion, gets the current processor IDetc.Function.
This function module provides the following APIs:
CVI_SYS_Init:InitializeMMFsystem.
CVI_SYS_Exit:DeinitializeMMFsystem.
CVI_SYS_Bind:binds a data source to a data receiver.
CVI_SYS_UnBind:unbinds a data source from a data receiver.
CVI_SYS_GetBindbyDest:According toDataReceiveuserGetBindDatasource.
CVI_SYS_GetBindbySrc:According toDatasourceGetBindDataReceiveuser.
CVI_SYS_GetVersion:gets the current MMF software version.
CVI_SYS_GetChipId:gets the current processor ID.
CVI_SYS_Mmap:memory mapping interface.
CVI_SYS_MmapCache:memory mapping interface.
CVI_SYS_Munmap:memory unmapping interface.
CVI_SYS_IonAlloc:allocates ION memory for the user.
CVI_SYS_IonAlloc_Cached:allocates ION memory for the user, thisMemorywillSupport cache.
CVI_SYS_IonFlushCache:flushcache contenttoMemory, andmake cache incontentInvalid.
CVI_SYS_IonInvalidateCache:make cache incontentInvalid.
CVI_SYS_IonFree:releases ION memory for the user.
CVI_SYS_SetVIVPSSMode:SetVI & VPSS Operating Modes.
CVI_SYS_GetVIVPSSMode:GetVI & VPSS Operating Modes.
CVI_SYS_GetModName:gets the string handle corresponding to MOD_ID.
CVI_SYS_GetChipVersion:gets the processor version.
CVI_SYS_GetPowerOnReason:gets the processor power-on reason.
CVI_SYS_GetCurPTS:gets the current timestamp.
CVI_VB_SetConfig:Set MMF video block pool attributes.
CVI_VB_GetConfig:GetMMFVideobuffer poolAttribute.
CVI_VB_Init:InitializeMMFVideobuffer pool.
CVI_VB_Exit:DeinitializeMMFVideobuffer pool.
CVI_VB_GetBlock:gets a video buffer.
CVI_VB_ReleaseBlock:releases an acquired video buffer.
CVI_VB_CreatePool:Create a buffer pool.
CVI_VB_CreateExPool:Create a externalbuffer pool.
CVI_VB_DestroyPool:Destroy a buffer pool.
CVI_VB_PhysAddr2Handle:gets a buffer handle from its physical address.
CVI_VB_Handle2PhysAddr:gets the physical address of a buffer.
CVI_VB_Handle2PoolId:Getaregionblocktheinbuffer poolID
CVI_VB_InquireUserCnt:queries the buffer usage count.
CVI_VB_MmapPool:isabuffer poolmapUserstateVirtual address.
CVI_VB_MunmapPool:isabuffer poolreleaseUserstatemap.
CVI_VB_GetBlockVirAddr:gets the user-space virtual address of a buffer.
CVI_VB_PrintPool:printabuffer poolUseInformation.
CVI_LOG_SetLevelConf:Setetc.level.
CVI_LOG_GetLevelConf:Getetc.level.
3.3.1. CVI_SYS_Init¶
- Description
Initializesystem. includingVideo InputOutput, VideoencodingDecoding, VideooverlayRegion, Video Processing, Audio inputOutputetc.ModulewillbeInitialize.
- Syntax
CVI_S32 CVI_SYS_Init(CVI_VOID);- Parameters
None.
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_sys.h, cvi_comm_sys.h
Library files: libsys.a
- Note
innotCallDeinitializebefore, If multiplesecondaryInitialize, stillwillReturnSuccess, butactualonsystem is not readywillforMMFrunStatushasanyaffect.
- Example
CVI_S32 s32Ret = CVI_FAILURE; CVI_VB_Exit(); CVI_SYS_Exit(); if (pstVbConfig == NULL) { SAMPLE_PRT("input parameter is null, it is invaild!\n"); return CVI_FAILURE; } s32Ret = CVI_SYS_Init(); if (s32Ret != CVI_SUCCESS) { SAMPLE_PRT("CVI_SYS_Init failed!\n"); return CVI_FAILURE; } s32Ret = CVI_VB_SetConfig(pstVbConfig); if (s32Ret != CVI_SUCCESS) { SAMPLE_PRT("CVI_VB_SetConf failed!\n"); CVI_SYS_Exit(); return CVI_FAILURE; } s32Ret = CVI_VB_Init(); if (s32Ret != CVI_SUCCESS) { SAMPLE_PRT("CVI_VB_Init failed!\n"); CVI_SYS_Exit(); return CVI_FAILURE; }- Related Topics
3.3.2. CVI_SYS_Exit¶
- Description
Deinitializesystem. includingVideo InputOutput, VideoencodingDecoding, VideooverlayRegion, Video Processing, Audio inputOutputetc.ModulewillbeDestroyorDisable.
- Syntax
CVI_S32 CVI_SYS_Exit(CVI_VOID);- Parameters
None.
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_sys.h, cvi_comm_sys.h
Library files: libsys.a
- Note
Deinitializetime, If hasblockinginMMFonUser, thenDeinitializewillFailure. If thehasblockinginMMFonCallReturn, thencanSuccessDeinitialize.
- Example
Please refer to CVI_SYS_Init example
- Related Topics
3.3.3. CVI_SYS_Bind¶
- Description
binds a data source to a data receiverInterface.
- Syntax
CVI_S32 CVI_SYS_Bind(const MMF_CHN_S *pstSrcChn, const MMF_CHN_S *pstDestChn);- Parameters
Parameter Name
Description
Input/Output
pstSrcChn
Source channel pointer
Input
pstDestChn
PurposeChannelPointer
Input
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_sys.h, cvi_comm_sys.h
Library files: libsys.a
- Note
systembeforeSupportBinding Relationships, See Table.
sameaDataReceiveuseronlycanBindaDatasource.
Bindisrefers toDatasourceandDataReceiveusercreatebindingrelationship. Bindafter, DatasourcegenerateDatawillautomaticSendgiveReceiveuser.
VIandVDECisDatasource, iswithChannelisSenduser, tootherModuleSendData, UserwillDevice numbersetis0, SDKnotcheckInputDevice number.
VPSSisDataReceiveusertime, iswithDevice (GROUP) isReceiveuser, ReceiveotherModuletoData, UserwillChannel numbersetis0
othercaseneed tospecifiedDevice numberandChannel number.
- Example
None.
- Related Topics
3.3.4. CVI_SYS_UnBind¶
- Description
unbinds a data source from a data receiverInterface.
- Syntax
CVI_S32 CVI_SYS_UnBind(const MMF_CHN_S *pstSrcChn, const MMF_CHN_S *pstDestChn);- Parameters
Parameter Name
Description
Input/Output
pstSrcChn
Source channel pointer
Input
pstDestChn
PurposeChannelPointer
Input
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_sys.h, cvi_comm_sys.h
Library files: libsys.a
- Note
pstDestChnIf nottoBindsourceChannel, thenconnectReturnSuccess. If toBindsourceChannelbutisBindsourceChanneland pstSrcChnnotmatch, thenReturnFailure
- Example
None.
- Related Topics
3.3.5. CVI_SYS_GetBindbyDest¶
- Description
According toDataReceiveuserGetBindDatasource.
- Syntax
CVI_S32 CVI_SYS_GetBindbyDest(const MMF_CHN_S *pstDestChn, MMF_CHN_S *pstSrcChn);- Parameters
Parameter Name
Description
Input/Output
pstDestChn
PurposeChannelPointer
Input
pstSrcChn
Source channel pointer
Output
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_sys.h, cvi_comm_sys.h
Library files: libsys.a
- Note
None.
- Example
None.
- Related Topics
3.3.6. CVI_SYS_GetBindbySrc¶
- Description
According toDatasourceGetBindDataReceiveuser.
- Syntax
CVI_S32 CVI_SYS_GetBindbySrc(const MMF_CHN_S *pstSrcChn, MMF_BIND_DEST_S * pstBindDest);- Parameters
Parameter Name
Description
Input/Output
pstSrcChn
Source channel pointer
Input
pstBindDest
BindPurposeChannelPointer
Output
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_sys.h, cvi_comm_sys.h
Library files: libsys.a
- Note
None.
- Example
None.
- Related Topics
3.3.7. CVI_SYS_GetVersion¶
- Description
gets the current MMF software version.
- Syntax
CVI_S32 CVI_SYS_Get Version(MMF_VERSION_S *pstVersion);- Parameters
Parameter Name
Description
Input/Output
pstVersion
MMFsoftwareversion
Output
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_sys.h, cvi_comm_sys.h
Library files: libsys.a
- Note
None.
- Example
None.
- Related Topics
None.
3.3.8. CVI_SYS_GetChipId¶
- Description
GetcurrentProcessor ID.
- Syntax
CVI_S32 CVI_SYS_GetChipId(CVI_U32 *pu32ChipId);- Parameters
Parameter Name
Description
Input/Output
pu32ChipId
Processor IDPointer
Output
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_sys.h, cvi_comm_sys.h
Library files: libsys.a
- Note
None.
- Example
CVI_U32 u32ChipId; CVI_SYS_GetChipId(&u32ChipId); if (u32ChipId == CVI181x) ...- Related Topics
None.
3.3.9. CVI_SYS_Mmap¶
- Description
memory mapping interface.
- Syntax
void *CVI_SYS_Mmap(CVI_U64 u64PhyAddr, CVI_U32 u32Size);- Parameters
Parameter Name
Description
Input/Output
u64PhyAddr
Starting address of the memory unit to map
Input
u32Size
Number of mapped bytes
Input
- Return Value
Return Value
Description
Non-zero
Success
0
Failure
- Requirements
Header files: cvi_sys.h, cvi_comm_sys.h
Library files: libsys.a
- Note
The input address must be a valid physical address.
u32Size cannot be 0
- Example
None.
- Related Topics
3.3.10. CVI_SYS_MmapCache¶
- Description
memory mapping interface.
- Syntax
void *CVI_SYS_MmapCache(CVI_U64 u64PhyAddr, CVI_U32 u32Size);- Parameters
Parameter Name
Description
Input/Output
u64PhyAddr
Starting address of the memory unit to map
Input
u32Size
Number of mapped bytes
Input
- Return Value
Return Value
Description
Non-zero
Success
0
Failure
- Requirements
Header files: cvi_sys.h, cvi_comm_sys.h
Library files: libsys.a
- Note
The input address must be a valid physical address.
u32Size cannot be 0
The virtual address obtained through this API may be shared with the HW DMA. Call invalidate before processor access; after the processor modifies it, call flush so that the HW DMA can read it.
thisAPIonlycanused to mapalreadyallocateCachedMemoryAddress. For example, If vb poolVB_POOL_CONFIG_SMediumenRemapModeAttributeisVB_REMAP_MODE_NONE, thenthat ismakethroughthisAPIGet Virtual address, inMemoryblocktime, alsoNonemethodGetCachedMemorytoperformanceprovide.
- Example
None.
- Related Topics
3.3.11. CVI_SYS_Munmap¶
- Description
memory unmapping interface.
- Syntax
CVI_S32 CVI_SYS_ Munmap(CVI_VOID *pVirAddr, CVI_U32 u32Size);- Parameters
Parameter Name
Description
Input/Output
pVirAddr
mmapafterReturnAddress
Input
u32Size
Number of mapped bytes
Input
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_sys.h, cvi_comm_sys.h
Library files: libsys.a
- Note
None.
- Example
None.
- Related Topics
3.3.12. CVI_SYS_IonAlloc¶
- Description
allocates ION memory for the user.
- Syntax
CVI_S32 CVI_SYS_IonAlloc(CVI_U64 *pu64PhyAddr, CVI_VOID **ppVirAddr, const CVI_CHAR *strName, CVI_U32 u32Len);- Parameters
Parameter Name
Description
Input/Output
pu64PhyAddr
PhysicalAddressPointer
Output
ppVirAddr
Virtual addressPointerPointer. If isNULL, thennotwillperformmap
Output
strName
allocate ION Memoryname
Input
u32Len
Size
Input
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_sys.h, cvi_comm_sys.h
Library files: libsys.a
- Note
throughthisAPItheallocateMemory, need tothroughCVI_SYS_MmapGetitsVirtual address.
- Example
None.
- Related Topics
3.3.13. CVI_SYS_IonAlloc_Cached¶
- Description
allocates ION memory for the user, thisMemorywillSupport cache.
- Syntax
CVI_S32 CVI_SYS_IonAlloc_Cached(CVI_U64 *pu64PhyAddr, CVI_VOID **ppVirAddr, const CVI_CHAR *strName, CVI_U32 u32Len);- Parameters
Parameter Name
Description
Input/Output
pu64PhyAddr
PhysicalAddressPointer.
Output
ppVirAddr
Virtual addressPointerPointer. If isNULL, thennotwillperformmap.
Output
strName
allocate ION Memoryname
Input
u32Len
Size.
Input
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_sys.h, cvi_comm_sys.h
Library files: libsys.a
- Note
The virtual address obtained through this API may be shared with the HW DMA. Call invalidate before processor access; after the processor modifies it, call flush so that the HW DMA can read it.
throughthisAPItheallocateMemory, need tothroughCVI_SYS_MmapCacheGetitsVirtual address.
- Example
None.
- Related Topics
3.3.14. CVI_SYS_IonFlushCache¶
- Description
flushcache contenttoMemory, andmake cache incontentInvalid.
- Syntax
CVI_S32 CVI_SYS_IonFlushCache(CVI_U64 u64PhyAddr, CVI_VOID *pVirAddr, CVI_U32 u32Len);- Parameters
Parameter Name
Description
Input/Output
pu64PhyAddr
PhysicalAddressPointer.
Input
pVirAddr
Virtual address pointer.
Input
u32Len
Size.
Input
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_sys.h, cvi_comm_sys.h
Library files: libsys.a
- Note
This interface should be used with CVI_SYS_IonAlloc_Cached Use together with the interface.
- Example
None.
- Related Topics
3.3.15. CVI_SYS_IonInvalidateCache¶
- Description
make cache incontentInvalid.
- Syntax
CVI_S32 CVI_SYS_IonInvalidateCache(CVI_U64 u64PhyAddr, CVI_VOID *pVirAddr, CVI_U32 u32Len);- Parameters
Parameter Name
Description
Input/Output
pu64PhyAddr
PhysicalAddressPointer.
Input
pVirAddr
Virtual address pointer.
Input
u32Len
Size.
Input
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_sys.h, cvi_comm_sys.h
Library files: libsys.a
- Note
This interface should be used with CVI_SYS_IonAlloc_Cached Use together with the interface.
- Example
None.
- Related Topics
3.3.16. CVI_SYS_IonFree¶
- Description
releases ION memory for the user.
- Syntax
CVI_S32 CVI_SYS_IonFree(CVI_U64 u64PhyAddr, CVI_VOID *pVirAddr);- Parameters
Parameter Name
Description
Input/Output
u64PhyAddr
PhysicalAddressPointer.
Input
pVirAddr
Virtual address pointer.
Input
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_sys.h, cvi_comm_sys.h
Library files: libsys.a
- Note
IONMemorynotcanRelease.
- Example
None.
- Related Topics
3.3.17. CVI_SYS_SetVIVPSSMode¶
- Description
SetVI & VPSSOperating mode.
- Syntax
CVI_S32 CVI_SYS_SetVIVPSSMode(const VI_VPSS_MODE_S *pstVIVPSSMode);- Parameters
Parameter Name
Description
Input/Output
pstVIVPSSMode
VI, VPSS Operating Modes
Input
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_sys.h, cvi_comm_sys.h
Library files: libsys.a
- Note
mustin CVI_SYS_Init after, thehasVI PIPEandthehasVPSSgroupCreatebeforeSet.
- Example
None.
- Related Topics
3.3.18. CVI_SYS_GetVIVPSSMode¶
- Description
GetVI & VPSS Operating Modes.
- Syntax
CVI_S32 CVI_SYS_GetVIVPSSMode(VI_VPSS_MODE_S *pstVIVPSSMode);- Parameters
Parameter Name
Description
Input/Output
pstVIVPSSMode
VI, VPSS Operating Modes
Output
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_sys.h, cvi_comm_sys.h
Library files: libsys.a
- Note
None.
- Example
None.
- Related Topics
3.3.19. CVI_SYS_GetModName¶
- Description
gets the string handle corresponding to MOD_ID.
- Syntax
const CVI_CHAR *CVI_SYS_GetModName(MOD_ID_E id);- Parameters
Parameter Name
Description
Input/Output
id
MOD_ID_E
Input
- Return Value
Return Value
Description
const CVI_CHAR *
MOD_IDcharacterhandle
NULL
Failure
- Requirements
Header files: cvi_sys.h, cvi_comm_sys.h
Library files: libsys.a
- Note
None.
- Example
None.
- Related Topics
None.
3.3.20. CVI_SYS_GetChipVersion¶
- Description
gets the processor version.
- Syntax
CVI_S32 CVI_SYS_GetChipVersion(CVI_U32 *pu32ChipVersion);- Parameters
Parameter Name
Description
Input/Output
pu32ChipVersion
Processorversion
Output
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_sys.h
Library files: libsys.a
- Note
None.
- Example
None.
- Related Topics
3.3.21. CVI_SYS_GetPowerOnReason¶
- Description
gets the processor power-on reason.
- Syntax
CVI_S32 CVI_SYS_GetPowerOnReason(CVI_U32 *pu32PowerOnReason);- Parameters
Parameter Name
Description
Input/Output
pu32PowerOnReason
Processorpower-onreason
Output
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_sys.h
Library files: libsys.a
- Note
None.
- Example
None.
- Related Topics
None.
3.3.22. CVI_SYS_GetCurPTS¶
- Description
gets the current timestamp.
- Syntax
CVI_S32 CVI_SYS_GetCurPTS(CVI_U64 *pu64CurPTS);- Parameters
Parameter Name
Description
Input/Output
pu64CurPTS
currentTimestamp
Output
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_sys.h
Library files: libsys.a
- Note
None.
- Example
None.
- Related Topics
None.
3.3.23. CVI_VB_SetConfig¶
- Description
Set MMF video block pool attributes.
- Syntax
CVI_S32 CVI_VB_SetConfig(const VB_CONFIG_S *pstVbConfig);- Parameters
Parameter Name
Description
Input/Output
pstVbConfig
Video block pool attribute pointer
Input
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_vb.h, cvi_comm_vb.h
Library files: libsys.a
- Note
onlycaninsystemtonot initializedStatusunder, canSetbuffer poolAttribute, otherwise, it returnsFailure.
video buffer According tonotsameapplicationsceneneed tonotsameConfiguration. ConfigurationthenSee Video Memory Block Pool.
commonbuffer poolineachregionblockSizeshouldAccording tocurrentImagePixel formatandImageWhetherCompressionwhilehasthenotsame. specificallocateSizePlease refer to VB_CONFIG_S StructureinDescription.
- Example
Please refer to CVI_SYS_Init example
- Related Topics
3.3.24. CVI_VB_GetConfig¶
- Description
GetMMFVideobuffer poolAttribute.
- Syntax
CVI_S32 CVI_VB_GetConfig(VB_CONFIG_S *pstVbConfig);- Parameters
Parameter Name
Description
Input/Output
pstVbConfig
Video block pool attribute pointer
Output
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_vb.h, cvi_comm_vb.h
Library files: libsys.a
- Note
must firstCall CVI_VB_SetConfig Set MMF video block pool attributes.
- Example
None.
- Related Topics
3.3.25. CVI_VB_Init¶
- Description
InitializeMMFVideobuffer pool.
- Syntax
CVI_S32 CVI_VB_Init(CVI_VOID);- Parameters
None.
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_vb.h, cvi_comm_vb.h
Library files: libsys.a
- Note
must firstCallCVI_VB_SetConfigConfigurationbuffer poolAttribute, thenInitialize, otherwiseInitializewillFailure.
If multiplesecondaryInitialize, stillwillReturnSuccess, butactualonsystem is not readywillforMMFrunStatushasanyaffect.
- Example
Please refer to CVI_SYS_Init example
- Related Topics
3.3.26. CVI_VB_Exit¶
- Description
DeinitializeMMFVideobuffer pool.
- Syntax
CVI_S32 CVI_VB_Exit(CVI_VOID);- Parameters
None.
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_vb.h, cvi_comm_vb.h
Library files: libsys.a
- Note
must firstCall CVI_SYS_Exit Deinitialize MMFsystem, thenDeinitializebuffer pool, otherwise, it returnsFailure.
canDeinitialize, notReturnFailure
- Example
Please refer to CVI_SYS_Init example
- Related Topics
3.3.27. CVI_VB_GetBlock¶
- Description
gets a video buffer.
- Syntax
VB_BLK CVI_VB_GetBlock(VB_POOL Pool, CVI_U32 u32BlkSize);- Parameters
Parameter Name
Description
Input/Output
Pool
buffer poolIDnumber. Value Range: [0, VB_MAX_POOLS).
Input
u32BlkSize
regionblockSize. Value Range: Data TypesfullRange, withbyteas the unit.
Input
- Return Value
Return Value
Description
Non-VB_INVALID_HANDLE
Valid block handle.
VB_INVALID_HANDLE
GetFailure.
- Requirements
Header files: cvi_vb.h, cvi_comm_vb.h
Library files: libsys.a
- Note
UserinCreatebuffer poolafter that, canCallthisInterfacefromthisbuffer poolintoGetregionblock; the 2 itemParameter u32BlkSize mustless thanoretc.toCreatethisbuffer pooltimespecifiedregionblockSize.
the 1itemParameter Pool SetisInvalid ID number VB_INVALID_POOLID time, willfromcommonbuffer poolinGetoneblockdescriptorcombinedspecifiedSizeregionblock; of, thenwillfromspecifiedPoolgoGetoneblockspecifiedSizeregionblock. If specifiedSizeNonemethoddescriptorcombined, willGetnottoregionblock.
commonbuffer poolmaintostore VPU (VI/VPSS/VO/GDC) Image. becauseismultipleModule, therefore, When forcommonbuffer poolnotWhen operation (ifusagemultipleregionblock) willaffectitemMMF systemnormalrun.
- Example
None.
- Related Topics
3.3.28. CVI_VB_ReleaseBlock¶
- Description
releases an acquired video buffer.
- Syntax
CVI_S32 CVI_VB_ReleaseBlock(VB_BLK Block);- Parameters
Parameter Name
Description
Input/Output
Block
Block handle
Input
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_vb.h, cvi_comm_vb.h
Library files: libsys.a
- Note
GetregionblockUseafter, shouldthisCallthisInterfaceReleaseregionblock.
- Example
None.
- Related Topics
3.3.29. CVI_VB_CreatePool¶
- Description
Create a buffer pool.
- Syntax
VB_POOL CVI_VB_CreatePool(VB_POOL_CONFIG_S *pstVbPoolCfg);- Parameters
Parameter Name
Description
Input/Output
pstVbPoolCfg
buffer poolConfigurationAttributeParameterPointer.
Input
- Return Value
Return Value
Description
Non-VB_INVALID_HANDLE
Valid block pool ID number.
VB_INVALID_HANDLE
Createbuffer poolFailure, cancanisParameterIllegaloruserretainMemorynotenough.
- Requirements
Header files: cvi_vb.h, cvi_comm_vb.h
Library files: libsys.a
- Note
None.
- Example
None.
- Related Topics
3.3.30. CVI_VB_CreateExPool¶
- Description
Create a externalbuffer pool.
- Syntax
VB_POOL CVI_VB_CreateExPool(VB_POOL_CONFIG_EX_S *pstVbPoolExCfg);- Parameters
Parameter Name
Description
Input/Output
pstVbPoolExCfg
externalbuffer poolConfigurationAttributeParameterPointer.
Input
- Return Value
Return Value
Description
Non-VB_INVALID_HANDLE
Valid block pool ID number.
VB_INVALID_HANDLE
Createbuffer poolFailure, cancanisParameterIllegaloruserretainMemorynotenough.
- Requirements
Header files: cvi_vb.h, cvi_comm_vb.h
Library files: libsys.a
- Note
None.
- Example
None.
- Related Topics
None.
3.3.31. CVI_VB_DestroyPool¶
- Description
Destroy a buffer pool.
- Syntax
CVI_S32 CVI_VB_DestroyPool(VB_POOL Pool);- Parameters
Parameter Name
Description
Input/Output
Pool
buffer poolIDnumber. Value Range: [0, VB_MAX_POOLS).
Input
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_vb.h, cvi_comm_vb.h
Library files: libsys.a
- Note
Destroy a does not existbuffer pool, thenReturnCVI_ERR_VB_ILLEGAL_PARAM.
inDeinitializeMMF buffer pooltime, thehasbuffer poolwillbeDestroy, includingUserstatebuffer pool.
exitVB poolbeforepleaseensureVB poolinanyVB nothasbeusage, otherwiseNonemethodexit.
[0, VB_MAX_POOLS)Rangeinbuffer poolID number, includingcommonbuffer pool, Modulecommonbuffer pool, Modulehasbuffer pooletc.ID number. pleaseensurePoolis CVI_VB_CreatePool theCreatebuffer poolID number, otherwise, it returnsFailure.
If currentbuffer poolhasthrough CVI_VB_MmapPool InterfaceVirtual address, thenmust firstthrough CVI_VB_MunmapPool Interfacereleasemap, Then, canDestroybuffer pool.
- Example
None.
- Related Topics
3.3.32. CVI_VB_PhysAddr2Handle¶
- Description
byaalreadyGetregionblockPhysicalAddressGethandle.
- Syntax
VB_BLK CVI_VB_PhysAddr2Handle(CVI_U64 u64PhyAddr);- Parameters
Parameter Name
Description
Input/Output
u64PhyAddr
regionblockPhysicalAddress
Input
- Return Value
Return Value
Description
Non-VB_INVALID_HANDLE
Valid block handle.
VB_INVALID_HANDLE
GetFailure.
- Requirements
Header files: cvi_vb.h, cvi_comm_vb.h
Library files: libsys.a
- Note
PhysicalAddressshouldthisisfromMMFVideobuffer poolinGetValidregionblockAddress.
- Example
None.
- Related Topics
None.
3.3.33. CVI_VB_Handle2PhysAddr¶
- Description
byaalreadyGetBlock handleGetPhysicalAddress.
- Syntax
CVI_U64 CVI_VB_Handle2PhysAddr(VB_BLK Block);- Parameters
Parameter Name
Description
Input/Output
Block
Block handle
Input
- Return Value
Return Value
Description
Non-zero
ValidPhysicalAddress.
0
Invalid return value; the block handle is illegal.
- Requirements
Header files: cvi_vb.h, cvi_comm_vb.h
Library files: libsys.a
- Note
The block must be a valid block obtained from the MMF video block pool.
- Example
None.
- Related Topics
None.
3.3.34. CVI_VB_Handle2PoolId¶
- Description
byaalreadyGetBlock handleGetVideobuffer poolID.
- Syntax
VB_POOL CVI_VB_Handle2PoolId(VB_BLK Block);- Parameters
Parameter Name
Description
Input/Output
Block
Block handle
Input
- Return Value
Return Value
Description
VB_INVALID_POOLID
ValidVideobuffer poolID.
VB_INVALID_POOLID
Invalid return value; the block handle is illegal.
- Requirements
Header files: cvi_vb.h, cvi_comm_vb.h
Library files: libsys.a
- Note
The block must be a valid block obtained from the MMF video block pool.
- Example
None.
- Related Topics
None.
3.3.35. CVI_VB_InquireUserCnt¶
- Description
byaalreadyGetBlock handleGetstorageblockUsenumber.
- Syntax
CVI_S32 CVI_VB_InquireUserCnt(VB_BLK Block, CVI_U32 *pCnt);- Parameters
Parameter Name
Description
Input/Output
Block
Block handle
Input
pCnt
regionblockUsenumber
Output
- Return Value
Return Value
Description
number
Usenumber.
number
Invalid return value; the block handle is illegal.
- Requirements
Header files: cvi_vb.h, cvi_comm_vb.h
Library files: libsys.a
- Note
None.
- Example
None.
- Related Topics
None.
3.3.36. CVI_VB_MmapPool¶
- Description
isaVideobuffer poolmapUserstateVirtual address.
- Syntax
CVI_S32 CVI_VB_MmapPool(VB_POOL Pool);- Parameters
Parameter Name
Description
Input/Output
Pool
cachepoolID number. Value Range: [0, VB_MAX_POOLS).
Input
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_vb.h, cvi_comm_vb.h
Library files: libsys.a
- Note
A valid video block pool ID must be input.
repeatmapisSuccess.
- Example
None.
- Related Topics
None.
3.3.37. CVI_VB_MunmapPool¶
- Description
isaVideobuffer poolreleaseUserstatemap.
- Syntax
CVI_S32 CVI_VB_MunmapPool(VB_POOL Pool);- Parameters
Parameter Name
Description
Input/Output
Pool
Block pool ID number. Value range: [0, VB_MAX_POOLS).
Input
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_vb.h, cvi_comm_vb.h
Library files: libsys.a
- Note
A valid video block pool ID must be input.
The video block pool must already be mapped. If it is not mapped, CVI_ERR_VB_NOTREADY is returned directly.
must firstReleaseVirtual address, Then, thenDestroybuffer pool.
- Example
None.
- Related Topics
None.
3.3.38. CVI_VB_GetBlockVirAddr¶
- Description
GetaVideobuffer poolinregionblockUserstateVirtual address.
- Syntax
CVI_S32 CVI_VB_GetBlockVirAddr(VB_POOL Pool, VB_BLK Block, void **ppVirAddr);- Parameters
Parameter Name
Description
Input/Output
Pool
Block pool ID number. Value range: [0, VB_MAX_POOLS).
Input
Block
Block handle
Input
ppVirAddr
UserstateVirtual address.
Output
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_vb.h, cvi_comm_vb.h
Library files: libsys.a
- Note
mustInputvalidVideobuffer poolID, validBlock handle.
The video block pool must already be mapped. If it is not mapped, CVI_ERR_VB_NOTREADY is returned directly.
If PhysicalAddressnotincurrentVB poolRangein, thenReturnCVI_ERR_VB_ILLEGAL_PARAM.
- Example
None.
- Related Topics
None.
3.3.39. CVI_VB_PrintPool¶
- Description
printabuffer poolUseInformation.
- Syntax
CVI_VOID CVI_VB_PrintPool(VB_POOL Pool);- Parameters
Parameter Name
Description
Input/Output
Pool
Block pool ID number. Value range: [0, VB_MAX_POOLS).
Input
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_vb.h, cvi_comm_vb.h
Library files: libsys.a
- Note
None.
- Example
None.
- Related Topics
None.
3.3.40. CVI_LOG_SetLevelConf¶
- Description
Setetc.level.
- Syntax
CVI_S32 CVI_LOG_SetLevelConf(LOG_LEVEL_CONF_S *pstConf);- Parameters
Parameter Name
Description
Input/Output
pstConf
etc.levelInformationStructure
Input
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_sys.h, cvi_comm_sys.h, cvi_debug.h
Library files: libsys.a
- Note
None.
- Example
None.
- Related Topics
3.3.41. CVI_LOG_GetLevelConf¶
- Description
Getetc.level.
- Syntax
CVI_S32 CVI_LOG_GetLevelConf(LOG_LEVEL_CONF_S *pstConf);- Parameters
Parameter Name
Description
Input/Output
pstConf->enModId
need toGetetc.levelModuleID
Input
pstConf->s32Level
Gettoetc.level
Output
- Return Value
Return Value
Description
0
Success
Non-zero
Failure; see Error Codes.
- Requirements
Header files: cvi_sys.h, cvi_comm_sys.h, cvi_debug
Library files: libsys.a
- Note
None.
- Example
None.
- Related Topics