Tsdemux: how to catch and process SCTE-35 events to pull out splice insert and send them further to mpegtsmux

I need to understand how I can somehow catch and process these SCTE-35 tags, which event is in the callback, in order to extract a structure with information about splice insert from it and apparently send it directly to mpegtsmux to get this splice insert in my stream

based on Tsdemux: send-scte35-events not working? - #11 by Romario