Skip to content

RDKEMW-19410: Updating AVInput Plugin to Use ReFactored DeviceSettings Thunder Plugin via COM-RPC#30

Open
yuvaramachandran-gurusamy wants to merge 10 commits into
developfrom
topic/RDKEMW-19410
Open

RDKEMW-19410: Updating AVInput Plugin to Use ReFactored DeviceSettings Thunder Plugin via COM-RPC#30
yuvaramachandran-gurusamy wants to merge 10 commits into
developfrom
topic/RDKEMW-19410

Conversation

@yuvaramachandran-gurusamy

Copy link
Copy Markdown

No description provided.

…s Thunder Plugin via COM-RPC

Signed-off-by: Yuvaramachandran Gurusamy <yuvaramachandran_gurusamy@comcast.com>
Signed-off-by: Yuvaramachandran Gurusamy <yuvaramachandran_gurusamy@comcast.com>
Signed-off-by: Yuvaramachandran Gurusamy <yuvaramachandran_gurusamy@comcast.com>
Signed-off-by: Yuvaramachandran Gurusamy <yuvaramachandran_gurusamy@comcast.com>
Copilot AI review requested due to automatic review settings July 6, 2026 18:00
@yuvaramachandran-gurusamy
yuvaramachandran-gurusamy requested a review from a team as a code owner July 6, 2026 18:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds a COM-RPC–based AVInput implementation that talks to the refactored DeviceSettings Thunder plugin, while retaining the existing libds/IARM-based implementation. The build is switched at CMake configure time via a new DS_COMRPC option.

Changes:

  • Added a new DS_COMRPC/ AVInput + AVInputImplementation pair using DeviceSettingsClientHelper and DeviceSettings COM-RPC sub-interfaces for HDMI-In / Composite-In.
  • Added a DS_IARM/ AVInput + AVInputImplementation pair (legacy path) to keep the libds/IARM implementation available.
  • Updated plugin/CMakeLists.txt to select sources/dependencies from DS_COMRPC/ vs DS_IARM/ based on DS_COMRPC.

Reviewed changes

Copilot reviewed 5 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
plugin/DS_IARM/AVInputImplementation.h Adds the legacy libds/IARM AVInput implementation interface + event dispatch scaffolding.
plugin/DS_IARM/AVInputImplementation.cpp Implements legacy libds/IARM AVInput behaviors and event dispatching.
plugin/DS_IARM/AVInput.h Adds legacy AVInput plugin wrapper (JSON-RPC + COM-RPC root to implementation).
plugin/DS_IARM/AVInput.cpp Implements legacy AVInput plugin lifecycle and JSON-RPC getInputDevices wrapper.
plugin/DS_COMRPC/AVInputImplementation.h Adds COM-RPC AVInput implementation interface bridging DeviceSettings notifications to AVInput events.
plugin/DS_COMRPC/AVInputImplementation.cpp Implements COM-RPC AVInput behaviors via DeviceSettings sub-interfaces and notification delegates.
plugin/DS_COMRPC/AVInput.h Adds COM-RPC AVInput plugin wrapper (JSON-RPC + COM-RPC root to implementation).
plugin/DS_COMRPC/AVInput.cpp Implements COM-RPC AVInput plugin lifecycle and JSON-RPC getInputDevices wrapper using DeviceSettings queries.
plugin/CMakeLists.txt Adds DS_COMRPC option and switches sources/includes/libs based on selected implementation.


namespace WPEFramework {
namespace Plugin {
SERVICE_REGISTRATION(AVInputImplementation, 1, 0);
Comment on lines +282 to +295
case ON_AVINPUT_DEVICES_CHANGED: {

if (auto* const devices = boost::get<Exchange::IAVInput::IInputDeviceIterator* const>(&params)) {
LOGINFO("ON_AVINPUT_DEVICES_CHANGED");

std::list<IAVInput::IDevicesChangedNotification*>::const_iterator index(_devicesChangedNotifications.begin());

while (index != _devicesChangedNotifications.end()) {
(*index)->OnDevicesChanged(*devices);
++index;
}
}
break;
}
Comment on lines +1459 to +1461
audio->SetAudioMixerLevels(0, Exchange::IDeviceSettingsAudio::AUDIO_INPUT_PRIMARY, primaryVolume);
audio->SetAudioMixerLevels(0, Exchange::IDeviceSettingsAudio::AUDIO_INPUT_SYSTEM, inputVolume);
LOGINFO("Setting MixerLevels: primaryVolume[%d] inputVolume[%d]", primaryVolume, inputVolume);
return Core::ERROR_NONE;
}

int iType = AVInputUtils::getTypeOfInput(typeOfInput);
Core::hresult AVInputImplementation::SetVideoRectangle(const uint16_t x, const uint16_t y,
const uint16_t w, const uint16_t h, const string& typeOfInput, SuccessResult& successResult)
{
int iType = AVInputUtils::getTypeOfInput(typeOfInput);
Signed-off-by: Yuvaramachandran Gurusamy <yuvaramachandran_gurusamy@comcast.com>
Signed-off-by: Yuvaramachandran Gurusamy <yuvaramachandran_gurusamy@comcast.com>
Copilot AI review requested due to automatic review settings July 7, 2026 19:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 9 changed files in this pull request and generated 5 comments.


namespace WPEFramework {
namespace Plugin {
SERVICE_REGISTRATION(AVInputImplementation, 1, 0);
LOGERR("IDeviceSettingsHDMIIn not available");
num = 0;
}
hdmiIn->Release();
LOGERR("IDeviceSettingsCompositeIn not available");
num = 0;
}
compositeIn->Release();
Comment on lines +470 to +471
int iType = AVInputUtils::getTypeOfInput(typeOfInput);
Core::hresult comResult = Core::ERROR_NONE;
Comment on lines +610 to +611
int iType = AVInputUtils::getTypeOfInput(typeOfInput);
Core::hresult comResult = Core::ERROR_NONE;
Signed-off-by: Yuvaramachandran Gurusamy <yuvaramachandran_gurusamy@comcast.com>
Copilot AI review requested due to automatic review settings July 9, 2026 17:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 9 changed files in this pull request and generated 8 comments.

Comment on lines +674 to +686
auto* hdmiIn = AcquireSubInterface<Exchange::IDeviceSettingsHDMIIn>();
if (nullptr != hdmiIn) {
comResult = hdmiIn->GetHDMIInNumberOfInputs(num);
if (comResult != Core::ERROR_NONE) {
LOGERR("GetHDMIInNumberOfInputs failed, Error: %d", static_cast<int>(comResult));
num = 0;
}
} else {
LOGERR("IDeviceSettingsHDMIIn not available");
num = 0;
}
hdmiIn->Release();
break;
Comment on lines +690 to +704
auto* compositeIn = AcquireSubInterface<Exchange::IDeviceSettingsCompositeIn>();
if (nullptr != compositeIn) {
comResult = compositeIn->GetNrOfCompositeInputs(num);
if (comResult != Core::ERROR_NONE) {
LOGERR("GetNrOfCompositeInputs failed, Error: %d", static_cast<int>(comResult));
num = 0;
}
} else {
LOGERR("IDeviceSettingsCompositeIn not available");
num = 0;
}
compositeIn->Release();
isHdmi = false;
break;
}
return Core::ERROR_NONE;
}

int iType = AVInputUtils::getTypeOfInput(typeOfInput);
Core::hresult AVInputImplementation::SetVideoRectangle(const uint16_t x, const uint16_t y,
const uint16_t w, const uint16_t h, const string& typeOfInput, SuccessResult& successResult)
{
int iType = AVInputUtils::getTypeOfInput(typeOfInput);
Comment on lines +61 to +68
AVInputImplementation::~AVInputImplementation()
{
AVInputImplementation::_instance = nullptr;

// COM-RPC: notifications are unregistered in Deinitialize() via
// DeviceSettingsClientHelper::Close() which calls OnDeviceSettingsDeactivated()
_registeredDsEventHandlers = false;
}
}

Core::hresult AVInputImplementation::GetARCPortId(string& portId, bool& success)
{

namespace WPEFramework {
namespace Plugin {
SERVICE_REGISTRATION(AVInputImplementation, 1, 0);
Comment on lines +102 to +105
} else {
SYSLOG(Logging::Startup, (_T("AVInput::Initialize: Failed to initialize AVInput plugin")));
message = _T("AVInput plugin could not be initialized");
}
Copilot AI review requested due to automatic review settings July 12, 2026 09:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 9 changed files in this pull request and generated 7 comments.

Comment on lines +289 to +298
if (auto* const devices = boost::get<Exchange::IAVInput::IInputDeviceIterator* const>(&params)) {
LOGINFO("ON_AVINPUT_DEVICES_CHANGED");

std::list<IAVInput::IDevicesChangedNotification*>::const_iterator index(_devicesChangedNotifications.begin());

while (index != _devicesChangedNotifications.end()) {
(*index)->OnDevicesChanged(*devices);
++index;
}
}

namespace WPEFramework {
namespace Plugin {
SERVICE_REGISTRATION(AVInputImplementation, 1, 0);
LOGERR("IDeviceSettingsHDMIIn not available");
num = 0;
}
hdmiIn->Release();
LOGERR("IDeviceSettingsCompositeIn not available");
num = 0;
}
compositeIn->Release();
Comment on lines +470 to +471
int iType = AVInputUtils::getTypeOfInput(typeOfInput);
Core::hresult comResult = Core::ERROR_NONE;
Core::hresult AVInputImplementation::SetVideoRectangle(const uint16_t x, const uint16_t y,
const uint16_t w, const uint16_t h, const string& typeOfInput, SuccessResult& successResult)
{
int iType = AVInputUtils::getTypeOfInput(typeOfInput);
Comment on lines +288 to +291
JsonArray deviceArr = getInputDevices(iType);
response["devices"] = deviceArr;
response["deviceList"] = deviceArr;
}
Signed-off-by: Yuvaramachandran Gurusamy <yuvaramachandran_gurusamy@comcast.com>
Copilot AI review requested due to automatic review settings July 16, 2026 14:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 9 changed files in this pull request and generated 4 comments.

LOGERR("IDeviceSettingsHDMIIn not available");
num = 0;
}
hdmiIn->Release();
LOGERR("IDeviceSettingsCompositeIn not available");
num = 0;
}
compositeIn->Release();
Comment on lines +113 to +118
~DispatchJob()
{
if (_avInputImplementation != nullptr) {
_avInputImplementation->Release();
}
}
namespace DSHelper = WPEFramework::Plugin::DeviceSettingsClientHelper;
namespace WPEFramework {
namespace Plugin {
SERVICE_REGISTRATION(AVInputImplementation, 1, 0);
Signed-off-by: Yuvaramachandran Gurusamy <yuvaramachandran_gurusamy@comcast.com>
Copilot AI review requested due to automatic review settings July 16, 2026 16:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 9 changed files in this pull request and generated 8 comments.


namespace WPEFramework {
namespace Plugin {
SERVICE_REGISTRATION(AVInputImplementation, 1, 0);
Comment on lines +61 to +68
AVInputImplementation::~AVInputImplementation()
{
AVInputImplementation::_instance = nullptr;

// COM-RPC: notifications are unregistered in Deinitialize() via
// DSHelper::Close() which calls OnDeviceSettingsDeactivated()
_registeredDsEventHandlers = false;
}
Comment on lines +134 to +146
Core::hresult AVInputImplementation::Configure(PluginHost::IShell* service)
{
_service = service;

// COM-RPC: open the DeviceSettings plugin link.
// DS_IARM equivalent: device::Manager::Initialize()
// OnDeviceSettingsActivated() fires once DeviceSettings is ready,
// which registers the HDMI-In and Composite-In notification delegates.
DSHelper::Open(service);
LOGINFO("AVInputImplementation: DSHelper::Open() called");

return Core::ERROR_NONE;
}
Comment on lines +672 to +687
case INPUT_TYPE_INT_HDMI: {
// COM-RPC: device::HdmiInput::getInstance().getNumberOfInputs()
auto* hdmiIn = DSHelper::AcquireSubInterface<Exchange::IDeviceSettingsHDMIIn>();
if (nullptr != hdmiIn) {
comResult = hdmiIn->GetHDMIInNumberOfInputs(num);
if (comResult != Core::ERROR_NONE) {
LOGERR("GetHDMIInNumberOfInputs failed, Error: %d", static_cast<int>(comResult));
num = 0;
}
} else {
LOGERR("IDeviceSettingsHDMIIn not available");
num = 0;
}
hdmiIn->Release();
break;
}
Comment on lines +688 to +704
case INPUT_TYPE_INT_COMPOSITE: {
// COM-RPC: device::CompositeInput::getInstance().getNumberOfInputs()
auto* compositeIn = DSHelper::AcquireSubInterface<Exchange::IDeviceSettingsCompositeIn>();
if (nullptr != compositeIn) {
comResult = compositeIn->GetNrOfCompositeInputs(num);
if (comResult != Core::ERROR_NONE) {
LOGERR("GetNrOfCompositeInputs failed, Error: %d", static_cast<int>(comResult));
num = 0;
}
} else {
LOGERR("IDeviceSettingsCompositeIn not available");
num = 0;
}
compositeIn->Release();
isHdmi = false;
break;
}
Comment on lines +470 to +472
int iType = AVInputUtils::getTypeOfInput(typeOfInput);
Core::hresult comResult = Core::ERROR_NONE;

Comment on lines +610 to +612
int iType = AVInputUtils::getTypeOfInput(typeOfInput);
Core::hresult comResult = Core::ERROR_NONE;

Comment on lines +292 to +298
std::list<IAVInput::IDevicesChangedNotification*>::const_iterator index(_devicesChangedNotifications.begin());

while (index != _devicesChangedNotifications.end()) {
(*index)->OnDevicesChanged(*devices);
++index;
}
}
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