'How to kill dummy-thread created by gstreamer callback?

Gstreamer is very good to process video stream. After running the loop. I create two callback functions to handle events.

    pgiesrcpad = pgie.get_static_pad("src")
    if not pgiesrcpad:
        sys.stderr.write(" Unable to get src pad of primary infer \n")

    pgiesrcpad.add_probe(Gst.PadProbeType.BUFFER, pgie_src_pad_buffer_probe, 0)

    tiler_sink_pad = tiler.get_static_pad("sink")
    if not tiler_sink_pad:
        sys.stderr.write(" Unable to get sink pad \n")
    else:
        tiler_sink_pad.add_probe(Gst.PadProbeType.BUFFER, tiler_sink_pad_buffer_probe, 0)

    setting.pipeline.set_state(Gst.State.PAUSED)

    setting.pipeline.set_state(Gst.State.PLAYING)

    try:
        setting.loop.run()
    except:
        print("Exiting app\n")
        setting.pipeline.set_state(Gst.State.NULL)

callback function

def pgie_src_pad_buffer_probe(pad, info, u_data):
    ptvsd.debug_this_thread()
    global batch_detection
    gst_buffer = info.get_buffer()
...

However, these two callback functions are created by dummy-thread. So After quit the loop, i cannot kill these two dummy thread. Please help to kill dummy thread in gstreamer. dummy-thread



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source