企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
通过设置视频帧监听的方式,来进行美狐相关功能的渲染。 ``` mUMediaStreamManager.setVideoFrameListener(this)//设置监听 //回调处理     @Override     public void onSurfaceCreated() {         if (mhBeautyManager == null) {             mhBeautyManager = new MHBeautyManager(getApplicationContext(), true); mhBeautyManager.setBeautyDataModel(BeautyDataModel.getInstance());             if (beautyViewHolder != null) { beautyViewHolder.setMhBeautyManager(mhBeautyManager);             }         }     }     @Override     public void onSurfaceChanged(int width, int height) {}     @Override     public void onSurfaceDestroyed() {         Log.i(TAG, "onSurfaceDestroyed");         if(mhBeautyManager!=null){             mhBeautyManager.destroy();             mhBeautyManager = null;         }     }     @Override public int onDrawFrame(int texId, int texWidth, int texHeight) {         int  newTex = texId;         if(mhBeautyManager!=null){             int textId =   mhBeautyManager.render(texId,texWidth,texHeight);             if(textId!=-1){                 newTex = textId;             }         }         return newTex;     } ```