diff options
author | Hangyu Kuang <hkuang@google.com> | 2019-03-21 18:17:40 -0700 |
---|---|---|
committer | Hangyu Kuang <hkuang@google.com> | 2019-03-26 13:57:25 -0700 |
commit | ef545fbe3af65e30e77087dad150470173289b45 (patch) | |
tree | 6dff2e2f9db7a80a746b1c47ed9a95d09d375642 /media/eco/include | |
parent | 8d28536351da76ec5a769aeda0b7c614217dfa41 (diff) | |
download | av-ef545fbe3af65e30e77087dad150470173289b45.tar.gz |
ECOService: Add implementation for ECOData part 2.
Add readFromParcel and writeToParcel implementation and unit test.
Bug: 117877984
Test: Unit test.
Change-Id: I2ecf12017c28f2d22b055fe2d570aaa6da9b956e
Diffstat (limited to 'media/eco/include')
-rw-r--r-- | media/eco/include/eco/ECOData.h | 10 | ||||
-rw-r--r-- | media/eco/include/eco/ECOUtils.h | 38 |
2 files changed, 48 insertions, 0 deletions
diff --git a/media/eco/include/eco/ECOData.h b/media/eco/include/eco/ECOData.h index 37b048c..4d17b73 100644 --- a/media/eco/include/eco/ECOData.h +++ b/media/eco/include/eco/ECOData.h @@ -143,6 +143,16 @@ public: private: void init(); + // ValueType. This must match the index in ECODataValueType. + enum ValueType { + kTypeInt32 = 0, + kTypeInt64 = 1, + kTypeSize = 2, + kTypeFloat = 3, + kTypeDouble = 4, + kTypeString = 5, + }; + /* The type of the data */ int32_t mDataType; diff --git a/media/eco/include/eco/ECOUtils.h b/media/eco/include/eco/ECOUtils.h new file mode 100644 index 0000000..6d69288 --- /dev/null +++ b/media/eco/include/eco/ECOUtils.h @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_MEDIA_ECO_UTILS_H_ +#define ANDROID_MEDIA_ECO_UTILS_H_ + +#include <utils/Errors.h> + +namespace android { +namespace media { +namespace eco { + +#define RETURN_STATUS_IF_ERROR(expr) \ + { \ + status_t _errorCode = (expr); \ + if (_errorCode != NO_ERROR) { \ + return _errorCode; \ + } \ + } + +} // namespace eco +} // namespace media +} // namespace android + +#endif // ANDROID_MEDIA_ECO_UTILS_H_ |