How to pass parameter to Smart Record callback function

When setting up smart record you fill out the params structure and one of the fields is:

params.callback = smart_record_callback; 

I can see the signature of the callback is:

static gpointer smart_record_callback (NvDsSRRecordingInfo *info, gpointer userData)

How do we pass in userData - I can’t see how to set that up in the params structure?

I want to use it to pass in the source_id.

Hardware Platform (Jetson / GPU): Jetson Nano
DeepStream Version: DS5.0 developer preview

Hi @jasonpgf2a
The userData in this call back is the userData pased into through NvDsSRStart() as described below.


vDsSRStatus NvDsSRStart (NvDsSRContext *ctx, NvDsSRSessionId *sessionId, guint startTime, guint duration, gpointer userData);


Thankyou @mchi I was looking at the params structure where you specify the callback function name. Have tested and it works well. ;-)

Hi, my pipeline works like this:

rtsp -> decode  -> detect -> track -> dstexample ->osd->tee |
| msg conv + msg broke
| encodeh264 ->rtppay->udpsink

In dstexample, i capture frames when alarm occurs and send a kafka message. 

Now i want to 
1)start smart-record  (which has bbox in frame) related with that alarm and 
2)upload the record file with minio c++ api when it finished.

It seems like i should add a srbin after encoder264, is that right?
Do you have some suggestions about that?