get_nvds_buf_surface¶
-
pyds.
get_nvds_buf_surface
(arg0: int, arg1: int) → numpy.ndarray[uint8]¶ - This function returns the frame in NumPy format. Only RGBA format is supported. For x86_64, only CUDA pinned memory is supported. For Jetson, the buffer is mapped to CPU memory.
- arg input
address of the Gstbuffer which contains NvBufSurface
- arg input1
batch_id of the frame to be processed. This indicates the frame’s index within NvBufSurface
nvds_acquire_meta_lock¶
-
pyds.
nvds_acquire_meta_lock
(arg0: pyds.NvDsBatchMeta) → None¶ lock to be acquired before updating metadata
- arg input
An object of type
NvDsBatchMeta
nvds_release_meta_lock¶
-
pyds.
nvds_release_meta_lock
(arg0: pyds.NvDsBatchMeta) → None¶ lock to be released after updating metadata
- arg input
An object of type
NvDsBatchMeta
nvds_create_batch_meta¶
-
pyds.
nvds_create_batch_meta
(arg0: int) → pyds.NvDsBatchMeta¶ Creates a
NvDsBatchMeta
of given batch size.- arg max_batch_size
maximum number of frames those can be present in the batch
- returns
allocated
NvDsBatchMeta
object
nvds_destroy_batch_meta¶
-
pyds.
nvds_destroy_batch_meta
(arg0: pyds.NvDsBatchMeta) → int¶ Deletes/Releases
NvDsBatchMeta
batch_meta object- arg batch_meta
An object of type
NvDsBatchMeta
to be deleted/destroyed after use
nvds_acquire_frame_meta_from_pool¶
-
pyds.
nvds_acquire_frame_meta_from_pool
(arg0: pyds.NvDsBatchMeta) → pyds.NvDsFrameMeta¶ Acquires
NvDsFrameMeta
from frame_meta pool. User must acquire the frame_meta from frame_meta pool to fill frame metatada.- arg batch_meta
An object of type
NvDsBatchMeta
from whichNvDsFrameMeta
will be acquired- returns
acquired
NvDsFrameMeta
object from frame meta pool
nvds_add_frame_meta_to_batch¶
-
pyds.
nvds_add_frame_meta_to_batch
(arg0: pyds.NvDsBatchMeta, arg1: pyds.NvDsFrameMeta) → None¶ After acquiring and filling frame metadata, user must add it to the batch metadata with this API
- arg batch_meta
An object of type
NvDsBatchMeta
to which frame_meta will be attached.- arg frame_meta
An object of type
NvDsFrameMeta
acquired from frame_meta_pool present inNvDsBatchMeta
nvds_remove_frame_meta_from_batch¶
-
pyds.
nvds_remove_frame_meta_from_batch
(arg0: pyds.NvDsBatchMeta, arg1: pyds.NvDsFrameMeta) → None¶ Removes given frame meta from the batch metadata
- arg batch_meta
An object of type
NvDsBatchMeta
from which frame_meta is to be removed.- arg frame_meta
A object of type
NvDsFrameMeta
to be removed from batch_meta.
nvds_acquire_obj_meta_from_pool¶
-
pyds.
nvds_acquire_obj_meta_from_pool
(arg0: pyds.NvDsBatchMeta) → pyds.NvDsObjectMeta¶ - Acquires
NvDsObjectMeta
from the object meta pool User must acquire the object meta from the object meta pool to fill object metatada
- arg batch_meta
An object of type
NvDsBatchMeta
from whichNvDsObjectMeta
will be acquired- returns
acquired
NvDsObjectMeta
object from object meta pool
- Acquires
nvds_remove_obj_meta_from_frame¶
-
pyds.
nvds_remove_obj_meta_from_frame
(arg0: pyds.NvDsFrameMeta, arg1: pyds.NvDsObjectMeta) → None¶ Removes given object meta from the frame metadata
- arg frame_meta
An object of type
NvDsFrameMeta
from which obj_meta is to be removed.- arg obj_meta
An object of type
NvDsObjectMeta
to be removed from frame_meta.
nvds_acquire_classifier_meta_from_pool¶
-
pyds.
nvds_acquire_classifier_meta_from_pool
(arg0: pyds.NvDsBatchMeta) → pyds.NvDsClassifierMeta¶ Acquires
NvDsClassifierMeta
from the classifier meta pool User must acquire the classifier meta from the classifier meta pool to fill classifier metatada- Parameters
batch_meta – An object of type
NvDsBatchMeta
from which
NvDsClassifierMeta
will be acquired- Returns
acquired
NvDsClassifierMeta
object from classifier meta pool
nvds_add_classifier_meta_to_object¶
-
pyds.
nvds_add_classifier_meta_to_object
(arg0: pyds.NvDsObjectMeta, arg1: pyds.NvDsClassifierMeta) → None¶ After acquiring and filling classifier metadata user must add it to the object metadata with this API
- Parameters
obj_meta – An object of type
NvDsObjectMeta
to which classifier_meta will be attached.classifier_meta – An object of type
NvDsClassifierMeta
acquired from
classifier_meta_pool present in @ref NvDsBatchMeta.
nvds_remove_classifier_meta_from_obj¶
-
pyds.
nvds_remove_classifier_meta_from_obj
(arg0: pyds.NvDsObjectMeta, arg1: pyds.NvDsClassifierMeta) → None¶ Removes given classifier meta from object metadata
- Parameters
obj_meta – An object of type
NvDsObjectMeta
from which classifier_meta
is to be removed. :arg classifier_meta: An object of type
NvDsClassifierMeta
to be removed from obj_meta.
nvds_acquire_display_meta_from_pool¶
-
pyds.
nvds_acquire_display_meta_from_pool
(arg0: pyds.NvDsBatchMeta) → pyds.NvDsDisplayMeta¶ Acquires NvDsDisplayMeta from the display meta pool User must acquire the display meta from the display meta pool to
fill display metatada
- Parameters
batch_meta –
- An object of type
NvDsBatchMeta
from which NvDsDisplayMeta
will be acquired.
- returns
acquired
NvDsDisplayMeta
object from display meta pool
- An object of type
nvds_add_display_meta_to_frame¶
-
pyds.
nvds_add_display_meta_to_frame
(arg0: pyds.NvDsFrameMeta, arg1: pyds.NvDsDisplayMeta) → None¶ After acquiring and filling classifier metadata user must add
it to the frame metadata with this API
- Parameters
frame_meta – An object of type
NvDsFrameMeta
to which display_meta will be attached.display_meta – An object of type
NvDsDisplayMeta
acquired from
display_meta_pool present in @ref NvDsBatchMeta.
nvds_remove_display_meta_from_frame¶
-
pyds.
nvds_remove_display_meta_from_frame
(arg0: pyds.NvDsFrameMeta, arg1: pyds.NvDsDisplayMeta) → None¶ Removes given display meta from frame metadata
- Parameters
frame_meta – An object of type
NvDsFrameMeta
from which display_meta is to be removed.- Ag display_meta
An object of type
NvDsDisplayMeta
to be removed from frame_meta.
nvds_acquire_label_info_meta_from_pool¶
-
pyds.
nvds_acquire_label_info_meta_from_pool
(arg0: pyds.NvDsBatchMeta) → pyds.NvDsLabelInfo¶ Acquires
NvDsLabelInfo
from the labelinfo meta poolUser must acquire the labelinfo meta from the labelinfo meta pool to
fill labelinfo metatada
- Parameters
batch_meta – An object of type
NvDsBatchMeta
from whichNvDsLabelInfo
will be acquired- Returns
An object of type
NvDsLabelInfo
object from label info meta pool
nvds_add_label_info_meta_to_classifier¶
-
pyds.
nvds_add_label_info_meta_to_classifier
(arg0: pyds.NvDsClassifierMeta, arg1: pyds.NvDsLabelInfo) → None¶ After acquiring and filling labelinfo metadata user must add
it to the classifier metadata with this API
- arg classifier_meta
An object of type
NvDsClassifierMeta
to which label_info_meta will be attached.- arg label_info_meta
An object of type
NvDsLabelInfo
acquired from label_info_meta_pool present inNvDsBatchMeta
.
nvds_remove_label_info_meta_from_classifier¶
-
pyds.
nvds_remove_label_info_meta_from_classifier
(arg0: pyds.NvDsClassifierMeta, arg1: pyds.NvDsLabelInfo) → None¶ Removes given labelinfo meta from the classifier metadata
- arg classifier_meta
An object of type
NvDsClassifierMeta
from which label_info_meta is to be removed.
- Parameters
label_info_meta – An object of type
NvDsLabelInfo
to be removed from classifier_meta.
nvds_add_user_meta_to_batch¶
-
pyds.
nvds_add_user_meta_to_batch
(arg0: pyds.NvDsBatchMeta, arg1: pyds.NvDsUserMeta) → None¶ After acquiring and filling user metadata user must add it to batch metadata if required at batch level with this API
- Parameters
batch_meta – An object of type
NvDsBatchMeta
to which user_meta will be attached.user_meta – An object of type
NvDsUserMeta
acquired from user_meta_pool present inNvDsBatchMeta
.
nvds_add_user_meta_to_frame¶
-
pyds.
nvds_add_user_meta_to_frame
(arg0: pyds.NvDsFrameMeta, arg1: pyds.NvDsUserMeta) → None¶ After acquiring and filling user metadata user must add
it to frame metadata if required at frame level with this API
- Parameters
frame_meta – An object of type
NvDsFrameMeta
to which user_meta will be attached.user_meta – An object of type
NvDsUserMeta
acquired from user_meta_pool present inNvDsBatchMeta
.
nvds_add_user_meta_to_obj¶
-
pyds.
nvds_add_user_meta_to_obj
(arg0: pyds.NvDsObjectMeta, arg1: pyds.NvDsUserMeta) → None¶ After acquiring and filling user metadata user must add
it to object metadata if required at object level with this API
- Parameters
obj_meta – An object of type
NvDsObjectMeta
to which user_meta will be attached.user_meta – An object of type
NvDsUserMeta
acquired from user_meta_pool presentNvDsBatchMeta
.
nvds_acquire_user_meta_from_pool¶
-
pyds.
nvds_acquire_user_meta_from_pool
(arg0: pyds.NvDsBatchMeta) → pyds.NvDsUserMeta¶ acquires NvDsUserMeta from the user meta pool
User must acquire the user meta from the user meta pool to
fill user metatada
- Parameters
batch_meta – An object of type
NvDsBatchMeta
from whichNvDsUserMeta
will be acquired
nvds_remove_user_meta_from_batch¶
-
pyds.
nvds_remove_user_meta_from_batch
(arg0: pyds.NvDsBatchMeta, arg1: pyds.NvDsUserMeta) → None¶ Removes given user metadata from the batch metadata
- Parameters
batch_meta – An object of type
NvDsBatchMeta
from which user_meta is to be removed.user_meta –
- An object of type
NvDsUserMeta
to be removed from batch_meta.
- returns
acquired
NvDsUserMeta
object from user meta pool
- An object of type
nvds_remove_user_meta_from_frame¶
-
pyds.
nvds_remove_user_meta_from_frame
(arg0: pyds.NvDsFrameMeta, arg1: pyds.NvDsUserMeta) → None¶ Removes given user metadata from the frame metadata
- arg frame_meta
An object of type
NvDsFrameMeta
from which user_meta is to be removed.
- Parameters
user_meta – An object of type
NvDsUserMeta
to be removed from frame_meta.
nvds_remove_user_meta_from_object¶
-
pyds.
nvds_remove_user_meta_from_object
(arg0: pyds.NvDsObjectMeta, arg1: pyds.NvDsUserMeta) → None¶ Removes given user metadata from the object metadata
- Parameters
obj_meta – An object of type
NvDsObjectMeta
from which user_meta is to be removed.user_meta – An object of type
NvDsUserMeta
to be removed from obj_meta.
nvds_get_current_metadata_info¶
-
pyds.
nvds_get_current_metadata_info
(arg0: pyds.NvDsBatchMeta) → int¶ Debug function to get current metadata info
- Parameters
batch_meta – An object of type
NvDsBatchMeta
nvds_batch_meta_copy_func¶
-
pyds.
nvds_batch_meta_copy_func
(arg0: capsule, arg1: capsule) → capsule¶ copy function to copy batch_meta It is called when meta_data needs to copied / transformed
from one buffer to other. meta_data and user_data are passed as arguments.
- arg data
An object of type
NvDsBatchMeta
- arg user_data
An object of user specific data
- returns
an object that can be typecasted tot
NvDsBatchMeta
nvds_batch_meta_release_func¶
-
pyds.
nvds_batch_meta_release_func
(arg0: capsule, arg1: capsule) → None¶ batch_meta release function called when meta_data is going to be released.
- Parameters
data – An object of type
NvDsBatchMeta
user_data – An object of user specific data
nvds_get_nth_frame_meta¶
-
pyds.
nvds_get_nth_frame_meta
(arg0: pyds.GList, arg1: int) → pyds.NvDsFrameMeta¶ - Parameters
frame_meta_list – A list of objects of type
NvDsFrameMeta
index – index at which
NvDsFrameMeta
object needs to be accessed.
- Returns
an object of type
NvDsFrameMeta
from frame_meta_list
nvds_clear_frame_meta_list¶
nvds_clear_obj_meta_list¶
-
pyds.
nvds_clear_obj_meta_list
(arg0: pyds.NvDsFrameMeta, arg1: pyds.GList) → None¶ removes all the object metadata present in the frame metadata
- Parameters
frame_meta – An object of type
NvDsFrameMeta
from whichNvDsObjectMetaList
needs to be clearedmeta_list – An object of type
NvDsObjectMetaList
which needs to be cleared
)pyds;
constexpr const char* nvds_clear_label_info_meta_list=R”pyds( removes all the label info metadata present in classifier metadata
- Parameters
classifier_meta – An object of type
NvDsClassifierMeta
from whichNvDsLabelInfoList
needs to be clearedmeta_list – An object of type
NvDsLabelInfoList
which needs to be cleared
nvds_clear_classifier_meta_list¶
nvds_clear_label_info_meta_list¶
nvds_clear_display_meta_list¶
-
pyds.
nvds_clear_display_meta_list
(arg0: pyds.NvDsFrameMeta, arg1: pyds.GList) → None¶ removes all the display metadata present in the frame metadata
- Parameters
frame_meta – An object of type
NvDsFrameMeta
from which
NvDisplayMetaList
needs to be cleared :arg meta_list: An object of typeNvDisplayMetaList
which needs to be cleared
nvds_clear_batch_user_meta_list¶
-
pyds.
nvds_clear_batch_user_meta_list
(arg0: pyds.NvDsBatchMeta, arg1: pyds.GList) → None¶ removes all the user metadata present in the batch metadata
- Parameters
batch_meta – An object of type
NvDsBatchMeta
from whichNvDsUserMetaList
needs to be clearedmeta_list – An object of type
NvDsUserMetaList
which needs to be cleared
nvds_clear_frame_user_meta_list¶
-
pyds.
nvds_clear_frame_user_meta_list
(arg0: pyds.NvDsFrameMeta, arg1: pyds.GList) → None¶ removes all the user metadata present in the frame metadata
- Parameters
frame_meta – An object of type
NvDsFrameMeta
from whichNvDsUserMetaList
needs to be clearedmeta_list – An object of type
NvDsUserMetaList
which needs to be cleared
nvds_clear_obj_user_meta_list¶
-
pyds.
nvds_clear_obj_user_meta_list
(arg0: pyds.NvDsObjectMeta, arg1: pyds.GList) → None¶ removes all the user metadata present in the object metadata
- Parameters
object_meta – An object of type
NvDsObjectMeta
from whichNvDsUserMetaList
needs to be clearedmeta_list – An object of type
NvDsUserMetaList
which needs to be cleared
nvds_clear_meta_list¶
-
pyds.
nvds_clear_meta_list
(arg0: pyds.NvDsBatchMeta, arg1: pyds.GList, arg2: pyds.NvDsMetaPool) → pyds.GList¶ removes all the metadata elements present in the given metadata list
- Parameters
batch_meta – An object of type
NvDsBatchMeta
meta_list – An object of type
NvDsMetaList
which needs to be clearedmeta_pool – An object of type
NvDsMetaPool
to which list belongs to
- Returns
an object of updated meta list
nvds_copy_batch_user_meta_list¶
-
pyds.
nvds_copy_batch_user_meta_list
(arg0: pyds.GList, arg1: pyds.NvDsBatchMeta) → None¶ deep copy of src_user_meta_list to user meta list present in the
dst_batch_meta.
- Parameters
src_user_meta_list – An obect of type
NvDsUserMetaList
dst_batch_meta – An object of type
NvDsBatchMeta
nvds_copy_frame_user_meta_list¶
-
pyds.
nvds_copy_frame_user_meta_list
(arg0: pyds.GList, arg1: pyds.NvDsFrameMeta) → None¶ deep copy of src_user_meta_list to user meta list present in the
dst_frame_meta.
- Parameters
src_user_meta_list – An object of type
NvDsUserMetaList
dst_frame_meta – An object of type
NvDsFrameMeta
nvds_copy_display_meta_list¶
-
pyds.
nvds_copy_display_meta_list
(arg0: pyds.GList, arg1: pyds.NvDsFrameMeta) → None¶ deep copy of src_display_meta_list to display meta list present in the
dst_frame_meta.
- Parameters
src_display_meta_list – An object of type
NvDisplayMetaList
dst_frame_meta – An object of type
NvDsFrameMeta
nvds_copy_frame_meta_list¶
-
pyds.
nvds_copy_frame_meta_list
(*args, **kwargs)¶ Overloaded function.
nvds_copy_frame_meta_list(arg0: pyds.GList, arg1: pyds.NvDsBatchMeta) -> None
deep copy of src_frame_meta_list to frame meta list present in the dst_batch_meta.
- arg src_frame_meta_list
An object of type
NvDsFrameMetaList
- arg dst_batch_meta
An object of type
NvDsBatchMeta
nvds_copy_frame_meta_list(arg0: pyds.GList, arg1: pyds.NvDsBatchMeta) -> None
nvds_get_user_meta_type¶
-
pyds.
nvds_get_user_meta_type
(arg0: str) → pyds.NvDsMetaType¶ generates a unique user metadata type from the given string describing user specific metadata.
- Parameters
meta_descriptor – A string object describing metadata. The format of the string should be specified as below ORG_NAME.COMPONENT_NAME.METADATA_DESCRIPTION. e.g. (NVIDIA.NVINFER.TENSOR_METADATA)
nvds_copy_obj_meta_list¶
-
pyds.
nvds_copy_obj_meta_list
(arg0: pyds.GList, arg1: pyds.NvDsFrameMeta) → None¶ deep copy of src_obj_meta_list to frame meta list present in the
dst_frame_meta.
- Parameters
src_obj_meta_list – An object of type
NvDsObjectMetaList
dst_frame_meta – An object of type
NvDsFrameMeta
nvds_get_user_meta_type¶
-
pyds.
nvds_get_user_meta_type
(arg0: str) → pyds.NvDsMetaType¶ generates a unique user metadata type from the given string describing user specific metadata.
- Parameters
meta_descriptor – A string object describing metadata. The format of the string should be specified as below ORG_NAME.COMPONENT_NAME.METADATA_DESCRIPTION. e.g. (NVIDIA.NVINFER.TENSOR_METADATA)
gst_buffer_add_nvds_meta¶
-
pyds.
gst_buffer_add_nvds_meta
(arg0: _GstBuffer, arg1: capsule, arg2: capsule, arg3: void* (void*, void*), arg4: void (void*, void*)) → pyds.NvDsMeta¶ Adds GstMeta of type
NvDsMeta
to the GstBuffer and sets the meta_data member ofNvDsMeta
.- Parameters
buffer – GstBuffer to which the function adds metadata.
meta_data – The object to which the function sets the meta_data member of
NvDsMeta
.user_data – A user specific data object
copy_func – The NvDsMetaCopyFunc function to be called when NvDsMeta is to be copied. The function is called with meta_data and user_data as parameters.
release_func – The NvDsMetaReleaseFunc function to be called when NvDsMeta is to be destroyed. The function is called with meta_data and user_data as parameters.
- Returns
A object to the attached
NvDsMeta
object; or NONE in case failure
NvBufSurfaceCreate¶
-
pyds.
NvBufSurfaceCreate
(arg0: pyds.NvBufSurface, arg1: int, arg2: pyds.NvBufSurfaceCreateParams) → int¶ Allocate batch of buffers.
Allocates memory for batchSize buffers and returns in surf object allocated NvBufSurface. params object should have allocation parameters of single object. If size field in params is set, buffer of that size will be allocated and all other parameters (w, h, color format etc.) will be ignored.
Use NvBufSurfaceDestroy to free all the resources.
- Parameters
surf – pointer to allocated batched buffers.
batchSize – batch size of buffers.
params – pointer to NvBufSurfaceCreateParams structure.
- Returns
0 for success, -1 for failure.
NvBufSurfaceDestroy¶
-
pyds.
NvBufSurfaceDestroy
(arg0: pyds.NvBufSurface) → int¶ Free the batched buffers previously allocated through NvBufSurfaceCreate.
- Parameters
surf – An object to NvBufSurface to free.
- Returns
0 for success, -1 for failure.
NvBufSurfaceMap¶
-
pyds.
NvBufSurfaceMap
(arg0: pyds.NvBufSurface, arg1: int, arg2: int, arg3: pyds.NvBufSurfaceMemMapFlags) → int¶ Map HW batched buffers to HOST CPU address space.
Valid for NVBUF_MEM_CUDA_UNIFIED type of memory for dGPU and
NVBUF_MEM_SURFACE_ARRAY and NVBUF_MEM_HANDLE type of memory for Jetson.
This function will fill addr array of NvBufSurfaceMappedAddr field of NvBufSurfaceParams with the CPU mapped memory pointers.
The client must call NvBufSurfaceSyncForCpu() with the virtual address populated by this function before accessing the mapped memory in CPU.
After memory mapping is complete, mapped memory modification must be coordinated between the CPU and hardware device as follows:
CPU: If the CPU modifies any mapped memory, the client must call NvBufSurfaceSyncForDevice() before any hardware device accesses the memory.
Hardware device: If the mapped memory is modified by any hardware device, the client must call NvBufSurfaceSyncForCpu() before CPU accesses the memory.
Use NvBufSurfaceUnMap() to unmap buffer(s) and release any resource.
- Parameters
surf – pointer to NvBufSurface structure.
index – index of buffer in the batch. -1 for all buffers in batch.
plane – index of plane in buffer. -1 for all planes in buffer.
type – flag for mapping type.
- Returns
0 for success, -1 for failure.
NvBufSurfaceUnMap¶
-
pyds.
NvBufSurfaceUnMap
(arg0: pyds.NvBufSurface, arg1: int, arg2: int) → int¶ Unmap the previously mapped buffer(s).
- Parameters
surf – pointer to NvBufSurface structure.
index – index of buffer in the batch. -1 for all buffers in batch.
:arg plane:index of plane in buffer. -1 for all planes in buffer.
- Returns
0 for success, -1 for failure.
NvBufSurfaceCopy¶
-
pyds.
NvBufSurfaceCopy
(arg0: pyds.NvBufSurface, arg1: pyds.NvBufSurface) → int¶ Copy the memory content of source batched buffer(s) to memory of destination
batched buffer(s).
This function can be used to copy source buffer(s) of one memory type to destination buffer(s) of different memory type. e.g. CUDA Host to CUDA Device or malloced memory to CUDA device etc.
Both source and destination NvBufSurface must have same buffer and batch size.
- Parameters
srcSurf – pointer to source NvBufSurface structure.
dstSurf – pointer to destination NvBufSurface structure.
returns: 0 for success, -1 for failure.
NvBufSurfaceSyncForCpu¶
-
pyds.
NvBufSurfaceSyncForCpu
(arg0: pyds.NvBufSurface, arg1: int, arg2: int) → int¶ Syncs the HW memory cache for the CPU.
Valid only for NVBUF_MEM_SURFACE_ARRAY and NVBUF_MEM_HANDLE memory types.
- Parameters
surf – pointer to NvBufSurface structure.
index – index of buffer in the batch. -1 for all buffers in batch.
plane – index of plane in buffer. -1 for all planes in buffer.
- Returns
0 for success, -1 for failure.
NvBufSurfaceSyncForDevice¶
NvBufSurfaceFromFd¶
NvBufSurfaceMemSet¶
-
pyds.
NvBufSurfaceMemSet
(arg0: pyds.NvBufSurface, arg1: int, arg2: int, arg3: int) → int¶ Fill each byte of buffer(s) in NvBufSurface with provided value.
This function can also be used to reset the buffer(s) in the batch.
- Parameters
surf – pointer to NvBufSurface structure.
index – index of buffer in the batch. -1 for all buffers in batch.
plane – index of plane in buffer. -1 for all planes in buffer.
value – value to be set.
- Returns
0 for success, -1 for failure.
NvBufSurfaceMapEglImage¶
-
pyds.
NvBufSurfaceMapEglImage
(arg0: pyds.NvBufSurface, arg1: int) → int¶ Creates an EGLImage from memory of NvBufSurface buffer(s).
Only memory type NVBUF_MEM_SURFACE_ARRAY is supported. This function will set eglImage pointer of NvBufSurfaceMappedAddr field of NvBufSurfaceParams with EGLImageKHR.
This function can be used in scenarios where CUDA operation on Jetson HW memory (NVBUF_MEM_SURFACE_ARRAY) is required. EGLImageKHR provided by this function can then be register with CUDA for further CUDA operations.
- Parameters
surf – pointer to NvBufSurface structure.
index – index of buffer in the batch. -1 for all buffers in batch.
- Returns
0 for success, -1 for failure.