Skip to content
Closed
Show file tree
Hide file tree
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
20 changes: 14 additions & 6 deletions AVOutput/AVOutputTV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2203,14 +2203,17 @@ namespace Plugin {
uint32_t AVOutputTV::getSupportedDolbyVisionModes(const JsonObject& parameters, JsonObject& response)
{
LOGINFO("Entry\n");
tvDolbyMode_t dvModes[tvMode_Max];
tvDolbyMode_t *dvModesPtr = dvModes; // Pointer to statically allocated tvDolbyMode_t array
tvDolbyMode_t dvModes[tvMode_Max] = { tvDolbyMode_Invalid };
tvDolbyMode_t *dvModesPtr[tvMode_Max] = { 0 };
unsigned short totalAvailable = 0;

for (int i = 0; i < tvMode_Max; i++)
{
dvModesPtr[i] = &dvModes[i];
}
// Set an initial value to indicate the mode type
dvModes[0] = tvDolbyMode_Dark;

tvError_t ret = GetTVSupportedDolbyVisionModes(&dvModesPtr, &totalAvailable);
tvError_t ret = GetTVSupportedDolbyVisionModes(dvModesPtr, &totalAvailable);
if(ret != tvERROR_NONE) {
returnResponse(false);
}
Expand Down Expand Up @@ -2423,9 +2426,14 @@ namespace Plugin {
uint32_t AVOutputTV::getSupportedPictureModes(const JsonObject& parameters, JsonObject& response)
{
LOGINFO("Entry\n");
pic_modes_t *pictureModes;
pic_modes_t pictureModes[PIC_MODES_SUPPORTED_MAX];
pic_modes_t *pictureModesPtr[PIC_MODES_SUPPORTED_MAX]={0};
unsigned short totalAvailable = 0;
tvError_t ret = GetTVSupportedPictureModes(&pictureModes,&totalAvailable);
for (int i = 0; i < PIC_MODES_SUPPORTED_MAX; i++)
{
pictureModesPtr[i] = &pictureModes[i];
}
tvError_t ret = GetTVSupportedPictureModes(pictureModesPtr,&totalAvailable);
if(ret != tvERROR_NONE) {
returnResponse(false);
}
Expand Down
5 changes: 0 additions & 5 deletions AVOutput/AVOutputTV.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

#include "tvTypes.h"
#include "tvSettings.h"
#include "tvSettingsExtODM.h"
#include <pthread.h>
#include "Module.h"
#include "tvError.h"
Expand Down Expand Up @@ -270,7 +269,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 +306,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 Expand Up @@ -340,10 +337,8 @@ class AVOutputTV : public AVOutputBase {
int getLocalparam( std::string forParam,paramIndex_t indexInfo,int & value,tvPQParameterIndex_t pqParamIndex,bool sync=false);

tvDataComponentColor_t getComponentColorEnum(std::string colorName);
int getDolbyParams(tvContentFormatType_t format, std::string &s, std::string source = "");
tvError_t getParamsCaps(std::string param, capVectors_t &vecInfo);
int GetPanelID(char *panelid);
int ConvertHDRFormatToContentFormat(tvhdr_type_t hdrFormat);
int ReadCapablitiesFromConf(std::string param, capDetails_t& info);
void getDimmingModeStringFromEnum(int value, std::string &toStore);
void getColorTempStringFromEnum(int value, std::string &toStore);
Expand Down
87 changes: 8 additions & 79 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,14 +235,19 @@ namespace Plugin {
int AVOutputTV::getDolbyModeIndex(const char * dolbyMode)
{
int mode = 0;
tvDolbyMode_t dolbyModes[tvMode_Max];
tvDolbyMode_t *dolbyModesPtr = dolbyModes; // Pointer to statically allocated tvDolbyMode_t array
tvDolbyMode_t dolbyModes[tvMode_Max] = { tvDolbyMode_Invalid };
tvDolbyMode_t *dolbyModesPtr[tvMode_Max] = { 0 };
unsigned short totalAvailable = 0;

for (int i = 0; i < tvMode_Max; i++)
{
dolbyModesPtr[i] = &dolbyModes[i];
}

// Set an initial value to indicate the mode type
dolbyModes[0] = tvDolbyMode_Dark;

tvError_t ret = GetTVSupportedDolbyVisionModes(&dolbyModesPtr, &totalAvailable);
tvError_t ret = GetTVSupportedDolbyVisionModes(dolbyModesPtr, &totalAvailable);
if (ret == tvERROR_NONE) {
for (int count = 0; count < totalAvailable; count++) {
if(strncasecmp(dolbyMode, getDolbyModeStringFromEnum(dolbyModes[count]).c_str(), strlen(dolbyMode))==0) {
Expand Down Expand Up @@ -925,26 +900,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 @@ -1654,32 +1609,6 @@ namespace Plugin {
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;
}

void AVOutputTV::getDimmingModeStringFromEnum(int value, std::string &toStore)
{
const char *color_temp_string[] = {
Expand Down
Loading