use of com.lansosdk.videoeditor.DrawPadView in project LanSoEditor_advance by LanSoSdk.
the class PictureSetRealTimeActivity method initDrawPad.
/**
* Step1: 初始化DrawPad
*/
private void initDrawPad() {
// 设置为自动刷新模式, 帧率为25
drawPadView.setUpdateMode(DrawPadUpdateMode.AUTO_FLUSH, 30);
// 使能实时录制,并设置录制后视频的宽度和高度, 码率, 帧率,保存路径.
drawPadView.setRealEncodeEnable(480, 480, 1000000, (int) 30, dstPath);
drawPadView.setOnDrawPadThreadProgressListener(new onDrawPadThreadProgressListener() {
@Override
public void onThreadProgress(DrawPad arg0, long arg1) {
if (arg1 >= 1000 * 1000 && isSwitched == false) {
bgLayer.switchBitmap(BitmapFactory.decodeFile("/sdcard/a2.jpg"));
isSwitched = true;
}
}
});
drawPadView.setOnDrawPadCompletedListener(new DrawPadCompleted());
drawPadView.setOnDrawPadProgressListener(new DrawPadProgressListener());
// 设置DrawPad的宽高, 这里设置为480x480,如果您已经在xml中固定大小,则不需要再次设置,
// 可以直接调用startDrawPad来开始录制.
drawPadView.setDrawPadSize(480, 480, new onDrawPadSizeChangedListener() {
@Override
public void onSizeChanged(int viewWidth, int viewHeight) {
// TODO Auto-generated method stub
startDrawPad();
}
});
// 这里仅仅是举例,当界面再次返回的时候,依旧显示图片更新的动画效果,即重新开始DrawPad, 很多时候是不需要这样的场景, 这里仅仅是举例
drawPadView.setOnViewAvailable(new onViewAvailable() {
@Override
public void viewAvailable(DrawPadView v) {
startDrawPad();
}
});
}
use of com.lansosdk.videoeditor.DrawPadView in project LanSoEditor_advance by LanSoSdk.
the class TextureLayerDemoActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.texturelayer_demo_layout);
drawPadView = (DrawPadView) findViewById(R.id.id_texturelayer_drawpadview);
findViewById(R.id.id_texturelayer_testbutton).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
selectFilter();
}
});
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
initDrawPad();
}
}, 200);
}
use of com.lansosdk.videoeditor.DrawPadView in project LanSoEditor_advance by LanSoSdk.
the class TwoVideoLayerActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.twovideolayer_demo_layout);
mVideoPath = getIntent().getStringExtra("videopath");
mDrawPadView = (DrawPadView) findViewById(R.id.id_twovideolayer_view);
mInfo = new MediaInfo(mVideoPath, false);
if (mInfo.prepare() == false) {
Toast.makeText(TwoVideoLayerActivity.this, "视频源文件错误!", Toast.LENGTH_SHORT).show();
this.finish();
}
playVideo = (LinearLayout) findViewById(R.id.id_twovideolayer_saveplay);
playVideo.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if (SDKFileUtils.fileExist(dstPath)) {
Intent intent = new Intent(TwoVideoLayerActivity.this, VideoPlayerActivity.class);
intent.putExtra("videopath", dstPath);
startActivity(intent);
} else {
Toast.makeText(TwoVideoLayerActivity.this, "目标文件不存在", Toast.LENGTH_SHORT).show();
}
}
});
playVideo.setVisibility(View.GONE);
findViewById(R.id.id_twovideolayer_testbutton).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if (twoVideoLayer != null) {
isDisplayed = !isDisplayed;
twoVideoLayer.setDisplayTexture2(isDisplayed);
}
}
});
// 在手机的默认路径下创建一个文件名,用来保存生成的视频文件,(在onDestroy中删除)
editTmpPath = SDKFileUtils.newMp4PathInBox();
dstPath = SDKFileUtils.newMp4PathInBox();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
startPlayVideo();
}
}, 500);
}
use of com.lansosdk.videoeditor.DrawPadView in project LanSoEditor_advance by LanSoSdk.
the class BitmapLayerFilterDemoActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.bitmaplayer_filter_layout);
initView();
drawPadView = (DrawPadView) findViewById(R.id.DrawPad_view);
// 在手机的默认路径下创建一个文件名,用来保存生成的视频文件,(在onDestroy中删除)
dstPath = SDKFileUtils.newMp4PathInBox();
mContext = getApplicationContext();
findViewById(R.id.id_bitmapfilter_demo_selectbtn).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
selectFilter();
}
});
AdjusterFilter = (SeekBar) findViewById(R.id.id_bitmapfilter_demo_seek1);
AdjusterFilter.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
if (mFilterAdjuster != null) {
mFilterAdjuster.adjust(progress);
}
}
});
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
initDrawPad();
}
}, 200);
}
use of com.lansosdk.videoeditor.DrawPadView in project LanSoEditor_advance by LanSoSdk.
the class CanvasLayerDemoActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.canvaslayer_demo_layout);
mVideoPath = getIntent().getStringExtra("videopath");
mInfo = new MediaInfo(mVideoPath, false);
if (mInfo.prepare() == false) {
Log.e(TAG, " video path is error.finish\n");
finish();
}
mDrawPadView = (DrawPadView) findViewById(R.id.id_canvaslayer_drawpadview);
playVideo = (LinearLayout) findViewById(R.id.id_canvasLayer_saveplay);
playVideo.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if (SDKFileUtils.fileExist(dstPath)) {
Intent intent = new Intent(CanvasLayerDemoActivity.this, VideoPlayerActivity.class);
intent.putExtra("videopath", dstPath);
startActivity(intent);
} else {
Toast.makeText(CanvasLayerDemoActivity.this, "目标文件不存在", Toast.LENGTH_SHORT).show();
}
}
});
playVideo.setVisibility(View.GONE);
// 在手机的默认路径下创建一个文件名,用来保存生成的视频文件,(在onDestroy中删除)
editTmpPath = SDKFileUtils.newMp4PathInBox();
dstPath = SDKFileUtils.newMp4PathInBox();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
// showHintDialog();
startPlayVideo();
}
}, 500);
}
Aggregations