Commit 10d335d71513e432373dec9df46b5558cf6b074c
1 parent
e69cf19f
直接用乔熙的BGR输出
Showing
2 changed files
with
10 additions
and
9 deletions
vehicle_structure_platform.git0708-3080-trt-face/src/SfxDecoder/DxDecoderWrap.cpp
@@ -294,6 +294,7 @@ void DxDecoderWrap::DxCUDADecoderCallback( void * buf, unsigned int size, int wi | @@ -294,6 +294,7 @@ void DxDecoderWrap::DxCUDADecoderCallback( void * buf, unsigned int size, int wi | ||
294 | unsigned char *pHwData = nullptr; | 294 | unsigned char *pHwData = nullptr; |
295 | cudaError_t cudaStatus = cudaMalloc((void **)&pHwData, rgbSize); | 295 | cudaError_t cudaStatus = cudaMalloc((void **)&pHwData, rgbSize); |
296 | if (cudaStatus != cudaSuccess) { | 296 | if (cudaStatus != cudaSuccess) { |
297 | + m_queue_frames_mutex.unlock(); | ||
297 | LOG_ERROR("[{}]- cudaMalloc failed !!!", m_name.c_str()); | 298 | LOG_ERROR("[{}]- cudaMalloc failed !!!", m_name.c_str()); |
298 | return ; | 299 | return ; |
299 | } | 300 | } |
@@ -308,13 +309,13 @@ void DxDecoderWrap::DxCUDADecoderCallback( void * buf, unsigned int size, int wi | @@ -308,13 +309,13 @@ void DxDecoderWrap::DxCUDADecoderCallback( void * buf, unsigned int size, int wi | ||
308 | // unsigned char* cpu_data = new unsigned char[rgb_size]; | 309 | // unsigned char* cpu_data = new unsigned char[rgb_size]; |
309 | // cudaStatus = cudaMemcpy(cpu_data, pHwData, rgb_size * sizeof(unsigned char), cudaMemcpyDeviceToHost); | 310 | // cudaStatus = cudaMemcpy(cpu_data, pHwData, rgb_size * sizeof(unsigned char), cudaMemcpyDeviceToHost); |
310 | 311 | ||
311 | - // if (timestamp > 245 && timestamp < 255) | ||
312 | - // { | ||
313 | - // string file_name = "./nv12/"+to_string(timestamp) + ".txt"; | ||
314 | - // FILE* fp=fopen(file_name.c_str(),"wb"); | ||
315 | - // fwrite(cpu_data, rgb_size, 1, fp); | ||
316 | - // fclose(fp); | ||
317 | - // } | 312 | + // // if (timestamp > 245 && timestamp < 255) |
313 | + // // { | ||
314 | + // // string file_name = "./nv12/"+to_string(timestamp) + ".txt"; | ||
315 | + // // FILE* fp=fopen(file_name.c_str(),"wb"); | ||
316 | + // // fwrite(cpu_data, rgb_size, 1, fp); | ||
317 | + // // fclose(fp); | ||
318 | + // // } | ||
318 | 319 | ||
319 | // cv::Mat img(m_height, m_width, CV_8UC3, cpu_data); | 320 | // cv::Mat img(m_height, m_width, CV_8UC3, cpu_data); |
320 | // cv::imwrite("test.jpg", img); | 321 | // cv::imwrite("test.jpg", img); |
vehicle_structure_platform.git0708-3080-trt-face/src/SfxDecoder/SfxDecoder.cpp
@@ -43,8 +43,8 @@ bool SfxDecoder::OpenDecoder(DxDecoderConfig& cfg) | @@ -43,8 +43,8 @@ bool SfxDecoder::OpenDecoder(DxDecoderConfig& cfg) | ||
43 | sfx_cfg->flags.useFastDecode = 0; | 43 | sfx_cfg->flags.useFastDecode = 0; |
44 | sfx_cfg->flags.accelId = m_cfg.devId; | 44 | sfx_cfg->flags.accelId = m_cfg.devId; |
45 | sfx_cfg->flags.frameNumber = 1; | 45 | sfx_cfg->flags.frameNumber = 1; |
46 | - sfx_cfg->flags.fmt = SFX_VIDEO_FORMAT_NV12U8; | ||
47 | - //sfx_cfg->flags.fmt = SFX_VIDEO_FORMAT_C3BGRU8; | 46 | + // sfx_cfg->flags.fmt = SFX_VIDEO_FORMAT_NV12U8; |
47 | + sfx_cfg->flags.fmt = SFX_VIDEO_FORMAT_C3BGRU8; | ||
48 | 48 | ||
49 | m_handler = SfxStreamHandlerInterface::SfxGetInstance(sfx_cfg); | 49 | m_handler = SfxStreamHandlerInterface::SfxGetInstance(sfx_cfg); |
50 | 50 |