how can I used "nv12_to_bgr_planar_batch" function

When I used callback function to get data, I can get YUV data. But I used “nv12_to_bgr_planar_batch” can’t get rgb data
these code no problem:
uint8_t pBuf;
pBuf = (uint8_t
)malloc(pOutData->frameSize_2 * sizeof(uint8_t));
)pBuf, 128, pOutData->frameSize_);
cudaStream_t cst = pOutData->stream_;
cudaMemcpyAsync(pBuf, pOutData->dpFrame_, pOutData->frameSize_, cudaMemcpyDeviceToHost, cst);
int len = fwrite(pBuf, 1, pOutData->frameSize_, g_fp);

error code:
uint8_t* devBuf;
cudaError_t cudaStatus = cudaMalloc((void**)&devBuf, pOutData->frameSize_2sizeof(uint8_t));
if(cudaStatus != cudaSuccess)
printf(“malloc failed\n”);

cout << "convert now" << endl;		

nv12_to_bgr_planar_batch(pOutData->dpFrame_, 1.5*pOutData->nWidthPixels_,  (float*)devBuf, 3*pOutData->nWidthPixels_, pOutData->nWidthPixels_, pOutData->nHeightPixels_, 1, true, pOutData->stream_);
cudaMemcpyAsync(pBuf, devBuf, pOutData->frameSize_*2*sizeof(uint8_t), cudaMemcpyDeviceToHost, pOutData->stream_);	
int len = fwrite(pBuf, 1, pOutData->frameSize_*2, g_fp);


Which DeepStream version do you use?
It’s recommended to check our color space converter module as sample.

You can find more information in our document: Adding a module into the analysis pipeline

// Add frame paser
IModule* pConvertor = pDeviceWorker-