ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
**1.初始化SDK** ~~~ MHSDK.init(this,"你的授权密钥");//建议在Application子类的onCreate方法中初始化SDK ~~~ ***** **2.添加美狐UI组件** 在布局文件中添加美狐的UI组件 ``` <com.meihu.beauty.views.MeiHuBeautyControl android:layout_width="match_parent" android:layout_height="wrap_content"/> ``` ***** **3.在集成了美狐UI组件的Activity中初始化** ~~~ //初始化 MhDataManager.getInstance().create(this.getApplicationContext()); ~~~ **4.在腾讯云直播的自定义渲染方法中 调用美狐SDK的渲染方法** 实现TXLivePusher.VideoCustomProcessListener接口 调用 livePusher.setVideoProcessListener(this); 设置回调。 ~~~ @Override public int onTextureCustomProcess(int texture, int width, int height) { int faceScale = 4; //人脸识别对纹理的缩小倍数 int textureScale = 2;//图像渲染对纹理的缩小倍数 if (mDeviceLevel == DEVICE_LEVEL_HIGH) { textureScale = 1; } int newTexture = MhDataManager.getInstance().getMHBeautyManager().render12(texture,width,height,faceScale,textureScale); return newTexture; } ~~~