Making a DirectShow transform filter utilizing the latest nVidia Video Codec SDK (v11.1.5). When trying to compile, the linker complains about an unresolved external symbol for the CopyToDeviceFrame method inside the NvEncoderCuda class. I have looked at the library I’m linking to (NvEncoderLib.lib) and it has the CopyToDeviceFrame method in it. I generated the lib file by adding a library output to the AppEncodeCuda sample in the SDK:
add_library(NvEncoderLib STATIC ${NV_ENC_SOURCES})
In my filter code, this is the method to handle the encoding of the frames:
HRESULT CNVENCEncoder::OnReceive(IMediaSample *pSample)
{
std::vector<std::vector<uint8_t>> vPacket;
BYTE* pBuffer = NULL;
if (pSample->GetPointer(&pBuffer) < 0)
return S_FALSE;
const NvEncInputFrame* encoderInputFrame = m_pEncoder->GetNextInputFrame();
m_pEncoder->CopyToDeviceFrame(context, pBuffer, 0, (CUdeviceptr)encoderInputFrame->inputPtr,
(int)encoderInputFrame->pitch,
m_pEncoder->GetEncodeWidth(),
m_pEncoder->GetEncodeHeight(),
CU_MEMORYTYPE_HOST,
encoderInputFrame->bufferFormat,
encoderInputFrame->chromaOffsets,
encoderInputFrame->numChromaPlanes);
m_pEncoder->EncodeFrame(vPacket);
return S_OK;
}
It is only the CopyToDeviceFrame method that is breaking the linker, I have several calls earlier that initialize the encoder, etc. that all link and compile without issue.
Am I missing something? Is there a different way to do this without CopyToDeviceFrame?
Thanks for the help in advance-