Skip to content
Open
Changes from all commits
Commits
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
39 changes: 34 additions & 5 deletions source/cap.c
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 source/cap.c

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 'source/cap.c' (Match: rdk/components/generic/libunpriv/rdk/components/generic/libunpriv/1, 377 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/libunpriv/+archive/RDKB-RELEASE-TEST-DUNFELL-1.tar.gz, file: source/cap.c)
*
* Copyright 2018 RDK Management
*
Expand Down Expand Up @@ -47,13 +47,42 @@
bool fetchRFC(char* key,char** value)
{
#ifdef _RDK_VIDEO_PRIV_CAPS_
RFC_ParamData_t nonrootsupportData;
WDMP_STATUS nonrootstatus= getRFCParameter("NonRootSupport",key, &nonrootsupportData);
if (WDMP_SUCCESS == nonrootstatus && (!isNull(nonrootsupportData.value)))
RFC_ParamData_t nonrootsupportData;
rbusHandle_t handle;
rbusValue_t val;

int rc1;
char componentName[] = "libunpriv";
bool result = false;
int len = 0;
char const* data = NULL;
rc1 = rbus_open(&handle, componentName);

if (rc1 != RBUS_ERROR_SUCCESS)
{
log_cap("provider: First rbus_open for handle1 err: %d\n", rc1);
return false;
}

rc1 = rbus_get(handle, key, &val);

if(rc1 == RBUS_ERROR_SUCCESS) {

data = rbusValue_GetString(val);
rbusValue_Release(val);
}
else
{
log_cap("Failed to get value from rbus");
}

rbus_close(handle);

if (rc1 == RBUS_ERROR_SUCCESS && (!isNull(data)))
{
*value = (char*)malloc(strlen(nonrootsupportData.value)+1);
*value = (char*)malloc(strlen(data)+1);
if( NULL != *value ){
strncpy(*value,nonrootsupportData.value,strlen(nonrootsupportData.value)+1);
strncpy(*value,data,strlen(data)+1);
return true;
}
}
Expand Down
Loading