Lines Matching refs:session

62     struct session_s *session;  // session the effect is on  member
162 static void session_set_fx_enabled(struct session_s *session, uint32_t id, bool enabled);
175 session_set_fx_enabled(effect->session, effect->id, false); in effect_set_state()
205 session_set_fx_enabled(effect->session, effect->id, false); in effect_set_state()
225 session_set_fx_enabled(effect->session, effect->id, true); in effect_set_state()
250 struct session_s *session, in effect_create() argument
253 effect->session = session; in effect_create()
268 static int session_init(struct session_s *session) in session_init() argument
273 session->state = SESSION_STATE_INIT; in session_init()
274 session->id = 0; in session_init()
275 session->io = 0; in session_init()
276 session->created_msk = 0; in session_init()
278 status = effect_init(&session->effects[i], i); in session_init()
284 static int session_create_effect(struct session_s *session, in session_create_effect() argument
291 id == AEC_ID ? "AEC" : id == NS_ID ? "NS" : "?", session->created_msk); in session_create_effect()
293 if (session->created_msk == 0) { in session_create_effect()
294 session->config.inputCfg.samplingRate = 16000; in session_create_effect()
295 session->config.inputCfg.channels = AUDIO_CHANNEL_IN_MONO; in session_create_effect()
296 session->config.inputCfg.format = AUDIO_FORMAT_PCM_16_BIT; in session_create_effect()
297 session->config.outputCfg.samplingRate = 16000; in session_create_effect()
298 session->config.outputCfg.channels = AUDIO_CHANNEL_IN_MONO; in session_create_effect()
299 session->config.outputCfg.format = AUDIO_FORMAT_PCM_16_BIT; in session_create_effect()
300 session->enabled_msk = 0; in session_create_effect()
301 session->processed_msk = 0; in session_create_effect()
303 status = effect_create(&session->effects[id], session, interface); in session_create_effect()
308 session->created_msk |= (1<<id); in session_create_effect()
315 static int session_release_effect(struct session_s *session, in session_release_effect() argument
320 session->created_msk &= ~(1<<fx->id); in session_release_effect()
321 if (session->created_msk == 0) in session_release_effect()
324 list_remove(&session->node); in session_release_effect()
325 free(session); in session_release_effect()
332 static int session_set_config(struct session_s *session, effect_config_t *config) in session_set_config() argument
345 if (session->enabled_msk) { in session_set_config()
346 if (session->config.inputCfg.samplingRate != config->inputCfg.samplingRate || in session_set_config()
347 session->config.inputCfg.channels != config->inputCfg.channels || in session_set_config()
348 session->config.outputCfg.channels != config->outputCfg.channels) in session_set_config()
354 memcpy(&session->config, config, sizeof(effect_config_t)); in session_set_config()
356 session->state = SESSION_STATE_CONFIG; in session_set_config()
360 static void session_get_config(struct session_s *session, effect_config_t *config) in session_get_config() argument
362 memcpy(config, &session->config, sizeof(effect_config_t)); in session_get_config()
369 static void session_set_fx_enabled(struct session_s *session, uint32_t id, bool enabled) in session_set_fx_enabled() argument
372 if(session->enabled_msk == 0) { in session_set_fx_enabled()
375 session->enabled_msk |= (1 << id); in session_set_fx_enabled()
377 session->enabled_msk &= ~(1 << id); in session_set_fx_enabled()
378 if(session->enabled_msk == 0) { in session_set_fx_enabled()
383 id, enabled, session->enabled_msk); in session_set_fx_enabled()
384 session->processed_msk = 0; in session_set_fx_enabled()
396 struct session_s *session; in get_session() local
399 session = node_to_item(node, struct session_s, node); in get_session()
400 if (session->io == ioId) { in get_session()
401 if (session->created_msk & (1 << id)) { in get_session()
405 ALOGV("get_session() found session %p", session); in get_session()
406 return session; in get_session()
410 session = (struct session_s *)calloc(1, sizeof(struct session_s)); in get_session()
411 session_init(session); in get_session()
412 session->id = sessionId; in get_session()
413 session->io = ioId; in get_session()
414 list_add_tail(&session_list, &session->node); in get_session()
416 ALOGV("get_session() created session %p", session); in get_session()
418 return session; in get_session()
482 struct session_s *session; in fx_process() local
495 session = (struct session_s *)effect->session; in fx_process()
497 session->processed_msk |= (1<<effect->id); in fx_process()
499 if ((session->processed_msk & session->enabled_msk) == session->enabled_msk) { in fx_process()
500 effect->session->processed_msk = 0; in fx_process()
536 *(int *)pReplyData = session_set_config(effect->session, (effect_config_t *)pCmdData); in fx_command()
552 session_get_config(effect->session, (effect_config_t *)pReplyData); in fx_command()
672 struct session_s *session; in lib_create() local
686 session = get_session(id, sessionId, ioId); in lib_create()
688 if (session == NULL) { in lib_create()
693 status = session_create_effect(session, id, pInterface); in lib_create()
695 if (status < 0 && session->created_msk == 0) { in lib_create()
696 list_remove(&session->node); in lib_create()
697 free(session); in lib_create()
705 struct session_s *session; in lib_release() local
714 session = node_to_item(node, struct session_s, node); in lib_release()
715 if (session == fx->session) { in lib_release()
716 session_release_effect(fx->session, fx); in lib_release()