use of jp.co.cyberagent.lansongsdk.gpuimage.LanSongBeautyAdvanceFilter in project LanSoEditor_advance by LanSoSdk.
the class CameraLayerKTVDemoActivity method initDrawPad.
/**
* Step1: 开始运行 DrawPad 容器
*/
private void initDrawPad() {
// 因手机屏幕是16:9;全屏模式,建议分辨率设置为960x544;
int padWidth = 960;
int padHeight = 544;
int bitrate = 3000 * 1024;
int frameRate = 25;
drawPadCamera.setRealEncodeEnable(padWidth, padHeight, bitrate, frameRate, dstPath);
/**
* 设置进度回调
*/
drawPadCamera.setOnDrawPadProgressListener(drawPadProgressListener);
drawPadCamera.setOnDrawPadThreadProgressListener(new onDrawPadThreadProgressListener() {
@Override
public void onThreadProgress(DrawPad v, long currentTimeUs) {
// 如果第二个视频要切换
if (isChangedVideo) {
// 重新增加这个图层.
drawPadCamera.removeLayer(currentLayer);
currentLayer = null;
currentLayer = drawPadCamera.addVideoLayer(videoWidth, videoHeight, null);
drawPadCamera.changeLayerPosition(currentLayer, 0);
if (vplayer2 != null) {
vplayer2.setSurface(new Surface(currentLayer.getVideoTexture()));
vplayer2.start();
} else if (vplayer3 != null) {
vplayer3.setSurface(new Surface(currentLayer.getVideoTexture()));
vplayer3.start();
}
isChangedVideo = false;
}
}
});
drawPadCamera.setRecordMic(true);
alphaPixelFilter = new LanSongAlphaPixelFilter();
beautyFilter = new LanSongBeautyAdvanceFilter();
// drawPadCamera.setCameraParam(false, beautyFilter,true); //设置为美颜.
// 设置是否前置.
drawPadCamera.setCameraParam(false, alphaPixelFilter, true);
drawPadCamera.setOnViewAvailable(new onViewAvailable() {
@Override
public void viewAvailable(DrawPadCameraView v) {
startDrawPad();
}
});
}
Aggregations