Coding Convention

In general, NNStreamer follows The Coding Style of GStreamer for coding convention.

C codes (.c sources)

All C codes of NNStreamer are required to use K&R with 2-space indenting. Just follow what's already there and you'll be fine. We only require .c files to be indented, headers may be indented differently for better readability. Please use spaces for indenting, not tabs, even in header files.

When you push your commits, apply gst-indent to .c files before you submit a commit with style change. If there is a change due to code style issues, make two separate commits: (Please do not include other codes' style change in the same commit)

  • commit with style change only (i.e., commit gst-indent-formatted original code - not your code change)
  • commit with your code change only (i.e., contents only).
$ ./tools/development/gst-indent <file-name>

C headers (.h)

You may indent differently from what gst-indent does. You may also break the 80-column rule with header files.

Except the two, you are required to follow the general coding styles mandated by gst-indent

C++ files (.cc)

Do not use .cpp extensions, use .cc extensions for C++ sources. Use .h for headers.

Please try to stick with the same indentation rules (2 spaces) and refer to .clang-format, which mandates the coding styles via CI.

Other files

  • [Java] TBD
  • [Python] TBD
  • [Bash] TBD

File Locations

Directory structure of nnstreamer.git

  • debian: Debian/Ubuntu packaging files
  • Documentation: Documentations
  • ext/nnstreamer: NNStreamer plugins and subplugins that depend on optional or non-standard external packages. Components in this directory can be built and included optionally.
    • android_source: Plugins required to support Android/JAVA APIs.
    • tensor_decoder: Decoder subplugins
    • tensor_filter: Filter subplugins
    • tensor_source: Source elements that provide tensor/tensors streams. We do not have subplugin architectures for sources.
    • Potentially we can add tensor_converter here later for converter subplugins. We do not have converter subplugins released, yet.
  • gst/nnstreamer: All core nnstreamer codes are located here.
    • **tensor_* **: Plugins of nnstreamer.
  • jni: Android/Java build scripts.
  • packaging: Tizen RPM build scripts. OpenSUSE/Redhat Linux may reuse this.
  • tests: Unit test cases. We have SSAT test cases and GTEST test cases. There are a lot of subdirectories, which are groups of unit test cases.
  • tools: Various developmental tools and scripts of NNStreamer.

The results of the search are