diff --git a/AVOutput/AVOutputTV.cpp b/AVOutput/AVOutputTV.cpp index 704e3ffba..afcb31720 100644 --- a/AVOutput/AVOutputTV.cpp +++ b/AVOutput/AVOutputTV.cpp @@ -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; diff --git a/AVOutput/AVOutputTV.h b/AVOutput/AVOutputTV.h index c79eb6718..d2d026831 100644 --- a/AVOutput/AVOutputTV.h +++ b/AVOutput/AVOutputTV.h @@ -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); @@ -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); diff --git a/AVOutput/AVOutputTVHelper.cpp b/AVOutput/AVOutputTVHelper.cpp index a50462f2b..fe2425340 100644 --- a/AVOutput/AVOutputTVHelper.cpp +++ b/AVOutput/AVOutputTVHelper.cpp @@ -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; @@ -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; @@ -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); } @@ -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; @@ -1729,6 +1680,7 @@ namespace Plugin { tr181ErrorCode_t err = getLocalParam(rfc_caller_id, tr181_param_name.c_str(), ¶m); 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; }