Skip to content

Commit 2529943

Browse files
aktamilbeskk451
authored andcommitted
RDKEMW-5197 : Removed Plugin Caps implementation
1 parent 414c41b commit 2529943

File tree

4 files changed

+4
-893
lines changed

4 files changed

+4
-893
lines changed

AVOutput/AVOutput.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ namespace Plugin {
6060
const std::string Initialize(PluginHost::IShell* service);
6161
void Deinitialize(PluginHost::IShell* service);
6262
virtual string Information() const override { return {}; }
63-
virtual void AddRef() const { }
64-
virtual uint32_t Release() const {return 0; }
6563
BEGIN_INTERFACE_MAP(AVOutput)
6664
INTERFACE_ENTRY(PluginHost::IPlugin)
6765
INTERFACE_ENTRY(PluginHost::IDispatcher)

AVOutput/AVOutputTV.cpp

Lines changed: 1 addition & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -868,120 +868,76 @@ 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 ENABLE_CAPS_SUPPORT_FROM_PLUGIN
872-
return this->GetBacklightCaps(max_backlight, context_caps);
873-
#else
874871
return GetBacklightCaps(max_backlight, context_caps);
875-
#endif
876872
}, parameters, response);
877873
}
878874

879875
uint32_t AVOutputTV::getBrightnessCapsV2(const JsonObject& parameters, JsonObject& response) {
880876
return getPQCapabilityWithContext([this]( tvContextCaps_t** context_caps, int* max_brightness) {
881-
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
882-
return this->GetBrightnessCaps(max_brightness, context_caps);
883-
#else
884877
return GetBrightnessCaps(max_brightness, context_caps);
885-
#endif
886878
},
887879
parameters, response);
888880
}
889881

890882
uint32_t AVOutputTV::getContrastCapsV2(const JsonObject& parameters, JsonObject& response) {
891883
return getPQCapabilityWithContext([this](tvContextCaps_t** context_caps, int* max_contrast) {
892-
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
893-
return this->GetContrastCaps(max_contrast, context_caps);
894-
#else
895884
return GetContrastCaps(max_contrast, context_caps);
896-
#endif
897885
},
898886
parameters, response);
899887
}
900888

901889
uint32_t AVOutputTV::getSharpnessCapsV2(const JsonObject& parameters, JsonObject& response) {
902890
return getPQCapabilityWithContext([this](tvContextCaps_t** context_caps, int* max_sharpness) {
903-
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
904-
return this->GetSharpnessCaps(max_sharpness, context_caps);
905-
#else
906891
return GetSharpnessCaps(max_sharpness, context_caps);
907-
#endif
908892
},
909893
parameters, response);
910894
}
911895

912896
uint32_t AVOutputTV::getSaturationCapsV2(const JsonObject& parameters, JsonObject& response) {
913897
return getPQCapabilityWithContext([this](tvContextCaps_t** context_caps, int* max_saturation) {
914-
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
915-
return this->GetSaturationCaps(max_saturation, context_caps);
916-
#else
917898
return GetSaturationCaps(max_saturation, context_caps);
918-
#endif
919899
},
920900
parameters, response);
921901
}
922902

923903
uint32_t AVOutputTV::getHueCapsV2(const JsonObject& parameters, JsonObject& response) {
924904
return getPQCapabilityWithContext([this]( tvContextCaps_t** context_caps, int* max_hue) {
925-
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
926-
return this->GetHueCaps(max_hue, context_caps);
927-
#else
928905
return GetHueCaps(max_hue, context_caps);
929-
#endif
930906
},
931907
parameters, response);
932908
}
933909

934910
uint32_t AVOutputTV::getPrecisionDetailCaps(const JsonObject& parameters, JsonObject& response) {
935911
return getPQCapabilityWithContext([this](tvContextCaps_t** context_caps, int* max_precision) {
936-
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
937-
return this->GetPrecisionDetailCaps(max_precision, context_caps);
938-
#else
939912
return GetPrecisionDetailCaps(max_precision, context_caps);
940-
#endif
941913
},
942914
parameters, response);
943915
}
944916

945917
uint32_t AVOutputTV::getLocalContrastEnhancementCaps(const JsonObject& parameters, JsonObject& response) {
946918
return getPQCapabilityWithContext([this](tvContextCaps_t** context_caps, int* max_val) {
947-
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
948-
return this->GetLocalContrastEnhancementCaps(max_val, context_caps);
949-
#else
950919
return GetLocalContrastEnhancementCaps(max_val, context_caps);
951-
#endif
952920
},
953921
parameters, response);
954922
}
955923

956924
uint32_t AVOutputTV::getMPEGNoiseReductionCaps(const JsonObject& parameters, JsonObject& response) {
957925
return getPQCapabilityWithContext([this](tvContextCaps_t** context_caps, int* max_val) {
958-
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
959-
return this->GetMPEGNoiseReductionCaps(max_val, context_caps);
960-
#else
961926
return GetMPEGNoiseReductionCaps(max_val, context_caps);
962-
#endif
963927
},
964928
parameters, response);
965929
}
966930

967931
uint32_t AVOutputTV::getDigitalNoiseReductionCaps(const JsonObject& parameters, JsonObject& response) {
968932
return getPQCapabilityWithContext([this](tvContextCaps_t** context_caps, int* max_val) {
969-
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
970-
return this->GetDigitalNoiseReductionCaps(max_val, context_caps);
971-
#else
972933
return GetDigitalNoiseReductionCaps(max_val, context_caps);
973-
#endif
974934
},
975935
parameters, response);
976936
}
977937

978938
uint32_t AVOutputTV::getAISuperResolutionCaps(const JsonObject& parameters, JsonObject& response) {
979939
return getPQCapabilityWithContext([this](tvContextCaps_t** context_caps, int* max_val) {
980-
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
981-
return this->GetAISuperResolutionCaps(max_val, context_caps);
982-
#else
983940
return GetAISuperResolutionCaps(max_val, context_caps);
984-
#endif
985941
},
986942
parameters, response);
987943
}
@@ -1023,32 +979,20 @@ namespace Plugin {
1023979
}
1024980
response["uiMatrixPositions"] = uiPosArray;
1025981
response["context"] = parseContextCaps(context_caps);
1026-
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
1027-
// TODO:: Review cleanup once HAL is available, as memory will be allocated in HAL.
1028-
delete[] ui_matrix_positions;
1029-
#endif
1030982
LOGINFO("Exit\n");
1031983
returnResponse(true);
1032984
}
1033985

1034986
uint32_t AVOutputTV::getMEMCCaps(const JsonObject& parameters, JsonObject& response) {
1035987
return getPQCapabilityWithContext([this](tvContextCaps_t** context_caps, int* max_val) {
1036-
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
1037-
return this->GetMEMCCaps(max_val, context_caps);
1038-
#else
1039988
return GetMEMCCaps(max_val, context_caps);
1040-
#endif
1041989
},
1042990
parameters, response);
1043991
}
1044992

1045993
uint32_t AVOutputTV::getLowLatencyStateCapsV2(const JsonObject& parameters, JsonObject& response) {
1046994
return getPQCapabilityWithContext([this](tvContextCaps_t** context_caps, int* max_latency) {
1047-
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
1048-
return this->GetLowLatencyStateCaps(max_latency, context_caps);
1049-
#else
1050995
return GetLowLatencyStateCaps(max_latency, context_caps);
1051-
#endif
1052996
},
1053997
parameters, response);
1054998
}
@@ -1103,9 +1047,6 @@ namespace Plugin {
11031047
response["options"] = optionsArray;
11041048
response["context"] = parseContextCaps(context_caps);
11051049

1106-
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
1107-
free(color_temp);
1108-
#endif
11091050

11101051
returnResponse(true);
11111052
}
@@ -1141,10 +1082,6 @@ namespace Plugin {
11411082

11421083
response["context"] = parseContextCaps(context_caps);
11431084

1144-
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
1145-
free(sdr_gamma);
1146-
#endif
1147-
11481085
returnResponse(true);
11491086
}
11501087

@@ -1172,10 +1109,6 @@ namespace Plugin {
11721109

11731110
response["context"] = parseContextCaps(context_caps);
11741111

1175-
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
1176-
free(dimming_mode);
1177-
#endif
1178-
11791112
returnResponse(true);
11801113
}
11811114

@@ -1194,10 +1127,6 @@ namespace Plugin {
11941127

11951128
response["context"] = parseContextCaps(m_aspectRatioCaps);
11961129

1197-
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
1198-
free(m_aspectRatio);
1199-
#endif
1200-
12011130
returnResponse(true);
12021131
}
12031132

@@ -1216,10 +1145,6 @@ namespace Plugin {
12161145

12171146
response["context"] = parseContextCaps(m_pictureModeCaps);
12181147

1219-
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
1220-
free(m_pictureModes);
1221-
#endif
1222-
12231148
returnResponse(true);
12241149
}
12251150

@@ -1248,11 +1173,6 @@ namespace Plugin {
12481173

12491174
response["context"] = parseContextCaps(m_backlightModeCaps);
12501175

1251-
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
1252-
// TODO: Review cleanup once HAL is available, as memory will be allocated in HAL.
1253-
free(m_backlightModes);
1254-
#endif
1255-
12561176
returnResponse(true);
12571177
}
12581178

@@ -1288,12 +1208,6 @@ namespace Plugin {
12881208
// Indicate success
12891209
response["success"] = true;
12901210

1291-
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
1292-
// TODO: Clean up when HAL handles memory
1293-
delete min_values;
1294-
delete max_values;
1295-
#endif
1296-
12971211
returnResponse(true);
12981212
}
12991213

@@ -5332,11 +5246,7 @@ namespace Plugin {
53325246
}
53335247
response["component"] = componentJson;
53345248
response["context"] = parseContextCaps(context_caps);
5335-
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
5336-
// Clean up dynamic memory
5337-
delete[] colorArray;
5338-
delete[] componentArray;
5339-
#endif
5249+
53405250
LOGINFO("Exit: getCMSCapsV2");
53415251
returnResponse(true);
53425252
}
@@ -5841,10 +5751,6 @@ namespace Plugin {
58415751
response["color"] = colorJson;
58425752
response["context"] = parseContextCaps(context_caps);
58435753

5844-
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
5845-
delete[] colorArray;
5846-
delete[] controlArray;
5847-
#endif
58485754

58495755
LOGINFO("Exit: get2PointWBCapsV2");
58505756
returnResponse(true);

AVOutput/AVOutputTV.h

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
#define STRING_COLORTEMPERATURE "ColorTemperature."
7474
#define CREATE_DIRTY(__X__) (__X__+=STRING_DIRTY)
7575
#define CAPABLITY_FILE_NAME "pq_capabilities.ini"
76+
#define CAPABILITY_FILE_NAMEV2 "/etc/pq_capabilities.json"
7677

7778

7879
class CIniFile
@@ -236,7 +237,7 @@ class AVOutputTV : public AVOutputBase {
236237
DECLARE_JSON_RPC_METHOD(getAutoBacklightModeCaps)
237238
DECLARE_JSON_RPC_METHOD(getBacklightCapsV2)
238239
DECLARE_JSON_RPC_METHOD(getBrightnessCapsV2)
239-
DECLARE_JSON_RPC_METHOD(getContrastCapsV2)
240+
DECLARE_JSON_RPC_METHOD(getContrastCapsV2)
240241
DECLARE_JSON_RPC_METHOD(getSharpnessCapsV2)
241242
DECLARE_JSON_RPC_METHOD(getSaturationCapsV2)
242243
DECLARE_JSON_RPC_METHOD(getHueCapsV2)
@@ -469,26 +470,7 @@ class AVOutputTV : public AVOutputBase {
469470
int *max_offset, tvWBColor_t **color,
470471
tvWBControl_t **control, size_t* num_color,
471472
size_t* num_control, tvContextCaps_t ** context_caps);
472-
#if ENABLE_CAPS_SUPPORT_FROM_PLUGIN
473-
#define CAPABILITY_FILE_NAMEV2 "/opt/panel/pq_capabilities.json"
474-
tvError_t GetBacklightCaps(int *max_backlight, tvContextCaps_t **context_caps);
475-
tvError_t GetBrightnessCaps(int *max_brightness, tvContextCaps_t **context_caps);
476-
tvError_t GetContrastCaps(int* max_contrast, tvContextCaps_t** context_caps);
477-
tvError_t GetSharpnessCaps(int *max_sharpness, tvContextCaps_t **context_caps);
478-
tvError_t GetSaturationCaps(int* max_saturation, tvContextCaps_t** context_caps);
479-
tvError_t GetHueCaps(int* max_hue, tvContextCaps_t** context_caps);
480-
tvError_t GetPrecisionDetailCaps(int* max_precision, tvContextCaps_t** context_caps);
481-
tvError_t GetLowLatencyStateCaps(int* max_latency, tvContextCaps_t ** context_caps);
482-
tvError_t GetColorTemperatureCaps(tvColorTemp_t** color_temp, size_t* num_color_temp, tvContextCaps_t** context_caps);
483-
tvError_t GetSdrGammaCaps(tvSdrGamma_t** sdr_gamma, size_t* num_sdr_gamma, tvContextCaps_t** context_caps);
484-
tvError_t GetTVDimmingModeCaps(tvDimmingMode_t** dimming_mode, size_t* num_dimming_mode, tvContextCaps_t** context_caps);
485-
tvError_t GetAspectRatioCaps(tvDisplayMode_t** aspect_ratio, size_t* num_aspect_ratio, tvContextCaps_t** context_caps);
486-
tvError_t GetTVPictureModeCaps(tvPQModeIndex_t** mode, size_t* num_pic_modes, tvContextCaps_t** context_caps);
487-
tvError_t GetAISuperResolutionCaps(int* maxAISuperResolution, tvContextCaps_t** context_caps);
488-
tvError_t GetMEMCCaps(int* maxMEMC, tvContextCaps_t** context_caps);
489-
#else
490-
#define CAPABILITY_FILE_NAMEV2 "/etc/pq_capabilities.json"
491-
#endif
473+
492474
uint32_t getPQCapabilityWithContext(
493475
const std::function<tvError_t(tvContextCaps_t**, int*)>& getCapsFunc,
494476
const JsonObject& parameters,

0 commit comments

Comments
 (0)