diff --git a/AVInput/AVInput.cpp b/AVInput/AVInput.cpp index 2accadfd..8c71c7a6 100644 --- a/AVInput/AVInput.cpp +++ b/AVInput/AVInput.cpp @@ -31,8 +31,8 @@ #include #define API_VERSION_NUMBER_MAJOR 1 -#define API_VERSION_NUMBER_MINOR 6 -#define API_VERSION_NUMBER_PATCH 0 +#define API_VERSION_NUMBER_MINOR 7 +#define API_VERSION_NUMBER_PATCH 1 #define HDMI 0 #define COMPOSITE 1 @@ -48,6 +48,7 @@ #define AVINPUT_METHOD_GET_EDID_VERSION "getEdidVersion" #define AVINPUT_METHOD_SET_EDID_ALLM_SUPPORT "setEdid2AllmSupport" #define AVINPUT_METHOD_GET_EDID_ALLM_SUPPORT "getEdid2AllmSupport" +#define AVINPUT_METHOD_GET_HDMI_COMPATIBILITY_VERSION "getHdmiVersion" #define AVINPUT_METHOD_SET_MIXER_LEVELS "setMixerLevels" #define AVINPUT_METHOD_START_INPUT "startInput" #define AVINPUT_METHOD_STOP_INPUT "stopInput" @@ -167,6 +168,10 @@ void AVInput::InitializeIARM() IARM_BUS_DSMGR_NAME, IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_STATUS, dsAVStatusEventHandler)); + IARM_CHECK(IARM_Bus_RegisterEventHandler( + IARM_BUS_DSMGR_NAME, + IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_VIDEO_MODE_UPDATE, + dsAVVideoModeEventHandler)); IARM_CHECK(IARM_Bus_RegisterEventHandler( IARM_BUS_DSMGR_NAME, IARM_BUS_DSMGR_EVENT_HDMI_IN_AVI_CONTENT_TYPE, @@ -203,6 +208,9 @@ void AVInput::DeinitializeIARM() IARM_BUS_DSMGR_NAME, IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_STATUS, dsAVStatusEventHandler)); IARM_CHECK(IARM_Bus_RemoveEventHandler( + IARM_BUS_DSMGR_NAME, + IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_VIDEO_MODE_UPDATE, dsAVVideoModeEventHandler)); + IARM_CHECK(IARM_Bus_RemoveEventHandler( IARM_BUS_DSMGR_NAME, IARM_BUS_DSMGR_EVENT_HDMI_IN_AVI_CONTENT_TYPE, dsAviContentTypeEventHandler)); } @@ -223,6 +231,7 @@ void AVInput::RegisterAll() Register(_T(AVINPUT_METHOD_SET_MIXER_LEVELS), &AVInput::setMixerLevels, this); Register(_T(AVINPUT_METHOD_SET_EDID_ALLM_SUPPORT), &AVInput::setEdid2AllmSupportWrapper, this); Register(_T(AVINPUT_METHOD_GET_EDID_ALLM_SUPPORT), &AVInput::getEdid2AllmSupportWrapper, this); + Register(_T(AVINPUT_METHOD_GET_HDMI_COMPATIBILITY_VERSION), &AVInput::getHdmiVersionWrapper, this); Register(_T(AVINPUT_METHOD_START_INPUT), &AVInput::startInput, this); Register(_T(AVINPUT_METHOD_STOP_INPUT), &AVInput::stopInput, this); Register(_T(AVINPUT_METHOD_SCALE_INPUT), &AVInput::setVideoRectangleWrapper, this); @@ -748,17 +757,18 @@ void AVInput::AVInputStatusChange( int port , bool isPresented, int type) * @param[in] port HDMI In port id. * @param[dsVideoPortResolution_t] video resolution data */ -void AVInput::AVInputVideoModeUpdate( int port , dsVideoPortResolution_t resolution) +void AVInput::AVInputVideoModeUpdate( int port , dsVideoPortResolution_t resolution, int type) { LOGWARN("AVInputVideoModeUpdate [%d]", port); JsonObject params; params["id"] = port; std::stringstream locator; - locator << "hdmiin://localhost/deviceid/" << port; - params["locator"] = locator.str(); + if(type == HDMI){ + + locator << "hdmiin://localhost/deviceid/" << port; + switch(resolution.pixelResolution) { - switch(resolution.pixelResolution) { case dsVIDEO_PIXELRES_720x480: params["width"] = 720; params["height"] = 480; @@ -773,8 +783,8 @@ void AVInput::AVInputVideoModeUpdate( int port , dsVideoPortResolution_t resolut params["width"] = 1280; params["height"] = 720; break; - - case dsVIDEO_PIXELRES_1920x1080: + + case dsVIDEO_PIXELRES_1920x1080: params["width"] = 1920; params["height"] = 1080; break; @@ -793,10 +803,31 @@ void AVInput::AVInputVideoModeUpdate( int port , dsVideoPortResolution_t resolut params["width"] = 1920; params["height"] = 1080; break; + } + params["progressive"] = (!resolution.interlaced); } + else if(type == COMPOSITE) + { + locator << "cvbsin://localhost/deviceid/" << port; + switch(resolution.pixelResolution) { + case dsVIDEO_PIXELRES_720x480: + params["width"] = 720; + params["height"] = 480; + break; + case dsVIDEO_PIXELRES_720x576: + params["width"] = 720; + params["height"] = 576; + break; + default: + params["width"] = 720; + params["height"] = 576; + break; + } - params["progressive"] = (!resolution.interlaced); + params["progressive"] = false; + } + params["locator"] = locator.str(); switch(resolution.frameRate) { case dsVIDEO_FRAMERATE_24: params["frameRateN"] = 24000; @@ -849,16 +880,17 @@ void AVInput::AVInputVideoModeUpdate( int port , dsVideoPortResolution_t resolut void AVInput::dsAviContentTypeEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len) { - if(!AVInput::_instance) - return; + if(!AVInput::_instance) + return; - if (IARM_BUS_DSMGR_EVENT_HDMI_IN_AVI_CONTENT_TYPE == eventId) - { - IARM_Bus_DSMgr_EventData_t *eventData = (IARM_Bus_DSMgr_EventData_t *)data; - int hdmi_in_port = eventData->data.hdmi_in_content_type.port; - int avi_content_type = eventData->data.hdmi_in_content_type.aviContentType; - LOGINFO("Received IARM_BUS_DSMGR_EVENT_HDMI_IN_AVI_CONTENT_TYPE event port: %d, Content Type : %d", hdmi_in_port,avi_content_type); -AVInput::_instance->hdmiInputAviContentTypeChange(hdmi_in_port, avi_content_type); + if (IARM_BUS_DSMGR_EVENT_HDMI_IN_AVI_CONTENT_TYPE == eventId) + { + IARM_Bus_DSMgr_EventData_t *eventData = (IARM_Bus_DSMgr_EventData_t *)data; + int hdmi_in_port = eventData->data.hdmi_in_content_type.port; + int avi_content_type = eventData->data.hdmi_in_content_type.aviContentType; + LOGINFO("Received IARM_BUS_DSMGR_EVENT_HDMI_IN_AVI_CONTENT_TYPE event port: %d, Content Type : %d", hdmi_in_port,avi_content_type); + + AVInput::_instance->hdmiInputAviContentTypeChange(hdmi_in_port, avi_content_type); } } @@ -941,7 +973,17 @@ void AVInput::dsAVVideoModeEventHandler(const char *owner, IARM_EventId_t eventI resolution.interlaced = eventData->data.hdmi_in_video_mode.resolution.interlaced; resolution.frameRate = eventData->data.hdmi_in_video_mode.resolution.frameRate; LOGWARN("Received IARM_BUS_DSMGR_EVENT_HDMI_IN_VIDEO_MODE_UPDATE event port: %d, pixelResolution: %d, interlaced : %d, frameRate: %d \n", hdmi_in_port,resolution.pixelResolution, resolution.interlaced, resolution.frameRate); - AVInput::_instance->AVInputVideoModeUpdate(hdmi_in_port, resolution); + AVInput::_instance->AVInputVideoModeUpdate(hdmi_in_port, resolution,HDMI); + } + else if (IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_VIDEO_MODE_UPDATE == eventId) { + IARM_Bus_DSMgr_EventData_t *eventData = (IARM_Bus_DSMgr_EventData_t *)data; + int composite_in_port = eventData->data.composite_in_video_mode.port; + dsVideoPortResolution_t resolution = {}; + resolution.pixelResolution = eventData->data.composite_in_video_mode.resolution.pixelResolution; + resolution.interlaced = eventData->data.composite_in_video_mode.resolution.interlaced; + resolution.frameRate = eventData->data.composite_in_video_mode.resolution.frameRate; + LOGWARN("Received IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_VIDEO_MODE_UPDATE event port: %d, pixelResolution: %d, interlaced : %d, frameRate: %d \n", composite_in_port,resolution.pixelResolution, resolution.interlaced, resolution.frameRate); + AVInput::_instance->AVInputVideoModeUpdate(composite_in_port, resolution,COMPOSITE); } } @@ -1362,6 +1404,53 @@ uint32_t AVInput::setEdidVersionWrapper(const JsonObject& parameters, JsonObject } } +uint32_t AVInput::getHdmiVersionWrapper(const JsonObject& parameters, JsonObject& response) +{ + LOGINFOMETHOD(); + returnIfParamNotFound(parameters, "portId"); + string sPortId = parameters["portId"].String(); + int portId = 0; + + try { + portId = stoi(sPortId); + }catch (const std::exception& err) { + LOGWARN("sPortId invalid paramater: %s ", sPortId.c_str()); + returnResponse(false); + } + + dsHdmiMaxCapabilityVersion_t hdmiCapVersion = HDMI_COMPATIBILITY_VERSION_14; + + try { + device::HdmiInput::getInstance().getHdmiVersion(portId, &(hdmiCapVersion)); + LOGWARN("AVInput::getHdmiVersion Hdmi Version:%d", hdmiCapVersion); + } + catch (const device::Exception& err) { + LOG_DEVICE_EXCEPTION1(std::to_string(portId)); + returnResponse(false); + } + + + switch ((int)hdmiCapVersion){ + case HDMI_COMPATIBILITY_VERSION_14: + response["HdmiCapabilityVersion"] = "1.4"; + break; + case HDMI_COMPATIBILITY_VERSION_20: + response["HdmiCapabilityVersion"] = "2.0"; + break; + case HDMI_COMPATIBILITY_VERSION_21: + response["HdmiCapabilityVersion"] = "2.1"; + break; + } + + + if(hdmiCapVersion == HDMI_COMPATIBILITY_VERSION_MAX) + { + returnResponse(false); + }else{ + returnResponse(true); + } +} + int AVInput::setEdidVersion(int iPort, int iEdidVer) { bool ret = true; diff --git a/AVInput/AVInput.h b/AVInput/AVInput.h index 0f04d6bb..22b61827 100644 --- a/AVInput/AVInput.h +++ b/AVInput/AVInput.h @@ -85,6 +85,7 @@ class AVInput: public PluginHost::IPlugin, public PluginHost::JSONRPC uint32_t getSupportedGameFeatures(const JsonObject& parameters, JsonObject& response); uint32_t getGameFeatureStatusWrapper(const JsonObject& parameters, JsonObject& response); uint32_t setMixerLevels(const JsonObject& parameters, JsonObject& response); + uint32_t getHdmiVersionWrapper(const JsonObject& parameters, JsonObject& response); //End methods JsonArray getInputDevices(int iType); @@ -106,7 +107,7 @@ class AVInput: public PluginHost::IPlugin, public PluginHost::JSONRPC void AVInputStatusChange( int port , bool isPresented, int type); static void dsAVStatusEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len); - void AVInputVideoModeUpdate( int port , dsVideoPortResolution_t resolution); + void AVInputVideoModeUpdate( int port , dsVideoPortResolution_t resolution,int type); static void dsAVVideoModeEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len); void AVInputALLMChange( int port , bool allmMode); diff --git a/AVInput/CHANGELOG.md b/AVInput/CHANGELOG.md index 2e200c40..6c8c2ac2 100644 --- a/AVInput/CHANGELOG.md +++ b/AVInput/CHANGELOG.md @@ -14,3 +14,18 @@ All notable changes to this RDK Service will be documented in this file. * Changes in CHANGELOG should be updated when commits are added to the main or release branches. There should be one CHANGELOG entry per JIRA Ticket. This is not enforced on sprint branches since there could be multiple changes for the same JIRA ticket during development. +## [1.7.1] - 2025-02-17 +### Changed +- Added support for handling the videoStreamInfoUpdate for composite Input. + +## [1.7.0] - 2025-02-17 +### Added +- Added support for Getting the Maximum HDMI Compatibility version for the given port. + +## [1.0.0] - 2025-02-17 +### Added +- Add CHANGELOG + +### Change +- Reset API version to 1.0.0 +- Change README to inform how to update changelog and API version diff --git a/AVOutput/AVOutputTV.cpp b/AVOutput/AVOutputTV.cpp index 90de5d9b..e9bd4fb8 100644 --- a/AVOutput/AVOutputTV.cpp +++ b/AVOutput/AVOutputTV.cpp @@ -375,13 +375,6 @@ namespace Plugin { } else { LOGINFO("Platform Init successful...\n"); - ret = TvSyncCalibrationInfoODM(); - if(ret != tvERROR_NONE) { - LOGERR(" SD3 <->cri_data sync failed, ret: %s \n", getErrorString(ret).c_str()); - } - else { - LOGERR(" SD3 <->cri_data sync success, ret: %s \n", getErrorString(ret).c_str()); - } } tvVideoFormatCallbackData callbackData = {this,tvVideoFormatChangeHandler}; @@ -2282,9 +2275,14 @@ namespace Plugin { { LOGINFO("Entry\n"); - pic_modes_t *dvModes; + tvDolbyMode_t dvModes[tvMode_Max]; + tvDolbyMode_t *dvModesPtr = dvModes; // Pointer to statically allocated tvDolbyMode_t array unsigned short totalAvailable = 0; - tvError_t ret = GetTVSupportedDolbyVisionModesODM(&dvModes,&totalAvailable); + + // Set an initial value to indicate the mode type + dvModes[0] = tvDolbyMode_Dark; + + tvError_t ret = GetTVSupportedDolbyVisionModes(&dvModesPtr, &totalAvailable); if(ret != tvERROR_NONE) { returnResponse(false); } @@ -2292,7 +2290,7 @@ namespace Plugin { JsonArray SupportedDVModes; for(int count = 0;count +#include +#include #include "tvTypes.h" #include "tvSettings.h" @@ -67,6 +69,49 @@ #define STRING_DEFAULT "Default" #define STRING_SOURCE "Source." #define CREATE_DIRTY(__X__) (__X__+=STRING_DIRTY) +#define CAPABLITY_FILE_NAME "pq_capabilities.ini" + + +class CIniFile +{ + std::string m_path; + std::string opt_path; + boost::property_tree::ptree m_data; + +public: + CIniFile(const std::string & filename, const std::string & filepath = "/etc/" ) + { + opt_path = "/opt/panel/"; + m_path = filepath; + m_path.append(filename); + opt_path.append(filename); + + if(!boost::filesystem::exists( opt_path)) { + std::cout << "AVOutput : Using " << m_path < + T Get(const std::string & key) + { + return m_data.get(key); + } + + template + void Set(const std::string & key, const T & value){ + //TODO DD: Not required currently + //m_data.put(key, value); + } +}; namespace WPEFramework { namespace Plugin { @@ -217,10 +262,14 @@ class AVOutputTV : public AVOutputBase { tvError_t getParamsCaps(std::vector &range, std::vector &pqmode, std::vector &source, std::vector &format,std::string param , std::string & isPlatformSupport, std::vector & index); + int GetPanelID(char *panelid); + int ConvertHDRFormatToContentFormat(tvhdr_type_t hdrFormat); + int ReadCapablitiesFromConf(std::string &rangeInfo,std::string &pqmodeInfo,std::string &formatInfo,std::string &sourceInfo,std::string param, std::string & isPlatformSupport, std::string & indexInfo); void getDimmingModeStringFromEnum(int value, std::string &toStore); void getColorTempStringFromEnum(int value, std::string &toStore); int getCurrentPictureMode(char *picMode); int getDolbyParamToSync(int sourceIndex, int formatIndex, int& value); + tvDolbyMode_t GetDolbyVisionEnumFromModeString(const char* modeString); std::string getDolbyModeStringFromEnum( tvDolbyMode_t mode); JsonArray getSupportedVideoSource(void); int getAvailableCapabilityModesWrapper(std::string param, std::string & outparam); diff --git a/AVOutput/AVOutputTVHelper.cpp b/AVOutput/AVOutputTVHelper.cpp index 9b93d10c..d5536fbf 100644 --- a/AVOutput/AVOutputTVHelper.cpp +++ b/AVOutput/AVOutputTVHelper.cpp @@ -192,7 +192,7 @@ namespace Plugin { if( source.compare("none") == 0 || source.compare("Current") == 0 ) { tvVideoSrcType_t currentSource = VIDEO_SOURCE_IP; - GetCurrentSource(¤tSource); + GetCurrentVideoSource(¤tSource); sourceIndex = (int)currentSource; } else { @@ -237,14 +237,18 @@ namespace Plugin { int AVOutputTV::getDolbyModeIndex(const char * dolbyMode) { int mode = 0; - pic_modes_t *dolbyModes ; + tvDolbyMode_t dolbyModes[tvMode_Max]; + tvDolbyMode_t *dolbyModesPtr = dolbyModes; // Pointer to statically allocated tvDolbyMode_t array unsigned short totalAvailable = 0; - tvError_t ret = GetTVSupportedDolbyVisionModesODM(&dolbyModes,&totalAvailable); - if(ret == tvERROR_NONE) { - for(int count = 0;count formatInputSet; std::set sourceInputSet; - if( ReadCapablitiesFromConfODM( rangeCapInfo, pqmodeCapInfo, formatCapInfo, sourceCapInfo,param, isPlatformSupport, indexInfo) ) { + if( ReadCapablitiesFromConf( rangeCapInfo, pqmodeCapInfo, formatCapInfo, sourceCapInfo,param, isPlatformSupport, indexInfo) ) { LOGINFO( "%s: readCapablitiesFromConf Failed !!!\n",__FUNCTION__); return false; } @@ -635,7 +639,7 @@ namespace Plugin { PQFileName = std::string(AVOUTPUT_RFC_CALLERID_OVERRIDE); } else { - int val=GetPanelIDODM(panelId); + int val=GetPanelID(panelId); if(val==0) { LOGINFO("%s : panel id read is : %s\n",__FUNCTION__,panelId); if(strncmp(panelId,AVOUTPUT_CONVERTERBOARD_PANELID,strlen(AVOUTPUT_CONVERTERBOARD_PANELID))!=0) { @@ -672,15 +676,13 @@ namespace Plugin { current_format = VIDEO_FORMAT_SDR; } // get current source - GetCurrentSource(¤t_source); + GetCurrentVideoSource(¤t_source); tr181_param_name += std::string(AVOUTPUT_SOURCE_PICTUREMODE_STRING_RFC_PARAM); tr181_param_name += "."+convertSourceIndexToString(current_source)+"."+"Format."+convertVideoFormatToString(current_format)+"."+"PictureModeString"; tr181ErrorCode_t err = getLocalParam(rfc_caller_id, tr181_param_name.c_str(), ¶m); if ( tr181Success == err ) { - std::string local = param.value; - transform(local.begin(), local.end(), local.begin(), ::tolower); - ret = SetTVPictureMode(local.c_str()); + ret = SetTVPictureMode(param.value); if(ret != tvERROR_NONE) { LOGWARN("Picture Mode set failed: %s\n",getErrorString(ret).c_str()); @@ -751,10 +753,10 @@ namespace Plugin { } else if (source == "Current") { tvVideoSrcType_t currentSource = VIDEO_SOURCE_IP; - tvError_t ret = GetCurrentSource(¤tSource); + tvError_t ret = GetCurrentVideoSource(¤tSource); if(ret != tvERROR_NONE) { - LOGWARN("%s: GetCurrentSource( ) Failed \n",__FUNCTION__); + LOGWARN("%s: GetCurrentVideoSource( ) Failed \n",__FUNCTION__); return -1; } source = convertSourceIndexToString(currentSource); @@ -1283,7 +1285,7 @@ namespace Plugin { sourceIndex = (tvVideoSrcType_t)getSourceIndex(source); } else { - GetCurrentSource(&sourceIndex); + GetCurrentVideoSource(&sourceIndex); } char picMode[PIC_MODE_NAME_MAX]={0}; @@ -1306,7 +1308,7 @@ namespace Plugin { tr181ErrorCode_t err = getLocalParam(rfc_caller_id, rfc_param.c_str(), ¶m); if ( tr181Success != err) { tvError_t retVal = GetDefaultPQParams(pqmodeIndex,(tvVideoSrcType_t)sourceIndex, - (tvVideoFormatType_t)ConvertHDRFormatToContentFormatODM((tvhdr_type_t)format), + (tvVideoFormatType_t)ConvertHDRFormatToContentFormat((tvhdr_type_t)format), PQ_PARAM_DOLBY_MODE,&dolby_mode_value); if( retVal != tvERROR_NONE ) { LOGERR("%s : failed\n",__FUNCTION__); @@ -1336,7 +1338,7 @@ namespace Plugin { std::string indexInfo; std::vector localIndex; - if( ReadCapablitiesFromConfODM( rangeInfo, pqmodeInfo, formatInfo ,sourceInfo,param, platformsupport, indexInfo)) { + if( ReadCapablitiesFromConf( rangeInfo, pqmodeInfo, formatInfo ,sourceInfo,param, platformsupport, indexInfo)) { LOGERR( "%s: ReadCapablitiesFromConf Failed !!!\n",__FUNCTION__); return tvERROR_GENERAL; } @@ -1359,7 +1361,7 @@ namespace Plugin { std::string pqmodeInfo; std::string indexInfo; - if( ReadCapablitiesFromConfODM( rangeInfo, pqmodeInfo, formatInfo ,sourceInfo,param, isPlatformSupport, indexInfo)) { + if( ReadCapablitiesFromConf( rangeInfo, pqmodeInfo, formatInfo ,sourceInfo,param, isPlatformSupport, indexInfo)) { LOGERR( "%s: ReadCapablitiesFromConf Failed !!!\n",__FUNCTION__); return tvERROR_GENERAL; } @@ -1370,6 +1372,119 @@ namespace Plugin { return ret; } + int AVOutputTV::GetPanelID(char *panelId) + { + if (panelId == NULL) { + printf("Invalid buffer provided for panel ID\n"); + return -1; + } + + const char *command = "/usr/bin/panelIDConfig -i"; + FILE *fp; + + // Execute the binary + fp = popen(command, "r"); + if (fp == NULL) { + printf("Failed to execute command: %s\n", command); + return -1; + } + + // Read the panel ID from the binary's output + if (fgets(panelId, 20, fp) != NULL) { + size_t len = strlen(panelId); + if (len > 0 && panelId[len - 1] == '\n') { + panelId[len - 1] = '\0'; + } + } else { + printf("Failed to read panel ID from panelIDConfig binary\n"); + pclose(fp); + return -1; + } + + pclose(fp); + return 0; + } + + int AVOutputTV::ConvertHDRFormatToContentFormat(tvhdr_type_t hdrFormat) + { + int ret=tvContentFormatType_SDR; + switch(hdrFormat) + { + case HDR_TYPE_SDR: + ret=tvContentFormatType_SDR; + break; + case HDR_TYPE_HDR10: + ret=tvContentFormatType_HDR10; + break; + case HDR_TYPE_HDR10PLUS: + ret=tvContentFormatType_HDR10PLUS; + break; + case HDR_TYPE_DOVI: + ret=tvContentFormatType_DOVI; + break; + case HDR_TYPE_HLG: + ret=tvContentFormatType_HLG; + break; + default: + break; + } + return ret; + } + + + int AVOutputTV::ReadCapablitiesFromConf(std::string &rangeInfo,std::string &pqmodeInfo,std::string &formatInfo,std::string &sourceInfo, + std::string param, std::string & isPlatformSupport, std::string & indexInfo) + { + int ret = 0; + + try { + CIniFile inFile(CAPABLITY_FILE_NAME); + std::string configString; + if ((param == "DolbyVisionMode") || (param == "Backlight") ) { + configString = param + ".platformsupport"; + isPlatformSupport = inFile.Get(configString); + printf(" platfromsupport : %s\n",isPlatformSupport.c_str() ); + } + + if ( (param == "ColorTemperature") || (param == "DimmingMode") || + ( param == "AutoBacklightControl") || (param == "DolbyVisionMode") || + (param == "HDR10Mode") || (param == "HLGMode") || (param == "AspectRatio") || + (param == "PictureMode") || (param == "VideoSource") || (param == "VideoFormat") || + (param == "VideoFrameRate") ) { + configString = param + ".range"; + rangeInfo = inFile.Get(configString); + printf(" String Range info : %s\n",rangeInfo.c_str() ); + } else { + configString = param + ".range_from"; + rangeInfo = inFile.Get(configString); + configString = param + ".range_to"; + rangeInfo += ","+inFile.Get(configString); + printf(" Integer Range Info : %s\n",rangeInfo.c_str() ); + } + + if ((param == "VideoSource") || (param == "PictureMode") || (param == "VideoFormat") ) { + configString.clear(); + configString = param + ".index"; + indexInfo = inFile.Get(configString); + printf("Index value %s\n", indexInfo.c_str()); + } + + configString.clear(); + configString = param + ".pqmode"; + pqmodeInfo = inFile.Get(configString); + configString = param + ".format"; + formatInfo = inFile.Get(configString); + configString = param + ".source"; + sourceInfo = inFile.Get(configString); + ret = 0; + } + catch(const boost::property_tree::ptree_error &e) { + printf("%s: error %s::config table entry not found in ini file\n",__FUNCTION__,e.what()); + ret = -1; + } + return ret; + } + void AVOutputTV::getDimmingModeStringFromEnum(int value, std::string &toStore) { const char *color_temp_string[] = { @@ -1400,9 +1515,9 @@ namespace Plugin { std::string tr181_param_name; tvVideoSrcType_t currentSource = VIDEO_SOURCE_IP; - ret = GetCurrentSource(¤tSource); + ret = GetCurrentVideoSource(¤tSource); if(ret != tvERROR_NONE) { - LOGERR("GetCurrentSource() Failed set source to default\n"); + LOGERR("GetCurrentVideoSource() Failed set source to default\n"); return 0; } @@ -1463,6 +1578,32 @@ namespace Plugin { return ret; } + tvDolbyMode_t AVOutputTV::GetDolbyVisionEnumFromModeString(const char* modeString) + { + if (strcmp(modeString, "Invalid") == 0) { + return tvDolbyMode_Invalid; + } else if (strcmp(modeString, "Dark") == 0) { + return tvDolbyMode_Dark; + } else if (strcmp(modeString, "Bright") == 0) { + return tvDolbyMode_Bright; + } else if (strcmp(modeString, "Game") == 0) { + return tvDolbyMode_Game; + } else if (strcmp(modeString, "HDR10 Dark") == 0) { + return tvHDR10Mode_Dark; + } else if (strcmp(modeString, "HDR10 Bright") == 0) { + return tvHDR10Mode_Bright; + } else if (strcmp(modeString, "HDR10 Game") == 0) { + return tvHDR10Mode_Game; + } else if (strcmp(modeString, "HLG Dark") == 0) { + return tvHLGMode_Dark; + } else if (strcmp(modeString, "HLG Bright") == 0) { + return tvHLGMode_Bright; + } else if (strcmp(modeString, "HLG Game") == 0) { + return tvHLGMode_Game; + } + + return tvDolbyMode_Invalid; // Default case for invalid input + } std::string AVOutputTV::getDolbyModeStringFromEnum( tvDolbyMode_t mode) diff --git a/AVOutput/CHANGELOG.md b/AVOutput/CHANGELOG.md index 2e200c40..d9497c1c 100644 --- a/AVOutput/CHANGELOG.md +++ b/AVOutput/CHANGELOG.md @@ -14,3 +14,14 @@ All notable changes to this RDK Service will be documented in this file. * Changes in CHANGELOG should be updated when commits are added to the main or release branches. There should be one CHANGELOG entry per JIRA Ticket. This is not enforced on sprint branches since there could be multiple changes for the same JIRA ticket during development. +## [1.0.10] - 2025-02-17 +### Fixed +ODM API removal changes phase 1 and Fixed PQ Mode Camel Case issue + +## [1.0.0] - 2025-02-17 +### Added +- Add CHANGELOG + +### Change +- Reset API version to 1.0.0 +- Change README to inform how to update changelog and API version diff --git a/CompositeInput/CHANGELOG.md b/CompositeInput/CHANGELOG.md index 2e200c40..06bea2b4 100644 --- a/CompositeInput/CHANGELOG.md +++ b/CompositeInput/CHANGELOG.md @@ -14,3 +14,15 @@ All notable changes to this RDK Service will be documented in this file. * Changes in CHANGELOG should be updated when commits are added to the main or release branches. There should be one CHANGELOG entry per JIRA Ticket. This is not enforced on sprint branches since there could be multiple changes for the same JIRA ticket during development. +## [1.1.5] - 2025-02-17 +### Added + +Added support for handling the videoStreamInfoUpdate for composite Input. + +## [1.0.0] - 2025-02-17 +### Added +- Add CHANGELOG + +### Change +- Reset API version to 1.0.0 +- Change README to inform how to update changelog and API version diff --git a/CompositeInput/CompositeInput.cpp b/CompositeInput/CompositeInput.cpp index 0e3a6708..fa06704a 100644 --- a/CompositeInput/CompositeInput.cpp +++ b/CompositeInput/CompositeInput.cpp @@ -28,8 +28,8 @@ #include "dsMgr.h" #define API_VERSION_NUMBER_MAJOR 1 -#define API_VERSION_NUMBER_MINOR 0 -#define API_VERSION_NUMBER_PATCH 2 +#define API_VERSION_NUMBER_MINOR 1 +#define API_VERSION_NUMBER_PATCH 5 #define COMPOSITE_HOT_PLUG_EVENT_CONNECTED 1 #define COMPOSITE_HOT_PLUG_EVENT_DISCONNECTED 0 @@ -42,6 +42,7 @@ #define COMPOSITEINPUT_EVENT_ON_DEVICES_CHANGED "onDevicesChanged" #define COMPOSITEINPUT_EVENT_ON_SIGNAL_CHANGED "onSignalChanged" #define COMPOSITEINPUT_EVENT_ON_STATUS_CHANGED "onInputStatusChanged" +#define COMPOSITEINPUT_EVENT_ON_VIDEO_MODE_UPDATED "videoStreamInfoUpdate" namespace WPEFramework { @@ -103,6 +104,7 @@ namespace WPEFramework IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_HOTPLUG, dsCompositeEventHandler) ); IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_SIGNAL_STATUS, dsCompositeSignalStatusEventHandler) ); IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_STATUS, dsCompositeStatusEventHandler) ); + IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_VIDEO_MODE_UPDATE,dsCompositeVideoModeEventHandler) ); } } @@ -114,6 +116,7 @@ namespace WPEFramework IARM_CHECK( IARM_Bus_RemoveEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_HOTPLUG, dsCompositeEventHandler) ); IARM_CHECK( IARM_Bus_RemoveEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_SIGNAL_STATUS, dsCompositeSignalStatusEventHandler) ); IARM_CHECK( IARM_Bus_RemoveEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_STATUS, dsCompositeStatusEventHandler) ); + IARM_CHECK( IARM_Bus_RemoveEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_VIDEO_MODE_UPDATE, dsCompositeVideoModeEventHandler) ); } } @@ -361,6 +364,89 @@ namespace WPEFramework sendNotify(COMPOSITEINPUT_EVENT_ON_STATUS_CHANGED, params); } + /** + * @brief This function is used to translate Composite input video mode change to + * videoStreamInfoUpdate event. + * + * @param[in] port Composite In port id. + * @param[dsVideoPortResolution_t] video resolution data + */ + void CompositeInput::compositeInputVideoModeUpdate( int port , dsVideoPortResolution_t resolution) + { + LOGWARN("compositeInputVideoModeUpdate [%d]", port); + + JsonObject params; + params["id"] = port; + std::stringstream locator; + locator << "cvbsin://localhost/deviceid/" << port; + params["locator"] = locator.str(); + + switch(resolution.pixelResolution) { + case dsVIDEO_PIXELRES_720x480: + params["width"] = 720; + params["height"] = 480; + break; + case dsVIDEO_PIXELRES_720x576: + params["width"] = 720; + params["height"] = 576; + break; + default: + params["width"] = 720; + params["height"] = 576; + break; + } + + params["progressive"] = false; + + switch(resolution.frameRate) { + case dsVIDEO_FRAMERATE_24: + params["frameRateN"] = 24000; + params["frameRateD"] = 1000; + break; + + case dsVIDEO_FRAMERATE_25: + params["frameRateN"] = 25000; + params["frameRateD"] = 1000; + break; + + case dsVIDEO_FRAMERATE_30: + params["frameRateN"] = 30000; + params["frameRateD"] = 1000; + break; + + case dsVIDEO_FRAMERATE_50: + params["frameRateN"] = 50000; + params["frameRateD"] = 1000; + break; + + case dsVIDEO_FRAMERATE_60: + params["frameRateN"] = 60000; + params["frameRateD"] = 1000; + break; + + case dsVIDEO_FRAMERATE_23dot98: + params["frameRateN"] = 24000; + params["frameRateD"] = 1001; + break; + + case dsVIDEO_FRAMERATE_29dot97: + params["frameRateN"] = 30000; + params["frameRateD"] = 1001; + break; + + case dsVIDEO_FRAMERATE_59dot94: + params["frameRateN"] = 60000; + params["frameRateD"] = 1001; + break; + + default: + params["frameRateN"] = 60000; + params["frameRateD"] = 1000; + break; + } + + sendNotify(COMPOSITEINPUT_EVENT_ON_VIDEO_MODE_UPDATED, params); + } void CompositeInput::dsCompositeEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len) { @@ -409,6 +495,25 @@ namespace WPEFramework CompositeInput::_instance->compositeInputStatusChange(composite_in_port, composite_in_status); } } + void CompositeInput::dsCompositeVideoModeEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len) + { + if(!CompositeInput::_instance) + return; + + if (IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_VIDEO_MODE_UPDATE == eventId) + { + IARM_Bus_DSMgr_EventData_t *eventData = (IARM_Bus_DSMgr_EventData_t *)data; + int composite_in_port = eventData->data.composite_in_video_mode.port; + dsVideoPortResolution_t resolution = {}; + resolution.pixelResolution = eventData->data.composite_in_video_mode.resolution.pixelResolution; + resolution.interlaced = eventData->data.composite_in_video_mode.resolution.interlaced; + resolution.frameRate = eventData->data.composite_in_video_mode.resolution.frameRate; + LOGWARN("Received IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_VIDEO_MODE_UPDATE event port: %d, pixelResolution: %d, interlaced : %d, frameRate: %d \n", composite_in_port,resolution.pixelResolution, resolution.interlaced, resolution.frameRate); + + CompositeInput::_instance->compositeInputVideoModeUpdate(composite_in_port, resolution); + + } + } } // namespace Plugin } // namespace WPEFramework diff --git a/CompositeInput/CompositeInput.h b/CompositeInput/CompositeInput.h index 19be2d10..3d1de607 100644 --- a/CompositeInput/CompositeInput.h +++ b/CompositeInput/CompositeInput.h @@ -20,7 +20,7 @@ #pragma once #include "libIBus.h" - +#include "dsTypes.h" #include "Module.h" namespace WPEFramework { @@ -70,6 +70,8 @@ namespace WPEFramework { void compositeInputStatusChange( int port , bool isPresented); static void dsCompositeStatusEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len); + void compositeInputVideoModeUpdate( int port , dsVideoPortResolution_t resolution); + static void dsCompositeVideoModeEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len); public: CompositeInput(); virtual ~CompositeInput(); diff --git a/HdmiInput/CHANGELOG.md b/HdmiInput/CHANGELOG.md index 2e200c40..3e73c318 100644 --- a/HdmiInput/CHANGELOG.md +++ b/HdmiInput/CHANGELOG.md @@ -14,3 +14,14 @@ All notable changes to this RDK Service will be documented in this file. * Changes in CHANGELOG should be updated when commits are added to the main or release branches. There should be one CHANGELOG entry per JIRA Ticket. This is not enforced on sprint branches since there could be multiple changes for the same JIRA ticket during development. +## [1.4.0] - 2025-02-17 +### Added +- Added support for Getting the Maximum HDMI Compatibility version for the given port. + +## [1.0.0] - 2025-02-17 +### Added +- Add CHANGELOG + +### Change +- Reset API version to 1.0.0 +- Change README to inform how to update changelog and API version diff --git a/HdmiInput/HdmiInput.cpp b/HdmiInput/HdmiInput.cpp index 85f9d696..e45efa09 100644 --- a/HdmiInput/HdmiInput.cpp +++ b/HdmiInput/HdmiInput.cpp @@ -56,6 +56,7 @@ #define HDMIINPUT_EVENT_ON_AVI_CONTENT_TYPE_CHANGED "hdmiContentTypeUpdate" #define HDMIINPUT_METHOD_GET_LOW_LATENCY_MODE "getTVLowLatencyMode" #define HDMIINPUT_METHOD_GET_AV_LATENCY "getAVLatency" +#define HDMIINPUT_METHOD_GET_HDMI_COMPATIBILITY_VERSION "getHdmiVersion" #define HDMICECSINK_CALLSIGN "org.rdk.HdmiCecSink" #define HDMICECSINK_CALLSIGN_VER HDMICECSINK_CALLSIGN".1" @@ -66,7 +67,7 @@ #define registerMethod(...) for (uint8_t i = 1; GetHandler(i); i++) GetHandler(i)->Register(__VA_ARGS__) #define API_VERSION_NUMBER_MAJOR 1 -#define API_VERSION_NUMBER_MINOR 3 +#define API_VERSION_NUMBER_MINOR 4 #define API_VERSION_NUMBER_PATCH 0 static int audio_output_delay = 100; @@ -126,7 +127,8 @@ namespace WPEFramework registerMethod(HDMIINPUT_METHOD_GAME_FEATURE_STATUS, &HdmiInput::getHdmiGameFeatureStatusWrapper, this); registerMethod(HDMIINPUT_METHOD_GET_AV_LATENCY, &HdmiInput::getAVLatency, this); registerMethod(HDMIINPUT_METHOD_GET_LOW_LATENCY_MODE, &HdmiInput::getTVLowLatencyMode, this); - m_primVolume = DEFAULT_PRIM_VOL_LEVEL; + registerMethod(HDMIINPUT_METHOD_GET_HDMI_COMPATIBILITY_VERSION, &HdmiInput::getHdmiVersionWrapper, this); + m_primVolume = DEFAULT_PRIM_VOL_LEVEL; m_inputVolume = DEFAULT_INPUT_VOL_LEVEL; } @@ -1198,6 +1200,53 @@ namespace WPEFramework } } + uint32_t HdmiInput::getHdmiVersionWrapper(const JsonObject& parameters, JsonObject& response) + { + LOGINFOMETHOD(); + returnIfParamNotFound(parameters, "portId"); + string sPortId = parameters["portId"].String(); + int portId = 0; + + try { + portId = stoi(sPortId); + }catch (const std::exception& err) { + LOGWARN("sPortId invalid paramater: %s ", sPortId.c_str()); + returnResponse(false); + } + + dsHdmiMaxCapabilityVersion_t hdmiCapVersion = HDMI_COMPATIBILITY_VERSION_14; + + try { + device::HdmiInput::getInstance().getHdmiVersion(portId, &(hdmiCapVersion)); + LOGWARN("HdmiInput::getHdmiVersion Hdmi Version:%d", hdmiCapVersion); + } + catch (const device::Exception& err) { + LOG_DEVICE_EXCEPTION1(std::to_string(portId)); + returnResponse(false); + } + + + switch ((int)hdmiCapVersion){ + case HDMI_COMPATIBILITY_VERSION_14: + response["HdmiCapabilityVersion"] = "1.4"; + break; + case HDMI_COMPATIBILITY_VERSION_20: + response["HdmiCapabilityVersion"] = "2.0"; + break; + case HDMI_COMPATIBILITY_VERSION_21: + response["HdmiCapabilityVersion"] = "2.1"; + break; + } + + + if(hdmiCapVersion == HDMI_COMPATIBILITY_VERSION_MAX) + { + returnResponse(false); + }else{ + returnResponse(true); + } + } + uint32_t HdmiInput::getServiceState(PluginHost::IShell* shell, const string& callsign, PluginHost::IShell::state& state) { LOGINFO("entering getServiceState\n"); diff --git a/HdmiInput/HdmiInput.h b/HdmiInput/HdmiInput.h index 78a051de..ff93202e 100644 --- a/HdmiInput/HdmiInput.h +++ b/HdmiInput/HdmiInput.h @@ -72,6 +72,7 @@ namespace WPEFramework { uint32_t getHdmiGameFeatureStatusWrapper(const JsonObject& parameters, JsonObject& response); uint32_t getAVLatency(const JsonObject& parameters, JsonObject& response); uint32_t getTVLowLatencyMode(const JsonObject& parameters, JsonObject& response); + uint32_t getHdmiVersionWrapper(const JsonObject& parameters, JsonObject& response); //End methods JsonArray getHDMIInputDevices();