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