Skip to content

Commit 5a234c0

Browse files
slkanthiarjunbinusky
authored andcommitted
Implement DimmingmodeCaps, AspectRatioCaps, LowLatencyStateCaps and PictureModeCaps
(cherry picked from commit 434aa831f1df3fe378c9a2d981794248c93ebafa)
1 parent 1027a4a commit 5a234c0

File tree

3 files changed

+74
-16
lines changed

3 files changed

+74
-16
lines changed

AVOutput/AVOutputTV.cpp

Lines changed: 45 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,13 @@ namespace Plugin {
401401
registerMethod("getSaturationCapsV2", &AVOutputTV::getSaturationCapsV2, this);
402402
registerMethod("getHueCapsV2", &AVOutputTV::getHueCapsV2, this);
403403
registerMethod("getPrecisionDetailCapsV2", &AVOutputTV::getPrecisionDetailCapsV2, this);
404+
registerMethod("getLowLatencyStateCapsV2", &AVOutputTV::getLowLatencyStateCapsV2, this);
404405
registerMethod("getColorTemperatureCapsV2", &AVOutputTV::getColorTemperatureCapsV2, this);
405406
registerMethod("getSdrGammaCapsV2", &AVOutputTV::getSdrGammaCapsV2, this);
407+
registerMethod("getTVDimmingModeCapsV2", &AVOutputTV::getTVDimmingModeCapsV2, this);
408+
registerMethod("getAspectRatioCapsV2", &AVOutputTV::getAspectRatioCapsV2, this);
406409
registerMethod("getDVCalibrationCapsV2", &AVOutputTV::getDVCalibrationCapsV2, this);
410+
registerMethod("getTVPictureModeCapsV2", &AVOutputTV::getTVPictureModeCapsV2, this);
407411

408412
LOGINFO("Exit\n");
409413
}
@@ -507,7 +511,7 @@ namespace Plugin {
507511
}
508512

509513
uint32_t AVOutputTV::getCapsV2(
510-
const std::function<tvError_t(int*, tvContextCaps_t**, std::vector<std::string>&)>& getCapsFunc,
514+
const std::function<tvError_t( tvContextCaps_t**,int*, std::vector<std::string>&)>& getCapsFunc,
511515
const char* key,
512516
const JsonObject& parameters,
513517
JsonObject& response)
@@ -516,7 +520,7 @@ namespace Plugin {
516520
tvContextCaps_t* context_caps = nullptr;
517521
std::vector<std::string> options;
518522
// Call the HAL function
519-
tvError_t result = getCapsFunc(&max_value, &context_caps, options);
523+
tvError_t result = getCapsFunc( &context_caps, &max_value, options);
520524
LOGWARN("AVOutputPlugins: %s: result: %d", __FUNCTION__, result);
521525
if (result != tvERROR_NONE) {
522526
returnResponse(false);
@@ -529,11 +533,12 @@ namespace Plugin {
529533
optionsArray.Add(option);
530534
}
531535
rangeInfo["options"] = optionsArray;
532-
} else {
536+
capsInfo["rangeInfo"] = rangeInfo;
537+
} else if (max_value){
533538
rangeInfo["from"] = 0;
534539
rangeInfo["to"] = max_value;
540+
capsInfo["rangeInfo"] = rangeInfo;
535541
}
536-
capsInfo["rangeInfo"] = rangeInfo;
537542
capsInfo["platformSupport"] = true;
538543
capsInfo["context"] = parseContextCaps(context_caps);
539544
response[key] = capsInfo;
@@ -590,67 +595,94 @@ namespace Plugin {
590595
}
591596

592597
uint32_t AVOutputTV::getBacklightCapsV2(const JsonObject& parameters, JsonObject& response) {
593-
return getCapsV2([this](int* max_backlight, tvContextCaps_t** context_caps, std::vector<std::string>&) {
598+
return getCapsV2([this]( tvContextCaps_t** context_caps, int* max_backlight, std::vector<std::string>&) {
594599
return this->GetBacklightCaps(max_backlight, context_caps);
595600
}, "Backlight", parameters, response);
596601
}
597602

598603
uint32_t AVOutputTV::getBrightnessCapsV2(const JsonObject& parameters, JsonObject& response) {
599-
return getCapsV2([this](int* max_brightness, tvContextCaps_t** context_caps, std::vector<std::string>& options) {
604+
return getCapsV2([this]( tvContextCaps_t** context_caps, int* max_brightness, std::vector<std::string>& options) {
600605
return this->GetBrightnessCaps(max_brightness, context_caps);
601606
},
602607
"Brightness", parameters, response);
603608
}
604609

605610
uint32_t AVOutputTV::getContrastCapsV2(const JsonObject& parameters, JsonObject& response) {
606-
return getCapsV2([this](int* max_contrast, tvContextCaps_t** context_caps, std::vector<std::string>& options) {
611+
return getCapsV2([this](tvContextCaps_t** context_caps, int* max_contrast, std::vector<std::string>& options) {
607612
return this->GetContrastCaps(max_contrast, context_caps);
608613
},
609614
"Contrast", parameters, response);
610615
}
611616

612617
uint32_t AVOutputTV::getSharpnessCapsV2(const JsonObject& parameters, JsonObject& response) {
613-
return getCapsV2([this](int* max_sharpness, tvContextCaps_t** context_caps, std::vector<std::string>& options) {
618+
return getCapsV2([this](tvContextCaps_t** context_caps, int* max_sharpness, std::vector<std::string>& options) {
614619
return this->GetSharpnessCaps(max_sharpness, context_caps);
615620
},
616621
"Sharpness", parameters, response);
617622
}
618623

619624
uint32_t AVOutputTV::getSaturationCapsV2(const JsonObject& parameters, JsonObject& response) {
620-
return getCapsV2([this](int* max_saturation, tvContextCaps_t** context_caps, std::vector<std::string>& options) {
625+
return getCapsV2([this](tvContextCaps_t** context_caps, int* max_saturation, std::vector<std::string>& options) {
621626
return this->GetSaturationCaps(max_saturation, context_caps);
622627
},
623628
"Saturation", parameters, response);
624629
}
625630

626631
uint32_t AVOutputTV::getHueCapsV2(const JsonObject& parameters, JsonObject& response) {
627-
return getCapsV2([this](int* max_hue, tvContextCaps_t** context_caps, std::vector<std::string>& options) {
632+
return getCapsV2([this]( tvContextCaps_t** context_caps, int* max_hue, std::vector<std::string>& options) {
628633
return this->GetHueCaps(max_hue, context_caps);
629634
},
630635
"Hue", parameters, response);
631636
}
632637

633638
uint32_t AVOutputTV::getPrecisionDetailCapsV2(const JsonObject& parameters, JsonObject& response) {
634-
return getCapsV2([this](int* max_precision, tvContextCaps_t** context_caps, std::vector<std::string>& options) {
639+
return getCapsV2([this](tvContextCaps_t** context_caps, int* max_precision, std::vector<std::string>& options) {
635640
return this->GetPrecisionDetailCaps(max_precision, context_caps);
636641
},
637642
"PrecisionDetails", parameters, response);
638643
}
639644

645+
uint32_t AVOutputTV::getLowLatencyStateCapsV2(const JsonObject& parameters, JsonObject& response) {
646+
return getCapsV2([this](tvContextCaps_t** context_caps, int* max_latency, std::vector<std::string>& options) {
647+
return this->GetLowLatencyStateCaps(max_latency, context_caps);
648+
},
649+
"LowLatencyState", parameters, response);
650+
}
651+
640652
uint32_t AVOutputTV::getColorTemperatureCapsV2(const JsonObject& parameters, JsonObject& response) {
641-
return getCapsV2([this](int* options_count, tvContextCaps_t** context_caps, std::vector<std::string>& options) {
653+
return getCapsV2([this](tvContextCaps_t** context_caps, int* options_count, std::vector<std::string>& options) {
642654
return this->GetColorTemperatureCaps(options_count, context_caps, options);
643655
},
644656
"ColorTemperature", parameters, response);
645657
}
646658

647659
uint32_t AVOutputTV::getSdrGammaCapsV2(const JsonObject& parameters, JsonObject& response) {
648-
return getCapsV2([this](int* options_count, tvContextCaps_t** context_caps, std::vector<std::string>& options) {
660+
return getCapsV2([this](tvContextCaps_t** context_caps, int* options_count, std::vector<std::string>& options) {
649661
return this->GetSdrGammaCaps(options_count, context_caps, options);
650662
},
651663
"SDRGamma", parameters, response);
652664
}
653665

666+
uint32_t AVOutputTV::getTVDimmingModeCapsV2(const JsonObject& parameters, JsonObject& response) {
667+
return getCapsV2([this](tvContextCaps_t** context_caps, int* options_count, std::vector<std::string>& options) {
668+
return this->GetTVDimmingModeCaps(options_count, context_caps, options);
669+
},
670+
"DimmingMode", parameters, response);
671+
}
672+
uint32_t AVOutputTV::getAspectRatioCapsV2(const JsonObject& parameters, JsonObject& response) {
673+
return getCapsV2([this](tvContextCaps_t** context_caps, int* options_count, std::vector<std::string>& options) {
674+
return this->GetAspectRatioCaps(options_count, context_caps, options);
675+
},
676+
"AspectRatio", parameters, response);
677+
}
678+
679+
uint32_t AVOutputTV::getTVPictureModeCapsV2(const JsonObject& parameters, JsonObject& response) {
680+
return getCapsV2([this](tvContextCaps_t** context_caps, int* options_count, std::vector<std::string>& options) {
681+
return this->GetTVPictureModeCaps(context_caps);
682+
},
683+
"PictureMode", parameters, response);
684+
}
685+
654686
uint32_t AVOutputTV::getDVCalibrationCapsV2(const JsonObject& parameters, JsonObject& response) {
655687
tvDVCalibrationSettings_t *min_values = nullptr;
656688
tvDVCalibrationSettings_t *max_values = nullptr;

AVOutput/AVOutputTV.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,13 @@ class AVOutputTV : public AVOutputBase {
254254
DECLARE_JSON_RPC_METHOD(getSaturationCapsV2)
255255
DECLARE_JSON_RPC_METHOD(getHueCapsV2)
256256
DECLARE_JSON_RPC_METHOD(getPrecisionDetailCapsV2)
257+
DECLARE_JSON_RPC_METHOD(getLowLatencyStateCapsV2)
257258
DECLARE_JSON_RPC_METHOD(getColorTemperatureCapsV2)
258259
DECLARE_JSON_RPC_METHOD(getSdrGammaCapsV2)
260+
DECLARE_JSON_RPC_METHOD(getTVDimmingModeCapsV2)
261+
DECLARE_JSON_RPC_METHOD(getAspectRatioCapsV2)
259262
DECLARE_JSON_RPC_METHOD(getDVCalibrationCapsV2)
263+
DECLARE_JSON_RPC_METHOD(getTVPictureModeCapsV2)
260264

261265
/*Set API's*/
262266
DECLARE_JSON_RPC_METHOD(setBacklight)
@@ -442,11 +446,15 @@ class AVOutputTV : public AVOutputBase {
442446
tvError_t GetSaturationCaps(int* max_saturation, tvContextCaps_t** context_caps);
443447
tvError_t GetHueCaps(int* max_hue, tvContextCaps_t** context_caps);
444448
tvError_t GetPrecisionDetailCaps(int* max_precision, tvContextCaps_t** context_caps);
449+
tvError_t GetLowLatencyStateCaps(int* max_latency, tvContextCaps_t ** context_caps);
445450
tvError_t GetColorTemperatureCaps(int* options_count, tvContextCaps_t** context_caps, std::vector<std::string>& options);
446451
tvError_t GetSdrGammaCaps(int* options_count, tvContextCaps_t** context_caps, std::vector<std::string>& options);
452+
tvError_t GetTVDimmingModeCaps(int* options_count, tvContextCaps_t** context_caps, std::vector<std::string>& options);
453+
tvError_t GetAspectRatioCaps(int* options_count, tvContextCaps_t** context_caps, std::vector<std::string>& options);
447454
tvError_t GetDVCalibrationCaps(tvDVCalibrationSettings_t **min_values, tvDVCalibrationSettings_t **max_values, tvContextCaps_t **context_caps);
455+
tvError_t GetTVPictureModeCaps( tvContextCaps_t** context_caps);
448456
uint32_t getCapsV2(
449-
const std::function<tvError_t(int*, tvContextCaps_t**, std::vector<std::string>&)>& getCapsFunc,
457+
const std::function<tvError_t(tvContextCaps_t**, int*, std::vector<std::string>&)>& getCapsFunc,
450458
const char* key,
451459
const JsonObject& parameters,
452460
JsonObject& response);

AVOutput/AVOutputTVHelper.cpp

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2348,8 +2348,8 @@ tvError_t AVOutputTV::ReadJsonFile(JsonObject& root) {
23482348

23492349
tvError_t AVOutputTV::ExtractRangeInfo(const JsonObject& data, int* max_value, std::vector<std::string>& options) {
23502350
if (!data.HasLabel("rangeInfo")) {
2351-
LOGWARN("AVOutputPlugins: %s: 'rangeInfo' missing", __FUNCTION__);
2352-
return tvERROR_GENERAL;
2351+
LOGWARN("AVOutputPlugins: %s: 'rangeInfo' not available", __FUNCTION__);
2352+
return tvERROR_NONE;
23532353
}
23542354

23552355
JsonObject rangeInfo = data["rangeInfo"].Object();
@@ -2516,6 +2516,10 @@ tvError_t AVOutputTV::GetPrecisionDetailCaps(int* max_precision, tvContextCaps_t
25162516
std::vector<std::string> emptyOptions;
25172517
return GetCaps("PrecisionDetails", max_precision, context_caps, emptyOptions);
25182518
}
2519+
tvError_t AVOutputTV::GetLowLatencyStateCaps(int* max_latency, tvContextCaps_t ** context_caps){
2520+
std::vector<std::string> emptyOptions;
2521+
return GetCaps("LowLatencyState", max_latency, context_caps, emptyOptions);
2522+
}
25192523

25202524
tvError_t AVOutputTV::GetColorTemperatureCaps(int* options_count, tvContextCaps_t** context_caps, std::vector<std::string>& options) {
25212525
return GetCaps("ColorTemperature", options_count, context_caps, options);
@@ -2525,6 +2529,20 @@ tvError_t AVOutputTV::GetSdrGammaCaps(int* options_count, tvContextCaps_t** cont
25252529
return GetCaps("SDRGamma", options_count, context_caps, options);
25262530
}
25272531

2532+
tvError_t AVOutputTV::GetTVDimmingModeCaps(int* options_count, tvContextCaps_t** context_caps, std::vector<std::string>& options) {
2533+
return GetCaps("DimmingMode", options_count, context_caps, options);
2534+
}
2535+
2536+
tvError_t AVOutputTV::GetAspectRatioCaps(int* options_count, tvContextCaps_t** context_caps, std::vector<std::string>& options){
2537+
return GetCaps("AspectRatio", options_count, context_caps, options);
2538+
}
2539+
2540+
tvError_t AVOutputTV::GetTVPictureModeCaps( tvContextCaps_t** context_caps){
2541+
std::vector<std::string> emptyOptions;
2542+
int* options_count = nullptr;
2543+
return GetCaps("PictureMode", options_count, context_caps, emptyOptions);
2544+
}
2545+
25282546
/*
25292547
tvError_t GetColorTemperatureCaps(char*** options, size_t* options_count, tvContextCaps_t** context_caps);
25302548
Since C does not have std::vector, we use char*** options (a pointer to an array of strings).

0 commit comments

Comments
 (0)