how to convert dwImageNvMedia/NvMediaImage to opencv mat?

Hi all!
I have crosscompileed opencv,and i want to use driveworks sdk with opencv. But how to convert dwImageNvMedia/NvMediaImage to OpenCV’s cv::Mat?
Thanks!