@@ -515,6 +515,18 @@ namespace Plugin {
515
515
uint32_t AVOutputTV::getBacklightV2 (const JsonObject& parameters, JsonObject& response)
516
516
{
517
517
LOGINFO (" Entry: %s" , __FUNCTION__);
518
+ #define TODO_MOVE_TO_INIT 1
519
+ #if TODO_MOVE_TO_INIT
520
+ // Retrieve Backlight Caps (Initialization)
521
+ LOGINFO (" Calling GetBacklightCaps\n " );
522
+ tvError_t error = GetBacklightCaps (&m_maxBacklight, &m_backlightCaps);
523
+ if (error == tvERROR_NONE) {
524
+ LOGINFO (" Backlight capabilities retrieved successfully. Max: %d\n " , m_maxBacklight);
525
+ } else {
526
+ LOGERR (" Failed to retrieve backlight capabilities. Error code: %d\n " , error);
527
+ returnResponse (false );
528
+ }
529
+ #endif
518
530
std::vector<tvConfigContext_t> validContexts = getValidContextsFromParameters (parameters);
519
531
if (validContexts.empty ()) {
520
532
LOGERR (" %s: No valid context found for the given parameters" , __FUNCTION__);
@@ -860,10 +872,45 @@ namespace Plugin {
860
872
}
861
873
862
874
uint32_t AVOutputTV::getPictureModeCapsV2 (const JsonObject& parameters, JsonObject& response) {
863
- return getCapsV2 ([this ](tvContextCaps_t** context_caps, int * options_count) {
864
- return this ->GetTVPictureModeCaps (context_caps);
865
- },
866
- " PictureMode" , parameters, response);
875
+ tvPQModeIndex_t* modes = nullptr ;
876
+ size_t num_pic_modes = 0 ;
877
+ tvContextCaps_t* context_caps = nullptr ;
878
+
879
+ tvError_t err = GetTVPictureModeCaps (&modes, &num_pic_modes, &context_caps);
880
+ if (err != tvERROR_NONE) {
881
+ return err;
882
+ }
883
+
884
+ JsonObject pictureModeJson;
885
+ JsonObject rangeInfo;
886
+ JsonArray optionsArray;
887
+
888
+ for (size_t i = 0 ; i < num_pic_modes; ++i) {
889
+ switch (modes[i]) {
890
+ case PQ_MODE_STANDARD: optionsArray.Add (" Standard" ); break ;
891
+ case PQ_MODE_VIVID: optionsArray.Add (" Vivid" ); break ;
892
+ case PQ_MODE_ENERGY_SAVING: optionsArray.Add (" EnergySaving" ); break ;
893
+ case PQ_MODE_CUSTOM: optionsArray.Add (" Custom" ); break ;
894
+ case PQ_MODE_THEATER: optionsArray.Add (" Theater" ); break ;
895
+ case PQ_MODE_GAME: optionsArray.Add (" Game" ); break ;
896
+ case PQ_MODE_SPORTS: optionsArray.Add (" Sports" ); break ;
897
+ case PQ_MODE_AIPQ: optionsArray.Add (" AI PQ" ); break ;
898
+ case PQ_MODE_DARK: optionsArray.Add (" Dark" ); break ;
899
+ case PQ_MODE_BRIGHT: optionsArray.Add (" Bright" ); break ;
900
+ case PQ_MODE_DVIQ: optionsArray.Add (" IQ" ); break ;
901
+ default : break ; // Skip invalid/unsupported modes
902
+ }
903
+ }
904
+
905
+ rangeInfo[" options" ] = optionsArray;
906
+ pictureModeJson[" rangeInfo" ] = rangeInfo;
907
+ pictureModeJson[" platformSupport" ] = true ;
908
+ pictureModeJson[" context" ] = parseContextCaps (context_caps); // Assuming same parser works
909
+
910
+ response[" PictureMode" ] = pictureModeJson;
911
+
912
+ free (modes);
913
+ returnResponse (true );
867
914
}
868
915
869
916
uint32_t AVOutputTV::getDVCalibrationCapsV2 (const JsonObject& parameters, JsonObject& response) {
0 commit comments