blob: cd4dd101516ada3e792640d081c1731b5c109ffe [file] [log] [blame]
Pawin Vongmasac80bf212018-09-06 05:22:36 -07001/*
2 * Copyright (C) 2018 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
17package android.hardware.media.c2@1.0;
18
19/**
Pawin Vongmasa9d1cf2a2018-11-14 13:40:40 -080020 * Generic configuration interface used by all configurable Codec 2.0
21 * components.
Pawin Vongmasac80bf212018-09-06 05:22:36 -070022 *
Pawin Vongmasa9d1cf2a2018-11-14 13:40:40 -080023 * This interface must be supported in all states of the inheriting
24 * object, and must not change the state of the inheriting object.
Pawin Vongmasac80bf212018-09-06 05:22:36 -070025 */
26interface IConfigurable {
27 /**
Pawin Vongmasa9d1cf2a2018-11-14 13:40:40 -080028 * Returns the name of this object. This must match the name that was
29 * supplied during the creation of the object.
Pawin Vongmasac80bf212018-09-06 05:22:36 -070030 *
Pawin Vongmasa9d1cf2a2018-11-14 13:40:40 -080031 * @return name Name of this object.
Pawin Vongmasac80bf212018-09-06 05:22:36 -070032 */
33 getName() generates (string name);
34
35 /**
Pawin Vongmasa9d1cf2a2018-11-14 13:40:40 -080036 * Queries a set of parameters from the object. Querying is performed at
37 * best effort: the object must query all supported parameters and skip
38 * unsupported ones, or parameters that could not be allocated. Any errors
39 * are communicated in the return value.
Pawin Vongmasac80bf212018-09-06 05:22:36 -070040 *
Pawin Vongmasa9d1cf2a2018-11-14 13:40:40 -080041 * \note Parameter values do not depend on the order of query.
Pawin Vongmasac80bf212018-09-06 05:22:36 -070042 *
Pawin Vongmasa9d1cf2a2018-11-14 13:40:40 -080043 * This method must return within 1ms if \p mayBlock is DONT_BLOCK, and
44 * within 5ms otherwise.
Pawin Vongmasac80bf212018-09-06 05:22:36 -070045 *
Pawin Vongmasa9d1cf2a2018-11-14 13:40:40 -080046 * @param indices List of param indices for params to be queried.
Pawin Vongmasac80bf212018-09-06 05:22:36 -070047 * @param mayBlock Whether this call may block or not.
48 * @return status Status of the call, which may be
Pawin Vongmasa9d1cf2a2018-11-14 13:40:40 -080049 * - OK - All parameters could be queried.
50 * - BAD_INDEX - All supported parameters could be queried, but some
51 * parameters were not supported.
52 * - NO_MEMORY - Could not allocate memory for a supported parameter.
53 * - BLOCKING - Querying some parameters requires blocking.
54 * - CORRUPTED - Some unknown error prevented the querying of the
55 * parameters. (unexpected)
56 * @return params List of params queried corresponding to \p indices.
Pawin Vongmasac80bf212018-09-06 05:22:36 -070057 */
58 query(
59 vec<ParamIndex> indices,
60 bool mayBlock
61 ) generates (
62 Status status,
63 Params params
64 );
65
66 /**
Pawin Vongmasa9d1cf2a2018-11-14 13:40:40 -080067 * Sets a set of parameters for the object. Tuning is performed at best
68 * effort: the object must update all supported configuration at best
69 * effort and skip unsupported parameters. Any errors are communicated in
70 * the return value and in \p failures.
Pawin Vongmasac80bf212018-09-06 05:22:36 -070071 *
Pawin Vongmasa9d1cf2a2018-11-14 13:40:40 -080072 * \note Parameter tuning DOES depend on the order of the tuning parameters.
73 * E.g. some parameter update may allow some subsequent parameter update.
Pawin Vongmasac80bf212018-09-06 05:22:36 -070074 *
Pawin Vongmasa9d1cf2a2018-11-14 13:40:40 -080075 * This method must return within 1ms if \p mayBlock is false, and within
76 * 5ms otherwise.
Pawin Vongmasac80bf212018-09-06 05:22:36 -070077 *
78 * @param inParams Requested parameter updates.
79 * @param mayBlock Whether this call may block or not.
80 * @return status Status of the call, which may be
Pawin Vongmasa9d1cf2a2018-11-14 13:40:40 -080081 * - OK - All parameters could be updated successfully.
82 * - BAD_INDEX - All supported parameters could be updated successfully,
83 * but some parameters were not supported.
84 * - NO_MEMORY - Some supported parameters could not be updated
85 * successfully because they contained unsupported values.
86 * These are returned in \p failures.
87 * - BLOCKING - Setting some parameters requires blocking.
88 * - CORRUPTED - Some unknown error prevented the update of the
89 * parameters. (unexpected)
90 * @return failures List of parameter failures.
91 * @return outParams Resulting values for the configured parameters.
Pawin Vongmasac80bf212018-09-06 05:22:36 -070092 */
93 config(
94 Params inParams,
95 bool mayBlock
96 ) generates (
97 Status status,
98 vec<SettingResult> failures,
99 Params outParams
100 );
101
102 // REFLECTION MECHANISM
103 // =========================================================================
104
105 /**
Pawin Vongmasa9d1cf2a2018-11-14 13:40:40 -0800106 * Returns a selected range of the set of supported parameters.
Pawin Vongmasac80bf212018-09-06 05:22:36 -0700107 *
Pawin Vongmasa9d1cf2a2018-11-14 13:40:40 -0800108 * The set of supported parameters are represented in a vector with a
109 * start index of 0, and the selected range are indices into this vector.
110 * Fewer than \p count parameters are returned if the selected range is
111 * not fully/not at all part of the available vector indices.
112 *
113 * This method must return within 1ms.
114 *
115 * @param start start index of selected range
116 * @param count size of the selected
Pawin Vongmasac80bf212018-09-06 05:22:36 -0700117 * @return status Status of the call, which may be
Pawin Vongmasa9d1cf2a2018-11-14 13:40:40 -0800118 * - OK - The operation completed successfully.
119 * - NO_MEMORY - Not enough memory to complete this method.
120 * @return params Vector containing the selected range of supported
121 * parameters.
Pawin Vongmasac80bf212018-09-06 05:22:36 -0700122 */
123 querySupportedParams(
124 uint32_t start,
125 uint32_t count
126 ) generates (
127 Status status,
128 vec<ParamDescriptor> params
129 );
130
131 /**
132 * Retrieves the supported values for the queried fields.
133 *
Pawin Vongmasa9d1cf2a2018-11-14 13:40:40 -0800134 * Upon return the object must fill in the supported
135 * values for the fields listed as well as a status for each field.
136 * Object shall process all fields queried even if some queries fail.
Pawin Vongmasac80bf212018-09-06 05:22:36 -0700137 *
Pawin Vongmasa9d1cf2a2018-11-14 13:40:40 -0800138 * This method must return within 1ms if \p mayBlock is false, and within
139 * 5ms otherwise.
Pawin Vongmasac80bf212018-09-06 05:22:36 -0700140 *
Pawin Vongmasa9d1cf2a2018-11-14 13:40:40 -0800141 * @param inFields Vector of field queries.
Pawin Vongmasac80bf212018-09-06 05:22:36 -0700142 * @param mayBlock Whether this call may block or not.
143 * @return status Status of the call, which may be
Pawin Vongmasa9d1cf2a2018-11-14 13:40:40 -0800144 * - OK - The operation completed successfully.
145 * - BLOCKING - Querying some parameters requires blocking.
146 * - NO_MEMORY - Not enough memory to complete this method.
147 * - BAD_INDEX - At least one field was not recognized as a component
148 * field.
149 * @return outFields Vector containing supported values and query result
150 * for the selected fields.
Pawin Vongmasac80bf212018-09-06 05:22:36 -0700151 */
152 querySupportedValues(
153 vec<FieldSupportedValuesQuery> inFields,
154 bool mayBlock
155 ) generates (
156 Status status,
157 vec<FieldSupportedValuesQueryResult> outFields
158 );
159
160};
161