可以参考一下这个源码的
https://wenku.baidu.com/view/cd8334e981c758f5f61f675c.html
这里有一个
https://download.csdn.net/download/qq_39167354/10169625