How nnstreamer/nnstreamer-example works
Project type and purpose
• This is an “example”—monorepo-style” toolkit showcasing how to build apps with nnstreamer/GStreamer across multiple platforms (Ubuntu native, bash scripts, Tizen GUI/.NET/Web, Android Java/Kotlin, IoT). It contains dozens of sample applications, scripts and templates illustrating pipeline creation, model invocation, and platform integration.
File‐structure analysis
• Top-level directories group by target platform or role:
• native/ & bash_script/ – Linux C/C++/Python binaries and gst-launch recipes
• Tizen.native/, Tizen.NET/, Tizen.web/, Tizen.platform/ – Tizen GUI (C/C++), .NET C# apps, Web apps, IoT packages
• android/ & android/kotlin_app/ – Android NDK (C/C++) and JNI-free Java/Kotlin examples
• packaging/, debian/, meson.build, .github/ – build, packaging, CI configs
• Every example subfolder houses source code, resources (model files: .tflite, .onnx), build scripts (meson.build, Gradle), and platform manifests (AndroidManifest.xml, tizen-manifest.xml).
Key README insights
• Describes supported platforms, build flows (PPA, gbs, Meson, Gradle), and categorizes examples by pipeline features: appsrc, tensor_decoder modes, networking (tcpclientsrc/tcpserversink), nnstreamer APIs.
Main components
a. Platforms (containers/columns):
• Ubuntu Native (C/C++/Python)
• gst-launch Scripts (bash)
• Tizen GUI (Native C/C++), Tizen .NET (C#), Tizen Web (HTML/JS)
• Tizen IoT (platform packages)
• Android (JNI/C++, Java API, Kotlin)
• Common Build/Packaging/CI
b. Core Library & Pipeline Engine
• nnstreamer (GStreamer + Tensor filters)
• External services/repos (Ubuntu PPA, Tizen OBS/RPM)
c. Model Artifacts
• .tflite, .onnx, labels.txt, vocab.txt
d. Hardware / Data Sources
• v4l2src (camera), tensor_src_tizensensor (accelerometer), appsrc (text), amcsrc/ahc2src (Android media/camera)
e. Output / UI Layers
• GTK/CairoOverlay (native), tizenwlsink (IoT), WebCanvas/HTML UI, Android SurfaceView, .NET UI
Relationships & interactions
• Each example app → invokes nnstreamer pipeline API or gst-launch → loads model artifact → consumes hardware/data source → processes tensors → decodes/overlays results → renders to UI or outputs to stdout/log.
• Offloading examples additionally connect via networking modules (tcpserversink/tcpclientsrc) to remote inference services.
Architectural patterns & design principles
• Modular monorepo: platform slices with identical high-level flow (Source → nnstreamer pipeline → Sink/UI).
• Plugin extensibility: tensor_decoder, tensor_converter, custom subplugins under templates/.
• Multi-language bindings: C/C++, Python, C#, Java, Kotlin, Web JS – all share the same NNStreamer core.
• Cross‐platform manifest/build isolation: Meson for Linux/Tizen native, Gradle for Android, npm for Web, gbs/PPA integration.