Subhash Chandra Bose Naripeddy | 3eedc00 | 2013-11-12 20:45:15 -0800 | [diff] [blame] | 1 | /* |
Trinath Thammishetty | 765efd2 | 2018-08-20 13:23:24 +0530 | [diff] [blame] | 2 | * Copyright (c) 2013-2015, 2018, The Linux Foundation. All rights reserved. |
Subhash Chandra Bose Naripeddy | 3eedc00 | 2013-11-12 20:45:15 -0800 | [diff] [blame] | 3 | * 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 Thammishetty | 765efd2 | 2018-08-20 13:23:24 +0530 | [diff] [blame] | 23 | #define BASSBOOST_PARAM_LATENCY 0x80000000 |
| 24 | |
Subhash Chandra Bose Naripeddy | 3eedc00 | 2013-11-12 20:45:15 -0800 | [diff] [blame] | 25 | #include "bundle.h" |
| 26 | |
Dhananjay Kumar | 5f15ff9 | 2014-05-19 16:45:08 +0800 | [diff] [blame] | 27 | enum { |
| 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 Naripeddy | 3eedc00 | 2013-11-12 20:45:15 -0800 | [diff] [blame] | 34 | extern const effect_descriptor_t bassboost_descriptor; |
| 35 | |
| 36 | typedef 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 Naripeddy | e40a7cd | 2014-06-03 19:42:41 -0700 | [diff] [blame] | 43 | int hw_acc_fd; |
Subhash Chandra Bose Naripeddy | 3eedc00 | 2013-11-12 20:45:15 -0800 | [diff] [blame] | 44 | bool temp_disabled; |
| 45 | uint32_t device; |
| 46 | struct bass_boost_params offload_bass; |
| 47 | } bassboost_context_t; |
| 48 | |
Dhananjay Kumar | 5f15ff9 | 2014-05-19 16:45:08 +0800 | [diff] [blame] | 49 | typedef struct pbe_context_s { |
| 50 | effect_context_t common; |
Subhash Chandra Bose Naripeddy | 3eedc00 | 2013-11-12 20:45:15 -0800 | [diff] [blame] | 51 | |
Dhananjay Kumar | 5f15ff9 | 2014-05-19 16:45:08 +0800 | [diff] [blame] | 52 | // 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 | |
| 60 | typedef 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 | |
| 67 | int bass_get_parameter(effect_context_t *context, effect_param_t *p, |
| 68 | uint32_t *size); |
| 69 | |
| 70 | int bass_set_parameter(effect_context_t *context, effect_param_t *p, |
| 71 | uint32_t size); |
| 72 | |
| 73 | int bass_set_device(effect_context_t *context, uint32_t device); |
| 74 | |
| 75 | int bass_set_mode(effect_context_t *context, int32_t hw_acc_fd); |
| 76 | |
| 77 | int bass_reset(effect_context_t *context); |
| 78 | |
| 79 | int bass_init(effect_context_t *context); |
| 80 | |
| 81 | int bass_enable(effect_context_t *context); |
| 82 | |
| 83 | int bass_disable(effect_context_t *context); |
| 84 | |
| 85 | int bass_start(effect_context_t *context, output_context_t *output); |
| 86 | |
| 87 | int bass_stop(effect_context_t *context, output_context_t *output); |
| 88 | |
| 89 | |
| 90 | int bassboost_get_strength(bassboost_context_t *context); |
| 91 | |
| 92 | int bassboost_set_strength(bassboost_context_t *context, uint32_t strength); |
Subhash Chandra Bose Naripeddy | 3eedc00 | 2013-11-12 20:45:15 -0800 | [diff] [blame] | 93 | |
| 94 | int bassboost_set_device(effect_context_t *context, uint32_t device); |
| 95 | |
Subhash Chandra Bose Naripeddy | e40a7cd | 2014-06-03 19:42:41 -0700 | [diff] [blame] | 96 | int bassboost_set_mode(effect_context_t *context, int32_t hw_acc_fd); |
| 97 | |
Subhash Chandra Bose Naripeddy | 3eedc00 | 2013-11-12 20:45:15 -0800 | [diff] [blame] | 98 | int bassboost_reset(effect_context_t *context); |
| 99 | |
| 100 | int bassboost_init(effect_context_t *context); |
| 101 | |
| 102 | int bassboost_enable(effect_context_t *context); |
| 103 | |
| 104 | int bassboost_disable(effect_context_t *context); |
| 105 | |
| 106 | int bassboost_start(effect_context_t *context, output_context_t *output); |
| 107 | |
| 108 | int bassboost_stop(effect_context_t *context, output_context_t *output); |
| 109 | |
Dhananjay Kumar | 5f15ff9 | 2014-05-19 16:45:08 +0800 | [diff] [blame] | 110 | int pbe_set_device(effect_context_t *context, uint32_t device); |
| 111 | |
| 112 | int pbe_set_mode(effect_context_t *context, int32_t hw_acc_fd); |
| 113 | |
| 114 | int pbe_reset(effect_context_t *context); |
| 115 | |
| 116 | int pbe_init(effect_context_t *context); |
| 117 | |
| 118 | int pbe_enable(effect_context_t *context); |
| 119 | |
| 120 | int pbe_disable(effect_context_t *context); |
| 121 | |
| 122 | int pbe_start(effect_context_t *context, output_context_t *output); |
| 123 | |
| 124 | int pbe_stop(effect_context_t *context, output_context_t *output); |
| 125 | |
Subhash Chandra Bose Naripeddy | 3eedc00 | 2013-11-12 20:45:15 -0800 | [diff] [blame] | 126 | #endif /* OFFLOAD_EFFECT_BASS_BOOST_H_ */ |