Multiple NIC for Transmission#37
Merged
Merged
Conversation
dmkarthi
reviewed
Jul 6, 2026
There was a problem hiding this comment.
Pull request overview
This PR updates dvledtx’s configuration model and TX plumbing to support mapping sessions to multiple NICs (via nic_index) and introduces optional decode-time scaling (scale_width/scale_height) with corresponding validation and documentation/config fixture updates.
Changes:
- Refactor config parsing/validation to support multiple
interfaces[]entries and per-sessionnic_index, plus a newtx_videoblock for transmission/scaling parameters. - Add optional scaling support and propagate “effective” (scaled) dimensions through decoder and crop logic.
- Update MTL/FFmpeg TX paths, tests, and config fixtures to use the new NIC/session allocation model.
Reviewed changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_session_manager.c | Adjust test app setup to allocate NIC/session arrays and use nics[0]. |
| tests/test_main.c | Update stubs and resolve_ip_addrs tests to use nics[] and dynamic allocation. |
| tests/test_ffmpeg_watchdog.c | Update test app setup to use dynamic NIC/session arrays. |
| tests/test_ffmpeg_tx.c | Update FFmpeg TX unit test setup to use nics[]. |
| tests/test_ffmpeg_tx_mock.c | Update FFmpeg TX mock tests for dynamic session arrays sizing. |
| tests/test_ffmpeg_decoder_mock.c | Update decoder mock test setup to use nics[]. |
| tests/test_config_reader.c | Update tests for dynamic config arrays and add scaling-related validation tests. |
| tests/meson.build | Add MTL include path; link mtl_tx.c into session_manager test. |
| src/util/config_reader.c | Implement multi-interface parsing, tx_video parsing, scaling validation, and dynamic config memory management. |
| src/mtl/mtl_tx.c | Extend MTL init to register multiple ports and route sessions by nic_index. |
| src/main.c | Log NIC[0] info when present; free app context on cleanup. |
| src/ffmpeg/ffmpeg_tx.c | Route FFmpeg mtl_st20p options via per-session NIC; add “first session registers 2nd NIC” workaround. |
| src/ffmpeg/ffmpeg_decoder.c | Decode/scale to “effective” dimensions when scaling is configured. |
| src/core/session_manager.c | Use scaled effective dimensions for fallback cropping; always call mtl_tx_uninit. |
| README.md | Document scaling feature and update config field descriptions (needs schema alignment). |
| meson.build | Make MTL a required dependency and add hardcoded MTL include path. |
| include/util/config_reader.h | Change config structs to dynamic arrays; add nic_index and dvledtx_config_free. |
| include/mtl/mtl_tx.h | Make mtl_tx_init/uninit always available; gate other APIs behind ENABLE_MTL_TX. |
| include/core/session_manager.h | Always include MTL API; make mtl_handle always part of session_manager. |
| include/app_context.h | Replace fixed session array with dynamically allocated NIC/session arrays and helpers. |
| config/tx_fullhd_single_session.json | Update sample config to new video + tx_video schema. |
| config/tx_fullhd_multi_session.json | Update sample config to new schema and adjusted values. |
| config/tx_fullhd_multi_nic.json | Add new multi-NIC example using per-session nic_index. |
| config/tx_4k_single_session.json | Update sample config to new schema and scaled output example. |
| config/tx_4k_multi_session.json | Update sample config to new schema and scaled tiled crops. |
| config/tx_2k_single_session.json | Update sample config to new schema. |
| config/tx_2k_multi_session.json | Update sample config to new schema. |
| .gitignore | Ignore generated dvledtx.log. |
Comments suppressed due to low confidence (1)
tests/meson.build:32
- The test build hardcodes '/usr/local/include/mtl' in include_directories(), but mtl_dep is declared required:false. Since test_session_manager compiles ../src/mtl/mtl_tx.c, the suite will still fail to compile/link when MTL isn’t installed. Either gate MTL-dependent tests on mtl_dep.found() or make MTL required for tests.
test_inc = include_directories('../include', '/usr/local/include/mtl')
test_deps = all_deps + [cmocka_dep]
test_c_args = ['-DALLOW_EXPERIMENTAL_API']
test_config_reader = executable('test_config_reader',
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Squashes the following multiple_nic branch commits prior to rebasing onto upstream/main (which independently merged the scaling_tx feature as OpenVisualCloud#32): 24c825d feat: add 2K/4K resolution support and rename config files 6df149d feat: add video scaling support (upscale/downscale) 7ba414c fix: address PR review comments 084b8cd feat: multi-NIC support for FFmpeg and direct MTL TX paths 72418ec fix: use shared frame counter for RTP timestamps in multi-session TX 5313ed5 feat: multi-NIC and scaling TX support from scaling_tx branch 3cc5866 Remove hardcoded MAX_TX_SESSIONS/MAX_INTERFACES limits f88c35c fix: address PR review comments (round 2)
…olve_ip_fails stub - config/*.json: unify tx_video.fmt to yuv422p10le and video.tx_url to the ball_<res>_yuv422p10_<fps>fps_<duration>.mp4 naming pattern; drop hardcoded absolute sample paths in favor of relative filenames. - tests/test_main.c: load_and_apply_config stub now always allocates the nic array so resolve_ip_addrs() is properly exercised when stub_load_config_set_ips is false, instead of leaving nic_count == 0 which let tx_app_real_main() fall into the infinite transmit loop and hang/timeout the whole test binary.
dmkarthi
approved these changes
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Checklist
Code Quality
Testing
Review Readiness
Documentation
Security
PR Type
What kind of change does this PR introduce?