How to restart/free gstreamer with jetson nano?

Hi,
There is no existing python sample but a user shares a C sample:
Nvidia-desktop kernel: [407343.357549] (NULL device *): nvhost_channelctl: invalid cmd 0x80685600 - #18 by DawnMaples

Please refer to it and see if you can run the same in python.