Added a new config for setting the subtitles display#440
Added a new config for setting the subtitles display#440
Conversation
|
Pull request must be merged with a description containing the required fields, Summary: If there is no jira releated to this change, please put 'Jira: NO-JIRA'. Description can be changed by editing the top comment on your pull request and making a new commit. |
|
Coverage statistics of your commit: |
There was a problem hiding this comment.
Pull request overview
Adds support for configuring a dedicated Wayland display name for subtitles rendering and propagates it from ServerManager configuration through IPC into the SessionServer, where it is applied via an environment variable.
Changes:
- Introduces a new
subtitlesDisplayNameconfig value (CMake defaults + JSON config template + config reader/helper plumbing). - Extends ServerManager ↔ SessionServer IPC/proto and controller interfaces to carry
subtitlesDisplayName. - Updates SessionServer services to apply
SUBTITLES_WAYLAND_DISPLAYand extends UT/CT coverage accordingly.
Reviewed changes
Copilot reviewed 40 out of 40 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unittests/serverManager/unittests/service/ConfigReaderTests.cpp | Adds unit tests for parsing subtitlesDisplayName from JSON. |
| tests/unittests/serverManager/unittests/service/ConfigHelperTests.cpp | Updates ConfigHelper unit test mocks for the new config accessor. |
| tests/unittests/serverManager/unittests/ipc/IpcTestsFixture.cpp | Updates IPC test fixture to pass subtitlesDisplayName through performSetConfiguration. |
| tests/unittests/serverManager/unittests/common/SessionServerAppManagerTestsFixture.cpp | Updates app manager tests to expect/propagate subtitles display name through controller calls. |
| tests/unittests/serverManager/mocks/SessionServerAppMock.h | Extends SessionServerApp mock with getSubtitlesDisplayName(). |
| tests/unittests/serverManager/mocks/ControllerMock.h | Updates controller mock method signatures to include subtitlesDisplayName. |
| tests/unittests/serverManager/mocks/ConfigReaderMock.h | Adds getSubtitlesDisplayName() to ConfigReader mock. |
| tests/unittests/media/server/service/sessionServerManager/SessionServerManagerTestsFixture.cpp | Updates session server manager tests for the new configureServices parameter and playback call. |
| tests/unittests/media/server/service/playbackService/PlaybackServiceTestsFixture.h | Adds fixture helpers for setting/verifying subtitles display env var. |
| tests/unittests/media/server/service/playbackService/PlaybackServiceTestsFixture.cpp | Implements new fixture helper to set/verify SUBTITLES_WAYLAND_DISPLAY. |
| tests/unittests/media/server/service/playbackService/PlaybackServiceTests.cpp | Adds a unit test ensuring subtitles display env var is set. |
| tests/unittests/media/server/mocks/service/SessionServerManagerMock.h | Updates session server manager mock signature for configureServices. |
| tests/unittests/media/server/mocks/service/PlaybackServiceMock.h | Adds playback service mock method setSubtitlesDisplayName. |
| tests/unittests/media/server/ipc/serverManagerModuleService/ServerManagerModuleServiceTestsFixture.cpp | Updates IPC service tests to include subtitlesDisplayName in requests and expectations. |
| tests/componenttests/server/common/MessageBuilders.cpp | Extends component-test request builder to set subtitlesDisplayName. |
| serverManager/service/source/ConfigReader.cpp | Parses subtitlesDisplayName from config JSON and exposes it via getter. |
| serverManager/service/source/ConfigHelper.cpp | Stores/returns subtitlesDisplayName from default config and config files. |
| serverManager/service/include/IConfigReader.h | Extends config reader interface with getSubtitlesDisplayName(). |
| serverManager/service/include/ConfigReader.h | Adds new getter + parse method + member for subtitles display name. |
| serverManager/service/include/ConfigHelper.h | Adds getSubtitlesDisplayName() and backing member. |
| serverManager/ipc/source/Controller.h | Extends controller API with subtitlesDisplayName for setConfiguration. |
| serverManager/ipc/source/Controller.cpp | Propagates subtitlesDisplayName to client IPC calls. |
| serverManager/ipc/source/Client.h | Extends client API with subtitlesDisplayName for setConfiguration. |
| serverManager/ipc/source/Client.cpp | Sets subtitlesDisplayName into the protobuf SetConfiguration request. |
| serverManager/ipc/include/IController.h | Updates controller interface to include subtitlesDisplayName. |
| serverManager/config/rialto-config.in.json | Adds subtitlesDisplayName to generated config JSON template. |
| serverManager/common/source/SessionServerAppManager.cpp | Passes subtitles display name when configuring/restarting session servers via IPC. |
| serverManager/common/source/SessionServerApp.h | Adds getter and storage for subtitles display name in session server app model. |
| serverManager/common/source/SessionServerApp.cpp | Persists subtitlesDisplayName from AppConfig and exposes it. |
| serverManager/common/source/ISessionServerApp.h | Extends interface with getSubtitlesDisplayName(). |
| proto/servermanagermodule.proto | Adds subtitlesDisplayName to SetConfigurationRequest (proto2 optional with default). |
| media/server/service/source/SessionServerManager.h | Updates configureServices signature to include subtitles display name. |
| media/server/service/source/SessionServerManager.cpp | Applies subtitles display name by calling playback service setter during configuration. |
| media/server/service/source/PlaybackService.h | Adds setSubtitlesDisplayName() to playback service API. |
| media/server/service/source/PlaybackService.cpp | Implements setting SUBTITLES_WAYLAND_DISPLAY env var. |
| media/server/service/include/ISessionServerManager.h | Updates session server manager interface to accept subtitles display name. |
| media/server/service/include/IPlaybackService.h | Extends playback service interface with subtitles display setter. |
| media/server/ipc/source/ServerManagerModuleService.cpp | Reads subtitlesDisplayName from protobuf request and passes into configureServices. |
| common/public/include/SessionServerCommon.in | Extends AppConfig and ServerManagerConfig with subtitles display name field/default. |
| CMakeLists.txt | Adds CMake default for SUBTITLES_WAYLAND_DISPLAY substitution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| rialto::SetConfigurationResponse response; | ||
| request.set_sessionmanagementsocketname(socketName); | ||
| request.set_clientdisplayname(clientDisplayName); | ||
| request.set_subtitlesdisplayname(subtitlesDisplayName); |
There was a problem hiding this comment.
subtitlesDisplayName is always written into the protobuf request, even when it’s an empty string. In proto2 this marks the field as present and overrides the .proto default, so the session server will see "" and won’t apply the intended default subtitles display. Consider only setting subtitlesdisplayname when the value is non-empty (or ensure a non-empty default is injected earlier in the server manager).
| request.set_subtitlesdisplayname(subtitlesDisplayName); | |
| if (!subtitlesDisplayName.empty()) | |
| { | |
| request.set_subtitlesdisplayname(subtitlesDisplayName); | |
| } |
| const std::string &ConfigHelper::getSubtitlesDisplayName() const | ||
| { | ||
| return m_subtitlesDisplayName; | ||
| } |
There was a problem hiding this comment.
ConfigHelper reads/stores subtitlesDisplayName (and exposes getSubtitlesDisplayName()), but there are no call sites using this accessor in the codebase. As-is, updates from rialto-config*.json won’t affect the value that ultimately gets sent to the SessionServer, so the new config option appears to have no runtime effect. Wire this through to where AppConfig / IPC configuration is built (e.g., via ServiceContext / SessionServerAppManagerFactory / SessionServerAppFactory, or by injecting this value into the performSetConfiguration call).
| common::MaxResourceCapabilitites maxResource{request->resources().maxplaybacks(), | ||
| request->resources().maxwebaudioplayers()}; | ||
| const auto kClientDisplayName = request->has_clientdisplayname() ? request->clientdisplayname() : ""; | ||
| const auto kSubtitlesDisplayName = request->subtitlesdisplayname(); |
There was a problem hiding this comment.
Coverity issue no longer present as of: undefined
Show issue
Coverity Issue - Use of auto that causes a copy
Using the "auto" keyword without an "&" causes the copy of an object of type "std::string".
Low Impact, CWE-none
AUTO_CAUSES_COPY
How to fix
Use "const auto &" instead of "auto".
Summary: Added a new config for setting the subtitles display
Type: Feature
Test Plan: UT/CT, Fullstack
Jira: ENTDAI-2351