The gst-nvinfer is open source. Please refer to the “Gst-Nvinfer source code diagram” in DeepStream SDK FAQ - Intelligent Video Analytics / DeepStream SDK - NVIDIA Developer Forums
The InferPreProcessor implementation can be found in /opt/nvidia/deepstream/deepstream/sources/libs/nvdsinfer/nvdsinfer_context_impl.cpp
And the preprocess is also introduced in Gst-nvinfer — DeepStream documentation 6.4 documentation