static u32 ddl_channel_set_callback(struct ddl_context *ddl_context, u32 instance_id) { struct ddl_client_context *ddl; u32 ret = false; DDL_MSG_MED("ddl_channel_open_callback"); ddl = ddl_get_current_ddl_client_for_command(ddl_context, DDL_CMD_CHANNEL_SET); if (ddl) { ddl->cmd_state = DDL_CMD_INVALID; if (!DDLCLIENT_STATE_IS(ddl, DDL_CLIENT_WAIT_FOR_CHDONE)) { DDL_MSG_ERROR("STATE-CRITICAL-CHSET"); ddl_release_command_channel(ddl_context, ddl->command_channel); } else { DDL_MSG_LOW("CH_SET_DONE"); DDL_MSG_LOW("ddl_state_transition: %s ~~>" "DDL_CLIENT_WAIT_FOR_INITCODEC", ddl_get_state_string(ddl->client_state)); ddl->client_state = DDL_CLIENT_WAIT_FOR_INITCODEC; ddl->instance_id = instance_id; if (ddl->decoding) { if (vidc_msg_timing) ddl_calc_core_proc_time(__func__, DEC_OP_TIME); if (ddl->codec_data.decoder.header_in_start) ddl_vidc_decode_init_codec(ddl); else { ddl_context->ddl_callback( VCD_EVT_RESP_START, VCD_S_SUCCESS, NULL, 0, (u32 *)ddl, ddl->client_data); ddl_release_command_channel( ddl_context, ddl->command_channel); ret = true; } } else ddl_vidc_encode_init_codec(ddl); } } return ret; }
static u32 ddl_channel_set_callback(struct ddl_context_type *p_ddl_context, u32 n_instance_id) { struct ddl_client_context_type *p_ddl; u32 b_ret = FALSE; DDL_MSG_MED("ddl_channel_open_callback"); p_ddl = ddl_get_current_ddl_client_for_command(p_ddl_context, DDL_CMD_CHANNEL_SET); if (p_ddl) { p_ddl->e_cmd_state = DDL_CMD_INVALID; if (!DDLCLIENT_STATE_IS(p_ddl, DDL_CLIENT_WAIT_FOR_CHDONE)) { DDL_MSG_ERROR("STATE-CRITICAL-CHSET"); ddl_release_command_channel(p_ddl_context, p_ddl->n_command_channel); } else { DDL_MSG_LOW("CH_SET_DONE"); DDL_MSG_LOW("ddl_state_transition: %s ~~>\ DDL_CLIENT_WAIT_FOR_INITCODEC", ddl_get_state_string(p_ddl->e_client_state)); p_ddl->e_client_state = DDL_CLIENT_WAIT_FOR_INITCODEC; p_ddl->n_channel_id = n_instance_id; if (p_ddl->b_decoding) { if (p_ddl->codec_data.decoder.b_header_in_start) ddl_vidc_decode_init_codec(p_ddl); else { p_ddl_context->ddl_callback( VCD_EVT_RESP_START, VCD_S_SUCCESS, NULL, 0, (u32 *)p_ddl, p_ddl->p_client_data); ddl_release_command_channel( p_ddl_context, p_ddl->n_command_channel); b_ret = TRUE; } } else ddl_vidc_encode_init_codec(p_ddl); } } return b_ret; }