From 61ec4486b56e4d5413e45508c32c8174c287c980 Mon Sep 17 00:00:00 2001 From: cmhu <2657262686@qq.com> Date: Tue, 11 Jun 2024 09:36:52 +0800 Subject: [PATCH] 解码器linux版的BGR设置有缺陷,改回NV12 --- vehicle_structure_platform.git0708-3080-trt-face/src/SfxDecoder/DxDecoderWrap.cpp | 5 +++-- vehicle_structure_platform.git0708-3080-trt-face/src/SfxDecoder/SfxDecoder.cpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/vehicle_structure_platform.git0708-3080-trt-face/src/SfxDecoder/DxDecoderWrap.cpp b/vehicle_structure_platform.git0708-3080-trt-face/src/SfxDecoder/DxDecoderWrap.cpp index 460e662..5c3e3aa 100644 --- a/vehicle_structure_platform.git0708-3080-trt-face/src/SfxDecoder/DxDecoderWrap.cpp +++ b/vehicle_structure_platform.git0708-3080-trt-face/src/SfxDecoder/DxDecoderWrap.cpp @@ -299,10 +299,11 @@ void DxDecoderWrap::DxCUDADecoderCallback( void * buf, unsigned int size, int wi return ; } - // Nv12ToColor24((unsigned char*)buf, m_width, pHwData, 3 * m_width, m_width, m_height, 0); + //Nv12ToColor24((unsigned char*)buf, m_width, pHwData, 3 * m_width, m_width, m_height, 0); + Nv12ToColor24((unsigned char*)buf, m_width, pHwData, 3*m_width, m_width, m_height, 0); - cudaStatus = cudaMemcpy(pHwData, buf, rgbSize * sizeof(unsigned char), cudaMemcpyDeviceToDevice); + // cudaStatus = cudaMemcpy(pHwData, buf, rgbSize * sizeof(unsigned char), cudaMemcpyDeviceToDevice); // int rgb_size = 3 * m_width * m_height; diff --git a/vehicle_structure_platform.git0708-3080-trt-face/src/SfxDecoder/SfxDecoder.cpp b/vehicle_structure_platform.git0708-3080-trt-face/src/SfxDecoder/SfxDecoder.cpp index 849440b..7d5bd19 100644 --- a/vehicle_structure_platform.git0708-3080-trt-face/src/SfxDecoder/SfxDecoder.cpp +++ b/vehicle_structure_platform.git0708-3080-trt-face/src/SfxDecoder/SfxDecoder.cpp @@ -43,8 +43,8 @@ bool SfxDecoder::OpenDecoder(DxDecoderConfig& cfg) sfx_cfg->flags.useFastDecode = 0; sfx_cfg->flags.accelId = m_cfg.devId; sfx_cfg->flags.frameNumber = 1; - // sfx_cfg->flags.fmt = SFX_VIDEO_FORMAT_NV12U8; - sfx_cfg->flags.fmt = SFX_VIDEO_FORMAT_C3BGRU8; + sfx_cfg->flags.fmt = SFX_VIDEO_FORMAT_NV12U8; + // sfx_cfg->flags.fmt = SFX_VIDEO_FORMAT_C3BGRU8; m_handler = SfxStreamHandlerInterface::SfxGetInstance(sfx_cfg); -- libgit2 0.21.4