Skip to content

Commit e6ae543

Browse files
authored
fix: hardware rendering (#695)
1 parent 5f06521 commit e6ae543

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

webrtc-sys/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ fn main() {
166166
.file("src/vaapi/implib/libva.so.tramp.S");
167167

168168
builder
169-
.flag("-I/usr/local/cuda-12.3/targets/x86_64-linux/include")
169+
.flag("-I/usr/local/cuda/include")
170170
.flag("-Isrc/nvidia/NvCodec/include")
171171
.flag("-Isrc/nvidia/NvCodec/NvCodec")
172172
.file("src/nvidia/NvCodec/NvCodec/NvDecoder/NvDecoder.cpp")

webrtc-sys/src/nvidia/h264_encoder_impl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,10 @@ int32_t NvidiaH264EncoderImpl::Encode(
322322

323323
if (cu_memory_type_ == CU_MEMORYTYPE_DEVICE) {
324324
NvEncoderCuda::CopyToDeviceFrame(
325-
cu_context_, (void*)frame_buffer->DataY(), 0,
325+
cu_context_, (void*)frame_buffer->DataY(), frame_buffer->StrideY(),
326326
reinterpret_cast<CUdeviceptr>(nv_enc_input_frame->inputPtr),
327327
nv_enc_input_frame->pitch, input_frame.width(), input_frame.height(),
328-
CU_MEMORYTYPE_DEVICE, nv_enc_input_frame->bufferFormat,
328+
CU_MEMORYTYPE_HOST, nv_enc_input_frame->bufferFormat,
329329
nv_enc_input_frame->chromaOffsets, nv_enc_input_frame->numChromaPlanes);
330330
}
331331

0 commit comments

Comments
 (0)