mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Merge "Use safe_union in FieldSupportedValues"
This commit is contained in:
committed by
Android (Google) Code Review
commit
0a6281e802
@@ -505,7 +505,7 @@ d36f747f9c9a8f2f21db2f8323c2d755dd08b34ce813932d7339979f7d490dab android.hardwar
|
||||
21aa259585caaa27b6470ebcd8509aabde0ef5d039160aa6425d589cb787488b android.hardware.media.c2@1.0::IInputSink
|
||||
b9422a9aca84df1ff9623dc12c0562abce97716e28d63a965f2bfb88f9ad9607 android.hardware.media.c2@1.0::IInputSurface
|
||||
0a786a19e6753f9774a7ca7781c2a2edfe5c0b5fa112355dfa0e50ebedeb08b9 android.hardware.media.c2@1.0::IInputSurfaceConnection
|
||||
4cb139f729c29d8d6f4ecdab149c4feb571dad8a06e56cd57fcb52e70208bab4 android.hardware.media.c2@1.0::types
|
||||
7d3c292ca75ec3e22a8fd4ae72d2edb0659d280257e763786e766f3429954dd1 android.hardware.media.c2@1.0::types
|
||||
4880af120fc1640225abdc2c60bda6d79617d73484d5124913c7278af3b11e2d android.hardware.neuralnetworks@1.2::IBurstCallback
|
||||
19877e466ad8c6ed42b38050b77bd010cf7800ff365fdc8574f45bbfda03a758 android.hardware.neuralnetworks@1.2::IBurstContext
|
||||
b83317b66721241887d2770b5ae95fd5af1e77c5daa7530ecb08fae8892f2b43 android.hardware.neuralnetworks@1.2::IDevice
|
||||
|
||||
@@ -27,6 +27,7 @@ hidl_interface {
|
||||
"android.hardware.media.omx@1.0",
|
||||
"android.hardware.media@1.0",
|
||||
"android.hidl.base@1.0",
|
||||
"android.hidl.safe_union@1.0",
|
||||
],
|
||||
gen_java: false,
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package android.hardware.media.c2@1.0;
|
||||
|
||||
import android.hardware.media.bufferpool@2.0::BufferStatusMessage;
|
||||
import android.hidl.safe_union@1.0::Monostate;
|
||||
|
||||
/**
|
||||
* Common return values for Codec2 operations.
|
||||
@@ -190,89 +191,68 @@ struct ParamDescriptor {
|
||||
*/
|
||||
typedef uint64_t PrimitiveValue;
|
||||
|
||||
/**
|
||||
* Description of a set of values.
|
||||
*
|
||||
* If the `step` member is 0, and `num` and `denom` are both 1, the `Range`
|
||||
* structure represents a closed interval bounded by `min` and `max`.
|
||||
*
|
||||
* Otherwise, the #ValueRange structure represents a finite sequence of numbers
|
||||
* produced from the following recurrence relation:
|
||||
*
|
||||
* @code
|
||||
* v[0] = min
|
||||
* v[i] = v[i - 1] * num / denom + step ; i >= 1
|
||||
* @endcode
|
||||
*
|
||||
* Both the ratio `num / denom` and the value `step` must be positive. The
|
||||
* last number in the sequence described by this #Range structure is the
|
||||
* largest number in the sequence that is smaller than or equal to `max`.
|
||||
*
|
||||
* @note
|
||||
* The division in the formula may truncate the result if the data type of
|
||||
* these values is an integral type.
|
||||
*/
|
||||
struct ValueRange {
|
||||
/**
|
||||
* Lower end of the range (inclusive).
|
||||
*/
|
||||
PrimitiveValue min;
|
||||
/**
|
||||
* Upper end of the range (inclusive).
|
||||
*/
|
||||
PrimitiveValue max;
|
||||
/**
|
||||
* The non-homogeneous term in the recurrence relation.
|
||||
*/
|
||||
PrimitiveValue step;
|
||||
/**
|
||||
* The numerator of the scale coefficient in the recurrence relation.
|
||||
*/
|
||||
PrimitiveValue num;
|
||||
/**
|
||||
* The denominator of the scale coefficient in the recurrence relation.
|
||||
*/
|
||||
PrimitiveValue denom;
|
||||
};
|
||||
|
||||
/*
|
||||
* Description of supported values for a field.
|
||||
*
|
||||
* This can be a continuous range or a discrete set of values.
|
||||
*
|
||||
* The intended type of values must be made clear in the context where
|
||||
* `FieldSupportedValues` is used.
|
||||
*/
|
||||
struct FieldSupportedValues {
|
||||
/**
|
||||
* Used if #type is `RANGE`.
|
||||
*
|
||||
* If the `step` member is 0, and `num` and `denom` are both 1, the `Range`
|
||||
* structure represents a closed interval bounded by `min` and `max`.
|
||||
*
|
||||
* Otherwise, the #Range structure represents a finite sequence of numbers
|
||||
* produced from the following recurrence relation:
|
||||
*
|
||||
* @code
|
||||
* v[0] = min
|
||||
* v[i] = v[i - 1] * num / denom + step ; i >= 1
|
||||
* @endcode
|
||||
*
|
||||
* Both the ratio `num / denom` and the value `step` must be positive. The
|
||||
* last number in the sequence described by this #Range structure is the
|
||||
* largest number in the sequence that is smaller than or equal to `max`.
|
||||
*
|
||||
* @note
|
||||
* The division in the formula may truncate the result if the data type of
|
||||
* these values is an integral type.
|
||||
*/
|
||||
struct Range {
|
||||
/**
|
||||
* Lower end of the range (inclusive).
|
||||
*/
|
||||
PrimitiveValue min;
|
||||
/**
|
||||
* Upper end of the range (inclusive).
|
||||
*/
|
||||
PrimitiveValue max;
|
||||
/**
|
||||
* The non-homogeneous term in the recurrence relation.
|
||||
*/
|
||||
PrimitiveValue step;
|
||||
/**
|
||||
* The numerator of the scale coefficient in the recurrence relation.
|
||||
*/
|
||||
PrimitiveValue num;
|
||||
/**
|
||||
* The denominator of the scale coefficient in the recurrence relation.
|
||||
*/
|
||||
PrimitiveValue denom;
|
||||
};
|
||||
|
||||
enum Type : int32_t {
|
||||
/** No supported values */
|
||||
EMPTY = 0,
|
||||
/** Numeric range, described in a #Range structure */
|
||||
RANGE,
|
||||
/** List of values */
|
||||
VALUES,
|
||||
/** List of flags that can be OR-ed */
|
||||
FLAGS,
|
||||
};
|
||||
/**
|
||||
* Type of the supported values.
|
||||
*/
|
||||
Type type;
|
||||
|
||||
/**
|
||||
* When #type is #Type.RANGE, #range shall specify the range of possible
|
||||
* values.
|
||||
*
|
||||
* The intended type of members of #range shall be clear in the context
|
||||
* where `FieldSupportedValues` is used.
|
||||
*/
|
||||
Range range;
|
||||
|
||||
/**
|
||||
* When #type is #Type.VALUES or #Type.FLAGS, #value shall list supported
|
||||
* values/flags.
|
||||
*
|
||||
* The intended type of components of #value shall be clear in the context
|
||||
* where `FieldSupportedValues` is used.
|
||||
*/
|
||||
safe_union FieldSupportedValues {
|
||||
/** No supported values */
|
||||
Monostate empty;
|
||||
/** Numeric range, described in a #ValueRange structure */
|
||||
ValueRange range;
|
||||
/** List of values */
|
||||
vec<PrimitiveValue> values;
|
||||
/** List of flags that can be OR-ed */
|
||||
vec<PrimitiveValue> flags;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user