33 #define GAIN_VALUE 100.0f
37 omx_volume_component_PrivateType* omx_volume_component_Private;
44 openmaxStandComp->
pComponentPrivate = calloc(1,
sizeof(omx_volume_component_PrivateType));
56 omx_volume_component_Private->ports = NULL;
69 if (omx_volume_component_Private->sPortTypesParam[
OMX_PortDomainAudio].nPorts && !omx_volume_component_Private->ports) {
71 if (!omx_volume_component_Private->ports) {
74 for (i=0; i < omx_volume_component_Private->sPortTypesParam[
OMX_PortDomainAudio].nPorts; i++) {
76 if (!omx_volume_component_Private->ports[i]) {
95 omx_volume_component_Private->gain =
GAIN_VALUE;
105 omx_volume_component_Private->currentQualityLevel = 1;
109 omx_volume_component_Private->multiResourceLevel[i]->CPUResourceRequested = volumeQualityLevels[i * 2];
110 omx_volume_component_Private->multiResourceLevel[i]->MemoryResourceRequested = volumeQualityLevels[i * 2 + 1];
122 omx_volume_component_PrivateType* omx_volume_component_Private = openmaxStandComp->
pComponentPrivate;
127 if (omx_volume_component_Private->ports) {
128 for (i=0; i < omx_volume_component_Private->sPortTypesParam[
OMX_PortDomainAudio].nPorts; i++) {
129 if(omx_volume_component_Private->ports[i]) {
130 omx_volume_component_Private->ports[i]->PortDestructor(omx_volume_component_Private->ports[i]);
133 free(omx_volume_component_Private->ports);
134 omx_volume_component_Private->ports=NULL;
147 int sampleCount = pInputBuffer->
nFilledLen / 2;
148 omx_volume_component_PrivateType* omx_volume_component_Private = openmaxStandComp->
pComponentPrivate;
150 if(omx_volume_component_Private->gain !=
GAIN_VALUE) {
151 for (i = 0; i < sampleCount; i++) {
153 (((
OMX_S16*) pInputBuffer->
pBuffer)[i] * (omx_volume_component_Private->gain / 100.0f));
166 OMX_PTR pComponentConfigStructure) {
170 omx_volume_component_PrivateType* omx_volume_component_Private = openmaxStandComp->
pComponentPrivate;
180 omx_volume_component_Private->gain = pVolume->
sVolume.
nValue;
193 OMX_PTR pComponentConfigStructure) {
196 omx_volume_component_PrivateType* omx_volume_component_Private = openmaxStandComp->
pComponentPrivate;
203 pVolume->
sVolume.
nValue = omx_volume_component_Private->gain;
218 OMX_PTR ComponentParameterStructure) {
228 omx_volume_component_PrivateType* omx_volume_component_Private = openmaxStandComp->
pComponentPrivate;
229 if (ComponentParameterStructure == NULL) {
234 switch(nParamIndex) {
243 if (portIndex <= 1) {
254 DEBUG(
DEB_LEV_ERR,
"In %s Incorrect State=%x lineno=%d\n",__func__,omx_volume_component_Private->state,__LINE__);
275 OMX_PTR ComponentParameterStructure) {
283 omx_volume_component_PrivateType* omx_volume_component_Private = openmaxStandComp->
pComponentPrivate;
284 if (ComponentParameterStructure == NULL) {
289 switch(nParamIndex) {