GStreamerCPPHelpers 0.0.3 Released – A Header-Only Library for Smart Pointers in GStreamer with C++

Hello everyone, I’ve just released version 0.0.3 of GStreamerCppHelpers. It’s a very lightweight header-only library designed to ease the integration between C++ applications and GStreamer, without relying on heavier C++ bindings.

Currently, it provides GstPtr<>, a smart pointer implementation for GStreamer types that require ref/unref management, offering functionality equivalent to the standard std::shared_ptr.

The library, licensed under LGPL-3.0, has already been used in enterprise projects for about three years and is stable. I’m announcing it here in case anyone finds it useful.

Best regards

1 Like

Hi,

I happen to develop one of those full-scale “heavier C++ bindings”, also a header-only library, based on GIR. Your GstPtr<> looks quite similar to my RefPtr<>, except mine doesn’t require C++17, handles a lot more types than GObject, GstMiniObject, GParamSpec, and GMainLoop, and it’s also nicely integrated with the bound APIs (so they return/accept RefPtr instead of the plain pointer when the parameter is transfer full).

Of course, being full bindings, it doesn’t just handle RefPtr, but also other kinds of pointers (UniquePtr, FloatPtr, WeakPtr); it has C++ wrappers for all the APIs (mostly generated from GIR), a bunch of boilerplate/hacks/magic for wrapping C++ callables (lambdas, member method pointers) into closures and signal handlers, and so on. And it lets you write custom classes (with deep derivability, faithfully represented both in C++ and GObject sides), with properties, signals, overriding vfuncs, implementing interfaces, etc.

That being said, I only really used my bindings with the GTK stack so far, as I ran into some complications with GStreamer’s GIR, and I don’t have enough experience with GStreamer to properly fix it.

Would you be interested in taking a look and perhaps contributing to my project? (Also, what’s the proper way to contact you?)

1 Like

Hi! I’m not sure I can help with the GStreamer GIRs since the goal of this small library was precisely to have a functional smart pointer without using to introspection. But write me at nacho.garglez at gmail dot com and we’ll see what it’s about. Thanks!