Skip to content

Latest commit

 

History

History
72 lines (41 loc) · 1.93 KB

3_Development.md

File metadata and controls

72 lines (41 loc) · 1.93 KB

Index


Development Environment

Use this command to run the full CI suite after setting up your environment

./misc/utils.sh ci-fix

Nix shell

Use a nix shell with all the build tools installed. Will use 5GB disk space. Install Nix

./misc/utils.sh dev-env-nix

Docker

Enter a nix shell packaged inside a OCI image. This is the same image that the CI pipeline uses.

./misc/utils.sh dev-env-docker 

Manual

You can install everything manually instead. Most things don't require a very specific version, but they may not exist in your package manager.


Test Stream

docker run -it --network=host codeberg.org/sentryshot/test-stream:v0.1.0
ffplay -rtsp_transport tcp rtsp://127.0.0.1:8554/1

Program Map

TODO:

The Plugin System

Each plugin is a dylib shared library. Enabled plugins are loaded at runtime with libloading, unloading or reloading is not supported.

https://github.com/luojia65/plugin-system-example

Tokio limitations

Tokio stores internal state in a global variable that isn't shared across shared libraries. Calling Tokio functions from a plugin must be done using a injected runtime handle, self.rt_handle.spawn() or by adding let _enter = self.rt_handle.enter() just before the function.