Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8e85d1f5 authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

audio: Use docstrings instead of comments in types.hal files

Converted comments into docstrings for enums and structures
in Audio HAL V7 definition.

Bug: 142480271
Test: m
Change-Id: Id5e36e7a42e2600ab69612819f8260110871c711
parent dd3aaa1c
Loading
Loading
Loading
Loading
+14 −8
Original line number Diff line number Diff line
@@ -44,8 +44,10 @@ enum AudioDrain : int32_t {
 * A substitute for POSIX timespec.
 */
struct TimeSpec {
    uint64_t tvSec;   // seconds
    uint64_t tvNSec;  // nanoseconds
    /** Seconds. */
    uint64_t tvSec;
    /** Nanoseconds. */
    uint64_t tvNSec;
};

struct ParameterValue {
@@ -85,8 +87,10 @@ struct MmapBufferInfo {
 * Used by streams opened in mmap mode.
 */
struct MmapPosition {
    int64_t  timeNanoseconds; // time stamp in ns, CLOCK_MONOTONIC
    int32_t  positionFrames;  // increasing 32 bit frame count reset when IStream.stop() is called
    /** Timestamp in ns, CLOCK_MONOTONIC. */
    int64_t  timeNanoseconds;
    /** Increasing 32 bit frame count reset when IStream.stop() is called. */
    int32_t  positionFrames;
};

/**
@@ -128,9 +132,12 @@ struct AudioMicrophoneCoordinate {
 */
@export(name="audio_microphone_channel_mapping_t", value_prefix="AUDIO_MICROPHONE_CHANNEL_MAPPING_")
enum AudioMicrophoneChannelMapping : uint32_t {
    UNUSED      = 0, /* Channel not used */
    DIRECT      = 1, /* Channel used and signal not processed */
    PROCESSED   = 2, /* Channel used and signal has some processing */
    /** Channel not used. */
    UNUSED      = 0,
    /** Channel used and signal not processed. */
    DIRECT      = 1,
    /** Channel used and signal has some processing. */
    PROCESSED   = 2,
};

/**
@@ -269,7 +276,6 @@ enum DualMonoMode : int32_t {
    // frameworks/base/media/java/android/media/AudioTrack.java
    /**
     * Disable any Dual Mono presentation effect.
     *
     */
    OFF = 0,
    /**
+24 −12
Original line number Diff line number Diff line
@@ -332,14 +332,22 @@ typedef string AudioGainMode;
 * A gain stage is always attached to an audio port.
 */
struct AudioGain {
    vec<AudioGainMode> mode; // modes of operation
    AudioChannelMask channelMask; // channels which gain can be controlled
    int32_t minValue;     // minimum gain value in millibels
    int32_t maxValue;     // maximum gain value in millibels
    int32_t defaultValue; // default gain value in millibels
    uint32_t stepValue;   // gain step in millibels
    uint32_t minRampMs;   // minimum ramp duration in ms
    uint32_t maxRampMs;   // maximum ramp duration in ms
    /** Modes of operation. */
    vec<AudioGainMode> mode;
    /** Channels which gain can be controlled. */
    AudioChannelMask channelMask;
    /** Minimum gain value in millibels. */
    int32_t minValue;
    /** Maximum gain value in millibels. */
    int32_t maxValue;
    /** Default gain value in millibels. */
    int32_t defaultValue;
    /** Gain step in millibels. */
    uint32_t stepValue;
    /** Ramp duration in ms. */
    uint32_t minRampMs;
    /** Maximum ramp duration in ms. */
    uint32_t maxRampMs;
};

/**
@@ -347,16 +355,20 @@ struct AudioGain {
 * given port.
 */
struct AudioGainConfig {
    int32_t index;  // index of the corresponding AudioGain in AudioPort.gains
    vec<AudioGainMode> mode; // modes of operation
    AudioChannelMask channelMask;  // channels which gain value follows
    /** Index of the corresponding AudioGain in AudioPort.gains. */
    int32_t index;
    /** Modes of operation. */
    vec<AudioGainMode> mode;
    /** Channels which gain value follows. */
    AudioChannelMask channelMask;
    /**
     * Gain values in millibels for each channel ordered from LSb to MSb in
     * channel mask. The number of values is 1 in joint mode or
     * the number of channels in the channel mask.
     */
    vec<int32_t> values;
    uint32_t rampDurationMs;  // ramp duration in ms
    /** Ramp duration in ms. */
    uint32_t rampDurationMs;
};


+40 −23
Original line number Diff line number Diff line
@@ -202,16 +202,26 @@ enum EffectFlags : int32_t {
 * enumeration of the effect engines present in a library.
 */
struct EffectDescriptor {
    Uuid type;                   // UUID of to the OpenSL ES interface implemented
                                 // by this effect
    Uuid uuid;                   // UUID for this particular implementation
    bitfield<EffectFlags> flags; // effect engine capabilities/requirements flags
    uint16_t cpuLoad;            // CPU load indication expressed in 0.1 MIPS units
                                 // as estimated on an ARM9E core (ARMv5TE) with 0 WS
    uint16_t memoryUsage;        // data memory usage expressed in KB and includes
                                 // only dynamically allocated memory
    uint8_t[64] name;            // human readable effect name
    uint8_t[64] implementor;     // human readable effect implementor name
    /** UUID of to the OpenSL ES interface implemented by this effect. */
    Uuid type;
    /** UUID for this particular implementation. */
    Uuid uuid;
    /** Effect engine capabilities/requirements flags. */
    bitfield<EffectFlags> flags;
    /**
     * CPU load indication expressed in 0.1 MIPS units as estimated on
     * an ARM9E core (ARMv5TE) with 0 WS.
     */
    uint16_t cpuLoad;
    /**
     * Data memory usage expressed in KB and includes only dynamically
     * allocated memory.
     */
    uint16_t memoryUsage;
    /** Human readable effect name. */
    uint8_t[64] name;
    /** Human readable effect implementor name. */
    uint8_t[64] implementor;
};

/**
@@ -242,11 +252,16 @@ enum EffectBufferAccess : int32_t {
 */
@export(name="", value_prefix="EFFECT_CONFIG_")
enum EffectConfigParameters : int32_t {
    BUFFER = 0x0001,    // buffer field
    SMP_RATE = 0x0002,  // samplingRate
    CHANNELS = 0x0004,  // channels
    FORMAT = 0x0008,    // format
    ACC_MODE = 0x0010,  // accessMode
    /** Buffer field. */
    BUFFER = 0x0001,
    /** Sampling rate. */
    SMP_RATE = 0x0002,
    /** Channels. */
    CHANNELS = 0x0004,
    /** Format. */
    FORMAT = 0x0008,
    /** Access mode. */
    ACC_MODE = 0x0010,
    // Note that the 2.0 ALL have been moved to an helper function
};

@@ -270,21 +285,23 @@ struct EffectConfig {

@export(name="effect_feature_e", value_prefix="EFFECT_FEATURE_")
enum EffectFeature : int32_t {
    AUX_CHANNELS, // supports auxiliary channels
                  // (e.g. dual mic noise suppressor)
    /** Supports auxiliary channels (e.g. dual mic noise suppressor). */
    AUX_CHANNELS,
    CNT
};

struct EffectAuxChannelsConfig {
    vec<AudioChannelMask> mainChannels;  // channel mask for main channels
    vec<AudioChannelMask> auxChannels;   // channel mask for auxiliary channels
    /** Channel mask for main channels. */
    vec<AudioChannelMask> mainChannels;
    /** Channel mask for auxiliary channels. */
    vec<AudioChannelMask> auxChannels;
};

struct EffectOffloadParameter {
    bool isOffload;          // true if the playback thread the effect
                             // is attached to is offloaded
    AudioIoHandle ioHandle;  // io handle of the playback thread
                             // the effect is attached to
    /** True if the playback thread the effect is attached to is offloaded. */
    bool isOffload;
    /** I/O handle of the playback thread the effect is attached to. */
    AudioIoHandle ioHandle;
};

/**