1 /* 2 * Copyright (C) 2010 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 ANDROID_EFFECTSFACTORY_H_ 18 #define ANDROID_EFFECTSFACTORY_H_ 19 20 #include <cutils/log.h> 21 #include <pthread.h> 22 #include <dirent.h> 23 #include <media/EffectsFactoryApi.h> 24 25 #if __cplusplus 26 extern "C" { 27 #endif 28 29 30 typedef struct list_elem_s { 31 void *object; 32 struct list_elem_s *next; 33 } list_elem_t; 34 35 // Structure used for storing effects with their sub effects. 36 // Used in creating gSubEffectList. Here, 37 // object holds the effect desc and the list sub_elem holds the sub effects 38 typedef struct list_sub_elem_s { 39 void *object; 40 list_elem_t *sub_elem; 41 struct list_sub_elem_s *next; 42 } list_sub_elem_t; 43 44 typedef struct lib_entry_s { 45 audio_effect_library_t *desc; 46 char *name; 47 char *path; 48 void *handle; 49 list_elem_t *effects; //list of effect_descriptor_t 50 pthread_mutex_t lock; 51 } lib_entry_t; 52 53 typedef struct effect_entry_s { 54 struct effect_interface_s *itfe; 55 effect_handle_t subItfe; 56 lib_entry_t *lib; 57 } effect_entry_t; 58 59 // Structure used to store the lib entry 60 // and the descriptor of the sub effects. 61 // The library entry is to be stored in case of 62 // sub effects as the sub effects are not linked 63 // to the library list - gLibraryList. 64 typedef struct sub_effect_entry_s { 65 lib_entry_t *lib; 66 void *object; 67 } sub_effect_entry_t; 68 69 #if __cplusplus 70 } // extern "C" 71 #endif 72 73 74 #endif /*ANDROID_EFFECTSFACTORY_H_*/ 75