Home | History | Annotate | Download | only in post_proc
      1 /*
      2  * Copyright (C) 2014 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 #ifndef OFFLOAD_EQUALIZER_H_
     18 #define OFFLOAD_EQUALIZER_H_
     19 
     20 #include "bundle.h"
     21 
     22 #define NUM_EQ_BANDS              5
     23 #define INVALID_PRESET		 -2
     24 #define PRESET_CUSTOM		 -1
     25 
     26 extern const effect_descriptor_t equalizer_descriptor;
     27 
     28 typedef struct equalizer_context_s {
     29     effect_context_t common;
     30 
     31     int preset;
     32     int band_levels[NUM_EQ_BANDS];
     33 
     34     // Offload vars
     35     struct mixer_ctl *ctl;
     36     uint32_t device;
     37     struct eq_params offload_eq;
     38 } equalizer_context_t;
     39 
     40 int equalizer_get_parameter(effect_context_t *context, effect_param_t *p,
     41                             uint32_t *size);
     42 
     43 int equalizer_set_parameter(effect_context_t *context, effect_param_t *p,
     44                             uint32_t size);
     45 
     46 int equalizer_set_device(effect_context_t *context,  uint32_t device);
     47 
     48 int equalizer_reset(effect_context_t *context);
     49 
     50 int equalizer_init(effect_context_t *context);
     51 
     52 int equalizer_enable(effect_context_t *context);
     53 
     54 int equalizer_disable(effect_context_t *context);
     55 
     56 int equalizer_start(effect_context_t *context, output_context_t *output);
     57 
     58 int equalizer_stop(effect_context_t *context, output_context_t *output);
     59 
     60 #endif /*OFFLOAD_EQUALIZER_H_*/
     61