use of com.lansosdk.videoeditor.DrawPadView in project LanSoEditor_advance by LanSoSdk.
the class Demo3LayerFilterActivity method initView.
private void initView() {
findViewById(R.id.id_filterLayer_demo_next).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (mplayer != null) {
mplayer.stop();
mplayer.release();
mplayer = null;
}
drawPadView.stopDrawPad();
filterExecute();
}
});
listFilterView = (HorizontalListView) findViewById(R.id.id_filterlayer_filterlist);
listFilterView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
if (filterLayer != null) {
GPUImageFilter filter = filterList.getFilter(getApplicationContext(), arg2);
currrentFilterName = filterList.getName(arg2);
filterLayer.switchFilterTo(filter);
}
}
});
drawPadView = (DrawPadView) findViewById(R.id.id_filterLayer_demo_view);
skbarFilterAdjuster = (SeekBar) findViewById(R.id.id_filterLayer_demo_seek1);
skbarFilterAdjuster.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);
}
}
});
skbarFilterAdjuster.setMax(100);
findViewById(R.id.id_filterLayer_demo_selectbtn).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
selectFilter();
}
});
findViewById(R.id.id_filterdemo_saveplay).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (SDKFileUtils.fileExist(dstPath)) {
Intent intent = new Intent(Demo3LayerFilterActivity.this, VideoPlayerActivity.class);
intent.putExtra("videopath", dstPath);
startActivity(intent);
} else {
Toast.makeText(Demo3LayerFilterActivity.this, "目标文件不存在", Toast.LENGTH_SHORT).show();
}
}
});
findViewById(R.id.id_filterdemo_saveplay).setVisibility(View.GONE);
}
use of com.lansosdk.videoeditor.DrawPadView in project LanSoEditor_advance by LanSoSdk.
the class OutBodyDemoActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.outbody_demo_layout);
srcVideoPath = getIntent().getStringExtra("videopath");
mInfo = new MediaInfo(srcVideoPath, false);
if (mInfo.prepare() == false) {
Toast.makeText(this, "传递过来的视频文件错误", Toast.LENGTH_SHORT).show();
this.finish();
}
mDrawPadView = (DrawPadView) findViewById(R.id.id_outbody_drawpadview);
btnTest = (Button) findViewById(R.id.id_outbody_testbutton);
btnTest.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (mainVideoLayer != null) {
mainVideoLayer.setSubImageEnable(false);
}
}
});
playVideo = (LinearLayout) findViewById(R.id.id_outbody_saveplay);
playVideo.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (SDKFileUtils.fileExist(dstPath)) {
Intent intent = new Intent(OutBodyDemoActivity.this, VideoPlayerActivity.class);
intent.putExtra("videopath", dstPath);
startActivity(intent);
} else {
Toast.makeText(OutBodyDemoActivity.this, "目标文件不存在", Toast.LENGTH_SHORT).show();
}
}
});
playVideo.setVisibility(View.GONE);
editTmpPath = SDKFileUtils.newMp4PathInBox();
dstPath = SDKFileUtils.newMp4PathInBox();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
// showHintDialog();
startPlayVideo();
}
}, 300);
}
use of com.lansosdk.videoeditor.DrawPadView in project LanSoEditor_advance by LanSoSdk.
the class MVLayerDemoActivity method initDrawPad.
/**
* Step1: 开始运行 DrawPad 容器
*/
private void initDrawPad() {
// 设置使能 实时录制, 即把正在DrawPad中呈现的画面实时的保存下来,实现所见即所得的模式
mDrawPadView.setRealEncodeEnable(480, 480, 1000000, (int) mInfo.vFrameRate, editTmpPath);
mDrawPadView.setOnDrawPadProgressListener(new onDrawPadProgressListener() {
@Override
public void onProgress(DrawPad v, long currentTimeUs) {
// TODO Auto-generated method stub
// Log.i(TAG,"MV当前时间戳是"+currentTimeUs);
}
});
// 设置当前DrawPad的宽度和高度,并把宽度自动缩放到父view的宽度,然后等比例调整高度.
mDrawPadView.setDrawPadSize(480, 480, new onDrawPadSizeChangedListener() {
@Override
public void onSizeChanged(int viewWidth, int viewHeight) {
// 开始DrawPad的渲染线程.
startDrawPad();
}
});
mDrawPadView.setOnViewAvailable(new onViewAvailable() {
@Override
public void viewAvailable(DrawPadView v) {
startPlayVideo();
}
});
}
use of com.lansosdk.videoeditor.DrawPadView in project LanSoEditor_advance by LanSoSdk.
the class ViewLayerOnlyActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.viewpen_preview_layout);
drawPadView = (DrawPadView) findViewById(R.id.id_viewLayer_DrawPad_view);
findViewById(R.id.id_viewLayer_saveplay).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (SDKFileUtils.fileExist(dstPath)) {
Intent intent = new Intent(ViewLayerOnlyActivity.this, VideoPlayerActivity.class);
intent.putExtra("videopath", dstPath);
startActivity(intent);
} else {
Toast.makeText(ViewLayerOnlyActivity.this, "目标文件不存在", Toast.LENGTH_SHORT).show();
}
}
});
findViewById(R.id.id_viewLayer_saveplay).setVisibility(View.GONE);
mGLRelativeLayout = (ViewLayerRelativeLayout) findViewById(R.id.id_viewLayer_gllayout);
textSurface = (TextSurface) findViewById(R.id.text_surface);
/**
* 在手机的默认路径下创建一个文件名,用来保存生成的视频文件,
* (在onDestroy中删除)
*/
editorTmpPath = SDKFileUtils.newMp4PathInBox();
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 VViewImage3DDemoActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.vview_image3d_demo_layout);
mVideoPath = getIntent().getStringExtra("videopath");
mInfo = new MediaInfo(mVideoPath, false);
if (mInfo.prepare() == false) {
Toast.makeText(this, "传递过来的视频文件错误", Toast.LENGTH_SHORT).show();
this.finish();
}
drawpadView = (DrawPadView) findViewById(R.id.id_image3d_drawpadview);
mGLRelativeLayout = (ViewLayerRelativeLayout) findViewById(R.id.id_image3d_viewlayout);
mStereoView = (StereoView) findViewById(R.id.id_image3d_stereoView);
mStereoView.setVisibility(View.INVISIBLE);
findViewById(R.id.id_image3d_saveplay).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (SDKFileUtils.fileExist(dstPath)) {
Intent intent = new Intent(VViewImage3DDemoActivity.this, VideoPlayerActivity.class);
intent.putExtra("videopath", dstPath);
startActivity(intent);
} else {
Toast.makeText(VViewImage3DDemoActivity.this, "目标文件不存在", Toast.LENGTH_SHORT).show();
}
}
});
findViewById(R.id.id_image3d_saveplay).setVisibility(View.GONE);
editTmpPath = SDKFileUtils.newMp4PathInBox();
dstPath = SDKFileUtils.newMp4PathInBox();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
startPlayVideo();
}
}, 300);
}
Aggregations