Skip to content

Commit

Permalink
Remove ODM specific apis from tvsettings HAL to make it generic- phase2
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunbinu authored and benjaminqcox committed Feb 5, 2025
1 parent 71d45c2 commit 234a299
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 54 deletions.
2 changes: 1 addition & 1 deletion AVOutput/AVOutputTV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2203,7 +2203,7 @@ namespace Plugin {
uint32_t AVOutputTV::getSupportedDolbyVisionModes(const JsonObject& parameters, JsonObject& response)
{
LOGINFO("Entry\n");
tvDolbyMode_t dvModes[tvMode_Max];
tvDolbyMode_t dvModes[tvMode_Max] = { tvDolbyMode_Invalid };
tvDolbyMode_t *dvModesPtr = dvModes; // Pointer to statically allocated tvDolbyMode_t array
unsigned short totalAvailable = 0;

Expand Down
2 changes: 0 additions & 2 deletions AVOutput/AVOutputTV.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ class AVOutputTV : public AVOutputBase {
private:


tvContentFormatType_t getContentFormatIndex(tvVideoHDRFormat_t formatToConvert);
int getPictureModeIndex(std::string pqmode);
int getSourceIndex(std::string source);
int getFormatIndex(std::string format);
Expand Down Expand Up @@ -308,7 +307,6 @@ class AVOutputTV : public AVOutputBase {
string convertSourceIndexToString(int source);
string convertVideoFormatToString(int format);
string convertPictureIndexToString(int pqmode);
tvContentFormatType_t convertFormatStringToTVContentFormat(const char *format);
//std::string convertSourceIndexToString(int sourceIndex);
//std::string convertVideoFormatToString( int formatIndex );
void convertUserScaleBacklightToDriverScale(int format,int * params);
Expand Down
54 changes: 3 additions & 51 deletions AVOutput/AVOutputTVHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,36 +32,6 @@ static bool m_isDalsEnabled = false;
namespace WPEFramework {
namespace Plugin {

tvContentFormatType_t AVOutputTV::getContentFormatIndex(tvVideoHDRFormat_t formatToConvert)
{
/* default to SDR always*/
tvContentFormatType_t ret = tvContentFormatType_NONE;
switch(formatToConvert) {
case tvVideoHDRFormat_HLG:
ret = tvContentFormatType_HLG;
break;

case tvVideoHDRFormat_HDR10:
ret = tvContentFormatType_HDR10;
break;

case tvVideoHDRFormat_HDR10PLUS:
ret = tvContentFormatType_HDR10PLUS;
break;

case tvVideoHDRFormat_DV:
ret = tvContentFormatType_DOVI;
break;

case tvVideoHDRFormat_SDR:
case tvVideoHDRFormat_NONE:
default:
ret = tvContentFormatType_SDR;
break;
}
return ret;
}

int AVOutputTV::getPictureModeIndex(std::string pqparam)
{
int index = -1;
Expand Down Expand Up @@ -265,7 +235,7 @@ namespace Plugin {
int AVOutputTV::getDolbyModeIndex(const char * dolbyMode)
{
int mode = 0;
tvDolbyMode_t dolbyModes[tvMode_Max];
tvDolbyMode_t dolbyModes[tvMode_Max] = { tvDolbyMode_Invalid };
tvDolbyMode_t *dolbyModesPtr = dolbyModes; // Pointer to statically allocated tvDolbyMode_t array
unsigned short totalAvailable = 0;

Expand Down Expand Up @@ -742,6 +712,7 @@ namespace Plugin {
}
}
strncpy(rfc_caller_id,PQFileName.c_str(),PQFileName.size());
rfc_caller_id[sizeof(rfc_caller_id) - 1] = '\0';
LOGINFO("%s : Default tvsettings file : %s\n",__FUNCTION__,rfc_caller_id);
}

Expand Down Expand Up @@ -924,26 +895,6 @@ namespace Plugin {
return ret;
}

tvContentFormatType_t AVOutputTV::convertFormatStringToTVContentFormat(const char *format)
{
tvContentFormatType_t ret = tvContentFormatType_SDR;

if( strncmp(format,"sdr",strlen(format)) == 0 || strncmp(format,"SDR",strlen(format)) == 0 ) {
ret = tvContentFormatType_SDR;
}
else if( strncmp(format,"hdr10",strlen(format)) == 0 || strncmp(format,"HDR10",strlen(format))==0 ) {
ret = tvContentFormatType_HDR10;
}
else if( strncmp(format,"hlg",strlen(format)) == 0 || strncmp(format,"HLG",strlen(format)) == 0 ) {
ret = tvContentFormatType_HLG;
}
else if( strncmp(format,"dolby",strlen(format)) == 0 || strncmp(format,"DOLBY",strlen(format)) == 0 ) {
ret=tvContentFormatType_DOVI;
}

return ret;
}

tvError_t AVOutputTV::updateAVoutputTVParamToHAL(std::string forParam, paramIndex_t indexInfo, int value,bool setNotDelete)
{
tvError_t ret = tvERROR_NONE;
Expand Down Expand Up @@ -1729,6 +1680,7 @@ namespace Plugin {
tr181ErrorCode_t err = getLocalParam(rfc_caller_id, tr181_param_name.c_str(), &param);
if ( err == tr181Success ) {
strncpy(picMode, param.value, strlen(param.value)+1);
picMode[strlen(param.value)] = '\0';
LOGINFO("getLocalParam success, mode = %s\n", picMode);
return 1;
}
Expand Down

0 comments on commit 234a299

Please sign in to comment.