Skip to content
Open

Test #184

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
1374c07
RDKEMW-8587: consume the config variables using dlsym() in MW.
santoshcomcast Oct 30, 2025
6b95abb
fix build issue
santoshcomcast Oct 30, 2025
2f17837
fix build issue
santoshcomcast Oct 30, 2025
2e068a5
addressed review comments
santoshcomcast Nov 5, 2025
6fd6b4f
fix build issue
santoshcomcast Nov 5, 2025
9932c3c
fix build issue
santoshcomcast Nov 5, 2025
cc2121a
fix build issue
santoshcomcast Nov 5, 2025
0d13c48
fix build issue
santoshcomcast Nov 5, 2025
397cf75
fix build issue
santoshcomcast Nov 5, 2025
8433557
fix coverity issue and removed unwanted code.
santoshcomcast Nov 5, 2025
51c8af5
Fix build issue.
santoshcomcast Nov 5, 2025
020d7fc
Addressed review comments.
santoshcomcast Nov 6, 2025
7e8a9f4
Addressed review comments.
santoshcomcast Nov 6, 2025
b1e9412
addressed review comments.
santoshcomcast Nov 10, 2025
661e8ec
RDKEMW-8587: consume the config variables using dlsym() in MW.
santoshcomcast Nov 11, 2025
bbe42f2
RDKEMW-8587: consume the config variables using dlsym() in MW.
santoshcomcast Nov 12, 2025
299bf52
fix build issue
santoshcomcast Nov 12, 2025
5f5a634
RDKEMW-8587: consume the config variables using dlsym() in MW.
santoshcomcast Nov 13, 2025
6553c8f
RDKEMW-8587: consume the config variables using dlsym() in MW.
santoshcomcast Nov 14, 2025
12f0193
RDKEMW-8587: consume the config variables using dlsym() in MW.
santoshcomcast Nov 17, 2025
565dbde
RDKEMW-8587: consume the config variables using dlsym() in MW.
santoshcomcast Nov 17, 2025
17faa45
RDKEMW-8587: consume the config variables using dlsym() in MW.
santoshcomcast Nov 17, 2025
8f60d7e
RDKEMW-8587: consume the config variables using dlsym() in MW.
santoshcomcast Nov 20, 2025
7455db3
RDKEMW-8587: consume the config variables using dlsym() in MW.
santoshcomcast Nov 20, 2025
8e51e51
RDKEMW-8587: consume the config variables using dlsym() in MW.
santoshcomcast Nov 20, 2025
329c312
Merge pull request #179 from rdkcentral/develop
santoshcomcast Nov 26, 2025
1928496
debug. disable dumpconfig and add logs
santoshcomcast Dec 9, 2025
05aa70f
enable debugconfig
santoshcomcast Dec 10, 2025
64a4609
move the debug prints within if condtion for all config dumpconfig
santoshcomcast Dec 10, 2025
9789231
added few more logs, lock_guard in searchconfig
santoshcomcast Dec 10, 2025
dde8258
add delay while every load
santoshcomcast Dec 10, 2025
36ed575
RDKEMW-8587: Fix dl symbol crash issue
yuvaramachandran-gurusamy Dec 11, 2025
fedb2e4
RDKEMW-8587: Fix dl symbol crash issue
yuvaramachandran-gurusamy Dec 11, 2025
54cca1e
RDKEMW-8587: Fix dl symbol crash issue
yuvaramachandran-gurusamy Dec 11, 2025
ffc1faf
RDKEMW-8587: Fix build error
yuvaramachandran-gurusamy Dec 11, 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
173 changes: 146 additions & 27 deletions ds/audioOutputPortConfig.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* 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/audioOutputPortConfig.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/audioOutputPortConfig.cpp' (Match: rdk/components/generic/devicesettings/rdk/components/generic/devicesettings/2.1-20161031, 310 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/devicesettings/+archive/2.1-20161031.tar.gz, file: ds/audioOutputPortConfig.cpp)

Check failure on line 3 in ds/audioOutputPortConfig.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/audioOutputPortConfig.cpp' (Match: rdk/components/generic/devicesettings/rdk/components/generic/devicesettings/2.1-20161031, 310 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/devicesettings/+archive/2.1-20161031.tar.gz, file: ds/audioOutputPortConfig.cpp)
*
* Copyright 2016 RDK Management
*
Expand Down Expand Up @@ -34,6 +34,17 @@
#include "dsUtl.h"
#include "stdlib.h"
#include "dslogger.h"
#include <dlfcn.h>
#include "manager.hpp"


typedef struct audioConfigs
{
const dsAudioTypeConfig_t *pKConfigs;
const dsAudioPortConfig_t *pKPorts;
int *pKConfigSize;
int *pKPortSize;
}audioConfigs_t;

namespace device {

Expand Down Expand Up @@ -108,8 +119,56 @@
return supportedTypes;
}

void AudioOutputPortConfig::load()
void dumpconfig(audioConfigs_t *config)
{
INT_INFO("\n\n=========================================================================================================================\n\n");
if(config->pKConfigs != NULL && *(config->pKConfigSize) != -1)
{
INT_INFO("%d:%s: Entering function\n", __LINE__, __func__);
INT_INFO("%d:%s: pKConfigs = %p\n", __LINE__, __func__, config->pKConfigs);
INT_INFO("%d:%s: pKPorts = %p\n", __LINE__, __func__, config->pKPorts);
INT_INFO("%d:%s: pKConfigSize addr =%p \n", __LINE__, __func__, config->pKConfigSize);
INT_INFO("%d:%s: pKConfigSize value = %d \n", __LINE__, __func__, *(config->pKConfigSize));

for (size_t i = 0; i < *(config->pKConfigSize); i++) {
const dsAudioTypeConfig_t *typeCfg = &(config->pKConfigs[i]);
INT_INFO("%d:%s: typeCfg->typeId = %d\n", __LINE__, __func__, typeCfg->typeId);
INT_INFO("%d:%s: typeCfg->name = %s\n", __LINE__, __func__, typeCfg->name);
INT_INFO("%d:%s: typeCfg->numSupportedEncodings = %zu\n", __LINE__, __func__, typeCfg->numSupportedEncodings);
INT_INFO("%d:%s: typeCfg->numSupportedCompressions = %zu\n", __LINE__, __func__, typeCfg->numSupportedCompressions);
INT_INFO("%d:%s: typeCfg->numSupportedStereoModes = %zu\n", __LINE__, __func__, typeCfg->numSupportedStereoModes);
}
}
else
{
INT_ERROR("%d:%s: kAudioConfigs is NULL and *(config->pKConfigSize) is -1\n", __LINE__, __func__);
}
if(config->pKPorts != NULL && *(config->pKPortSize) != -1)
{
INT_INFO("%d:%s: pKPortSize addr = %p \n", __LINE__, __func__, config->pKPortSize);
INT_INFO("%d:%s: pKPortSize value = %d \n", __LINE__, __func__, *(config->pKPortSize));
for (size_t i = 0; i < *(config->pKPortSize); i++) {
const dsAudioPortConfig_t *port = &(config->pKPorts[i]);
INT_INFO("%d:%s: port->id.type = %d\n", __LINE__, __func__, port->id.type);
INT_INFO("%d:%s: port->id.index = %d\n", __LINE__, __func__, port->id.index);
}
}
else
{
INT_ERROR("%d:%s: kAudioPorts is NULL and *(config->pKPortSize) is -1\n", __LINE__, __func__);
}
INT_INFO("\n\n=========================================================================================================================\n\n");
INT_INFO("%d:%s: Exit function\n", __LINE__, __func__);
}


void AudioOutputPortConfig::load(void* pDLHandle)
{
static int configSize, portSize, invalidSize = -1;
static audioConfigs_t configuration = {0};
bool isDynamicConfigLoad = false;

INT_INFO("Enter function\n");
try {
/*
* Load Constants First.
Expand All @@ -133,43 +192,103 @@

}

if ( nullptr != pDLHandle ) {
const char* searchVaribles[] = {
"kAudioConfigs",
"kAudioPorts",
"kAudioConfigs_size",
"kAudioPorts_size"
};
bool ret = false;

INT_INFO("%d:%s: Using dynamic library handle for config loading\n", __LINE__, __func__);
INT_INFO("%d:%s: Calling searchConfigs( %s)\n", __LINE__, __func__, searchVaribles[0]);
ret = searchConfigs(pDLHandle, searchVaribles[0], (void **)&configuration.pKConfigs);
if(ret == true)
{
// Considering Dynamic config loading is enabled since 1st symbol got
isDynamicConfigLoad = true;
INT_INFO("%d:%s: Calling searchConfigs( %s)\n", __LINE__, __func__, searchVaribles[2]);
ret = searchConfigs(pDLHandle, searchVaribles[2], (void **)&configuration.pKConfigSize);
if(ret == false)
{
INT_ERROR("%s is not defined\n", searchVaribles[2]);
configuration.pKConfigSize = &invalidSize;
}
INT_INFO("%d:%s: Calling searchConfigs( %s)\n", __LINE__, __func__, searchVaribles[1]);
ret = searchConfigs(pDLHandle, searchVaribles[1], (void **)&configuration.pKPorts);
if(ret == false)
{
INT_ERROR("%s is not defined\n", searchVaribles[1]);
}
INT_INFO("%d:%s: Calling searchConfigs( %s)\n", __LINE__, __func__, searchVaribles[3]);
ret = searchConfigs(pDLHandle, searchVaribles[3], (void **)&configuration.pKPortSize);
if(ret == false)
{
INT_ERROR("%s is not defined\n", searchVaribles[3]);
configuration.pKPortSize = &invalidSize;
}
}
}
if ( false == isDynamicConfigLoad)
{
INT_INFO("%d:%s: Using OLD config loading\n", __LINE__, __func__);
configuration.pKConfigs = kConfigs;
configSize = dsUTL_DIM(kConfigs);
configuration.pKConfigSize = &configSize;
configuration.pKPorts = kPorts;
portSize = dsUTL_DIM(kPorts);
configuration.pKPortSize = &portSize;
INT_INFO("configuration.pKConfigs =%p, configuration.pKPorts =%p, *(configuration.pKConfigSize) = %d, *(configuration.pKPortSize) = %d\n", configuration.pKConfigs, configuration.pKPorts, *(configuration.pKConfigSize), *(configuration.pKPortSize));
}
/*
* Initialize Audio portTypes (encodings, compressions etc.)
* and its port instances (db, level etc)
* Check if configs are loaded properly
*/
for (size_t i = 0; i < dsUTL_DIM(kConfigs); i++) {
const dsAudioTypeConfig_t *typeCfg = &kConfigs[i];
AudioOutputPortType &aPortType = AudioOutputPortType::getInstance(typeCfg->typeId);
aPortType.enable();
for (size_t j = 0; j < typeCfg->numSupportedEncodings; j++) {
aPortType.addEncoding(AudioEncoding::getInstance(typeCfg->encodings[j]));
_aEncodings.at(typeCfg->encodings[j]).enable();
}
for (size_t j = 0; j < typeCfg->numSupportedCompressions; j++) {
aPortType.addCompression(typeCfg->compressions[j]);
_aCompressions.at(typeCfg->compressions[j]).enable();

if ( configuration.pKConfigs != NULL && configuration.pKPorts != NULL &&
configuration.pKConfigSize != NULL && configuration.pKPortSize != NULL)
{
dumpconfig(&configuration);
//INT_INFO("disable the dumpconfig()\n");
/*
* Initialize Audio portTypes (encodings, compressions etc.)
* and its port instances (db, level etc)
*/
for (size_t i = 0; i < *(configuration.pKConfigSize); i++) {
const dsAudioTypeConfig_t *typeCfg = &(configuration.pKConfigs[i]);
AudioOutputPortType &aPortType = AudioOutputPortType::getInstance(typeCfg->typeId);
aPortType.enable();
for (size_t j = 0; j < typeCfg->numSupportedEncodings; j++) {
aPortType.addEncoding(AudioEncoding::getInstance(typeCfg->encodings[j]));
_aEncodings.at(typeCfg->encodings[j]).enable();
}
for (size_t j = 0; j < typeCfg->numSupportedCompressions; j++) {
aPortType.addCompression(typeCfg->compressions[j]);
_aCompressions.at(typeCfg->compressions[j]).enable();
}
for (size_t j = 0; j < typeCfg->numSupportedStereoModes; j++) {
aPortType.addStereoMode(typeCfg->stereoModes[j]);
_aStereoModes.at(typeCfg->stereoModes[j]).enable();
}
}
for (size_t j = 0; j < typeCfg->numSupportedStereoModes; j++) {
aPortType.addStereoMode(typeCfg->stereoModes[j]);
_aStereoModes.at(typeCfg->stereoModes[j]).enable();

/*
* set up ports based on kPorts[]
*/
for (size_t i = 0; i < *(configuration.pKPortSize); i++) {
const dsAudioPortConfig_t *port = &configuration.pKPorts[i];
_aPorts.push_back(AudioOutputPort((port->id.type), port->id.index, i));
_aPortTypes.at(port->id.type).addPort(_aPorts.at(i));
}
INT_INFO("%d:%s: Audio Configs loaded successfully\n", __LINE__, __func__);
}

/*
* set up ports based on kPorts[]
*/
for (size_t i = 0; i < dsUTL_DIM(kPorts); i++) {
const dsAudioPortConfig_t *port = &kPorts[i];
_aPorts.push_back(AudioOutputPort((port->id.type), port->id.index, i));
_aPortTypes.at(port->id.type).addPort(_aPorts.at(i));
else {
INT_ERROR("%d:%s: Audio Configs loading failed\n", __LINE__, __func__);
}

}
catch(const Exception &e) {
throw e;
}
INT_INFO("Exit funcation\n");
}

void AudioOutputPortConfig::release()
Expand Down
2 changes: 1 addition & 1 deletion ds/audioOutputPortConfig.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* 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/audioOutputPortConfig.hpp

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/audioOutputPortConfig.hpp' (Match: rdk/components/generic/devicesettings/rdk/components/generic/devicesettings/2.1-20161031, 77 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/devicesettings/+archive/2.1-20161031.tar.gz, file: ds/audioOutputPortConfig.hpp)

Check failure on line 3 in ds/audioOutputPortConfig.hpp

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/audioOutputPortConfig.hpp' (Match: rdk/components/generic/devicesettings/rdk/components/generic/devicesettings/2.1-20161031, 77 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/devicesettings/+archive/2.1-20161031.tar.gz, file: ds/audioOutputPortConfig.hpp)

Check failure on line 3 in ds/audioOutputPortConfig.hpp

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/audioOutputPortConfig.hpp' (Match: rdk/components/generic/devicesettings/rdk/components/generic/devicesettings/2.1-20161031, 77 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/devicesettings/+archive/2.1-20161031.tar.gz, file: ds/audioOutputPortConfig.hpp)
*
* Copyright 2016 RDK Management
*
Expand Down Expand Up @@ -66,7 +66,7 @@
List<AudioOutputPort> getPorts();
List<AudioOutputPortType> getSupportedTypes();

void load();
void load(void* pDLHandle);
void release();

};
Expand Down
Loading
Loading