OpenMAXBellagio  0.9.3
audio_effects/library_entry_point.c
Go to the documentation of this file.
1 
32 #include <omx_volume_component.h>
34 
49  unsigned int i;
50  DEBUG(DEB_LEV_FUNCTION_NAME, "In %s \n",__func__);
51 
52  if (stComponents == NULL) {
53  DEBUG(DEB_LEV_FUNCTION_NAME, "Out of %s \n",__func__);
54  return 2; // Return Number of Components - one for audio volume component
55  }
56 
58  stComponents[0]->componentVersion.s.nVersionMajor = 1;
59  stComponents[0]->componentVersion.s.nVersionMinor = 1;
60  stComponents[0]->componentVersion.s.nRevision = 1;
61  stComponents[0]->componentVersion.s.nStep = 1;
62 
63  stComponents[0]->name = calloc(1, OMX_MAX_STRINGNAME_SIZE);
64  if (stComponents[0]->name == NULL) {
66  }
67  strcpy(stComponents[0]->name, VOLUME_COMP_NAME);
68  stComponents[0]->name_specific_length = 1;
70 
71  stComponents[0]->name_specific = calloc(stComponents[0]->name_specific_length,sizeof(char *));
72  stComponents[0]->role_specific = calloc(stComponents[0]->name_specific_length,sizeof(char *));
73 
74  for(i=0;i<stComponents[0]->name_specific_length;i++) {
75  stComponents[0]->name_specific[i] = calloc(1, OMX_MAX_STRINGNAME_SIZE);
76  if (stComponents[0]->name_specific[i] == NULL) {
78  }
79  }
80  for(i=0;i<stComponents[0]->name_specific_length;i++) {
81  stComponents[0]->role_specific[i] = calloc(1, OMX_MAX_STRINGNAME_SIZE);
82  if (stComponents[0]->role_specific[i] == NULL) {
84  }
85  }
86 
87  strcpy(stComponents[0]->name_specific[0], VOLUME_COMP_NAME);
88  strcpy(stComponents[0]->role_specific[0], VOLUME_COMP_ROLE);
89 
90  stComponents[0]->nqualitylevels = VOLUME_QUALITY_LEVELS;
91  stComponents[0]->multiResourceLevel = malloc(stComponents[0]->nqualitylevels * sizeof(multiResourceDescriptor *));
92  for (i=0; i<stComponents[0]->nqualitylevels; i++) {
93  stComponents[0]->multiResourceLevel[i] = malloc(sizeof(multiResourceDescriptor));
94  stComponents[0]->multiResourceLevel[i]->CPUResourceRequested = volumeQualityLevels[i * 2];
95  stComponents[0]->multiResourceLevel[i]->MemoryResourceRequested = volumeQualityLevels[i * 2 + 1];
96  }
97 
99  stComponents[1]->componentVersion.s.nVersionMajor = 1;
100  stComponents[1]->componentVersion.s.nVersionMinor = 1;
101  stComponents[1]->componentVersion.s.nRevision = 1;
102  stComponents[1]->componentVersion.s.nStep = 1;
103 
104  stComponents[1]->name = calloc(1, OMX_MAX_STRINGNAME_SIZE);
105  if (stComponents[1]->name == NULL) {
107  }
108  strcpy(stComponents[1]->name, MIXER_COMP_NAME);
109  stComponents[1]->name_specific_length = 1;
111 
112  stComponents[1]->name_specific = calloc(stComponents[0]->name_specific_length,sizeof(char *));
113  stComponents[1]->role_specific = calloc(stComponents[0]->name_specific_length,sizeof(char *));
114 
115  for(i=0;i<stComponents[1]->name_specific_length;i++) {
116  stComponents[1]->name_specific[i] = calloc(1, OMX_MAX_STRINGNAME_SIZE);
117  if (stComponents[1]->name_specific[i] == NULL) {
119  }
120  }
121  for(i=0;i<stComponents[1]->name_specific_length;i++) {
122  stComponents[1]->role_specific[i] = calloc(1, OMX_MAX_STRINGNAME_SIZE);
123  if (stComponents[1]->role_specific[i] == NULL) {
125  }
126  }
127 
128  strcpy(stComponents[1]->name_specific[0], MIXER_COMP_NAME);
129  strcpy(stComponents[1]->role_specific[0], MIXER_COMP_ROLE);
130 
131  stComponents[1]->nqualitylevels = MIXER_QUALITY_LEVELS;
132  stComponents[1]->multiResourceLevel = malloc(stComponents[1]->nqualitylevels * sizeof(multiResourceDescriptor *));
133  for (i=0; i<stComponents[1]->nqualitylevels; i++) {
134  stComponents[1]->multiResourceLevel[i] = malloc(sizeof(multiResourceDescriptor));
135  stComponents[1]->multiResourceLevel[i]->CPUResourceRequested = mixerQualityLevels[i * 2];
136  stComponents[1]->multiResourceLevel[i]->MemoryResourceRequested = mixerQualityLevels[i * 2 + 1];
137  }
138 
139  DEBUG(DEB_LEV_FUNCTION_NAME, "Out of %s \n",__func__);
140  return 2;
141 }
DEB_LEV_FUNCTION_NAME
#define DEB_LEV_FUNCTION_NAME
Definition: omx_comp_debug_levels.h:59
OMX_VERSIONTYPE::nRevision
OMX_U8 nRevision
Definition: OMX_Types.h:346
DEBUG
#define DEBUG(n, fmt, args...)
Definition: omx_comp_debug_levels.h:77
stLoaderComponentType::name_specific
char ** name_specific
Definition: st_static_component_loader.h:43
MIXER_QUALITY_LEVELS
#define MIXER_QUALITY_LEVELS
Definition: omx_audiomixer_component.h:41
stLoaderComponentType::name
char * name
Definition: st_static_component_loader.h:41
omx_component_library_Setup
int omx_component_library_Setup(stLoaderComponentType **stComponents)
The library entry point. It must have the same name for each library of the components loaded by the ...
Definition: audio_effects/library_entry_point.c:48
stLoaderComponentType::role_specific
char ** role_specific
Definition: st_static_component_loader.h:44
VOLUME_COMP_NAME
#define VOLUME_COMP_NAME
Definition: omx_volume_component.h:35
OMX_VERSIONTYPE::s
struct OMX_VERSIONTYPE::@1 s
omx_volume_component_Constructor
OMX_ERRORTYPE omx_volume_component_Constructor(OMX_COMPONENTTYPE *openmaxStandComp, OMX_STRING cComponentName)
Definition: omx_volume_component.c:35
multiResourceDescriptor::MemoryResourceRequested
int MemoryResourceRequested
Definition: extension_struct.h:43
omx_volume_component.h
omx_audio_mixer_component_Constructor
OMX_ERRORTYPE omx_audio_mixer_component_Constructor(OMX_COMPONENTTYPE *openmaxStandComp, OMX_STRING cComponentName)
Definition: omx_audiomixer_component.c:35
OMX_VERSIONTYPE::nVersionMinor
OMX_U8 nVersionMinor
Definition: OMX_Types.h:345
VOLUME_QUALITY_LEVELS
#define VOLUME_QUALITY_LEVELS
Definition: omx_volume_component.h:38
stLoaderComponentType::nqualitylevels
OMX_U32 nqualitylevels
Definition: st_static_component_loader.h:47
VOLUME_COMP_ROLE
#define VOLUME_COMP_ROLE
Definition: omx_volume_component.h:36
st_static_component_loader.h
multiResourceDescriptor
Definition: extension_struct.h:41
OMX_VERSIONTYPE::nStep
OMX_U8 nStep
Definition: OMX_Types.h:347
omx_audiomixer_component.h
OMX_ErrorInsufficientResources
@ OMX_ErrorInsufficientResources
Definition: OMX_Core.h:131
stLoaderComponentType::componentVersion
OMX_VERSIONTYPE componentVersion
Definition: st_static_component_loader.h:40
OMX_VERSIONTYPE::nVersionMajor
OMX_U8 nVersionMajor
Definition: OMX_Types.h:344
stLoaderComponentType::multiResourceLevel
multiResourceDescriptor ** multiResourceLevel
Definition: st_static_component_loader.h:48
MIXER_COMP_NAME
#define MIXER_COMP_NAME
Definition: omx_audiomixer_component.h:37
multiResourceDescriptor::CPUResourceRequested
int CPUResourceRequested
Definition: extension_struct.h:42
MIXER_COMP_ROLE
#define MIXER_COMP_ROLE
Definition: omx_audiomixer_component.h:38
OMX_MAX_STRINGNAME_SIZE
#define OMX_MAX_STRINGNAME_SIZE
Definition: OMX_Core.h:281
stLoaderComponentType::name_specific_length
unsigned int name_specific_length
Definition: st_static_component_loader.h:42
stLoaderComponentType::constructor
OMX_ERRORTYPE(* constructor)(OMX_COMPONENTTYPE *, OMX_STRING cComponentName)
Definition: st_static_component_loader.h:46
stLoaderComponentType
the private data structure handled by the ST static loader that described an OpenMAX component
Definition: st_static_component_loader.h:39

Generated for OpenMAX Bellagio rel. 0.9.3 by  doxygen 1.5.1
SourceForge.net Logo