bdtinc / maskcam

Jetson Nano-based smart camera system that measures crowd face mask usage in real-time.
MIT License
243 stars 83 forks source link

what's the purpose of adding glib_cb_restart #26

Closed zhouyuchong closed 2 years ago

zhouyuchong commented 2 years ago

Hi, I'm trying to write a deepstream-app, and I'm not very familiar with Glib.I met a problem before that if the rtsp sources are not stable or the internet is poor, the pipeline will run without any errors as well as any outputs. So I'm trying to find a way to restart the pipeline under this circumstance. I found your codes and the glib_cb_restart confused me. I read your annotations, so the timeout_add will call glib_cb_restart and without a return value, the function will add another timeout_add. Your annotation said:Timer to avoid GLoop locking infinitely and But we want to check periodically for other events. I also found the explanation about Glib.MainContext.iteration. I don't get the point of the usage of this function. Appreciate if you can explain a little more or give me some hints. Thanks a lot