1 /*
2 * Copyright (C) 2024 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 #include <new>
18
19 #include <android-base/no_destructor.h>
20 #include <apex/ApexCodecs.h>
21
22 // TODO: remove when we have real implementations
23 #pragma clang diagnostic push
24 #pragma clang diagnostic ignored "-Wunused-parameter"
25
26 struct ApexCodec_ComponentStore {
27 ApexCodec_ComponentStore() = default;
28 };
29
ApexCodec_GetComponentStore()30 ApexCodec_ComponentStore *ApexCodec_GetComponentStore() {
31 ::android::base::NoDestructor<ApexCodec_ComponentStore> store;
32 return store.get();
33 }
34
ApexCodec_Traits_get(ApexCodec_ComponentStore * store,size_t index)35 ApexCodec_ComponentTraits *ApexCodec_Traits_get(
36 ApexCodec_ComponentStore *store, size_t index) {
37 return nullptr;
38 }
39
ApexCodec_Component_create(ApexCodec_ComponentStore * store,const char * name,ApexCodec_Component ** comp)40 ApexCodec_Status ApexCodec_Component_create(
41 ApexCodec_ComponentStore *store, const char *name, ApexCodec_Component **comp) {
42 *comp = nullptr;
43 return APEXCODEC_STATUS_NOT_FOUND;
44 }
45
ApexCodec_Component_destroy(ApexCodec_Component * comp)46 void ApexCodec_Component_destroy(ApexCodec_Component *comp) {}
47
ApexCodec_Component_start(ApexCodec_Component * comp)48 ApexCodec_Status ApexCodec_Component_start(ApexCodec_Component *comp) {
49 return APEXCODEC_STATUS_OMITTED;
50 }
51
ApexCodec_Component_flush(ApexCodec_Component * comp)52 ApexCodec_Status ApexCodec_Component_flush(ApexCodec_Component *comp) {
53 return APEXCODEC_STATUS_OMITTED;
54 }
55
ApexCodec_Component_reset(ApexCodec_Component * comp)56 ApexCodec_Status ApexCodec_Component_reset(ApexCodec_Component *comp) {
57 return APEXCODEC_STATUS_OMITTED;
58 }
59
ApexCodec_Component_getConfigurable(ApexCodec_Component * comp)60 ApexCodec_Configurable *ApexCodec_Component_getConfigurable(
61 ApexCodec_Component *comp) {
62 return nullptr;
63 }
64
ApexCodec_SupportedValues_getTypeAndValues(ApexCodec_SupportedValues * supportedValues,ApexCodec_SupportedValuesType * type,ApexCodec_SupportedValuesNumberType * numberType,ApexCodec_Value ** values,uint32_t * numValues)65 ApexCodec_Status ApexCodec_SupportedValues_getTypeAndValues(
66 ApexCodec_SupportedValues *supportedValues,
67 ApexCodec_SupportedValuesType *type,
68 ApexCodec_SupportedValuesNumberType *numberType,
69 ApexCodec_Value **values,
70 uint32_t *numValues) {
71 return APEXCODEC_STATUS_OMITTED;
72 }
73
ApexCodec_SupportedValues_release(ApexCodec_SupportedValues * values)74 void ApexCodec_SupportedValues_release(ApexCodec_SupportedValues *values) {}
75
ApexCodec_SettingResults_getResultAtIndex(ApexCodec_SettingResults * results,size_t index,ApexCodec_SettingResultFailure * failure,ApexCodec_ParamFieldValues * field,ApexCodec_ParamFieldValues ** conflicts,size_t * numConflicts)76 ApexCodec_Status ApexCodec_SettingResults_getResultAtIndex(
77 ApexCodec_SettingResults *results,
78 size_t index,
79 ApexCodec_SettingResultFailure *failure,
80 ApexCodec_ParamFieldValues *field,
81 ApexCodec_ParamFieldValues **conflicts,
82 size_t *numConflicts) {
83 return APEXCODEC_STATUS_OMITTED;
84 }
85
ApexCodec_SettingResults_release(ApexCodec_SettingResults * results)86 void ApexCodec_SettingResults_release(ApexCodec_SettingResults *results) {}
87
ApexCodec_Component_process(ApexCodec_Component * comp,const ApexCodec_Buffer * input,ApexCodec_Buffer * output,size_t * consumed,size_t * produced)88 ApexCodec_Status ApexCodec_Component_process(
89 ApexCodec_Component *comp,
90 const ApexCodec_Buffer *input,
91 ApexCodec_Buffer *output,
92 size_t *consumed,
93 size_t *produced) {
94 return APEXCODEC_STATUS_OMITTED;
95 }
96
ApexCodec_Configurable_config(ApexCodec_Configurable * comp,ApexCodec_LinearBuffer * config,ApexCodec_SettingResults ** results)97 ApexCodec_Status ApexCodec_Configurable_config(
98 ApexCodec_Configurable *comp,
99 ApexCodec_LinearBuffer *config,
100 ApexCodec_SettingResults **results) {
101 return APEXCODEC_STATUS_OMITTED;
102 }
103
ApexCodec_Configurable_query(ApexCodec_Configurable * comp,uint32_t indices[],size_t numIndices,ApexCodec_LinearBuffer * config,size_t * written)104 ApexCodec_Status ApexCodec_Configurable_query(
105 ApexCodec_Configurable *comp,
106 uint32_t indices[],
107 size_t numIndices,
108 ApexCodec_LinearBuffer *config,
109 size_t *written) {
110 return APEXCODEC_STATUS_OMITTED;
111 }
112
ApexCodec_ParamDescriptors_getIndices(ApexCodec_ParamDescriptors * descriptors,uint32_t ** indices,size_t * numIndices)113 ApexCodec_Status ApexCodec_ParamDescriptors_getIndices(
114 ApexCodec_ParamDescriptors *descriptors,
115 uint32_t **indices,
116 size_t *numIndices) {
117 return APEXCODEC_STATUS_OMITTED;
118 }
119
ApexCodec_ParamDescriptors_getDescriptor(ApexCodec_ParamDescriptors * descriptors,uint32_t index,ApexCodec_ParamAttribute * attr,const char ** name,uint32_t ** dependencies,size_t * numDependencies)120 ApexCodec_Status ApexCodec_ParamDescriptors_getDescriptor(
121 ApexCodec_ParamDescriptors *descriptors,
122 uint32_t index,
123 ApexCodec_ParamAttribute *attr,
124 const char **name,
125 uint32_t **dependencies,
126 size_t *numDependencies) {
127 return APEXCODEC_STATUS_OMITTED;
128 }
129
ApexCodec_ParamDescriptors_release(ApexCodec_ParamDescriptors * descriptors)130 ApexCodec_Status ApexCodec_ParamDescriptors_release(
131 ApexCodec_ParamDescriptors *descriptors) {
132 return APEXCODEC_STATUS_OMITTED;
133 }
134
ApexCodec_Configurable_querySupportedParams(ApexCodec_Configurable * comp,ApexCodec_ParamDescriptors ** descriptors)135 ApexCodec_Status ApexCodec_Configurable_querySupportedParams(
136 ApexCodec_Configurable *comp,
137 ApexCodec_ParamDescriptors **descriptors) {
138 return APEXCODEC_STATUS_OMITTED;
139 }
140
ApexCodec_Configurable_querySupportedValues(ApexCodec_Configurable * comp,ApexCodec_SupportedValuesQuery * queries,size_t numQueries)141 ApexCodec_Status ApexCodec_Configurable_querySupportedValues(
142 ApexCodec_Configurable *comp,
143 ApexCodec_SupportedValuesQuery *queries,
144 size_t numQueries) {
145 return APEXCODEC_STATUS_OMITTED;
146 }
147
148 #pragma clang diagnostic pop