Closed nassah221 closed 1 year ago
On further deliberation, I came up with this. It's a simulated example of implementing periodic notification wake-up for the thumbnailer which seems much less hacky and probably a more efficient way to do it.
This is not a good way to do notification type periodic wake-up since the if
condition will be evaluated a bajillion times on arrival of every rtp packet.
I like the solution that uses the sync cond -- however I do think some documentation will be critical around this as it's easy to get confused on what exactly is happening.
This code contains a poc for sending thumbnails as requested on every tick. The peer-connection
OnTrack
handler hands-off the rtp packets to theingestor
which 'ingests' the packets. The purpose of the ingestor is to transform the rtp packets to thumbnails and the code in-review implements an on-demand delivery of those thumbnails.The ingestor would extend to cover the case of writing the same rtp packets to file as per configuration.