Mikhail Naganov | 288a343 | 2022-03-25 00:29:56 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2022 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #define LOG_TAG "HalHidl" |
| 18 | #include <utils/Log.h> |
| 19 | |
| 20 | #include "EffectConversionHelperHidl.h" |
| 21 | |
| 22 | namespace android { |
| 23 | |
| 24 | EffectConversionHelperHidl::EffectConversionHelperHidl(std::string_view className) |
| 25 | : ConversionHelperHidl<EffectResult>(className, analyzeResult) { |
| 26 | } |
| 27 | |
| 28 | // static |
| 29 | status_t EffectConversionHelperHidl::analyzeResult(const EffectResult& result) { |
| 30 | switch (result) { |
| 31 | case EffectResult::OK: return OK; |
| 32 | case EffectResult::INVALID_ARGUMENTS: return BAD_VALUE; |
| 33 | case EffectResult::INVALID_STATE: return NOT_ENOUGH_DATA; |
| 34 | case EffectResult::NOT_INITIALIZED: return NO_INIT; |
| 35 | case EffectResult::NOT_SUPPORTED: return INVALID_OPERATION; |
| 36 | case EffectResult::RESULT_TOO_BIG: return NO_MEMORY; |
| 37 | } |
| 38 | return NO_INIT; |
| 39 | } |
| 40 | |
| 41 | } // namespace android |