How to perform conditional operations based on prediction?

Is it possible to overlay additional information on the stream? If so where in the pipeline do I make this change?

I’m using a CSI camera and want to detect gestures in real time, essentially I would want to use a syntax like

if prediction=“person” and gesture time>3 seconds
do this
do this

Additional information-
Deepstream 4.0 running on Jetpack 4.2.3 on Jetson Nano
e-con CUNANO30 CSI camera
Running the source1_csi_primary_nano example on the deepstream app using
$ deepstream-app -c <path_to_config_file>

Please check existing implementation in nvdsosd:

If these properties do not fit your requirement, you may need to implement it. There are NvBufSurface APIs that can be leveraged to access buffers.