How to use opencv or ros to obtain video streaming data of ar0231 on px2 (Solved)

Does anyone know how to use opencv or ros to obtain video streaming data of ar0231 on px2 ?Nvmedia has an NvMediaImageGetBits interface, but how to obtain video data flow through nvmedia and directly invoke the data through opencv or ros? Is there any code routine for reference?
https://docs.nvidia.com/drive/nvvib_docs/index.html#page/NVIDIA%2520DRIVE%2520Linux%2520SDK%2520Development%2520Guide%2FMultimedia%2Fnvmedia_sample_apps.html%23
This routine only allows video data of the camera to be displayed on the screen via HDMI. Can we change this routine to allow opencv or ros to access video data stream? How do I modify it?

Dear cheng,
I notice similar work is done by the community at https://devtalk.nvidia.com/default/topic/1015092/driveworks/how-to-publish-gmsl-camera-images-to-ros-/ . Could you please leverage their experience