Skip to content

Multiple NIC for Transmission#37

Merged
dmkarthi merged 2 commits into
OpenVisualCloud:mainfrom
sunilnom:multiple_nic
Jul 8, 2026
Merged

Multiple NIC for Transmission#37
dmkarthi merged 2 commits into
OpenVisualCloud:mainfrom
sunilnom:multiple_nic

Conversation

@sunilnom

@sunilnom sunilnom commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Description

Checklist

Code Quality

  • Code follows project style guidelines
  • No unnecessary debug logs or commented-out code
  • No hardcoded values / secrets

Testing

  • Unit test added/modified accordingly
  • Perform manual basic sanity testing at system level

Review Readiness

  • PR title and description are clear and meaningful
  • Story/Task IDs are linked

Documentation

  • README or relevant docs updated (if applicable)

Security

  • No sensitive data exposed (keys, passwords, tokens)
  • Input validation added where needed

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Documentation content changes
  • Testing
  • Other... Please describe:

Comment thread include/core/session_manager.h Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-session nic_index, plus a new tx_video block 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.

Comment thread src/util/config_reader.c Outdated
Comment thread include/app_context.h
Comment thread src/ffmpeg/ffmpeg_tx.c Outdated
Comment thread README.md
Comment thread meson.build
Comment thread tests/test_config_reader.c
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 dmkarthi merged commit cf2c12f into OpenVisualCloud:main Jul 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants