blob: 2cd06c25989cca824a476377407d0da58f071f37 [file] [log] [blame]
Subhash Chandra Bose Naripeddy3eedc002013-11-12 20:45:15 -08001/*
Trinath Thammishetty765efd22018-08-20 13:23:24 +05302 * Copyright (c) 2013-2014, 2018, The Linux Foundation. All rights reserved.
Subhash Chandra Bose Naripeddy3eedc002013-11-12 20:45:15 -08003 * Not a Contribution.
4 *
5 * Copyright (C) 2013 The Android Open Source Project
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19
20#ifndef OFFLOAD_EQUALIZER_H_
21#define OFFLOAD_EQUALIZER_H_
22
23#include "bundle.h"
24
25#define NUM_EQ_BANDS 5
26#define INVALID_PRESET -2
27#define PRESET_CUSTOM -1
28
Trinath Thammishetty765efd22018-08-20 13:23:24 +053029#define EQ_PARAM_LATENCY 0x80000000
30
Subhash Chandra Bose Naripeddy3eedc002013-11-12 20:45:15 -080031extern const effect_descriptor_t equalizer_descriptor;
32
33typedef struct equalizer_context_s {
34 effect_context_t common;
35
36 int preset;
37 int band_levels[NUM_EQ_BANDS];
38
39 // Offload vars
40 struct mixer_ctl *ctl;
Subhash Chandra Bose Naripeddye40a7cd2014-06-03 19:42:41 -070041 int hw_acc_fd;
Subhash Chandra Bose Naripeddy3eedc002013-11-12 20:45:15 -080042 uint32_t device;
43 struct eq_params offload_eq;
44} equalizer_context_t;
45
46int equalizer_get_parameter(effect_context_t *context, effect_param_t *p,
47 uint32_t *size);
48
49int equalizer_set_parameter(effect_context_t *context, effect_param_t *p,
50 uint32_t size);
51
52int equalizer_set_device(effect_context_t *context, uint32_t device);
53
Subhash Chandra Bose Naripeddye40a7cd2014-06-03 19:42:41 -070054int equalizer_set_mode(effect_context_t *context, int32_t hw_acc_fd);
55
Subhash Chandra Bose Naripeddy3eedc002013-11-12 20:45:15 -080056int equalizer_reset(effect_context_t *context);
57
58int equalizer_init(effect_context_t *context);
59
60int equalizer_enable(effect_context_t *context);
61
62int equalizer_disable(effect_context_t *context);
63
64int equalizer_start(effect_context_t *context, output_context_t *output);
65
66int equalizer_stop(effect_context_t *context, output_context_t *output);
67
68#endif /*OFFLOAD_EQUALIZER_H_*/