Skip to content

Commit

Permalink
Simplified readme
Browse files Browse the repository at this point in the history
  • Loading branch information
GrantSparks committed Jul 23, 2024
1 parent 6f8edbf commit d8b76fe
Showing 1 changed file with 2 additions and 28 deletions.
30 changes: 2 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Unofficial idiomatic Rust bindings for the [NDI 6 SDK](https://ndi.video/for-dev

## Requirements

This library has been developed and tested on Windows 10, but it should work on other platforms easily enough (please contribute!). You need to have the [NDI 6 SDK](https://ndi.video/for-developers/ndi-sdk/) installed for your platform. After installation, make sure your library path or system PATH (on Windows) includes the NDI library binaries location, e.g., `%NDI_SDK_DIR%\Bin\x64` (for Windows PATH).
This library has been developed and tested on Windows 10, but it should work on other platforms easily enough (please contribute!). You need to have the [NDI 6 SDK](https://ndi.video/for-developers/ndi-sdk/) installed for your platform. After installation, make sure your library path (or system PATH on Windows) includes the NDI library binaries location, (e.g., `%NDI_SDK_DIR%\Bin\x64` for Windows PATH).

You also need to install Rust bindgen [according to the instructions here](https://rust-lang.github.io/rust-bindgen/requirements.html).

Expand All @@ -17,7 +17,7 @@ Add this to your `Cargo.toml`:
grafton-ndi = "*"
```

Ensure that you have set up the environment variables correctly to point to your NDI SDK installation.
Ensure that you have set up the environment variables correctly for your NDI SDK installation.

## Examples

Expand All @@ -29,32 +29,6 @@ To run an example, use the following command:
cargo run --example NDIlib_Find
```

## Usage

The following example demonstrates how to use the `grafton-ndi` library to find NDI sources on the network and receive frames from a source.

https://github.com/GrantSparks/grafton-ndi/blob/c108d36c1eecc65e3c25ecfe2ba59e7f36b70b68/examples/NDIlib_Find.rs#L1C1-L42

## Best Practices

1. **Initialization and Deinitialization**:

- Always initialize the NDI library before using it and deinitialize it when done.
- Use `NDI::new()` for initialization and rely on Rust's ownership and drop semantics for cleanup.

2. **Error Handling**:

- Check for null pointers and handle errors gracefully.
- Use Rust's `Result` type to manage potential errors.

3. **Memory Management**:

- Ensure that you properly destroy any NDI instances you create to avoid memory leaks.
- Leverage Rust's ownership system to manage resources efficiently.

4. **Concurrency**:
- If using NDI in a multi-threaded environment, ensure proper synchronization.

## Contributing

Contributions are welcome! Please submit a pull request or open an issue to discuss what you would like to change.
Expand Down

0 comments on commit d8b76fe

Please sign in to comment.