VPIImage deallocate wrapped memory

If I have a VPI image, with no references to the memory it is wrapping, is it possible to deallocate that memory when I destroy the image? According to the VPI docs here “When destroying an VPIImage wrapper, the wrapped memory itself isn’t deallocated.”

How do I deallocate the wrapped memory given just the VPI image?


Wrapping uses a pre-allocated buffer so it’s expected that the user has the buffer pointer and should take care of it.

If you want to manage it with VPI API directly, please use vpiImageCreate rather than vpiImageCreateWrapper.


Ah, yes. Duh.

I’ve solved my problem by creating the wrapper, copying to a native VPIImage, then destroying the wrapper and the wrapped memory.

I’m wondering though, once I have a native VPIImage with a given backend (Say VIC). Is it possible to convert the image to another backend? (Say CUDA). I haven’t found any information on if this conversion is possible


Do you mean the different backend with the VPI interface?
If yes, this is handled by the VPI automatically so users don’t need to manually take care of it.


Awesome. Yeah it looks like if I create the image with both backends it works with either.

    VPIImage vpi_frame;
    vpiImageCreate(ctx->size.width(), ctx->size.height(), VPI_IMAGE_FORMAT_BGRA8, VPI_BACKEND_VIC|VPI_BACKEND_CUDA, &vpi_frame);

Thank you for your help!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.