RDKEMW-19410: Updating AVInput Plugin to Use ReFactored DeviceSettings Thunder Plugin via COM-RPC#30
Open
yuvaramachandran-gurusamy wants to merge 10 commits into
Open
RDKEMW-19410: Updating AVInput Plugin to Use ReFactored DeviceSettings Thunder Plugin via COM-RPC#30yuvaramachandran-gurusamy wants to merge 10 commits into
yuvaramachandran-gurusamy wants to merge 10 commits into
Conversation
…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>
Contributor
There was a problem hiding this comment.
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 usingDeviceSettingsClientHelperand 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.txtto select sources/dependencies fromDS_COMRPC/vsDS_IARM/based onDS_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>(¶ms)) { | ||
| 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>
|
|
||
| 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>
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"); | ||
| } |
Comment on lines
+289
to
+298
| if (auto* const devices = boost::get<Exchange::IAVInput::IInputDeviceIterator* const>(¶ms)) { | ||
| 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>
| 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>
|
|
||
| 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; | ||
| } | ||
| } |
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.
No description provided.