diff options
author | Barış Kaya <bkaya@google.com> | 2023-09-21 13:02:12 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2023-09-21 13:02:12 +0000 |
commit | 4042ac9f44931fb500a7ad619235d5a092974f6e (patch) | |
tree | 0c2adcdabdd96ad55598805e26f94e552a2aa2a0 | |
parent | 80243e861fd969e088dc49d55bb696ad0dd76eef (diff) | |
parent | dfbf5867782453579c3071de2287ce5a2b32aab9 (diff) | |
download | gamesdk-4042ac9f44931fb500a7ad619235d5a092974f6e.tar.gz |
Merge "Add a new error message to predictQualityLevels." into main
-rw-r--r-- | games-performance-tuner/http_backend/predict_quality_levels.cpp | 6 | ||||
-rw-r--r-- | include/tuningfork/tuningfork.h | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/games-performance-tuner/http_backend/predict_quality_levels.cpp b/games-performance-tuner/http_backend/predict_quality_levels.cpp index 8419ec66..ae6ee4bc 100644 --- a/games-performance-tuner/http_backend/predict_quality_levels.cpp +++ b/games-performance-tuner/http_backend/predict_quality_levels.cpp @@ -65,10 +65,14 @@ static TuningFork_ErrorCode DecodeResponse(const std::string& response, if (jresponse.find("qualityLevels") == jresponse.end()) { ALOGE("Quality levels not found in response"); - return TUNINGFORK_ERROR_PREDICT_QUALITY_LEVELS_PARSE_ERROR; + return TUNINGFORK_ERROR_PREDICT_QUALITY_LEVELS_INSUFFICIENT_DATA; } Json::array quality_levels = jresponse["qualityLevels"].array_items(); + if (quality_levels.empty()) { + ALOGE("No quality levels reported"); + return TUNINGFORK_ERROR_PREDICT_QUALITY_LEVELS_INSUFFICIENT_DATA; + } for (auto& quality_level : quality_levels) { // Fetch the fidelity parameters first for this level ProtobufSerialization fps; diff --git a/include/tuningfork/tuningfork.h b/include/tuningfork/tuningfork.h index fc28e2ed..a871c137 100644 --- a/include/tuningfork/tuningfork.h +++ b/include/tuningfork/tuningfork.h @@ -223,6 +223,10 @@ typedef enum TuningFork_ErrorCode { TUNINGFORK_ERROR_PREDICT_QUALITY_LEVELS_RESPONSE_ERROR = 41, ///< The response from predictQualityLevels was not a success ///< code + TUNINGFORK_ERROR_PREDICT_QUALITY_LEVELS_INSUFFICIENT_DATA = + 42, ///< There wasn't enough data to make a successful quality level + ///< prediction. + // Error codes 100-150 are reserved for engines integrations. } TuningFork_ErrorCode; |