是否有关于如何在 C 中使用 GStreamer GstBaseTransform 的完整示例?

Is there any complete example on how to use the GStreamer GstBaseTransform in C?

GstBaseTransform is the class intended for the simple image processing and analysis in GStreamer. Being new to GStreamer, I am looking for some more or less complete plugin that I could use for understanding how to implement mine. Unfortunately, the Plugin Writers Guide does not cover it, and in general I cannot find a complete source code of any simple enough example that uses it. Most of the websites I Google out simply repeat the documentation, some specialized code for Freescale in GitHub and also GLES 项目是我迄今为止能够找到的最接近的东西。然而,它是一个专门的生产代码,在尝试理解其余部分之前需要删除很多内容。

是否可以获得完整的 example/source 插件代码,该插件使用 GstBaseTransform 来做一些非常简单的事情,比如在图像上画线?

GStreamer 管道可以像“gst-launch-1.0 videotestsrc ! the_plugin ! videoconvert ! autovideosink”一样从命令行轻松启动。

我建议结合使用文档和元素生成器。元素构建器为您提供了一个基于多个基础 class 的插件模板,包括 basetransform。该工具可以在 gst-plugins-bad 存储库的 tools/gst-element-maker 中找到。

然后是基础文档class - 例如https://gstreamer.freedesktop.org/documentation/base/gstbasetransform.html?gi-language=c

通常文档会大体解释 class 的预期工作方式,并且确实有一些关于大多数 important/significant 功能的文档。

对于 basetransform,您最重要的功能将是 transformtransform_ip,具体取决于您的插件是否可以在 in-place 模式下工作。您可以在那里进行处理 - 就像将一行写入图像缓冲区。