From 9f1dfb29dc33a9e47b5012e1684a21e2f11bc255 Mon Sep 17 00:00:00 2001 From: enm10k Date: Tue, 10 Oct 2023 10:16:30 +0900 Subject: [PATCH] wip --- src/hwenc_jetson/jetson_buffer.cpp | 2 +- src/hwenc_jetson/jetson_video_decoder.cpp | 14 ++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/hwenc_jetson/jetson_buffer.cpp b/src/hwenc_jetson/jetson_buffer.cpp index b1a695fd..d1e41417 100644 --- a/src/hwenc_jetson/jetson_buffer.cpp +++ b/src/hwenc_jetson/jetson_buffer.cpp @@ -146,7 +146,7 @@ rtc::scoped_refptr JetsonBuffer::ToI420() { NvBufSurfaceUnMap(dst_surf, index, plane); if (ret == -1) { RTC_LOG(LS_ERROR) << __FUNCTION__ - << " Failed to NvBufSurfaceUnMap plane=" << plane; + << " Failed to NvBufSurfaceMap plane=" << plane; return scaled_buffer; } } diff --git a/src/hwenc_jetson/jetson_video_decoder.cpp b/src/hwenc_jetson/jetson_video_decoder.cpp index 9856cb8b..87718298 100644 --- a/src/hwenc_jetson/jetson_video_decoder.cpp +++ b/src/hwenc_jetson/jetson_video_decoder.cpp @@ -308,16 +308,6 @@ void JetsonVideoDecoder::CaptureLoop() { uint64_t pts = v4l2_buf.timestamp.tv_sec * rtc::kNumMicrosecsPerSec + v4l2_buf.timestamp.tv_usec; - NvBufSurfTransformRect src_rect, dest_rect; - src_rect.top = capture_crop_->c.top; - src_rect.left = capture_crop_->c.left; - src_rect.width = capture_crop_->c.width; - src_rect.height = capture_crop_->c.height; - dest_rect.top = 0; - dest_rect.left = 0; - dest_rect.width = capture_crop_->c.width; - dest_rect.height = capture_crop_->c.height; - NvBufSurf::NvCommonTransformParams transform_params; memset(&transform_params, 0, sizeof(transform_params)); transform_params.src_top = capture_crop_->c.top; @@ -429,12 +419,12 @@ int JetsonVideoDecoder::SetCapture() { } NvBufSurf::NvCommonAllocateParams cParams; + cParams.memType = NVBUF_MEM_SURFACE_ARRAY; cParams.width = capture_crop_->c.width; cParams.height = capture_crop_->c.height; cParams.layout = NVBUF_LAYOUT_PITCH; cParams.colorFormat = NVBUF_COLOR_FORMAT_YUV420; - cParams.memtag = NvBufSurfaceTag_VIDEO_ENC; - cParams.memType = NVBUF_MEM_SURFACE_ARRAY; + cParams.memtag = NvBufSurfaceTag_VIDEO_DEC; ret = NvBufSurf::NvAllocate(&cParams, 1, &dst_dma_fd_); INIT_ERROR(ret == -1, "failed to NvBufSurfaceAllocate");