Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b384710
topic/RDKEMW6161-Ramesh Inital commit of interfaces and check native…
rababu2 Aug 25, 2025
4204275
topic/RDKEMW6161-Ramesh Zoom interfaces moved to Video Device
rababu2 Aug 25, 2025
f5fff98
topic/RDKEMW6161-Ramesh merge changes Video
rababu2 Aug 25, 2025
bb2c5bc
topic/RDKEMW6161-Ramesh merge changes Video
rababu2 Aug 25, 2025
e74115a
topic/RDKEMW6161-Ramesh merge changes Video
rababu2 Aug 25, 2025
6809a87
topic/RDKEMW6161-Ramesh merge changes Video
rababu2 Aug 25, 2025
574a738
topic/RDKEMW6161-Ramesh merge changes Video
rababu2 Aug 25, 2025
9caee26
topic/RDKEMW6161-Ramesh merge changes Video
rababu2 Aug 25, 2025
9755062
topic/RDKEMW6161-Ramesh merge changes Video
rababu2 Aug 25, 2025
51d4012
topic/RDKEMW6161-Ramesh merge changes Video
rababu2 Aug 25, 2025
d2395c6
topic/RDKEMW6161-Ramesh merge changes Video
rababu2 Aug 26, 2025
d91573f
topic/RDKEMW6161-Ramesh merge changes Video
rababu2 Aug 26, 2025
f1791a5
topic/RDKEMW6161-Ramesh merge changes Video
rababu2 Aug 26, 2025
03bc141
topic/RDKEMW6161- Updated composite
rababu2 Aug 26, 2025
6db5886
topic/RDKEMW6161- Updated composite
rababu2 Aug 26, 2025
2cce9ec
topic/RDKEMW6161- Updated composite
rababu2 Aug 26, 2025
9a39ca4
topic/RDKEMW6161- Updated composite
rababu2 Aug 26, 2025
071e0d4
topic/RDKEMW6161- Updated composite
rababu2 Aug 26, 2025
2ef2da1
topic/RDKEMW6161- Updated composite
rababu2 Aug 26, 2025
494cb98
topic/RDKEMW6161- Updated Display
rababu2 Aug 26, 2025
e8a985f
topic/RDKEMW6161- Updated Display
rababu2 Aug 26, 2025
050faa1
topic/RDKEMW6161- Updated Display
rababu2 Aug 26, 2025
5004269
topic/RDKEMW6161- Updated Display
rababu2 Aug 26, 2025
28e70b8
topic/RDKEMW6161- Updated Display
rababu2 Aug 26, 2025
fafd5f8
topic/RDKEMW6161- Updated Display
rababu2 Aug 26, 2025
8c9a236
topic/RDKEMW6161- Composite and Display Implementation: Sync from bas…
rababu2 Aug 26, 2025
09ed4df
topic/RDKEMW6161- Composite and Display Implementation: Sync from bas…
rababu2 Aug 26, 2025
6da2453
topic/RDKEMW6161- Composite and Display Implementation: Sync from bas…
rababu2 Aug 26, 2025
7c190d6
topic/RDKEMW6161- Composite and Display Implementation: Sync from bas…
rababu2 Aug 26, 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 build_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ cd rfc
autoreconf -i
./configure --enable-rfctool=yes --enable-tr181set=yes
cd rfcapi
make librfcapi_la_CPPFLAGS="-I/usr/include/cjson"
make CXXFLAGS="-DUSE_IARMBUS" librfcapi_la_CPPFLAGS="-I/usr/include/cjson"
make install
export RFC_PATH=$ROOT/rfc

Expand Down
4 changes: 3 additions & 1 deletion ds/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ RM := rm -rf
CFLAGS += -std=c++0x -g -fPIC -D_REENTRANT -Wall
LIBNAME := ds
LIBNAMEFULL := lib$(LIBNAME).so
LIBNAMECLI := lib$(LIBNAME)-cli.so
LIBNAMECLI := lib$(LIBNAME)-cli.so
INSTALL := $(PWD)/install
OBJS := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
# In future add a conditional to choose implementation class based on build configuration
OBJS += iarm/IarmHostImpl.o
#$(PWD)/config should be first include path
# to override generic configs
ifneq ($(STANDALONE_BUILD_ENABLED),y)
Expand Down
274 changes: 108 additions & 166 deletions ds/host.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:

Check failure on line 3 in ds/host.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 'ds/host.cpp' (Match: rdk/components/generic/devicesettings/rdk/components/generic/devicesettings/1907, 389 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/devicesettings/+archive/rdk-dev-1907.tar.gz, file: ds/host.cpp)
*
* Copyright 2016 RDK Management
* Copyright 2025 RDK Management
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -28,25 +28,20 @@


#include <iostream>
#include <algorithm>
#include <string.h>
#include "iarmProxy.hpp"
#include <string>

#include "audioOutputPortConfig.hpp"
#include "videoOutputPortConfig.hpp"
#include "list.hpp"
#include "host.hpp"
#include "videoDeviceConfig.hpp"
#include "dsVideoPort.h"
#include "dsVideoDevice.h"
#include "dsAudio.h"
#include "dsDisplay.h"
#include "dslogger.h"
#include "dsHost.h"
#include "dsTypes.h"
#include "unsupportedOperationException.hpp"
#include "hostEDID.hpp"
#include "dsInternal.h"

#include "iarm/IarmHostImpl.hpp"

/**
* @file host.cpp
* @brief The host module is the central module of the Device Settings module.
Expand All @@ -56,24 +51,20 @@

namespace device
{

const int Host::kPowerOn = dsPOWER_ON;
const int Host::kPowerOff = dsPOWER_OFF;
const int Host::kPowerStandby = dsPOWER_STANDBY;


Host::Host()
{
// TODO Auto-generated destructor stub
}

Host::~Host() {
if (true)
{
IARMProxy::getInstance().UnRegisterPowerEventHandler();
}
}

const int Host::kPowerOn = dsPOWER_ON;
const int Host::kPowerOff = dsPOWER_OFF;
const int Host::kPowerStandby = dsPOWER_STANDBY;

Host::Host()
: m_impl(nullptr)
{
}

Host::~Host()
{
m_impl = nullptr;
}

/**
* @addtogroup dssettingshostapi
Expand Down Expand Up @@ -103,145 +94,6 @@
return instance;
}


/**
* @fn void Host::addPowerModeListener(PowerModeChangeListener *l)
* @brief This API is used to register listeners for Power Mode change event.
* The listener object is created by application and should be released by the application once the listener is removed.
* Listeners will be notified with the new mode via the listener's powerModeChanged() callback.
*
* @param[in] PowerModeChangeListener Pointer to Power Mode change listener
*
* @return None
*/
void Host::addPowerModeListener(PowerModeChangeListener *l)
{
std::list < PowerModeChangeListener* > ::iterator it;

it = find (powerEvntListeners.begin(),powerEvntListeners.end(), l);
if (it == powerEvntListeners.end())
{
powerEvntListeners.push_back (l);
cout << "Added Power Mode listener...!\n";
}
else
{
cout << "Already register for Power Mode Change\n";
}
return ;
}


/**
* @fn void Host::removePowerModeChangeListener(PowerModeChangeListener *l)
* @brief This API is used to remove a listener from Power Mode change listener list.
*
* @param[in]PowerModeChangeListener The listener to remove.
*
* @return None
*/
void Host::removePowerModeChangeListener(PowerModeChangeListener *l)
{
std::list < PowerModeChangeListener* > ::iterator it ;
it = find (powerEvntListeners.begin(),powerEvntListeners.end(), l);
if (it == powerEvntListeners.end())
{
cout << "Not Registered for Power Mode change yet...!\n";
}
else
{
powerEvntListeners.erase (it);
cout << "Removed from Power Mode listener group..!\n";
}
return;
}


/**
* @fn void Host::addDisplayConnectionListener (DisplayConnectionChangeListener *l)
* @brief This API is used to register listeners for Display connection change event.
* The listener will be notified if Display device is connected/disconnected from the video output port.
* The notification only carries the state change of the connection.
* It does not carry any other system state change that may have been triggered by the connection.
* The application is responsible to query the various parts of system to detect any such change.
* For example, when a TV device is replaced, the application shall query the video output port again upon the connection
* for the new resolution supported by the TV.
* The listener object is created by application and should be released by the application once the listener is removed.
*
* @param[in] DisplayConnectionChangeListener Pointer to Display connection change listener
*
* @return None
*/
void Host::addDisplayConnectionListener (DisplayConnectionChangeListener *l)
{
std::list < DisplayConnectionChangeListener* > ::iterator it;

it = find (dispEvntListeners.begin(), dispEvntListeners.end(), l);
if (it == dispEvntListeners.end())
{
dispEvntListeners.push_back (l);
cout << "Added Display listener...!\n";
}
else
{
cout << "Already registered to the Display listener\n";
}
return ;
}


/**
* @fn void Host::removeDisplayConnectionListener (DisplayConnectionChangeListener *l)
* @brief This API is used to remove listeners from the Display connection change event list.
*
* @param[in] DisplayConnectionChangeListener The listener to remove
*
* @return None
*/
void Host::removeDisplayConnectionListener (DisplayConnectionChangeListener *l)
{
std::list < DisplayConnectionChangeListener* > ::iterator it ;
it = find (dispEvntListeners.begin(), dispEvntListeners.end(), l);
if (it == dispEvntListeners.end())
{
cout << "Not Registered to Display Listener yet...!\n";
}
else
{
dispEvntListeners.erase (it);
cout << "Removed from the Display listener...!\n";
}
return;
}


/**
* @fn void Host::notifyPowerChange (const int mode)
* @brief This function is used to get the current power state.
*
* @param[in] mode Power mode of the decoder.
* @return None.
*/
void Host::notifyPowerChange (const int mode)
{
std::list < PowerModeChangeListener* > ::iterator it;
for ( it = powerEvntListeners.begin() ; it != powerEvntListeners.end(); it++ )
{
(*it)->powerModeChanged (mode);
}
}

void Host::notifyDisplayConnectionChange (int portHandle, bool newConnectionStatus)
{
std::list < DisplayConnectionChangeListener* > ::iterator it;
for ( it = dispEvntListeners.begin() ; it != dispEvntListeners.end(); it++ )
{
(*it)->displayConnectionChanged(getVideoOutputPort(portHandle), newConnectionStatus);
getVideoOutputPort(portHandle).setDisplayConnected(newConnectionStatus);
}
}


/**
* @fn bool Host::setPowerMode(int mode)
* @brief This API is used to change the power mode of the device.
Expand Down Expand Up @@ -913,11 +765,101 @@
printf ("%s:%d - Set Audio Mixer levels for audio input: %d with volume = %d\n", __PRETTY_FUNCTION__, __LINE__,aInput, volume);
}

DefaultImpl& Host::impl()
{
// lazy instantiation
if (!m_impl) {
m_impl = std::unique_ptr<DefaultImpl>(new DefaultImpl());
}
return *m_impl;
}


/**
* @fn void Host::Register(ICompositeInEvents *Evtnotification)
* @brief This API is used to register the Events
*
* @return dsError_t
*/
dsError_t Host::Register(ICompositeInEvents *listener)
{
return impl().Register(listener);
}

/**
* @fn void Host::UnRegister(ICompositeInEvents *Evtnotification)
* @brief This API is used to UnRegister the Events
*
* @return dsError_t
*/
dsError_t Host::UnRegister(ICompositeInEvents *listener)
{
return impl().UnRegister(listener);
}

/**
* @fn void Host::Register(IDisplayEvents *Evtnotification)
* @brief This API is used to register the Events
*
* @return dsError_t
*/
dsError_t Host::Register(IDisplayEvents *listener)
{
return impl().Register(listener);
}

/**
* @fn void Host::UnRegister(IDisplayEvents *Evtnotification)
* @brief This API is used to UnRegister the Events
*
* @return dsError_t
*/
dsError_t Host::UnRegister(IDisplayEvents *listener)
{
return impl().UnRegister(listener);
}

dsError_t Host::Register(IVideoDeviceEvents* listener)
{
return impl().Register(listener);
}

dsError_t Host::UnRegister(IVideoDeviceEvents* listener)
{
return impl().UnRegister(listener);
}

dsError_t Host::Register(IVideoOutputPortEvents* listener)
{
return impl().Register(listener);
}

dsError_t Host::UnRegister(IVideoOutputPortEvents* listener)
{
return impl().UnRegister(listener);
}

dsError_t Host::Register(IAudioOutputPortEvents* listener)
{
return impl().Register(listener);
}

dsError_t Host::UnRegister(IAudioOutputPortEvents* listener)
{
return impl().UnRegister(listener);
}

dsError_t Host::Register(IDisplayDeviceEvents* listener) {
return impl().Register(listener);
}

dsError_t Host::UnRegister(IDisplayDeviceEvents* listener) {
return impl().UnRegister(listener);
}

/** @} */

} // namespace device
/** @} */

/** @} */
Loading
Loading