VPI - Vision Programming Interface

1.2 Release

EGL Interoperability

EGL is our main vehicle for interoperability with multimedia, camera and graphics APIs. More...

Data Structures

struct  VPIWrapEGLImageParams
 Parameters for customizing EGLImage wrapping. More...
 

Functions

VPIStatus vpiInitWrapEGLImageParams (VPIWrapEGLImageParams *params)
 Initialize VPIWrapEGLImageParams with default values. More...
 
VPIStatus vpiImageCreateEGLImageWrapper (EGLImageKHR eglImage, const VPIWrapEGLImageParams *params, uint32_t flags, VPIImage *img)
 Create an image object by wrapping an existing EGLImage. More...
 
VPIStatus vpiImageSetWrappedEGLImage (VPIImage img, EGLImageKHR eglImage)
 Redefines the wrapped EGLImage of an existing VPIImage wrapper. More...
 
VPIStatus vpiEventCreateEGLSyncWrapper (EGLSyncKHR eglSync, VPIEvent *event)
 Create an event object by wrapping around an EGL sync object created from another client API. More...
 
VPIStatus vpiEventExportEGLSync (VPIEvent event, EGLDisplay eglDpy, EGLSyncKHR *eglSync)
 Export a recorded VPI event to EGL sync object. More...
 

Detailed Description

EGL is our main vehicle for interoperability with multimedia, camera and graphics APIs.

We provide function to export VPIEvent objects to be consumed by other APIs, as well as function to import images and sync objects from them.


Data Structure Documentation

◆ VPIWrapEGLImageParams

struct VPIWrapEGLImageParams

Parameters for customizing EGLImage wrapping.

These parameters are used to customize how EGLImage wrapping will be made. Make sure to call vpiInitWrapEGLImageParams to initialize this structure before updating its attributes. This guarantees that new attributes added in future versions will have a suitable default value assigned.

Definition at line 88 of file EGLInterop.h.

+ Collaboration diagram for VPIWrapEGLImageParams:
Data Fields
VPIColorSpec colorSpec Overriden VPIColorSpec of the wrapped EGLImage.

It it's a valid color spec, override the color spec information in the wrapped EGLImage. If VPI_COLOR_SPEC_DEFAULT, infer the color spec from the wrapped EGLImage.

Function Documentation

◆ vpiEventCreateEGLSyncWrapper()

VPIStatus vpiEventCreateEGLSyncWrapper ( EGLSyncKHR  eglSync,
VPIEvent event 
)

#include <vpi/EGLInterop.h>

Create an event object by wrapping around an EGL sync object created from another client API.

The created event can be used by vpiEventSync / vpiStreamWaitEvent to synchronize VPI tasks with a command queue from an external API.

Warning
This function is currently not implemented.
Parameters
[in]eglSyncEGL sync handle
[out]eventpointer to an event handle
Returns
Always returns VPI_ERROR_NOT_IMPLEMENTED.

◆ vpiEventExportEGLSync()

VPIStatus vpiEventExportEGLSync ( VPIEvent  event,
EGLDisplay  eglDpy,
EGLSyncKHR *  eglSync 
)

#include <vpi/EGLInterop.h>

Export a recorded VPI event to EGL sync object.

The resulting object can be used to allow a command queue belonging to an external API to wait on a recorded VPI event.

The exported EGLSync must be destroyed using eglDestroySyncKHR before the VPI event object is destroyed.

Warning
This function is currently not implemented.
Parameters
[in]eventEvent to be exported.
[in]eglDpyEGL display for which the sync object is being created.
[out]eglSyncExported EGL sync handle
Returns
Always returns VPI_ERROR_NOT_IMPLEMENTED.

◆ vpiImageCreateEGLImageWrapper()

VPIStatus vpiImageCreateEGLImageWrapper ( EGLImageKHR  eglImage,
const VPIWrapEGLImageParams params,
uint32_t  flags,
VPIImage img 
)

#include <vpi/EGLInterop.h>

Create an image object by wrapping an existing EGLImage.

The object doesn't own the wrapped memory. The user is still responsible for wrapped memory lifetime, which must be valid until the array object is destroyed.

The returned handle must be destroyed when not being used anymore by calling vpiImageDestroy.

Parameters
[in]eglImageEGL image created from another client API
[in]paramsIf not NULL, use the parameters to modify how the EGLImage is wrapped. Otherwise, it'll use default EGLImage handling.
[in]flagsImage flags. Here it can be specified in what backends the image can be used by or-ing together VPIBackend flags. Set flags to 0 to enable it in all backends supported by the active VPI context.
[out]imgPointer to memory where the created image handle will be written to.
Returns

◆ vpiImageSetWrappedEGLImage()

VPIStatus vpiImageSetWrappedEGLImage ( VPIImage  img,
EGLImageKHR  eglImage 
)

#include <vpi/EGLInterop.h>

Redefines the wrapped EGLImage of an existing VPIImage wrapper.

The new EGLImage must have the same characteristics (type and dimensions) of the existing EGLImage being wrapped.

The VPIImage must have been created by vpiImageCreateEGLImageWrapper.

This operation is efficient and does not allocate memory. The wrapped memory will be accessible to the same backends specified during wrapper creation.

The wrapped EGLImage must be valid while it's still being wrapped.

Parameters
[in]imgHandle to an image created by vpiImageCreateEGLImageWrapper .
[in]eglImageEGLImage object to be wrapped.
Returns
an error code on failure else VPI_SUCCESS.

◆ vpiInitWrapEGLImageParams()

VPIStatus vpiInitWrapEGLImageParams ( VPIWrapEGLImageParams params)

#include <vpi/EGLInterop.h>

Initialize VPIWrapEGLImageParams with default values.

Default values are:

Parameters
[in]paramsStructure to be initialized with default values.
Returns
VPI_SUCCESS if function succeeded, or VPI_ERROR_INVALID_ARGUMENT is params is NULL.