Skip to content

Commit 414c41b

Browse files
aktamilbeskk451
authored andcommitted
RDKEMW-5197 : Updated review comments
1 parent 96f62a8 commit 414c41b

File tree

4 files changed

+41
-113
lines changed

4 files changed

+41
-113
lines changed

AVOutput/AVOutput.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "UtilsSearchRDKProfile.h"
2424

2525
#define API_VERSION_NUMBER_MAJOR 1
26-
#define API_VERSION_NUMBER_MINOR 2
26+
#define API_VERSION_NUMBER_MINOR 1
2727
#define API_VERSION_NUMBER_PATCH 0
2828

2929
namespace WPEFramework {

AVOutput/AVOutputTV.cpp

Lines changed: 24 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ namespace Plugin {
868868

869869
uint32_t AVOutputTV::getBacklightCapsV2(const JsonObject& parameters, JsonObject& response) {
870870
return getPQCapabilityWithContext([this]( tvContextCaps_t** context_caps, int* max_backlight) {
871-
#if HAL_NOT_READY
871+
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
872872
return this->GetBacklightCaps(max_backlight, context_caps);
873873
#else
874874
return GetBacklightCaps(max_backlight, context_caps);
@@ -878,7 +878,7 @@ namespace Plugin {
878878

879879
uint32_t AVOutputTV::getBrightnessCapsV2(const JsonObject& parameters, JsonObject& response) {
880880
return getPQCapabilityWithContext([this]( tvContextCaps_t** context_caps, int* max_brightness) {
881-
#if HAL_NOT_READY
881+
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
882882
return this->GetBrightnessCaps(max_brightness, context_caps);
883883
#else
884884
return GetBrightnessCaps(max_brightness, context_caps);
@@ -889,7 +889,7 @@ namespace Plugin {
889889

890890
uint32_t AVOutputTV::getContrastCapsV2(const JsonObject& parameters, JsonObject& response) {
891891
return getPQCapabilityWithContext([this](tvContextCaps_t** context_caps, int* max_contrast) {
892-
#if HAL_NOT_READY
892+
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
893893
return this->GetContrastCaps(max_contrast, context_caps);
894894
#else
895895
return GetContrastCaps(max_contrast, context_caps);
@@ -900,7 +900,7 @@ namespace Plugin {
900900

901901
uint32_t AVOutputTV::getSharpnessCapsV2(const JsonObject& parameters, JsonObject& response) {
902902
return getPQCapabilityWithContext([this](tvContextCaps_t** context_caps, int* max_sharpness) {
903-
#if HAL_NOT_READY
903+
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
904904
return this->GetSharpnessCaps(max_sharpness, context_caps);
905905
#else
906906
return GetSharpnessCaps(max_sharpness, context_caps);
@@ -911,7 +911,7 @@ namespace Plugin {
911911

912912
uint32_t AVOutputTV::getSaturationCapsV2(const JsonObject& parameters, JsonObject& response) {
913913
return getPQCapabilityWithContext([this](tvContextCaps_t** context_caps, int* max_saturation) {
914-
#if HAL_NOT_READY
914+
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
915915
return this->GetSaturationCaps(max_saturation, context_caps);
916916
#else
917917
return GetSaturationCaps(max_saturation, context_caps);
@@ -922,7 +922,7 @@ namespace Plugin {
922922

923923
uint32_t AVOutputTV::getHueCapsV2(const JsonObject& parameters, JsonObject& response) {
924924
return getPQCapabilityWithContext([this]( tvContextCaps_t** context_caps, int* max_hue) {
925-
#if HAL_NOT_READY
925+
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
926926
return this->GetHueCaps(max_hue, context_caps);
927927
#else
928928
return GetHueCaps(max_hue, context_caps);
@@ -933,7 +933,7 @@ namespace Plugin {
933933

934934
uint32_t AVOutputTV::getPrecisionDetailCaps(const JsonObject& parameters, JsonObject& response) {
935935
return getPQCapabilityWithContext([this](tvContextCaps_t** context_caps, int* max_precision) {
936-
#if HAL_NOT_READY
936+
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
937937
return this->GetPrecisionDetailCaps(max_precision, context_caps);
938938
#else
939939
return GetPrecisionDetailCaps(max_precision, context_caps);
@@ -944,7 +944,7 @@ namespace Plugin {
944944

945945
uint32_t AVOutputTV::getLocalContrastEnhancementCaps(const JsonObject& parameters, JsonObject& response) {
946946
return getPQCapabilityWithContext([this](tvContextCaps_t** context_caps, int* max_val) {
947-
#if HAL_NOT_READY
947+
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
948948
return this->GetLocalContrastEnhancementCaps(max_val, context_caps);
949949
#else
950950
return GetLocalContrastEnhancementCaps(max_val, context_caps);
@@ -955,7 +955,7 @@ namespace Plugin {
955955

956956
uint32_t AVOutputTV::getMPEGNoiseReductionCaps(const JsonObject& parameters, JsonObject& response) {
957957
return getPQCapabilityWithContext([this](tvContextCaps_t** context_caps, int* max_val) {
958-
#if HAL_NOT_READY
958+
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
959959
return this->GetMPEGNoiseReductionCaps(max_val, context_caps);
960960
#else
961961
return GetMPEGNoiseReductionCaps(max_val, context_caps);
@@ -966,7 +966,7 @@ namespace Plugin {
966966

967967
uint32_t AVOutputTV::getDigitalNoiseReductionCaps(const JsonObject& parameters, JsonObject& response) {
968968
return getPQCapabilityWithContext([this](tvContextCaps_t** context_caps, int* max_val) {
969-
#if HAL_NOT_READY
969+
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
970970
return this->GetDigitalNoiseReductionCaps(max_val, context_caps);
971971
#else
972972
return GetDigitalNoiseReductionCaps(max_val, context_caps);
@@ -977,7 +977,7 @@ namespace Plugin {
977977

978978
uint32_t AVOutputTV::getAISuperResolutionCaps(const JsonObject& parameters, JsonObject& response) {
979979
return getPQCapabilityWithContext([this](tvContextCaps_t** context_caps, int* max_val) {
980-
#if HAL_NOT_READY
980+
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
981981
return this->GetAISuperResolutionCaps(max_val, context_caps);
982982
#else
983983
return GetAISuperResolutionCaps(max_val, context_caps);
@@ -1023,7 +1023,7 @@ namespace Plugin {
10231023
}
10241024
response["uiMatrixPositions"] = uiPosArray;
10251025
response["context"] = parseContextCaps(context_caps);
1026-
#if HAL_NOT_READY
1026+
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
10271027
// TODO:: Review cleanup once HAL is available, as memory will be allocated in HAL.
10281028
delete[] ui_matrix_positions;
10291029
#endif
@@ -1033,7 +1033,7 @@ namespace Plugin {
10331033

10341034
uint32_t AVOutputTV::getMEMCCaps(const JsonObject& parameters, JsonObject& response) {
10351035
return getPQCapabilityWithContext([this](tvContextCaps_t** context_caps, int* max_val) {
1036-
#if HAL_NOT_READY
1036+
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
10371037
return this->GetMEMCCaps(max_val, context_caps);
10381038
#else
10391039
return GetMEMCCaps(max_val, context_caps);
@@ -1044,7 +1044,7 @@ namespace Plugin {
10441044

10451045
uint32_t AVOutputTV::getLowLatencyStateCapsV2(const JsonObject& parameters, JsonObject& response) {
10461046
return getPQCapabilityWithContext([this](tvContextCaps_t** context_caps, int* max_latency) {
1047-
#if HAL_NOT_READY
1047+
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
10481048
return this->GetLowLatencyStateCaps(max_latency, context_caps);
10491049
#else
10501050
return GetLowLatencyStateCaps(max_latency, context_caps);
@@ -1103,7 +1103,7 @@ namespace Plugin {
11031103
response["options"] = optionsArray;
11041104
response["context"] = parseContextCaps(context_caps);
11051105

1106-
#if HAL_NOT_READY
1106+
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
11071107
free(color_temp);
11081108
#endif
11091109

@@ -1141,7 +1141,7 @@ namespace Plugin {
11411141

11421142
response["context"] = parseContextCaps(context_caps);
11431143

1144-
#if HAL_NOT_READY
1144+
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
11451145
free(sdr_gamma);
11461146
#endif
11471147

@@ -1172,7 +1172,7 @@ namespace Plugin {
11721172

11731173
response["context"] = parseContextCaps(context_caps);
11741174

1175-
#if HAL_NOT_READY
1175+
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
11761176
free(dimming_mode);
11771177
#endif
11781178

@@ -1194,7 +1194,7 @@ namespace Plugin {
11941194

11951195
response["context"] = parseContextCaps(m_aspectRatioCaps);
11961196

1197-
#if HAL_NOT_READY
1197+
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
11981198
free(m_aspectRatio);
11991199
#endif
12001200

@@ -1216,7 +1216,7 @@ namespace Plugin {
12161216

12171217
response["context"] = parseContextCaps(m_pictureModeCaps);
12181218

1219-
#if HAL_NOT_READY
1219+
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
12201220
free(m_pictureModes);
12211221
#endif
12221222

@@ -1248,7 +1248,7 @@ namespace Plugin {
12481248

12491249
response["context"] = parseContextCaps(m_backlightModeCaps);
12501250

1251-
#if HAL_NOT_READY
1251+
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
12521252
// TODO: Review cleanup once HAL is available, as memory will be allocated in HAL.
12531253
free(m_backlightModes);
12541254
#endif
@@ -1288,7 +1288,7 @@ namespace Plugin {
12881288
// Indicate success
12891289
response["success"] = true;
12901290

1291-
#if HAL_NOT_READY
1291+
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
12921292
// TODO: Clean up when HAL handles memory
12931293
delete min_values;
12941294
delete max_values;
@@ -1591,80 +1591,43 @@ namespace Plugin {
15911591

15921592
uint32_t AVOutputTV::resetPrecisionDetail(const JsonObject& parameters, JsonObject& response)
15931593
{
1594-
#if HAL_NOT_READY
1595-
bool success = false;
1596-
#else
15971594
bool success = resetPQParamToDefault(parameters, "PrecisionDetail",
15981595
PQ_PARAM_PRECISION_DETAIL, SetPrecisionDetail);
1599-
#endif
16001596
returnResponse(success);
16011597
}
16021598

16031599
uint32_t AVOutputTV::resetLocalContrastEnhancement(const JsonObject& parameters, JsonObject& response)
16041600
{
1605-
#if HAL_NOT_READY
1606-
bool success = false;
1607-
#else
1608-
#if ENABLE_PQ_PARAM
16091601
bool success = resetPQParamToDefault(parameters, "LocalContrastEnhancement",
16101602
PQ_PARAM_LOCAL_CONTRAST_ENHANCEMENT, SetLocalContrastEnhancement);
1611-
#else
1612-
bool success = true;
1613-
#endif
1614-
#endif
16151603
returnResponse(success);
16161604
}
16171605

16181606
uint32_t AVOutputTV::resetMPEGNoiseReduction(const JsonObject& parameters, JsonObject& response)
16191607
{
1620-
#if HAL_NOT_READY
1621-
bool success = false;
1622-
#else
1623-
#if ENABLE_PQ_PARAM
16241608
bool success = resetPQParamToDefault(parameters, "MPEGNoiseReduction",
16251609
PQ_PARAM_MPEG_NOISE_REDUCTION, SetMPEGNoiseReduction);
1626-
#else
1627-
bool success = true;
1628-
#endif
1629-
#endif
16301610
returnResponse(success);
16311611
}
16321612

16331613
uint32_t AVOutputTV::resetDigitalNoiseReduction(const JsonObject& parameters, JsonObject& response)
16341614
{
1635-
#if HAL_NOT_READY
1636-
bool success = false;
1637-
#else
1638-
#if ENABLE_PQ_PARAM
16391615
bool success = resetPQParamToDefault(parameters, "DigitalNoiseReduction",
16401616
PQ_PARAM_DIGITAL_NOISE_REDUCTION, SetDigitalNoiseReduction);
1641-
#else
1642-
bool success = true;
1643-
#endif
1644-
1645-
#endif
16461617
returnResponse(success);
16471618
}
16481619

16491620
uint32_t AVOutputTV::resetMEMC(const JsonObject& parameters, JsonObject& response)
16501621
{
1651-
#if HAL_NOT_READY
1652-
bool success = false;
1653-
#else
16541622
bool success = resetPQParamToDefault(parameters, "MEMC",
16551623
PQ_PARAM_MEMC, SetMEMC);
1656-
#endif
16571624
returnResponse(success);
16581625
}
16591626

16601627
uint32_t AVOutputTV::resetAISuperResolution(const JsonObject& parameters, JsonObject& response)
16611628
{
1662-
#if HAL_NOT_READY
1663-
bool success= false;
1664-
#else
16651629
bool success= resetPQParamToDefault(parameters,"AISuperResolution",
16661630
PQ_PARAM_AI_SUPER_RESOLUTION, SetAISuperResolution);
1667-
#endif
16681631
returnResponse(success);
16691632
}
16701633

@@ -1805,14 +1768,11 @@ namespace Plugin {
18051768
LOGINFO("currentPQMode: %d, currentFmt: %d, currentSrc: %d", currentPQMode, currentFmt, currentSrc);
18061769

18071770
if (isSetRequiredForParam(parameters, tr181ParamName)) {
1808-
#if HAL_NOT_READY
1809-
#else
18101771
tvError_t ret = halSetter(currentSrc, currentPQMode, currentFmt, value);
18111772
if (ret != tvERROR_NONE) {
18121773
LOGERR("HAL setter failed for %s", inputParamName.c_str());
18131774
returnResponse(false);
18141775
}
1815-
#endif
18161776
}
18171777

18181778
// Persist
@@ -1868,7 +1828,6 @@ namespace Plugin {
18681828

18691829
uint32_t AVOutputTV::setLocalContrastEnhancement(const JsonObject& parameters, JsonObject& response)
18701830
{
1871-
#if ENABLE_PQ_PARAM
18721831
return setContextPQParam(
18731832
parameters, response,
18741833
"localContrastEnhancement", "LocalContrastEnhancement",
@@ -1878,14 +1837,10 @@ namespace Plugin {
18781837
return SetLocalContrastEnhancement(src, mode, fmt, val);
18791838
}
18801839
);
1881-
#else
1882-
returnResponse(true);
1883-
#endif
18841840
}
18851841

18861842
uint32_t AVOutputTV::setMPEGNoiseReduction(const JsonObject& parameters, JsonObject& response)
18871843
{
1888-
#if ENABLE_PQ_PARAM
18891844
return setContextPQParam(
18901845
parameters, response,
18911846
"mpegNoiseReduction", "MPEGNoiseReduction",
@@ -1895,14 +1850,10 @@ namespace Plugin {
18951850
return SetMPEGNoiseReduction(src, mode, fmt, val);
18961851
}
18971852
);
1898-
#else
1899-
returnResponse(true);
1900-
#endif
19011853
}
19021854

19031855
uint32_t AVOutputTV::setDigitalNoiseReduction(const JsonObject& parameters, JsonObject& response)
19041856
{
1905-
#if ENABLE_PQ_PARAM
19061857
return setContextPQParam(
19071858
parameters, response,
19081859
"digitalNoiseReduction", "DigitalNoiseReduction",
@@ -1912,9 +1863,6 @@ namespace Plugin {
19121863
return SetDigitalNoiseReduction(src, mode, fmt, val);
19131864
}
19141865
);
1915-
#else
1916-
returnResponse(true);
1917-
#endif
19181866
}
19191867

19201868
uint32_t AVOutputTV::getBacklight(const JsonObject& parameters, JsonObject& response)
@@ -4440,7 +4388,7 @@ namespace Plugin {
44404388
if (ctx.videoSrcType == currentSrc && ctx.videoFormatType == currentFmt) {
44414389
if (SetTVPictureMode(mode.c_str()) != tvERROR_NONE) {
44424390
LOGERR("SetTVPictureMode failed for mode: %s", mode.c_str());
4443-
continue;
4391+
return false;
44444392
}
44454393
}
44464394
//TODO:: Revisit this logic. Have to revert if HAL call fails.
@@ -5384,7 +5332,7 @@ namespace Plugin {
53845332
}
53855333
response["component"] = componentJson;
53865334
response["context"] = parseContextCaps(context_caps);
5387-
#if HAL_NOT_READY
5335+
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
53885336
// Clean up dynamic memory
53895337
delete[] colorArray;
53905338
delete[] componentArray;
@@ -5893,7 +5841,7 @@ namespace Plugin {
58935841
response["color"] = colorJson;
58945842
response["context"] = parseContextCaps(context_caps);
58955843

5896-
#if HAL_NOT_READY
5844+
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
58975845
delete[] colorArray;
58985846
delete[] controlArray;
58995847
#endif

AVOutput/AVOutputTV.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -469,9 +469,8 @@ class AVOutputTV : public AVOutputBase {
469469
int *max_offset, tvWBColor_t **color,
470470
tvWBControl_t **control, size_t* num_color,
471471
size_t* num_control, tvContextCaps_t ** context_caps);
472-
#define HAL_NOT_READY 0
473-
#if HAL_NOT_READY
474-
#define CAPABLITY_FILE_NAMEV2 "/opt/panel/pq_capabilities.json"
472+
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
473+
#define CAPABILITY_FILE_NAMEV2 "/opt/panel/pq_capabilities.json"
475474
tvError_t GetBacklightCaps(int *max_backlight, tvContextCaps_t **context_caps);
476475
tvError_t GetBrightnessCaps(int *max_brightness, tvContextCaps_t **context_caps);
477476
tvError_t GetContrastCaps(int* max_contrast, tvContextCaps_t** context_caps);
@@ -488,7 +487,7 @@ class AVOutputTV : public AVOutputBase {
488487
tvError_t GetAISuperResolutionCaps(int* maxAISuperResolution, tvContextCaps_t** context_caps);
489488
tvError_t GetMEMCCaps(int* maxMEMC, tvContextCaps_t** context_caps);
490489
#else
491-
#define CAPABLITY_FILE_NAMEV2 "/etc/pq_capabilities.json"
490+
#define CAPABILITY_FILE_NAMEV2 "/etc/pq_capabilities.json"
492491
#endif
493492
uint32_t getPQCapabilityWithContext(
494493
const std::function<tvError_t(tvContextCaps_t**, int*)>& getCapsFunc,

0 commit comments

Comments
 (0)