hal: Add new parameter in SA+ effects and resolve compilation issue
Add new parameter in SA+ effects to get latency introduced by each effect. Use #ifdef instead of #if in environmentalreverb header file since _cplusplus macro not being defined is raising errors. Change-Id: I0d5e410414502ac2bef77f1cbd7b041e4f26844d
This commit is contained in:
parent
64fa732dcc
commit
765efd2d2a
|
@ -32,6 +32,8 @@
|
|||
#include "effect_api.h"
|
||||
#include "bass_boost.h"
|
||||
|
||||
#define BASSBOOST_MAX_LATENCY 30
|
||||
|
||||
/* Offload bassboost UUID: 2c4a8c24-1581-487f-94f6-0002a5d5c51b */
|
||||
const effect_descriptor_t bassboost_descriptor = {
|
||||
{0x0634f220, 0xddd4, 0x11db, 0xa0fc, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b }},
|
||||
|
@ -101,6 +103,11 @@ int bass_get_parameter(effect_context_t *context, effect_param_t *p,
|
|||
p->status = -EINVAL;
|
||||
p->vsize = sizeof(int16_t);
|
||||
break;
|
||||
case BASSBOOST_PARAM_LATENCY:
|
||||
if (p->vsize < sizeof(uint32_t))
|
||||
p->status = -EINVAL;
|
||||
p->vsize = sizeof(uint32_t);
|
||||
break;
|
||||
default:
|
||||
p->status = -EINVAL;
|
||||
}
|
||||
|
@ -127,6 +134,10 @@ int bass_get_parameter(effect_context_t *context, effect_param_t *p,
|
|||
*(int16_t *)value = 0;
|
||||
break;
|
||||
|
||||
case BASSBOOST_PARAM_LATENCY:
|
||||
*(uint32_t *)value = BASSBOOST_MAX_LATENCY;
|
||||
break;
|
||||
|
||||
default:
|
||||
p->status = -EINVAL;
|
||||
break;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2013-2015, 2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution.
|
||||
*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
|
@ -20,6 +20,8 @@
|
|||
#ifndef OFFLOAD_EFFECT_BASS_BOOST_H_
|
||||
#define OFFLOAD_EFFECT_BASS_BOOST_H_
|
||||
|
||||
#define BASSBOOST_PARAM_LATENCY 0x80000000
|
||||
|
||||
#include "bundle.h"
|
||||
|
||||
enum {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013-2014, 2017, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2013-2014, 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution.
|
||||
*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
|
@ -29,6 +29,8 @@
|
|||
#include "effect_api.h"
|
||||
#include "equalizer.h"
|
||||
|
||||
#define EQUALIZER_MAX_LATENCY 0
|
||||
|
||||
/* Offload equalizer UUID: a0dac280-401c-11e3-9379-0002a5d5c51b */
|
||||
const effect_descriptor_t equalizer_descriptor = {
|
||||
{0x0bed4300, 0xddd6, 0x11db, 0x8f34, {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}, // type
|
||||
|
@ -253,6 +255,12 @@ int equalizer_get_parameter(effect_context_t *context, effect_param_t *p,
|
|||
p->vsize = (2 + NUM_EQ_BANDS) * sizeof(uint16_t);
|
||||
break;
|
||||
|
||||
case EQ_PARAM_LATENCY:
|
||||
if (p->vsize < sizeof(uint32_t))
|
||||
p->status = -EINVAL;
|
||||
p->vsize = sizeof(uint32_t);
|
||||
break;
|
||||
|
||||
default:
|
||||
p->status = -EINVAL;
|
||||
}
|
||||
|
@ -352,6 +360,10 @@ int equalizer_get_parameter(effect_context_t *context, effect_param_t *p,
|
|||
}
|
||||
} break;
|
||||
|
||||
case EQ_PARAM_LATENCY:
|
||||
*(uint32_t *)value = EQUALIZER_MAX_LATENCY;
|
||||
break;
|
||||
|
||||
default:
|
||||
p->status = -EINVAL;
|
||||
break;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2013-2014, 2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution.
|
||||
*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
|
@ -26,6 +26,8 @@
|
|||
#define INVALID_PRESET -2
|
||||
#define PRESET_CUSTOM -1
|
||||
|
||||
#define EQ_PARAM_LATENCY 0x80000000
|
||||
|
||||
extern const effect_descriptor_t equalizer_descriptor;
|
||||
|
||||
typedef struct equalizer_context_s {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013 - 2014, 2017, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2013 - 2014, 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution.
|
||||
*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
|
@ -30,6 +30,8 @@
|
|||
#include "effect_api.h"
|
||||
#include "reverb.h"
|
||||
|
||||
#define REVERB_MAX_LATENCY 100
|
||||
|
||||
/* Offload auxiliary environmental reverb UUID: 79a18026-18fd-4185-8233-0002a5d5c51b */
|
||||
const effect_descriptor_t aux_env_reverb_descriptor = {
|
||||
{ 0xc2e5d5f0, 0x94bd, 0x4763, 0x9cac, { 0x4e, 0x23, 0x4d, 0x06, 0x83, 0x9e } },
|
||||
|
@ -522,6 +524,11 @@ int reverb_get_parameter(effect_context_t *context, effect_param_t *p,
|
|||
p->status = -EINVAL;
|
||||
p->vsize = sizeof(reverb_settings_t);
|
||||
break;
|
||||
case REVERB_PARAM_LATENCY:
|
||||
if (p->vsize < sizeof(uint32_t))
|
||||
return -EINVAL;
|
||||
p->vsize = sizeof(uint32_t);
|
||||
break;
|
||||
default:
|
||||
p->status = -EINVAL;
|
||||
}
|
||||
|
@ -575,6 +582,9 @@ int reverb_get_parameter(effect_context_t *context, effect_param_t *p,
|
|||
reverb_settings->diffusion = reverb_get_diffusion(reverb_ctxt);
|
||||
reverb_settings->density = reverb_get_density(reverb_ctxt);
|
||||
break;
|
||||
case REVERB_PARAM_LATENCY:
|
||||
*(uint16_t *)value = REVERB_MAX_LATENCY;
|
||||
break;
|
||||
default:
|
||||
p->status = -EINVAL;
|
||||
break;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2013-2014, 2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution.
|
||||
*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
|
@ -24,6 +24,8 @@
|
|||
|
||||
#define REVERB_DEFAULT_PRESET REVERB_PRESET_NONE
|
||||
|
||||
#define REVERB_PARAM_LATENCY 0x80000000
|
||||
|
||||
extern const effect_descriptor_t aux_env_reverb_descriptor;
|
||||
extern const effect_descriptor_t ins_env_reverb_descriptor;
|
||||
extern const effect_descriptor_t aux_preset_reverb_descriptor;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013-2015, 2017, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2013-2015, 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution.
|
||||
*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
|
@ -29,6 +29,8 @@
|
|||
#include "effect_api.h"
|
||||
#include "virtualizer.h"
|
||||
|
||||
#define VIRUALIZER_MAX_LATENCY 30
|
||||
|
||||
/* Offload Virtualizer UUID: 509a4498-561a-4bea-b3b1-0002a5d5c51b */
|
||||
const effect_descriptor_t virtualizer_descriptor = {
|
||||
{0x37cc2c00, 0xdddd, 0x11db, 0x8577, {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}},
|
||||
|
@ -304,6 +306,11 @@ int virtualizer_get_parameter(effect_context_t *context, effect_param_t *p,
|
|||
p->status = -EINVAL;
|
||||
p->vsize = sizeof(uint32_t);
|
||||
break;
|
||||
case VIRTUALIZER_PARAM_LATENCY:
|
||||
if (p->vsize < sizeof(uint32_t))
|
||||
p->status = -EINVAL;
|
||||
p->vsize = sizeof(uint32_t);
|
||||
break;
|
||||
default:
|
||||
p->status = -EINVAL;
|
||||
}
|
||||
|
@ -347,6 +354,10 @@ int virtualizer_get_parameter(effect_context_t *context, effect_param_t *p,
|
|||
*(uint32_t *)value = (uint32_t) virtualizer_get_virtualization_mode(virt_ctxt);
|
||||
break;
|
||||
|
||||
case VIRTUALIZER_PARAM_LATENCY:
|
||||
*(uint32_t *)value = VIRUALIZER_MAX_LATENCY;
|
||||
break;
|
||||
|
||||
default:
|
||||
p->status = -EINVAL;
|
||||
break;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2013-2015, 2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution.
|
||||
*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
|
@ -20,6 +20,8 @@
|
|||
#ifndef OFFLOAD_VIRTUALIZER_H_
|
||||
#define OFFLOAD_VIRTUALIZER_H_
|
||||
|
||||
#define VIRTUALIZER_PARAM_LATENCY 0x80000000
|
||||
|
||||
#include "bundle.h"
|
||||
|
||||
extern const effect_descriptor_t virtualizer_descriptor;
|
||||
|
|
|
@ -40,7 +40,9 @@ static const qahw_effect_uuid_t * const SL_IID_BASSBOOST_UUID = &SL_IID_BASSBOOS
|
|||
typedef enum
|
||||
{
|
||||
BASSBOOST_PARAM_STRENGTH_SUPPORTED,
|
||||
BASSBOOST_PARAM_STRENGTH
|
||||
BASSBOOST_PARAM_STRENGTH,
|
||||
BASSBOOST_PARAM_LATENCY = 0x80000000 // Internal paramter specific to qahw.
|
||||
// Used to get latency introduced by bassboost effect.
|
||||
} qahw_bassboost_params;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution.
|
||||
*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include <qahw_effect_api.h>
|
||||
|
||||
#if __cplusplus
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
@ -55,7 +55,9 @@ typedef enum
|
|||
REVERB_PARAM_DIFFUSION, // in permilles, range 0 to 1000
|
||||
REVERB_PARAM_DENSITY, // in permilles, range 0 to 1000
|
||||
REVERB_PARAM_PROPERTIES,
|
||||
REVERB_PARAM_BYPASS
|
||||
REVERB_PARAM_BYPASS,
|
||||
REVERB_PARAM_LATENCY = 0x80000000 // Internal paramter specific to qahw.
|
||||
// Used to get latency introduced by reverb effect.
|
||||
} qahw_env_reverb_params;
|
||||
|
||||
//qahw_reverb_settings is equal to SLEnvironmentalReverbSettings defined in OpenSL ES specification.
|
||||
|
@ -73,7 +75,7 @@ typedef struct s_reverb_settings {
|
|||
} __attribute__((packed)) qahw_reverb_settings;
|
||||
|
||||
|
||||
#if __cplusplus
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
|
|
|
@ -50,7 +50,9 @@ typedef enum
|
|||
EQ_PARAM_CUR_PRESET, // Gets/Sets the current preset.
|
||||
EQ_PARAM_GET_NUM_OF_PRESETS, // Gets the total number of presets the equalizer supports.
|
||||
EQ_PARAM_GET_PRESET_NAME, // Gets the preset name based on the index.
|
||||
EQ_PARAM_PROPERTIES // Gets/Sets all parameters at a time.
|
||||
EQ_PARAM_PROPERTIES, // Gets/Sets all parameters at a time.
|
||||
EQ_PARAM_LATENCY = 0x80000000 // Internal paramter specific to qahw.
|
||||
// Used to get latency introduced by equalizer effect.
|
||||
} qahw_equalizer_params;
|
||||
|
||||
enum
|
||||
|
|
|
@ -75,7 +75,10 @@ typedef enum
|
|||
// AUDIO_DEVICE_NONE when not virtualizing
|
||||
// status int -EINVAL if an error occurred
|
||||
// 0 if the output value is successfully retrieved
|
||||
VIRTUALIZER_PARAM_VIRTUALIZATION_MODE
|
||||
VIRTUALIZER_PARAM_VIRTUALIZATION_MODE,
|
||||
// Internal paramter specific to qahw.
|
||||
// Used to get latency introduced by virtuaizer effect.
|
||||
VIRTUALIZER_PARAM_LATENCY = 0x80000000
|
||||
} qahw_virtualizer_params;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Reference in New Issue