blob: ff674d46fe57100c418e1965e6dc37ac69e09ad3 [file] [log] [blame]
Subhash Chandra Bose Naripeddy3eedc002013-11-12 20:45:15 -08001/*
Trinath Thammishetty765efd22018-08-20 13:23:24 +05302 * Copyright (c) 2013-2015, 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_EFFECT_BASS_BOOST_H_
21#define OFFLOAD_EFFECT_BASS_BOOST_H_
22
Trinath Thammishetty765efd22018-08-20 13:23:24 +053023#define BASSBOOST_PARAM_LATENCY 0x80000000
24
Subhash Chandra Bose Naripeddy3eedc002013-11-12 20:45:15 -080025#include "bundle.h"
26
Dhananjay Kumar5f15ff92014-05-19 16:45:08 +080027enum {
28 BASS_INVALID = -1,
29 BASS_BOOST = 0, // index of bassboost
30 BASS_PBE, // index of PBE
31 BASS_COUNT // totol number of bass type
32};
33
Subhash Chandra Bose Naripeddy3eedc002013-11-12 20:45:15 -080034extern const effect_descriptor_t bassboost_descriptor;
35
36typedef struct bassboost_context_s {
37 effect_context_t common;
38
39 int strength;
40
41 // Offload vars
42 struct mixer_ctl *ctl;
Subhash Chandra Bose Naripeddye40a7cd2014-06-03 19:42:41 -070043 int hw_acc_fd;
Subhash Chandra Bose Naripeddy3eedc002013-11-12 20:45:15 -080044 bool temp_disabled;
45 uint32_t device;
46 struct bass_boost_params offload_bass;
47} bassboost_context_t;
48
Dhananjay Kumar5f15ff92014-05-19 16:45:08 +080049typedef struct pbe_context_s {
50 effect_context_t common;
Subhash Chandra Bose Naripeddy3eedc002013-11-12 20:45:15 -080051
Dhananjay Kumar5f15ff92014-05-19 16:45:08 +080052 // Offload vars
53 struct mixer_ctl *ctl;
54 int hw_acc_fd;
55 bool temp_disabled;
56 uint32_t device;
57 struct pbe_params offload_pbe;
58} pbe_context_t;
59
60typedef struct bass_context_s {
61 effect_context_t common;
62 bassboost_context_t bassboost_ctxt;
63 pbe_context_t pbe_ctxt;
64 int active_index;
65} bass_context_t;
66
67int bass_get_parameter(effect_context_t *context, effect_param_t *p,
68 uint32_t *size);
69
70int bass_set_parameter(effect_context_t *context, effect_param_t *p,
71 uint32_t size);
72
73int bass_set_device(effect_context_t *context, uint32_t device);
74
75int bass_set_mode(effect_context_t *context, int32_t hw_acc_fd);
76
77int bass_reset(effect_context_t *context);
78
79int bass_init(effect_context_t *context);
80
81int bass_enable(effect_context_t *context);
82
83int bass_disable(effect_context_t *context);
84
85int bass_start(effect_context_t *context, output_context_t *output);
86
87int bass_stop(effect_context_t *context, output_context_t *output);
88
89
90int bassboost_get_strength(bassboost_context_t *context);
91
92int bassboost_set_strength(bassboost_context_t *context, uint32_t strength);
Subhash Chandra Bose Naripeddy3eedc002013-11-12 20:45:15 -080093
94int bassboost_set_device(effect_context_t *context, uint32_t device);
95
Subhash Chandra Bose Naripeddye40a7cd2014-06-03 19:42:41 -070096int bassboost_set_mode(effect_context_t *context, int32_t hw_acc_fd);
97
Subhash Chandra Bose Naripeddy3eedc002013-11-12 20:45:15 -080098int bassboost_reset(effect_context_t *context);
99
100int bassboost_init(effect_context_t *context);
101
102int bassboost_enable(effect_context_t *context);
103
104int bassboost_disable(effect_context_t *context);
105
106int bassboost_start(effect_context_t *context, output_context_t *output);
107
108int bassboost_stop(effect_context_t *context, output_context_t *output);
109
Dhananjay Kumar5f15ff92014-05-19 16:45:08 +0800110int pbe_set_device(effect_context_t *context, uint32_t device);
111
112int pbe_set_mode(effect_context_t *context, int32_t hw_acc_fd);
113
114int pbe_reset(effect_context_t *context);
115
116int pbe_init(effect_context_t *context);
117
118int pbe_enable(effect_context_t *context);
119
120int pbe_disable(effect_context_t *context);
121
122int pbe_start(effect_context_t *context, output_context_t *output);
123
124int pbe_stop(effect_context_t *context, output_context_t *output);
125
Subhash Chandra Bose Naripeddy3eedc002013-11-12 20:45:15 -0800126#endif /* OFFLOAD_EFFECT_BASS_BOOST_H_ */