Skip to content

Commit 0dd73c6

Browse files
arjunbinuababu250
authored andcommitted
Remove ODM APIs - Phase 1
Reason for change: Eliminate the usage of ODM APIs that are scheduled for deprecation. Signed-off-by: Arjun Binu <[email protected]>
1 parent 114118f commit 0dd73c6

File tree

3 files changed

+225
-35
lines changed

3 files changed

+225
-35
lines changed

AVOutput/AVOutputTV.cpp

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -375,13 +375,6 @@ namespace Plugin {
375375
}
376376
else {
377377
LOGINFO("Platform Init successful...\n");
378-
ret = TvSyncCalibrationInfoODM();
379-
if(ret != tvERROR_NONE) {
380-
LOGERR(" SD3 <->cri_data sync failed, ret: %s \n", getErrorString(ret).c_str());
381-
}
382-
else {
383-
LOGERR(" SD3 <->cri_data sync success, ret: %s \n", getErrorString(ret).c_str());
384-
}
385378
}
386379

387380
tvVideoFormatCallbackData callbackData = {this,tvVideoFormatChangeHandler};
@@ -2282,17 +2275,22 @@ namespace Plugin {
22822275
{
22832276

22842277
LOGINFO("Entry\n");
2285-
pic_modes_t *dvModes;
2278+
tvDolbyMode_t dvModes[tvMode_Max];
2279+
tvDolbyMode_t *dvModesPtr = dvModes; // Pointer to statically allocated tvDolbyMode_t array
22862280
unsigned short totalAvailable = 0;
2287-
tvError_t ret = GetTVSupportedDolbyVisionModesODM(&dvModes,&totalAvailable);
2281+
2282+
// Set an initial value to indicate the mode type
2283+
dvModes[0] = tvDolbyMode_Dark;
2284+
2285+
tvError_t ret = GetTVSupportedDolbyVisionModes(&dvModesPtr, &totalAvailable);
22882286
if(ret != tvERROR_NONE) {
22892287
returnResponse(false);
22902288
}
22912289
else {
22922290
JsonArray SupportedDVModes;
22932291

22942292
for(int count = 0;count <totalAvailable;count++ ) {
2295-
SupportedDVModes.Add(dvModes[count].name);
2293+
SupportedDVModes.Add(getDolbyModeStringFromEnum(dvModes[count]));
22962294
}
22972295

22982296
response["supportedDVModes"] = SupportedDVModes;
@@ -2376,7 +2374,7 @@ namespace Plugin {
23762374

23772375
if( isSetRequired("Current",source,"DV") ) {
23782376
LOGINFO("Proceed with setDolbyVisionMode\n\n");
2379-
ret = SetTVDolbyVisionModeODM(value.c_str());
2377+
ret = SetTVDolbyVisionMode(GetDolbyVisionEnumFromModeString(value.c_str()));
23802378
}
23812379

23822380
if(ret != tvERROR_NONE) {
@@ -2437,7 +2435,7 @@ namespace Plugin {
24372435
if( err == 0 ) {
24382436
std::string dolbyModeValue = getDolbyModeStringFromEnum((tvDolbyMode_t)dolbyMode);
24392437
LOGINFO("%s : getLocalparam success format :%d source : %d format : %d dolbyvalue : %s\n",__FUNCTION__,formatIndex, sourceIndex, pqIndex, dolbyModeValue.c_str());
2440-
ret = SetTVDolbyVisionModeODM(dolbyModeValue.c_str());
2438+
ret = SetTVDolbyVisionMode((tvDolbyMode_t)dolbyMode);
24412439
}
24422440
else {
24432441
LOGERR("%s : GetLocalParam Failed \n",__FUNCTION__);
@@ -2822,7 +2820,7 @@ namespace Plugin {
28222820
if ( tr181Success == err ) {
28232821
//get curren source and if matches save for that alone
28242822
tvVideoSrcType_t current_source = VIDEO_SOURCE_IP;
2825-
GetCurrentSource(&current_source);
2823+
GetCurrentVideoSource(&current_source);
28262824

28272825
tvVideoFormatType_t current_format = VIDEO_FORMAT_NONE;
28282826
GetCurrentVideoFormat(&current_format);
@@ -3077,7 +3075,7 @@ namespace Plugin {
30773075
LOGINFO("Entry\n");
30783076
tvVideoSrcType_t currentSource = VIDEO_SOURCE_IP;
30793077

3080-
tvError_t ret = GetCurrentSource(&currentSource);
3078+
tvError_t ret = GetCurrentVideoSource(&currentSource);
30813079
if(ret != tvERROR_NONE) {
30823080
response["currentVideoSource"] = "NONE";
30833081
returnResponse(false);

AVOutput/AVOutputTV.h

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
#include "string.h"
2424
#include <set>
25+
#include <boost/filesystem.hpp>
26+
#include <boost/property_tree/ini_parser.hpp>
2527

2628
#include "tvTypes.h"
2729
#include "tvSettings.h"
@@ -67,6 +69,49 @@
6769
#define STRING_DEFAULT "Default"
6870
#define STRING_SOURCE "Source."
6971
#define CREATE_DIRTY(__X__) (__X__+=STRING_DIRTY)
72+
#define CAPABLITY_FILE_NAME "pq_capabilities.ini"
73+
74+
75+
class CIniFile
76+
{
77+
std::string m_path;
78+
std::string opt_path;
79+
boost::property_tree::ptree m_data;
80+
81+
public:
82+
CIniFile(const std::string & filename, const std::string & filepath = "/etc/" )
83+
{
84+
opt_path = "/opt/panel/";
85+
m_path = filepath;
86+
m_path.append(filename);
87+
opt_path.append(filename);
88+
89+
if(!boost::filesystem::exists( opt_path)) {
90+
std::cout << "AVOutput : Using " << m_path <<std::endl;
91+
boost::property_tree::ini_parser::read_ini(m_path, m_data);
92+
}
93+
else {
94+
std::cout << "AVOutput : Using " << opt_path << std::endl;
95+
boost::property_tree::ini_parser::read_ini(opt_path, m_data);
96+
}
97+
}
98+
99+
~CIniFile()
100+
{
101+
}
102+
103+
template <typename T>
104+
T Get(const std::string & key)
105+
{
106+
return m_data.get<T>(key);
107+
}
108+
109+
template <typename T>
110+
void Set(const std::string & key, const T & value){
111+
//TODO DD: Not required currently
112+
//m_data.put(key, value);
113+
}
114+
};
70115

71116
namespace WPEFramework {
72117
namespace Plugin {
@@ -217,10 +262,14 @@ class AVOutputTV : public AVOutputBase {
217262
tvError_t getParamsCaps(std::vector<std::string> &range, std::vector<std::string> &pqmode, std::vector<std::string> &source,
218263
std::vector<std::string> &format,std::string param , std::string & isPlatformSupport,
219264
std::vector<std::string> & index);
265+
int GetPanelID(char *panelid);
266+
int ConvertHDRFormatToContentFormat(tvhdr_type_t hdrFormat);
267+
int ReadCapablitiesFromConf(std::string &rangeInfo,std::string &pqmodeInfo,std::string &formatInfo,std::string &sourceInfo,std::string param, std::string & isPlatformSupport, std::string & indexInfo);
220268
void getDimmingModeStringFromEnum(int value, std::string &toStore);
221269
void getColorTempStringFromEnum(int value, std::string &toStore);
222270
int getCurrentPictureMode(char *picMode);
223271
int getDolbyParamToSync(int sourceIndex, int formatIndex, int& value);
272+
tvDolbyMode_t GetDolbyVisionEnumFromModeString(const char* modeString);
224273
std::string getDolbyModeStringFromEnum( tvDolbyMode_t mode);
225274
JsonArray getSupportedVideoSource(void);
226275
int getAvailableCapabilityModesWrapper(std::string param, std::string & outparam);

0 commit comments

Comments
 (0)