Import Tobias Work & Refactor Code
This merge request integrates a series of commits originally contributed by Tobias Ebsen (https://github.com/tobiasebsen/libndi).
These commits were cherry-picked, with unnecessary ones (e.g., example-related changes) dropped. Some commits were squashed for clarity, others broken down into smaller, more focused commits, and commit messages were updated where appropriate.
In addition, major refactoring was performed, and support for non-blocking socket logic was added.
Edited by Ahmed Hamed