Fwiw, nvivafilter is not available on all platforms (not on x86), so if you want your plugin to work with other nvidia plugins on x86, you’ll need an alternative. There is some example code in DeepStream for a similar plugin to nvivafilter.
Right now, the example has code to convert to a standard CPU Mat by default, however if you want, you can tear this conversion out and operate on the NVMM buffers directly using CUDA. You can do a contrast operation (or any curve) with a 1d lookup table yourself (eg. an array of length 256, with each index mapping to an output value) or with npp, which has primitives to do that. You can probably use shared memory to store the lut itself (that’s my plan anyway). Unfortunately the license is propretary for the example so any modifications you make will be owned by Nvidia.
NVIDIA Corporation and its licensors retain all intellectual property
and proprietary rights in and to this software, related documentation
and any modifications thereto. Any use, reproduction, disclosure or
distribution of this software and related documentation without an express
license agreement from NVIDIA Corporation is strictly prohibited.
Or you could do what I’m doing and write a plugin and filters from scratch using gst-template, though please note that the template script is currently broken, so if you use it, you’ll have to fix some things in the generated code before it’ll build. None of the PRs or the author’s code actually fix the issue. You could also revert the last commit to master which breaks it or use the broken template and fix the broken stuff yourself. Feel free to fork my repo and the submodule since it’s in a more or less working state. It’s just boilerplate for now, but you can get an idea of what’s intended, and it has some basic tests.