Android Hardware Abstraction Layer
Data Structures | Macros | Typedefs | Enumerations
audio_effect.h File Reference
#include <errno.h>
#include <stdint.h>
#include <strings.h>
#include <sys/cdefs.h>
#include <sys/types.h>
#include <cutils/bitops.h>
#include <system/audio.h>

Go to the source code of this file.

Data Structures

struct  effect_uuid_s
 
struct  effect_descriptor_s
 
struct  effect_interface_s
 
struct  audio_buffer_s
 
struct  buffer_provider_s
 
struct  buffer_config_s
 
struct  channel_config_s
 
struct  effect_config_s
 
struct  effect_param_s
 
struct  effect_offload_param_s
 
struct  audio_effect_library_s
 

Macros

#define EFFECT_STRING_LEN_MAX   64
 
#define EFFECT_UUID_INITIALIZER
 
#define EFFECT_FLAG_TYPE_SHIFT   0
 
#define EFFECT_FLAG_TYPE_SIZE   3
 
#define EFFECT_FLAG_TYPE_MASK
 
#define EFFECT_FLAG_TYPE_INSERT   (0 << EFFECT_FLAG_TYPE_SHIFT)
 
#define EFFECT_FLAG_TYPE_AUXILIARY   (1 << EFFECT_FLAG_TYPE_SHIFT)
 
#define EFFECT_FLAG_TYPE_REPLACE   (2 << EFFECT_FLAG_TYPE_SHIFT)
 
#define EFFECT_FLAG_TYPE_PRE_PROC   (3 << EFFECT_FLAG_TYPE_SHIFT)
 
#define EFFECT_FLAG_TYPE_POST_PROC   (4 << EFFECT_FLAG_TYPE_SHIFT)
 
#define EFFECT_FLAG_INSERT_SHIFT   (EFFECT_FLAG_TYPE_SHIFT + EFFECT_FLAG_TYPE_SIZE)
 
#define EFFECT_FLAG_INSERT_SIZE   3
 
#define EFFECT_FLAG_INSERT_MASK
 
#define EFFECT_FLAG_INSERT_ANY   (0 << EFFECT_FLAG_INSERT_SHIFT)
 
#define EFFECT_FLAG_INSERT_FIRST   (1 << EFFECT_FLAG_INSERT_SHIFT)
 
#define EFFECT_FLAG_INSERT_LAST   (2 << EFFECT_FLAG_INSERT_SHIFT)
 
#define EFFECT_FLAG_INSERT_EXCLUSIVE   (3 << EFFECT_FLAG_INSERT_SHIFT)
 
#define EFFECT_FLAG_VOLUME_SHIFT   (EFFECT_FLAG_INSERT_SHIFT + EFFECT_FLAG_INSERT_SIZE)
 
#define EFFECT_FLAG_VOLUME_SIZE   3
 
#define EFFECT_FLAG_VOLUME_MASK
 
#define EFFECT_FLAG_VOLUME_CTRL   (1 << EFFECT_FLAG_VOLUME_SHIFT)
 
#define EFFECT_FLAG_VOLUME_IND   (2 << EFFECT_FLAG_VOLUME_SHIFT)
 
#define EFFECT_FLAG_VOLUME_NONE   (0 << EFFECT_FLAG_VOLUME_SHIFT)
 
#define EFFECT_FLAG_DEVICE_SHIFT   (EFFECT_FLAG_VOLUME_SHIFT + EFFECT_FLAG_VOLUME_SIZE)
 
#define EFFECT_FLAG_DEVICE_SIZE   3
 
#define EFFECT_FLAG_DEVICE_MASK
 
#define EFFECT_FLAG_DEVICE_IND   (1 << EFFECT_FLAG_DEVICE_SHIFT)
 
#define EFFECT_FLAG_DEVICE_NONE   (0 << EFFECT_FLAG_DEVICE_SHIFT)
 
#define EFFECT_FLAG_INPUT_SHIFT   (EFFECT_FLAG_DEVICE_SHIFT + EFFECT_FLAG_DEVICE_SIZE)
 
#define EFFECT_FLAG_INPUT_SIZE   2
 
#define EFFECT_FLAG_INPUT_MASK
 
#define EFFECT_FLAG_INPUT_DIRECT   (1 << EFFECT_FLAG_INPUT_SHIFT)
 
#define EFFECT_FLAG_INPUT_PROVIDER   (2 << EFFECT_FLAG_INPUT_SHIFT)
 
#define EFFECT_FLAG_INPUT_BOTH   (3 << EFFECT_FLAG_INPUT_SHIFT)
 
#define EFFECT_FLAG_OUTPUT_SHIFT   (EFFECT_FLAG_INPUT_SHIFT + EFFECT_FLAG_INPUT_SIZE)
 
#define EFFECT_FLAG_OUTPUT_SIZE   2
 
#define EFFECT_FLAG_OUTPUT_MASK
 
#define EFFECT_FLAG_OUTPUT_DIRECT   (1 << EFFECT_FLAG_OUTPUT_SHIFT)
 
#define EFFECT_FLAG_OUTPUT_PROVIDER   (2 << EFFECT_FLAG_OUTPUT_SHIFT)
 
#define EFFECT_FLAG_OUTPUT_BOTH   (3 << EFFECT_FLAG_OUTPUT_SHIFT)
 
#define EFFECT_FLAG_HW_ACC_SHIFT   (EFFECT_FLAG_OUTPUT_SHIFT + EFFECT_FLAG_OUTPUT_SIZE)
 
#define EFFECT_FLAG_HW_ACC_SIZE   2
 
#define EFFECT_FLAG_HW_ACC_MASK
 
#define EFFECT_FLAG_HW_ACC_SIMPLE   (1 << EFFECT_FLAG_HW_ACC_SHIFT)
 
#define EFFECT_FLAG_HW_ACC_TUNNEL   (2 << EFFECT_FLAG_HW_ACC_SHIFT)
 
#define EFFECT_FLAG_AUDIO_MODE_SHIFT   (EFFECT_FLAG_HW_ACC_SHIFT + EFFECT_FLAG_HW_ACC_SIZE)
 
#define EFFECT_FLAG_AUDIO_MODE_SIZE   2
 
#define EFFECT_FLAG_AUDIO_MODE_MASK
 
#define EFFECT_FLAG_AUDIO_MODE_IND   (1 << EFFECT_FLAG_AUDIO_MODE_SHIFT)
 
#define EFFECT_FLAG_AUDIO_MODE_NONE   (0 << EFFECT_FLAG_AUDIO_MODE_SHIFT)
 
#define EFFECT_FLAG_AUDIO_SOURCE_SHIFT   (EFFECT_FLAG_AUDIO_MODE_SHIFT + EFFECT_FLAG_AUDIO_MODE_SIZE)
 
#define EFFECT_FLAG_AUDIO_SOURCE_SIZE   2
 
#define EFFECT_FLAG_AUDIO_SOURCE_MASK
 
#define EFFECT_FLAG_AUDIO_SOURCE_IND   (1 << EFFECT_FLAG_AUDIO_SOURCE_SHIFT)
 
#define EFFECT_FLAG_AUDIO_SOURCE_NONE   (0 << EFFECT_FLAG_AUDIO_SOURCE_SHIFT)
 
#define EFFECT_FLAG_OFFLOAD_SHIFT
 
#define EFFECT_FLAG_OFFLOAD_SIZE   1
 
#define EFFECT_FLAG_OFFLOAD_MASK
 
#define EFFECT_FLAG_OFFLOAD_SUPPORTED   (1 << EFFECT_FLAG_OFFLOAD_SHIFT)
 
#define EFFECT_MAKE_API_VERSION(M, m)   (((M)<<16) | ((m) & 0xFFFF))
 
#define EFFECT_API_VERSION_MAJOR(v)   ((v)>>16)
 
#define EFFECT_API_VERSION_MINOR(v)   ((m) & 0xFFFF)
 
#define EFFECT_CONTROL_API_VERSION   EFFECT_MAKE_API_VERSION(2,0)
 
#define EFFECT_CONFIG_BUFFER   0x0001
 
#define EFFECT_CONFIG_SMP_RATE   0x0002
 
#define EFFECT_CONFIG_CHANNELS   0x0004
 
#define EFFECT_CONFIG_FORMAT   0x0008
 
#define EFFECT_CONFIG_ACC_MODE   0x0010
 
#define EFFECT_CONFIG_PROVIDER   0x0020
 
#define EFFECT_CONFIG_ALL
 
#define EFFECT_LIBRARY_API_VERSION   EFFECT_MAKE_API_VERSION(3,0)
 
#define AUDIO_EFFECT_LIBRARY_TAG   ((('A') << 24) | (('E') << 16) | (('L') << 8) | ('T'))
 
#define AUDIO_EFFECT_LIBRARY_INFO_SYM   AELI
 
#define AUDIO_EFFECT_LIBRARY_INFO_SYM_AS_STR   "AELI"
 

Typedefs

typedef __BEGIN_DECLS struct
effect_uuid_s 
effect_uuid_t
 
typedef struct effect_descriptor_s effect_descriptor_t
 
typedef struct
effect_interface_s ** 
effect_handle_t
 
typedef struct audio_buffer_s audio_buffer_t
 
typedef int32_t(* buffer_function_t )(void *cookie, audio_buffer_t *buffer)
 
typedef struct buffer_provider_s buffer_provider_t
 
typedef struct buffer_config_s buffer_config_t
 
typedef struct channel_config_s channel_config_t
 
typedef struct effect_config_s effect_config_t
 
typedef struct effect_param_s effect_param_t
 
typedef struct
effect_offload_param_s 
effect_offload_param_t
 
typedef struct
audio_effect_library_s 
audio_effect_library_t
 

Enumerations

enum  effect_command_e {
  EFFECT_CMD_INIT, EFFECT_CMD_SET_CONFIG, EFFECT_CMD_RESET, EFFECT_CMD_ENABLE,
  EFFECT_CMD_DISABLE, EFFECT_CMD_SET_PARAM, EFFECT_CMD_SET_PARAM_DEFERRED, EFFECT_CMD_SET_PARAM_COMMIT,
  EFFECT_CMD_GET_PARAM, EFFECT_CMD_SET_DEVICE, EFFECT_CMD_SET_VOLUME, EFFECT_CMD_SET_AUDIO_MODE,
  EFFECT_CMD_SET_CONFIG_REVERSE, EFFECT_CMD_SET_INPUT_DEVICE, EFFECT_CMD_GET_CONFIG, EFFECT_CMD_GET_CONFIG_REVERSE,
  EFFECT_CMD_GET_FEATURE_SUPPORTED_CONFIGS, EFFECT_CMD_GET_FEATURE_CONFIG, EFFECT_CMD_SET_FEATURE_CONFIG, EFFECT_CMD_SET_AUDIO_SOURCE,
  EFFECT_CMD_OFFLOAD, EFFECT_CMD_FIRST_PROPRIETARY = 0x10000
}
 
enum  effect_buffer_access_e { EFFECT_BUFFER_ACCESS_WRITE, EFFECT_BUFFER_ACCESS_READ, EFFECT_BUFFER_ACCESS_ACCUMULATE }
 
enum  effect_feature_e { EFFECT_FEATURE_AUX_CHANNELS, EFFECT_FEATURE_CNT }
 

Macro Definition Documentation

#define AUDIO_EFFECT_LIBRARY_INFO_SYM   AELI

Definition at line 1005 of file audio_effect.h.

#define AUDIO_EFFECT_LIBRARY_INFO_SYM_AS_STR   "AELI"

Definition at line 1008 of file audio_effect.h.

#define AUDIO_EFFECT_LIBRARY_TAG   ((('A') << 24) | (('E') << 16) | (('L') << 8) | ('T'))

Definition at line 914 of file audio_effect.h.

#define EFFECT_API_VERSION_MAJOR (   v)    ((v)>>16)

Definition at line 244 of file audio_effect.h.

#define EFFECT_API_VERSION_MINOR (   v)    ((m) & 0xFFFF)

Definition at line 245 of file audio_effect.h.

#define EFFECT_CONFIG_ACC_MODE   0x0010

Definition at line 852 of file audio_effect.h.

#define EFFECT_CONFIG_ALL
Value:
EFFECT_CONFIG_CHANNELS | EFFECT_CONFIG_FORMAT | \
EFFECT_CONFIG_ACC_MODE | EFFECT_CONFIG_PROVIDER)

Definition at line 854 of file audio_effect.h.

#define EFFECT_CONFIG_BUFFER   0x0001

Definition at line 848 of file audio_effect.h.

#define EFFECT_CONFIG_CHANNELS   0x0004

Definition at line 850 of file audio_effect.h.

#define EFFECT_CONFIG_FORMAT   0x0008

Definition at line 851 of file audio_effect.h.

#define EFFECT_CONFIG_PROVIDER   0x0020

Definition at line 853 of file audio_effect.h.

#define EFFECT_CONFIG_SMP_RATE   0x0002

Definition at line 849 of file audio_effect.h.

#define EFFECT_CONTROL_API_VERSION   EFFECT_MAKE_API_VERSION(2,0)

Definition at line 254 of file audio_effect.h.

#define EFFECT_FLAG_AUDIO_MODE_IND   (1 << EFFECT_FLAG_AUDIO_MODE_SHIFT)

Definition at line 224 of file audio_effect.h.

#define EFFECT_FLAG_AUDIO_MODE_MASK
Value:

Definition at line 222 of file audio_effect.h.

#define EFFECT_FLAG_AUDIO_MODE_NONE   (0 << EFFECT_FLAG_AUDIO_MODE_SHIFT)

Definition at line 225 of file audio_effect.h.

#define EFFECT_FLAG_AUDIO_MODE_SHIFT   (EFFECT_FLAG_HW_ACC_SHIFT + EFFECT_FLAG_HW_ACC_SIZE)

Definition at line 220 of file audio_effect.h.

#define EFFECT_FLAG_AUDIO_MODE_SIZE   2

Definition at line 221 of file audio_effect.h.

#define EFFECT_FLAG_AUDIO_SOURCE_IND   (1 << EFFECT_FLAG_AUDIO_SOURCE_SHIFT)

Definition at line 232 of file audio_effect.h.

#define EFFECT_FLAG_AUDIO_SOURCE_MASK
Value:

Definition at line 230 of file audio_effect.h.

#define EFFECT_FLAG_AUDIO_SOURCE_NONE   (0 << EFFECT_FLAG_AUDIO_SOURCE_SHIFT)

Definition at line 233 of file audio_effect.h.

#define EFFECT_FLAG_AUDIO_SOURCE_SHIFT   (EFFECT_FLAG_AUDIO_MODE_SHIFT + EFFECT_FLAG_AUDIO_MODE_SIZE)

Definition at line 228 of file audio_effect.h.

#define EFFECT_FLAG_AUDIO_SOURCE_SIZE   2

Definition at line 229 of file audio_effect.h.

#define EFFECT_FLAG_DEVICE_IND   (1 << EFFECT_FLAG_DEVICE_SHIFT)

Definition at line 190 of file audio_effect.h.

#define EFFECT_FLAG_DEVICE_MASK
Value:

Definition at line 188 of file audio_effect.h.

#define EFFECT_FLAG_DEVICE_NONE   (0 << EFFECT_FLAG_DEVICE_SHIFT)

Definition at line 191 of file audio_effect.h.

#define EFFECT_FLAG_DEVICE_SHIFT   (EFFECT_FLAG_VOLUME_SHIFT + EFFECT_FLAG_VOLUME_SIZE)

Definition at line 186 of file audio_effect.h.

#define EFFECT_FLAG_DEVICE_SIZE   3

Definition at line 187 of file audio_effect.h.

#define EFFECT_FLAG_HW_ACC_MASK
Value:

Definition at line 214 of file audio_effect.h.

#define EFFECT_FLAG_HW_ACC_SHIFT   (EFFECT_FLAG_OUTPUT_SHIFT + EFFECT_FLAG_OUTPUT_SIZE)

Definition at line 212 of file audio_effect.h.

#define EFFECT_FLAG_HW_ACC_SIMPLE   (1 << EFFECT_FLAG_HW_ACC_SHIFT)

Definition at line 216 of file audio_effect.h.

#define EFFECT_FLAG_HW_ACC_SIZE   2

Definition at line 213 of file audio_effect.h.

#define EFFECT_FLAG_HW_ACC_TUNNEL   (2 << EFFECT_FLAG_HW_ACC_SHIFT)

Definition at line 217 of file audio_effect.h.

#define EFFECT_FLAG_INPUT_BOTH   (3 << EFFECT_FLAG_INPUT_SHIFT)

Definition at line 200 of file audio_effect.h.

#define EFFECT_FLAG_INPUT_DIRECT   (1 << EFFECT_FLAG_INPUT_SHIFT)

Definition at line 198 of file audio_effect.h.

#define EFFECT_FLAG_INPUT_MASK
Value:

Definition at line 196 of file audio_effect.h.

#define EFFECT_FLAG_INPUT_PROVIDER   (2 << EFFECT_FLAG_INPUT_SHIFT)

Definition at line 199 of file audio_effect.h.

#define EFFECT_FLAG_INPUT_SHIFT   (EFFECT_FLAG_DEVICE_SHIFT + EFFECT_FLAG_DEVICE_SIZE)

Definition at line 194 of file audio_effect.h.

#define EFFECT_FLAG_INPUT_SIZE   2

Definition at line 195 of file audio_effect.h.

#define EFFECT_FLAG_INSERT_ANY   (0 << EFFECT_FLAG_INSERT_SHIFT)

Definition at line 170 of file audio_effect.h.

#define EFFECT_FLAG_INSERT_EXCLUSIVE   (3 << EFFECT_FLAG_INSERT_SHIFT)

Definition at line 173 of file audio_effect.h.

#define EFFECT_FLAG_INSERT_FIRST   (1 << EFFECT_FLAG_INSERT_SHIFT)

Definition at line 171 of file audio_effect.h.

#define EFFECT_FLAG_INSERT_LAST   (2 << EFFECT_FLAG_INSERT_SHIFT)

Definition at line 172 of file audio_effect.h.

#define EFFECT_FLAG_INSERT_MASK
Value:

Definition at line 168 of file audio_effect.h.

#define EFFECT_FLAG_INSERT_SHIFT   (EFFECT_FLAG_TYPE_SHIFT + EFFECT_FLAG_TYPE_SIZE)

Definition at line 166 of file audio_effect.h.

#define EFFECT_FLAG_INSERT_SIZE   3

Definition at line 167 of file audio_effect.h.

#define EFFECT_FLAG_OFFLOAD_MASK
Value:

Definition at line 239 of file audio_effect.h.

#define EFFECT_FLAG_OFFLOAD_SHIFT
Value:
EFFECT_FLAG_AUDIO_SOURCE_SIZE)

Definition at line 236 of file audio_effect.h.

#define EFFECT_FLAG_OFFLOAD_SIZE   1

Definition at line 238 of file audio_effect.h.

#define EFFECT_FLAG_OFFLOAD_SUPPORTED   (1 << EFFECT_FLAG_OFFLOAD_SHIFT)

Definition at line 241 of file audio_effect.h.

#define EFFECT_FLAG_OUTPUT_BOTH   (3 << EFFECT_FLAG_OUTPUT_SHIFT)

Definition at line 209 of file audio_effect.h.

#define EFFECT_FLAG_OUTPUT_DIRECT   (1 << EFFECT_FLAG_OUTPUT_SHIFT)

Definition at line 207 of file audio_effect.h.

#define EFFECT_FLAG_OUTPUT_MASK
Value:

Definition at line 205 of file audio_effect.h.

#define EFFECT_FLAG_OUTPUT_PROVIDER   (2 << EFFECT_FLAG_OUTPUT_SHIFT)

Definition at line 208 of file audio_effect.h.

#define EFFECT_FLAG_OUTPUT_SHIFT   (EFFECT_FLAG_INPUT_SHIFT + EFFECT_FLAG_INPUT_SIZE)

Definition at line 203 of file audio_effect.h.

#define EFFECT_FLAG_OUTPUT_SIZE   2

Definition at line 204 of file audio_effect.h.

#define EFFECT_FLAG_TYPE_AUXILIARY   (1 << EFFECT_FLAG_TYPE_SHIFT)

Definition at line 160 of file audio_effect.h.

#define EFFECT_FLAG_TYPE_INSERT   (0 << EFFECT_FLAG_TYPE_SHIFT)

Definition at line 159 of file audio_effect.h.

#define EFFECT_FLAG_TYPE_MASK
Value:

Definition at line 157 of file audio_effect.h.

#define EFFECT_FLAG_TYPE_POST_PROC   (4 << EFFECT_FLAG_TYPE_SHIFT)

Definition at line 163 of file audio_effect.h.

#define EFFECT_FLAG_TYPE_PRE_PROC   (3 << EFFECT_FLAG_TYPE_SHIFT)

Definition at line 162 of file audio_effect.h.

#define EFFECT_FLAG_TYPE_REPLACE   (2 << EFFECT_FLAG_TYPE_SHIFT)

Definition at line 161 of file audio_effect.h.

#define EFFECT_FLAG_TYPE_SHIFT   0

Definition at line 155 of file audio_effect.h.

#define EFFECT_FLAG_TYPE_SIZE   3

Definition at line 156 of file audio_effect.h.

#define EFFECT_FLAG_VOLUME_CTRL   (1 << EFFECT_FLAG_VOLUME_SHIFT)

Definition at line 181 of file audio_effect.h.

#define EFFECT_FLAG_VOLUME_IND   (2 << EFFECT_FLAG_VOLUME_SHIFT)

Definition at line 182 of file audio_effect.h.

#define EFFECT_FLAG_VOLUME_MASK
Value:

Definition at line 179 of file audio_effect.h.

#define EFFECT_FLAG_VOLUME_NONE   (0 << EFFECT_FLAG_VOLUME_SHIFT)

Definition at line 183 of file audio_effect.h.

#define EFFECT_FLAG_VOLUME_SHIFT   (EFFECT_FLAG_INSERT_SHIFT + EFFECT_FLAG_INSERT_SIZE)

Definition at line 177 of file audio_effect.h.

#define EFFECT_FLAG_VOLUME_SIZE   3

Definition at line 178 of file audio_effect.h.

#define EFFECT_LIBRARY_API_VERSION   EFFECT_MAKE_API_VERSION(3,0)

Definition at line 912 of file audio_effect.h.

#define EFFECT_MAKE_API_VERSION (   M,
 
)    (((M)<<16) | ((m) & 0xFFFF))

Definition at line 243 of file audio_effect.h.

#define EFFECT_STRING_LEN_MAX   64

Definition at line 58 of file audio_effect.h.

#define EFFECT_UUID_INITIALIZER
Value:
{ 0xec7178ec, 0xe5e1, 0x4432, 0xa3f4, \
{ 0x46, 0x57, 0xe6, 0x79, 0x52, 0x10 } }

Definition at line 61 of file audio_effect.h.

Typedef Documentation

Definition at line 278 of file audio_effect.h.

typedef int32_t(* buffer_function_t)(void *cookie, audio_buffer_t *buffer)

Definition at line 800 of file audio_effect.h.

Definition at line 274 of file audio_effect.h.

typedef __BEGIN_DECLS struct effect_uuid_s effect_uuid_t

Enumeration Type Documentation

Enumerator
EFFECT_BUFFER_ACCESS_WRITE 
EFFECT_BUFFER_ACCESS_READ 
EFFECT_BUFFER_ACCESS_ACCUMULATE 

Definition at line 825 of file audio_effect.h.

Enumerator
EFFECT_CMD_INIT 
EFFECT_CMD_SET_CONFIG 
EFFECT_CMD_RESET 
EFFECT_CMD_ENABLE 
EFFECT_CMD_DISABLE 
EFFECT_CMD_SET_PARAM 
EFFECT_CMD_SET_PARAM_DEFERRED 
EFFECT_CMD_SET_PARAM_COMMIT 
EFFECT_CMD_GET_PARAM 
EFFECT_CMD_SET_DEVICE 
EFFECT_CMD_SET_VOLUME 
EFFECT_CMD_SET_AUDIO_MODE 
EFFECT_CMD_SET_CONFIG_REVERSE 
EFFECT_CMD_SET_INPUT_DEVICE 
EFFECT_CMD_GET_CONFIG 
EFFECT_CMD_GET_CONFIG_REVERSE 
EFFECT_CMD_GET_FEATURE_SUPPORTED_CONFIGS 
EFFECT_CMD_GET_FEATURE_CONFIG 
EFFECT_CMD_SET_FEATURE_CONFIG 
EFFECT_CMD_SET_AUDIO_SOURCE 
EFFECT_CMD_OFFLOAD 
EFFECT_CMD_FIRST_PROPRIETARY 

Definition at line 419 of file audio_effect.h.

Enumerator
EFFECT_FEATURE_AUX_CHANNELS 
EFFECT_FEATURE_CNT 

Definition at line 833 of file audio_effect.h.