use of com.lansosdk.videoeditor.DrawPadCameraView in project LanSoEditor_advance by LanSoSdk.
the class CameraLayerFullPortActivity method initDrawPad.
/**
* Step1: 开始运行 DrawPad 容器
*/
private void initDrawPad() {
int padWidth = 544;
int padHeight = 960;
/**
* 设置录制时的一些参数.
*/
mDrawPadCamera.setRealEncodeEnable(padWidth, padHeight, 3000 * 1024, (int) 25, dstPath);
/**
* 设置录制处理进度监听.
*/
mDrawPadCamera.setOnDrawPadProgressListener(drawPadProgressListener);
/**
* 相机前后置.是否设置滤镜.
*/
mDrawPadCamera.setCameraParam(false, null, true);
/**
* 当手动聚焦的时候, 返回聚焦点的位置,让focusView去显示一个聚焦的动画.
*/
mDrawPadCamera.setCameraFocusListener(new doFousEventListener() {
@Override
public void onFocus(int x, int y) {
focusView.startFocus(x, y);
}
});
mDrawPadCamera.setRecordMic(true);
/**
* UI界面有效后, 开始开启DrawPad线程, 来预览画面.
*/
mDrawPadCamera.setOnViewAvailable(new onViewAvailable() {
@Override
public void viewAvailable(DrawPadCameraView v) {
startDrawPad();
}
});
mDrawPadCamera.setOnDrawPadErrorListener(new onDrawPadErrorListener() {
@Override
public void onError(DrawPad d, int what) {
Log.e(TAG, "DrawPad容器线程运行出错!!!" + what);
}
});
}
use of com.lansosdk.videoeditor.DrawPadCameraView in project LanSoEditor_advance by LanSoSdk.
the class CameraLayerFullSegmentActivity method initDrawPad.
/**
* 初始化 DrawPad 容器
*/
private void initDrawPad() {
// 设置使能 实时录制, 即把正在DrawPad中呈现的画面实时的保存下来,实现所见即所得的模式
DisplayMetrics dm = new DisplayMetrics();
dm = getResources().getDisplayMetrics();
int padWidth = 544;
int padHeight = 960;
if (!isRecordMp3) {
// 如果不是录制音乐,则认为是录制外音.
drawPadCamera.setRecordMic(true);
}
// 设置录制
drawPadCamera.setRealEncodeEnable(padWidth, padHeight, 3000000, (int) 25, SDKFileUtils.newMp4PathInBox());
drawPadCamera.setCameraParam(false, null, false);
// 设置处理进度监听.
drawPadCamera.setOnDrawPadProgressListener(drawPadProgressListener);
drawPadCamera.setOnViewAvailable(new onViewAvailable() {
@Override
public void viewAvailable(DrawPadCameraView v) {
startDrawPad();
}
});
}
use of com.lansosdk.videoeditor.DrawPadCameraView in project LanSoEditor_advance by LanSoSdk.
the class CameraLayerFullSegmentActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LanSongUtil.hideBottomUIMenu(this);
setContentView(R.layout.cameralayer_fullsegment_layout);
if (LanSongUtil.checkRecordPermission(getBaseContext()) == false) {
Toast.makeText(getApplicationContext(), "请打开权限后,重试!!!", Toast.LENGTH_LONG).show();
finish();
}
drawPadCamera = (DrawPadCameraView) findViewById(R.id.id_fullscreen_padview);
initView();
recorderVideoBtn.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch(event.getAction()) {
case MotionEvent.ACTION_DOWN:
segmentStart();
break;
case // 录制结束.
MotionEvent.ACTION_UP:
segmentStop();
break;
}
return true;
}
});
dstPath = SDKFileUtils.newMp4PathInBox();
// 开始录制.
initDrawPad();
}
use of com.lansosdk.videoeditor.DrawPadCameraView in project LanSoEditor_advance by LanSoSdk.
the class CameraLayerFullLandscapeActivity method initDrawPad.
/**
* Step1: 开始运行 DrawPad 容器
*/
private void initDrawPad() {
// 因手机屏幕是16:9;全屏模式,建议分辨率设置为960x544;
int padWidth = 960;
int padHeight = 544;
int bitrate = 3000 * 1024;
int frameRate = 25;
mDrawPadCamera.setRealEncodeEnable(padWidth, padHeight, bitrate, frameRate, dstPath);
/**
* 设置进度回调
*/
mDrawPadCamera.setOnDrawPadProgressListener(drawPadProgressListener);
mDrawPadCamera.setRecordMic(true);
// 设置是否前置.
mDrawPadCamera.setCameraParam(true, null, true);
/**
* 设置当聚焦时的UI动画.
*/
mDrawPadCamera.setCameraFocusListener(new doFousEventListener() {
@Override
public void onFocus(int x, int y) {
focusView.startFocus(x, y);
}
});
mDrawPadCamera.setOnViewAvailable(new onViewAvailable() {
@Override
public void viewAvailable(DrawPadCameraView v) {
startDrawPad();
}
});
}
use of com.lansosdk.videoeditor.DrawPadCameraView in project LanSoEditor_advance by LanSoSdk.
the class CameraLayerFullPortWithMp3Activity method initDrawPad.
/**
* Step1: 开始运行 DrawPad 容器
*/
private void initDrawPad() {
int padWidth = 544;
int padHeight = 960;
// 码率
int bitrate = 3000 * 1024;
/**
* 设置录制时的一些参数.
*/
drawPadCamera.setRealEncodeEnable(padWidth, padHeight, bitrate, (int) 25, dstPath);
/**
* 设置录制处理进度监听.
*/
drawPadCamera.setOnDrawPadProgressListener(drawPadProgressListener);
/**
* 相机前后置.是否设置滤镜.
*/
drawPadCamera.setCameraParam(false, null, true);
/**
* 当手动聚焦的时候, 返回聚焦点的位置,让focusView去显示一个聚焦的动画.
*/
drawPadCamera.setCameraFocusListener(new doFousEventListener() {
@Override
public void onFocus(int x, int y) {
focusView.startFocus(x, y);
}
});
/**
* UI界面有效后, 开始开启DrawPad线程, 来预览画面.
*/
drawPadCamera.setOnViewAvailable(new onViewAvailable() {
@Override
public void viewAvailable(DrawPadCameraView v) {
startDrawPad();
}
});
drawPadCamera.setOnDrawPadErrorListener(new onDrawPadErrorListener() {
@Override
public void onError(DrawPad d, int what) {
Log.e(TAG, "DrawPad容器线程运行出错!!!" + what);
}
});
}
Aggregations