GstCUDA - Project Structure
General structure
The following scheme shows an overview about how GstCUDA source code and documentation is structured.
gst-cuda/ ├── autogen.sh #Script to create the configure and create initial Makefiles based in configure.ac ├── common #Basic GStreamer utilities ├── configure #Script to prepare everything to build the project ├── configure.ac #Initial configuration that uses autogen.sh to create the configure script ├── docs #Files to build project documentation ├── gst-libs #Libraries and base classes ├── Makefile.am #File used by automake with the configuration to generate a Makefile ├── sys #Quick Prototyping Elements ├── tests #Algorithms implemented by elements └── tools #Example to create a custom algorithm
docs
The docs directory contains files designated to create the documentation of the framework. It is divided in libs for generating the information about GstCUDA libraries and base classes and there is a plugins directory used to generate documentation about Quick Prototyping Elements Plug-in.
docs/ ├── libs #GstCUDA libraries and base classes └── plugins #Quick Prototyping Elements Plug-ins
gst-libs
GstCUDA libraries and base classes are located in gst-libs/sys/cuda.
gst-libs/ └── sys ├── cuda ├── filteralgorithm.hpp #CUDA algorithm template for cudafilter element ├── gstcudaallocator.c #GStreamer allocator for GstCuda based elements ├── gstcudaallocator.h #GStreamer allocator for GstCuda based elements header ├── gstcudabasefilter.c #Base class for single-input/single-output CUDA filters ├── gstcudabasefilter.h #Base class header for single-input/single-output CUDA filters ├── gstcudabasemiso.c #Base class for multiple-input/single-output CUDA filters ├── gstcudabasemiso.h #Base class header for multiple-input/single-output CUDA filters ├── gstcudabufferpool.c #GStreamer buffer pool for GstCuda based elements ├── gstcudabufferpool.h #GStreamer buffer pool for GstCuda based elements header ├── gstcuda.c #GstCUDA library API ├── gstcuda.h #Header of the library ├── gstcudameta.c #Extra buffer metadata for unified memory allocator mode ├── gstcudameta.h #Extra buffer metadata header for unified memory allocator mode ├── muxalgorithm.hpp #CUDA algorithm template for cudamux element
sys
The sys/cuda directory contains GstCUDA plugin source code and the GStreamer/CUDA quick prototyping element source code.
sys/ ├── cuda ├── gstcuda.c #GstCUDA plugin ├── gstcudafilter.cpp #Quick Prototyping element using GstCDUABasefilter class ├── gstcudafilter.h #Header of cudafilter element ├── gstcudamux.cpp #Quick Prototyping element using GstCDUAMISO class ├── gstcudamux.h #Header of cudamux element
tests
The tests/examples/cudafilter_algorithms directory contains gray-scale-filter.cu and memcpy.cu; which are examples of CUDA algorithm libraries that cudafilter element can implement. In tests/examples/filter, there is a base example to create an element using an integrated CUDA algorithm library.
tests/ ├── examples ├── cudafilter_algorithms │ ├── gray-scale-filter │ │ ├── gray-scale-filter.cu #Gray-scale-filter CUDA algorithm library │ │ └── test-pipelines.txt #Documentation of pipelines using algorithm │ └── memcpy │ ├── memcpy.cu #Memory-copy CUDA algorithm library │ └── test-pipelines.txt #Documentation of pipelines using algorithm ├── cudamux_algorithms │ └── mixer │ ├── mixer.cu #Image Mixer CUDA algorithm library │ └── test-pipelines.txt #Documentation of pipelines using algorithm ├── filter ├── gstcudaexamplefilter.c #Example to create an element using GstCUDABasefilter class ├── gstcudaexamplefilter.h #Header of the example ├── memcpy.cu #Memory-copy CUDA algorithm └── memcpy.h #Memory-copy CUDA algorithm header
tools
There is an template (example.cu) to create a CUDA algorithm library in tools/example.
tools/ ├── algorithm.mk #Helper Makefile to build example.cu └── example ├── example.cu #Algorithm library example └── Makefile #To build the algorithm library