I wrote a pipeline feeding in Buffers through an AppSrc and retrieving them with the AppSink. The source doesn’t seem to leak when paired with an AutoSink, but the AppSink leaks like a sieve. I’m disposing of Samples and Buffers in all callbacks where they are used or created.
I tried going back to basics - BasicTutorial8 to be precise. It seems that it leaks too. Over 10 minutes it lost over 100MB (see attached screenshot) - and that is audio only. Raw video is another story. Logging with the leaks Tracer on also shows leaking, and the ref count shows the buffers always seem to drop to 1, but not 0.
I tried setting the maximum buffers in the Sink, setting Drop to true and setting emit signals to true. The last two were because an article on S.O. suggested it - I’m not sure why they would work.
I tried changing the code in the source to use Spans for moving the data from shorts to bytes. I’m not sure, but I believe that the existing copying may leak. In any case, after my changes I tested and confirmed that my source isn’t leaking; when I replance the AppSink with an AutoSink the leak goes away.
It is possible I guess that the BasicTutorial8 has a bug, and I’d be happy to report it, but given my newness with GStreamer I figured it is more likely to be a “me” error. Any ideas on how to make BasicTutorial8 stop leaking? Whatever works there I assume I can take across to my “real” code.
Also, I’m using 1.24.5 if that helps.