Lines Matching full:effect
56 // Effect/Preprocessor state
71 // Effect operation table. Functions for all pre processors are declared in sPreProcOps[] table.
84 // Effect context
89 preproc_session_t *session; // session the effect is on
90 const preproc_ops_t *ops; // effect ops table
92 uint32_t type; // subtype of effect
109 uint32_t samplingRate; // sampling rate at effect process interface
173 // Effect descriptors
176 // UUIDs for effect types have been generated from http://www.itu.int/ITU-T/asn1/uuid.html
269 int AgcInit (preproc_effect_t *effect)
272 webrtc::GainControl *agc = static_cast<webrtc::GainControl *>(effect->engine);
280 int AgcCreate(preproc_effect_t *effect)
282 webrtc::GainControl *agc = effect->session->apm->gain_control();
288 effect->engine = static_cast<preproc_fx_handle_t>(agc);
289 AgcInit(effect);
293 int AgcGetParameter(preproc_effect_t *effect,
301 webrtc::GainControl *agc = static_cast<webrtc::GainControl *>(effect->engine);
357 int AgcSetParameter (preproc_effect_t *effect, void *pParam, void *pValue)
362 webrtc::GainControl *agc = static_cast<webrtc::GainControl *>(effect->engine);
399 void AgcEnable(preproc_effect_t *effect)
401 webrtc::GainControl *agc = static_cast<webrtc::GainControl *>(effect->engine);
406 void AgcDisable(preproc_effect_t *effect)
409 webrtc::GainControl *agc = static_cast<webrtc::GainControl *>(effect->engine);
434 int AecInit (preproc_effect_t *effect)
437 webrtc::EchoControlMobile *aec = static_cast<webrtc::EchoControlMobile *>(effect->engine);
443 int AecCreate(preproc_effect_t *effect)
445 webrtc::EchoControlMobile *aec = effect->session->apm->echo_control_mobile();
451 effect->engine = static_cast<preproc_fx_handle_t>(aec);
452 AecInit (effect);
456 int AecGetParameter(preproc_effect_t *effect,
470 *(uint32_t *)pValue = 1000 * effect->session->apm->stream_delay_ms();
481 int AecSetParameter (preproc_effect_t *effect, void *pParam, void *pValue)
490 status = effect->session->apm->set_stream_delay_ms(value/1000);
501 void AecEnable(preproc_effect_t *effect)
503 webrtc::EchoControlMobile *aec = static_cast<webrtc::EchoControlMobile *>(effect->engine);
508 void AecDisable(preproc_effect_t *effect)
511 webrtc::EchoControlMobile *aec = static_cast<webrtc::EchoControlMobile *>(effect->engine);
515 int AecSetDevice(preproc_effect_t *effect, uint32_t device)
518 webrtc::EchoControlMobile *aec = static_cast<webrtc::EchoControlMobile *>(effect->engine);
558 int NsInit (preproc_effect_t *effect)
561 webrtc::NoiseSuppression *ns = static_cast<webrtc::NoiseSuppression *>(effect->engine);
573 effect->session->apm->SetExtraOptions(config);
576 effect->session->apm->SetExtraOptions(config);
577 effect->type = NS_TYPE_SINGLE_CHANNEL;
581 int NsCreate(preproc_effect_t *effect)
583 webrtc::NoiseSuppression *ns = effect->session->apm->noise_suppression();
589 effect->engine = static_cast<preproc_fx_handle_t>(ns);
590 NsInit (effect);
594 int NsGetParameter(preproc_effect_t *effect __unused,
603 int NsSetParameter (preproc_effect_t *effect, void *pParam, void *pValue)
606 webrtc::NoiseSuppression *ns = static_cast<webrtc::NoiseSuppression *>(effect->engine);
622 effect->session->apm->SetExtraOptions(config);
623 effect->type = value;
635 void NsEnable(preproc_effect_t *effect)
637 webrtc::NoiseSuppression *ns = static_cast<webrtc::NoiseSuppression *>(effect->engine);
640 if (effect->type == NS_TYPE_MULTI_CHANNEL) {
644 effect->session->apm->SetExtraOptions(config);
648 void NsDisable(preproc_effect_t *effect)
651 webrtc::NoiseSuppression *ns = static_cast<webrtc::NoiseSuppression *>(effect->engine);
656 effect->session->apm->SetExtraOptions(config);
679 // Effect functions
690 int Effect_SetState(preproc_effect_t *effect, uint32_t state)
693 ALOGV("Effect_SetState proc %d, new %d old %d", effect->procId, state, effect->state);
696 switch(effect->state) {
698 effect->ops->disable(effect);
699 Session_SetProcEnabled(effect->session, effect->procId, false);
705 BAD_STATE_ABORT(effect->state, state);
709 switch(effect->state) {
711 status = effect->ops->create(effect);
720 BAD_STATE_ABORT(effect->state, state);
724 switch(effect->state) {
730 effect->ops->disable(effect);
731 Session_SetProcEnabled(effect->session, effect->procId, false);
737 BAD_STATE_ABORT(effect->state, state);
741 switch(effect->state) {
748 // enabling an already enabled effect is just ignored
751 effect->ops->enable(effect);
752 Session_SetProcEnabled(effect->session, effect->procId, true);
755 BAD_STATE_ABORT(effect->state, state);
759 BAD_STATE_ABORT(effect->state, state);
762 effect->state = state;
767 int Effect_Init(preproc_effect_t *effect, uint32_t procId)
770 effect->itfe = &sEffectInterfaceReverse;
772 effect->itfe = &sEffectInterface;
774 effect->ops = sPreProcOps[procId];
775 effect->procId = procId;
776 effect->state = PREPROC_EFFECT_STATE_INIT;
780 int Effect_Create(preproc_effect_t *effect,
784 effect->session = session;
785 *interface = (effect_handle_t)&effect->itfe;
786 return Effect_SetState(effect, PREPROC_EFFECT_STATE_CREATED);
789 int Effect_Release(preproc_effect_t *effect)
791 return Effect_SetState(effect, PREPROC_EFFECT_STATE_INIT);
1205 // Effect Control Interface Implementation
1212 preproc_effect_t * effect = (preproc_effect_t *)self;
1215 if (effect == NULL){
1216 ALOGV("PreProcessingFx_Process() ERROR effect == NULL");
1219 preproc_session_t * session = (preproc_session_t *)effect->session;
1227 session->processedMsk |= (1<<effect->procId);
1233 effect->session->processedMsk = 0;
1338 effect->session->apm->ProcessStream(session->procFrame);
1404 preproc_effect_t * effect = (preproc_effect_t *) self;
1408 if (effect == NULL){
1419 if (effect->ops->init) {
1420 effect->ops->init(effect);
1437 uint32_t enabledMsk = effect->session->enabledMsk;
1439 effect->session->enabledMsk = 0;
1442 *(int *)pReplyData = Session_SetConfig(effect->session, (effect_config_t *)pCmdData);
1445 effect->session->enabledMsk = enabledMsk;
1451 if (effect->state != PREPROC_EFFECT_STATE_ACTIVE) {
1452 *(int *)pReplyData = Effect_SetState(effect, PREPROC_EFFECT_STATE_CONFIG);
1464 Session_GetConfig(effect->session, (effect_config_t *)pReplyData);
1476 *(int *)pReplyData = Session_SetReverseConfig(effect->session,
1490 Session_GetReverseConfig(effect->session, (effect_config_t *)pCmdData);
1494 if (effect->ops->reset) {
1495 effect->ops->reset(effect);
1517 if (effect->ops->get_parameter) {
1518 p->status = effect->ops->get_parameter(effect, p->data,
1541 if (effect->ops->set_parameter) {
1542 *(int *)pReplyData = effect->ops->set_parameter(effect,
1553 *(int *)pReplyData = Effect_SetState(effect, PREPROC_EFFECT_STATE_ACTIVE);
1561 *(int *)pReplyData = Effect_SetState(effect, PREPROC_EFFECT_STATE_CONFIG);
1572 if (effect->ops->set_device) {
1573 effect->ops->set_device(effect, *(uint32_t *)pCmdData);
1593 effect->aux_channels_on = sHasAuxChannels[effect->procId];
1595 effect->aux_channels_on = false;
1597 effect->cur_channel_config = (effect->session->inChannelCount == 1) ?
1657 !effect->aux_channels_on) {
1659 " fx %d", effect->procId);
1698 if (*(uint32_t *)pCmdData != EFFECT_FEATURE_AUX_CHANNELS || !effect->aux_channels_on) {
1707 &sDualMicConfigs[effect->cur_channel_config],
1712 "gDualMicEnabled %d effect->aux_channels_on %d",
1713 gDualMicEnabled, effect->aux_channels_on);
1727 if (*(uint32_t *)pCmdData != EFFECT_FEATURE_AUX_CHANNELS || !effect->aux_channels_on) {
1731 "CmdData %d effect->aux_channels_on %d",
1732 *(uint32_t *)pCmdData, effect->aux_channels_on);
1747 effect->cur_channel_config = i;
1764 preproc_effect_t * effect = (preproc_effect_t *) self;
1766 if (effect == NULL || pDescriptor == NULL) {
1770 *pDescriptor = *sDescriptors[effect->procId];
1779 preproc_effect_t * effect = (preproc_effect_t *)self;
1782 if (effect == NULL){
1783 ALOGW("PreProcessingFx_ProcessReverse() ERROR effect == NULL");
1786 preproc_session_t * session = (preproc_session_t *)effect->session;
1793 session->revProcessedMsk |= (1<<effect->procId);
1800 effect->session->revProcessedMsk = 0;
1864 effect->session->apm->AnalyzeReverseStream(session->revFrame);
1872 // effect_handle_t interface implementation for effect
1888 // Effect Library Interface Implementation