u32 ddl_close(u32 **ddl_handle) { struct ddl_context *ddl_context; struct ddl_client_context **ddl = (struct ddl_client_context **)ddl_handle; if (!ddl || !*ddl) { VIDC_LOGERR_STRING("ddl_close:Bad_handle"); return VCD_ERR_BAD_HANDLE; } ddl_context = ddl_get_context(); if (!DDL_IS_INITIALIZED(ddl_context)) { VIDC_LOGERR_STRING("ddl_close:Not_inited"); return VCD_ERR_ILLEGAL_OP; } if (!DDLCLIENT_STATE_IS(*ddl, DDL_CLIENT_OPEN)) { VIDC_LOGERR_STRING("ddl_close:Not_in_open_state"); return VCD_ERR_ILLEGAL_OP; } ddl_move_client_state(*ddl, DDL_CLIENT_INVALID); if ((*ddl)->decoding) { vcd_fw_transact(false, true, (*ddl)->codec_data.decoder.codec.codec); } else { vcd_fw_transact(false, false, (*ddl)->codec_data.encoder.codec.codec); } ddl_client_transact(DDL_FREE_CLIENT, ddl); return VCD_S_SUCCESS; }
u32 ddl_close(u32 **p_ddl_handle) { struct ddl_context_type *p_ddl_context; struct ddl_client_context_type **pp_ddl = (struct ddl_client_context_type **)p_ddl_handle; if (NULL == pp_ddl || NULL == *pp_ddl) { VIDC_LOGERR_STRING("ddl_close:Bad_handle"); return VCD_ERR_BAD_HANDLE; } p_ddl_context = ddl_get_context(); if (!DDL_IS_INITIALIZED(p_ddl_context)) { VIDC_LOGERR_STRING("ddl_close:Not_inited"); return VCD_ERR_ILLEGAL_OP; } if (!DDLCLIENT_STATE_IS(*pp_ddl, DDL_CLIENT_OPEN)) { VIDC_LOGERR_STRING("ddl_close:Not_in_open_state"); return VCD_ERR_ILLEGAL_OP; } ddl_move_client_state(*pp_ddl, DDL_CLIENT_INVALID); if ((*pp_ddl)->b_decoding) { vcd_fw_transact(FALSE, TRUE, (*pp_ddl)->codec_data.decoder.codec_type.e_codec); } else { vcd_fw_transact(FALSE, FALSE, (*pp_ddl)->codec_data.encoder.codec_type.e_codec); } ddl_client_transact(DDL_FREE_CLIENT, pp_ddl); return VCD_S_SUCCESS; }