# Using VPI in a Custom DeepStream Plugin

**URL:** <https://forums.developer.nvidia.com/t/using-vpi-in-a-custom-deepstream-plugin/186038>\
**Category:** DeepStream SDK\
**Tags:** vpi, gstreamer\
**Created:** [August 9, 2021, 2:17pm UTC](https://forums.developer.nvidia.com/t/using-vpi-in-a-custom-deepstream-plugin/186038 "2021-08-09T14:17:17Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![AastaLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aastalll/32/14043_2.png) [@AastaLLL](https://forums.developer.nvidia.com/u/AastaLLL)\
**Post date:** [August 10, 2021, 2:10am UTC](https://forums.developer.nvidia.com/t/using-vpi-in-a-custom-deepstream-plugin/186038/3 "2021-08-10T02:10:44Z")

</div>

Hi,

**1.**  
Do you see the attached file in **[this comment](https://forums.developer.nvidia.com/t/deepstream-sdk-vpi-on-jetson-tx2/166834/21)**?  
We wrap the buffer with _vpiImageCreateCUDAMemWrapper_ directly to avoid duplicate buffer mapping.

**2.**  
Since perspective warp is not a point-to-point operation, you need to use different buffers to store input and output.

```auto
CHECK_VPI_STATUS(vpiSubmitPerspectiveWarp(dsexample->vpi_stream, 0, dsexample->warp, img, xform, out
                                            , VPI_INTERP_LINEAR, VPI_BORDER_ZERO, 0));
CHECK_VPI_STATUS(vpiSubmitConvertImageFormat(dsexample->vpi_stream, VPI_BACKEND_CUDA, out, img, NULL));
CHECK_VPI_STATUS(vpiStreamSync(dsexample->vpi_stream))

```

Please check the attached file for the detailed implementation.

Thanks.

---

_[View the full topic](https://forums.developer.nvidia.com/t/using-vpi-in-a-custom-deepstream-plugin/186038)._
