1.設定自定義采集 (Configure custom collection)
~~~
private void setupLocalVideo(FrameLayout frameLayout,boolean top) {
if(mTextureCamera == null){
mTextureCamera = new TextureCamera(this, 640, 480);
mTextureCamera.setOnCaptureListener(new TextureCamera.OnCaptureListener() {
@Override
public int onTextureBufferAvailable(int textureId, byte[] buffer, int width, int height) {
int newTexture = textureId;
try {
if (mhBeautyManager == null) {
mhBeautyManager = new MHBeautyManager(getApplicationContext(),true);
mhBeautyManager.setBeautyDataModel(BeautyDataModel.getInstance());
if (beautyViewHolder != null) {
beautyViewHolder.setMhBeautyManager(mhBeautyManager);
}
}else{
if (mCameraFacing == Camera.CameraInfo.CAMERA_FACING_FRONT){
newTexture = mhBeautyManager.render10(textureId, width, height);
}else{
newTexture = mhBeautyManager.render11(textureId, width, height);
}
}
} catch (Exception e) {
e.printStackTrace();
}
return newTexture;
}
@Override
public void onCapturerStarted() {
Log.d(TAG, "onCapturerStarted() called");
}
@Override
public void onCapturerStopped() {
Log.d(TAG, "onCapturerStopped() called");
}
@Override
public void onCameraSwitched(int facing, int orientation) {
Log.d(TAG, "onCameraSwitched() called with: facing = [" + facing + "], orientation = [" + orientation + "]");
mCameraFacing = facing;
}
});
}
mLocalView = new AgoraSurfaceView(VideoLineActivity.this);
mLocalView.init(mTextureCamera.getEglContext());
mLocalView.setBufferType(MediaIO.BufferType.TEXTURE);
mLocalView.setPixelFormat(MediaIO.PixelFormat.TEXTURE_2D);
mLocalView.setZOrderOnTop(top);
mLocalView.setZOrderMediaOverlay(top);
frameLayout.addView(mLocalView);
mRtcEngine.setLocalVideoRenderer(mLocalView);
mRtcEngine.setVideoSource(mTextureCamera);
mTextureCamera.onResume();
}
~~~
2.切換大小屏的時候銷毀資源(Destroying resources while switching screens)
~~~
mTextureCamera.onPause();
mTextureCamera.release();
mTextureCamera = null;
mhBeautyManager.destroy();
mhBeautyManager = null;
~~~
3. 設置本地渲染(Setting up local render)
大屏(Big Screen)
~~~
setupLocalVideo(video_chat_big,false);
~~~
小屏(Small screen)
~~~
setupLocalVideo(video_chat_small,true);
~~~
- 一、產品簡介(Product introduction)
- 1.功能說明(Functional Specification)
- 2.平臺支持(Platform support)
- 3.官方鏈接(The official link)
- 二、集成指引(Integrated guidance)
- Android集成指引(Android Integration Guide)
- 1.概述(Overview)
- 2.接入說明(Access instructions)
- 3.詳細步驟(detailed steps)
- 4.具體直播平臺接入(Specific live broadcast platform access)
- 1.騰訊云直播(Tencent Cloud Live)
- 2.阿里云(Alibaba Cloud)
- 三、MHSDK美顏相關接口部分(MHSDK Interface related to beauty)
- Android相關接口文檔說明(Android MHSDK Interface related to beauty)
- 美顏相關接口文檔說明(Description of interfaces related to beauty)
- 四、常見問題(FAQ)
- Android常見問題(Android FAQ)
- 1.認證失敗原因(Cause of authentication failure)
- 2.調用美型、貼紙、特效、調用美型、貼紙、特效、哈哈鏡沒有效果(Call beauty stickers special effects funhouse mirror have no effect)
- 3.MHBeautyManager的特別聲明(Special statement from MHBeautyManager)
- 4.使用MHUI的注意事項(Considerations for using MHUI)
- 5.卡頓問題(Caton problem)
- 6.閃退問題(flash back problem)
- 7.貼紙無法下載(Stickers cannot be downloaded)
- 8.AndroidX騰訊云環境集成問題(AndroidX Tencent cloud environment integration problems)
- 9.導入新的sdk出現亂碼(Garbled characters appear when importing a new SDK)
- 10.彈出的UI有陰影效果(The UI that pops up has a shadow effect)
- 11.Android10出現網絡資源失敗請檢查網絡(Android10 network resource failure please check the network)
- 12.美狐可以記錄設置的各種參數嗎(Can us fox record various parameters set)
- 13.七牛云替換sdk畫面上下顛倒(Seven niuyun replacement SDK screen upside down)
- 14.貼紙可以自定義嗎(Can stickers be customized)
- 15.您這邊可以錄制視頻嗎(Can you record a video)
- 16.MHSDK必須本地依賴嗎(Does MHSDK have to be locally dependent)
- 17.找不到某個方法(I can't find a way)
- 18.環信不顯示自己的頭像框(Ring letter does not show your avatar box)
- 19.如何取消特效(How to Cancel special effects)
- 20.水印沒有找到(Watermark not found)
- 21.聲網視頻通話大小屏切換問題(The size screen switchover of sonnet video calls is abnormal)
- 22.如何切換sdk的語言