Skip to content
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
05bd5b7
client changes in AVInput
Prathyushakothuru Sep 1, 2025
8349223
parameter changes
Prathyushakothuru Sep 1, 2025
c78de9b
resolving compilation issues
Prathyushakothuru Sep 2, 2025
8089d93
fixing compilatin issues
Prathyushakothuru Sep 2, 2025
cae99bf
modifications
Prathyushakothuru Sep 4, 2025
edcb205
.cpp file changes
Prathyushakothuru Sep 5, 2025
1e58a4a
Merge pull request #246 from rdkcentral/develop
Prathyushakothuru Sep 5, 2025
ff7414f
changes
Prathyushakothuru Sep 5, 2025
d61701e
added include header
Prathyushakothuru Sep 6, 2025
5c073c6
template changes
Prathyushakothuru Sep 8, 2025
edf04fd
fixing build issues
Prathyushakothuru Sep 8, 2025
4f0f28f
fixing review comments_!
Prathyushakothuru Sep 9, 2025
d9a6466
Merge pull request #253 from rdkcentral/develop
Prathyushakothuru Sep 15, 2025
bfbe61f
added mock changes
Prathyushakothuru Sep 15, 2025
1955e35
adding manager mock
Prathyushakothuru Sep 15, 2025
0b27a74
resolving errors
Prathyushakothuru Sep 15, 2025
adce966
modifications for few testcases
Prathyushakothuru Sep 15, 2025
519991f
build issue
Prathyushakothuru Sep 16, 2025
ddd7e67
test case modifications
Prathyushakothuru Sep 16, 2025
b62268d
missed semi colon
Prathyushakothuru Sep 16, 2025
751657a
Update test_AVInput.cpp
Prathyushakothuru Sep 16, 2025
2079be6
Update test_AVInput.cpp
Prathyushakothuru Sep 16, 2025
ef95957
removing iarm oncall
Prathyushakothuru Sep 16, 2025
4ee9e4b
removed IARM_event handlers
Prathyushakothuru Sep 18, 2025
e8066e0
review comment changes-2
Prathyushakothuru Sep 19, 2025
ad33319
initialize return changes
Prathyushakothuru Sep 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: main-workflow

on:
push:
branches: [ main, develop, 'sprint/**', 'release/**' ]
branches: [ main, develop, 'sprint/**', 'release/**' , feature/ds-manager_AVInput]
pull_request:
branches: [ main, develop, 'sprint/**', 'release/**' ]

Expand Down
270 changes: 174 additions & 96 deletions AVInput/AVInput.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**

Check failure on line 1 in AVInput/AVInput.cpp

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'AVInput/AVInput.cpp' (Match: rdkcentral/rdkservices/1, 1728 lines, url: https://github.com/rdkcentral/rdkservices/archive/GRT_v1.tar.gz, file: HdmiInput/HdmiInput.cpp)

Check failure on line 1 in AVInput/AVInput.cpp

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'AVInput/AVInput.cpp' (Match: rdkcentral/rdkservices/5.1.0, 1728 lines, url: https://github.com/rdkcentral/rdkservices/archive/AML_BSP_REL_VERSION_RDK5.1.0.tar.gz, file: AVInput/AVInput.cpp)

Check failure on line 1 in AVInput/AVInput.cpp

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'AVInput/AVInput.cpp' (Match: rdkcentral/rdkservices/1, 1728 lines, url: https://github.com/rdkcentral/rdkservices/archive/GRT_v1.tar.gz, file: AVInput/AVInput.cpp)
* If not stated otherwise in this file or this component's LICENSE
* file the following copyright and licenses apply:
*
Expand All @@ -18,13 +18,12 @@
**/

#include "AVInput.h"
#include "dsMgr.h"

#include "hdmiIn.hpp"
#include "compositeIn.hpp"

#include "UtilsJsonRpc.h"
#include "UtilsIarm.h"
#include "host.hpp"

#include "exception.hpp"
#include <vector>
Expand Down Expand Up @@ -113,6 +112,7 @@

AVInput::AVInput()
: PluginHost::JSONRPC()
, _registeredDsEventHandlers(false)
{
RegisterAll();
}
Expand All @@ -125,14 +125,38 @@
const string AVInput::Initialize(PluginHost::IShell * /* service */)
{
AVInput::_instance = this;
InitializeIARM();
try
{
device::Manager::Initialize();
LOGINFO("device::Manager::Initialize success");
registerDsEventHandlers();
}
catch(const device::Exception& err)
{
LOGINFO("device::Manager::Initialize failed");
LOG_DEVICE_EXCEPTION0();
}

return (string());
}

void AVInput::Deinitialize(PluginHost::IShell * /* service */)
{
DeinitializeIARM();

device::Host::getInstance().UnRegister(baseInterface<device::Host::IHdmiInEvents>());
device::Host::getInstance().UnRegister(baseInterface<device::Host::ICompositeInEvents>());
_registeredDsEventHandlers = false;
try
{
device::Manager::DeInitialize();
LOGINFO("device::Manager::DeInitialize success");

Choose a reason for hiding this comment

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

correct the try-catch block alignment wrt other places where it is already used.

}
catch(const device::Exception& err)
{
LOGINFO("device::Manager::DeInitialize failed");
LOG_DEVICE_EXCEPTION0();
}

AVInput::_instance = nullptr;
}

Expand All @@ -141,97 +165,6 @@
return (string());
}

void AVInput::InitializeIARM()
{
if (Utils::IARM::init()) {
IARM_Result_t res;
IARM_CHECK(IARM_Bus_RegisterEventHandler(
IARM_BUS_DSMGR_NAME,
IARM_BUS_DSMGR_EVENT_HDMI_IN_HOTPLUG,
dsAVEventHandler));
IARM_CHECK(IARM_Bus_RegisterEventHandler(
IARM_BUS_DSMGR_NAME,
IARM_BUS_DSMGR_EVENT_HDMI_IN_SIGNAL_STATUS,
dsAVSignalStatusEventHandler));
IARM_CHECK(IARM_Bus_RegisterEventHandler(
IARM_BUS_DSMGR_NAME,
IARM_BUS_DSMGR_EVENT_HDMI_IN_STATUS,
dsAVStatusEventHandler));
IARM_CHECK(IARM_Bus_RegisterEventHandler(
IARM_BUS_DSMGR_NAME,
IARM_BUS_DSMGR_EVENT_HDMI_IN_VIDEO_MODE_UPDATE,
dsAVVideoModeEventHandler));
IARM_CHECK(IARM_Bus_RegisterEventHandler(
IARM_BUS_DSMGR_NAME,
IARM_BUS_DSMGR_EVENT_HDMI_IN_ALLM_STATUS,
dsAVGameFeatureStatusEventHandler));
IARM_CHECK(IARM_Bus_RegisterEventHandler(
IARM_BUS_DSMGR_NAME,
IARM_BUS_DSMGR_EVENT_HDMI_IN_VRR_STATUS,
dsAVGameFeatureStatusEventHandler));
IARM_CHECK(IARM_Bus_RegisterEventHandler(
IARM_BUS_DSMGR_NAME,
IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_HOTPLUG,
dsAVEventHandler));
IARM_CHECK(IARM_Bus_RegisterEventHandler(
IARM_BUS_DSMGR_NAME,
IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_SIGNAL_STATUS,
dsAVSignalStatusEventHandler));
IARM_CHECK(IARM_Bus_RegisterEventHandler(
IARM_BUS_DSMGR_NAME,
IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_STATUS,
dsAVStatusEventHandler));
IARM_CHECK(IARM_Bus_RegisterEventHandler(
IARM_BUS_DSMGR_NAME,
IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_VIDEO_MODE_UPDATE,
dsAVVideoModeEventHandler));
IARM_CHECK(IARM_Bus_RegisterEventHandler(
IARM_BUS_DSMGR_NAME,
IARM_BUS_DSMGR_EVENT_HDMI_IN_AVI_CONTENT_TYPE,
dsAviContentTypeEventHandler));
}
}

void AVInput::DeinitializeIARM()
{
if (Utils::IARM::isConnected()) {
IARM_Result_t res;
IARM_CHECK(IARM_Bus_RemoveEventHandler(
IARM_BUS_DSMGR_NAME,
IARM_BUS_DSMGR_EVENT_HDMI_IN_HOTPLUG, dsAVEventHandler));
IARM_CHECK(IARM_Bus_RemoveEventHandler(
IARM_BUS_DSMGR_NAME,
IARM_BUS_DSMGR_EVENT_HDMI_IN_SIGNAL_STATUS, dsAVSignalStatusEventHandler));
IARM_CHECK(IARM_Bus_RemoveEventHandler(
IARM_BUS_DSMGR_NAME,
IARM_BUS_DSMGR_EVENT_HDMI_IN_STATUS, dsAVStatusEventHandler));
IARM_CHECK(IARM_Bus_RemoveEventHandler(
IARM_BUS_DSMGR_NAME,
IARM_BUS_DSMGR_EVENT_HDMI_IN_VIDEO_MODE_UPDATE, dsAVVideoModeEventHandler));
IARM_CHECK(IARM_Bus_RemoveEventHandler(
IARM_BUS_DSMGR_NAME,
IARM_BUS_DSMGR_EVENT_HDMI_IN_ALLM_STATUS, dsAVGameFeatureStatusEventHandler));
IARM_CHECK(IARM_Bus_RemoveEventHandler(
IARM_BUS_DSMGR_NAME,
IARM_BUS_DSMGR_EVENT_HDMI_IN_VRR_STATUS, dsAVGameFeatureStatusEventHandler));
IARM_CHECK(IARM_Bus_RemoveEventHandler(
IARM_BUS_DSMGR_NAME,
IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_HOTPLUG, dsAVEventHandler));
IARM_CHECK(IARM_Bus_RemoveEventHandler(
IARM_BUS_DSMGR_NAME,
IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_SIGNAL_STATUS, dsAVSignalStatusEventHandler));
IARM_CHECK(IARM_Bus_RemoveEventHandler(
IARM_BUS_DSMGR_NAME,
IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_STATUS, dsAVStatusEventHandler));
IARM_CHECK(IARM_Bus_RemoveEventHandler(
IARM_BUS_DSMGR_NAME,
IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_VIDEO_MODE_UPDATE, dsAVVideoModeEventHandler));
IARM_CHECK(IARM_Bus_RemoveEventHandler(
IARM_BUS_DSMGR_NAME,
IARM_BUS_DSMGR_EVENT_HDMI_IN_AVI_CONTENT_TYPE, dsAviContentTypeEventHandler));
}
}

void AVInput::RegisterAll()
{
Register<JsonObject, JsonObject>(_T(AVINPUT_METHOD_NUMBER_OF_INPUTS), &AVInput::endpoint_numberOfInputs, this);
Expand Down Expand Up @@ -923,7 +856,7 @@

sendNotify(AVINPUT_EVENT_ON_VIDEO_MODE_UPDATED, params);
}

#if 0
void AVInput::dsAviContentTypeEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len)
{
if(!AVInput::_instance)
Expand All @@ -939,6 +872,7 @@
AVInput::_instance->hdmiInputAviContentTypeChange(hdmi_in_port, avi_content_type);
}
}
#endif

void AVInput::hdmiInputAviContentTypeChange( int port , int content_type)
{
Expand All @@ -948,6 +882,7 @@
sendNotify(AVINPUT_EVENT_ON_AVI_CONTENT_TYPE_CHANGED, params);
}

#if 0
void AVInput::dsAVEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len)
{
if(!AVInput::_instance)
Expand Down Expand Up @@ -1071,6 +1006,8 @@
}
}

#endif

void AVInput::AVInputALLMChange( int port , bool allm_mode)
{
JsonObject params;
Expand Down Expand Up @@ -1792,5 +1729,146 @@
return edidVersion;
}

void AVInput::registerDsEventHandlers()
{
LOGINFO("registerDsEventHandlers");
if(!_registeredDsEventHandlers)
{
_registeredDsEventHandlers = true;
device::Host::getInstance().Register(baseInterface<device::Host::IHdmiInEvents>());
device::Host::getInstance().Register(baseInterface<device::Host::ICompositeInEvents>());
}
}

/* HDMIInEventsNotification*/

void AVInput::OnHdmiInAVIContentType(dsHdmiInPort_t port, dsAviContentType_t aviContentType)
{
LOGINFO("Received OnHdmiInAVIContentType callback, port: %d, Content Type: %d", port, aviContentType);

if(AVInput::_instance) {
AVInput::_instance->hdmiInputAviContentTypeChange(port, aviContentType);
}
}

void AVInput::OnHdmiInEventHotPlug(dsHdmiInPort_t port, bool isConnected)
{
LOGINFO("Received OnHdmiInEventHotPlug callback, port: %d, isConnected: %s", port, isConnected ? "true" : "false");

if(AVInput::_instance) {
AVInput::_instance->AVInputHotplug(port,isConnected ? AV_HOT_PLUG_EVENT_CONNECTED : AV_HOT_PLUG_EVENT_DISCONNECTED, HDMI);
}
}

void AVInput::OnHdmiInEventSignalStatus(dsHdmiInPort_t port, dsHdmiInSignalStatus_t signalStatus)
{
LOGINFO("Received OnHdmiInEventSignalStatus callback, port: %d, signalStatus: %d",port, signalStatus);

if(AVInput::_instance) {
AVInput::_instance->AVInputSignalChange(port, signalStatus, HDMI);
}
}

void AVInput::OnHdmiInEventStatus(dsHdmiInPort_t activePort, bool isPresented)
{
LOGINFO("Received OnHdmiInEventStatus callback, port: %d, isPresented: %s",activePort, isPresented ? "true" : "false");

if (AVInput::_instance) {
AVInput::_instance->AVInputStatusChange(activePort, isPresented, HDMI);
}
}

void AVInput::OnHdmiInVideoModeUpdate(dsHdmiInPort_t port, const dsVideoPortResolution_t& videoPortResolution)
{
LOGINFO("Received OnHdmiInVideoModeUpdate callback, port: %d, pixelResolution: %d, interlaced: %d, frameRate: %d",
port,
videoPortResolution.pixelResolution,
videoPortResolution.interlaced,
videoPortResolution.frameRate);

if (AVInput::_instance) {
AVInput::_instance->AVInputVideoModeUpdate(port, videoPortResolution, HDMI);
}
}

void AVInput::OnHdmiInAllmStatus(dsHdmiInPort_t port, bool allmStatus)
{
LOGINFO("Received OnHdmiInAllmStatus callback, port: %d, ALLM Mode: %s",
port, allmStatus ? "true" : "false");

if (AVInput::_instance) {
AVInput::_instance->AVInputALLMChange(port, allmStatus);
}
}

void AVInput::OnHdmiInVRRStatus(dsHdmiInPort_t port, dsVRRType_t vrrType)
{
LOGINFO("Received OnHdmiInVRRStatus callback, port: %d, VRR Type: %d",
port, vrrType);

if (!AVInput::_instance)
return;

// Handle transitions
if (vrrType == dsVRR_NONE) {
if (AVInput::_instance->m_currentVrrType != dsVRR_NONE) {
AVInput::_instance->AVInputVRRChange(port,AVInput::_instance->m_currentVrrType,false);
}
} else {
if (AVInput::_instance->m_currentVrrType != dsVRR_NONE) {
AVInput::_instance->AVInputVRRChange(port,AVInput::_instance->m_currentVrrType,false);
}
AVInput::_instance->AVInputVRRChange(port,vrrType,true);
}

AVInput::_instance->m_currentVrrType = vrrType;
}


/*CompositeInEventsNotification*/

void AVInput::OnCompositeInHotPlug(dsCompositeInPort_t port, bool isConnected)
{
LOGINFO("Received OnCompositeInHotPlug callback, port: %d, isConnected: %s",port, isConnected ? "true" : "false");

if(AVInput::_instance) {
AVInput::_instance->AVInputHotplug(port,isConnected ? AV_HOT_PLUG_EVENT_CONNECTED : AV_HOT_PLUG_EVENT_DISCONNECTED,COMPOSITE);
}
}

void AVInput::OnCompositeInSignalStatus(dsCompositeInPort_t port, dsCompInSignalStatus_t signalStatus)
{
LOGINFO("Received OnCompositeInSignalStatus callback, port: %d, signalStatus: %d",port, signalStatus);

if(AVInput::_instance) {
AVInput::_instance->AVInputSignalChange(port, signalStatus, COMPOSITE);
}
}

void AVInput::OnCompositeInStatus(dsCompositeInPort_t activePort, bool isPresented)
{
LOGINFO("Received OnCompositeInStatus callback, port: %d, isPresented: %s",
activePort, isPresented ? "true" : "false");

if (AVInput::_instance) {
AVInput::_instance->AVInputStatusChange(activePort, isPresented, COMPOSITE);
}
}

void AVInput::OnCompositeInVideoModeUpdate(dsCompositeInPort_t activePort, dsVideoPortResolution_t videoResolution)
{
LOGINFO("Received OnCompositeInVideoModeUpdate callback, port: %d, pixelResolution: %d, interlaced: %d, frameRate: %d",
activePort,
videoResolution.pixelResolution,
videoResolution.interlaced,
videoResolution.frameRate);

if (AVInput::_instance) {
AVInput::_instance->AVInputVideoModeUpdate(activePort, videoResolution, COMPOSITE);
}
}



} // namespace Plugin
} // namespace WPEFramework
Loading
Loading