Skip to main content

vaExportSurfaceHandle

Function vaExportSurfaceHandle 

Source
pub unsafe extern "C" fn vaExportSurfaceHandle(
    dpy: VADisplay,
    surface_id: VASurfaceID,
    mem_type: u32,
    flags: u32,
    descriptor: *mut c_void,
) -> VAStatus
Expand description

\brief Export a handle to a surface for use with an external API

The exported handles are owned by the caller, and the caller is responsible for freeing them when no longer needed (e.g. by closing DRM PRIME file descriptors).

This does not perform any synchronisation. If the contents of the surface will be read, vaSyncSurface() must be called before doing so. If the contents of the surface are written, then all operations must be completed externally before using the surface again by via VA-API functions.

@param[in] dpy VA display. @param[in] surface_id Surface to export. @param[in] mem_type Memory type to export to. @param[in] flags Combination of flags to apply (VA_EXPORT_SURFACE_*). @param[out] descriptor Pointer to the descriptor structure to fill with the handle details. The type of this structure depends on the value of mem_type.

@return Status code:

  • VA_STATUS_SUCCESS: Success.
  • VA_STATUS_ERROR_INVALID_DISPLAY: The display is not valid.
  • VA_STATUS_ERROR_UNIMPLEMENTED: The driver does not implement this interface.
  • VA_STATUS_ERROR_INVALID_SURFACE: The surface is not valid, or the surface is not exportable in the specified way.
  • VA_STATUS_ERROR_UNSUPPORTED_MEMORY_TYPE: The driver does not support exporting surfaces to the specified memory type.