use of com.lansosdk.videoeditor.MediaInfo in project LanSoEditor_advance by LanSoSdk.
the class VideoSpeedDemoActivity method initDrawPad.
private void initDrawPad() {
MediaInfo info = new MediaInfo(mVideoPath);
if (info.prepare()) {
drawPadView.setUpdateMode(DrawPadUpdateMode.ALL_VIDEO_READY, 25);
drawPadView.setDrawPadSize(480, 480, new onDrawPadSizeChangedListener() {
@Override
public void onSizeChanged(int viewWidth, int viewHeight) {
if (drawPadView.startDrawPad()) {
// 增加图层,开始播放呢.
addVideoLayer();
}
}
});
}
}
use of com.lansosdk.videoeditor.MediaInfo in project LanSoEditor_advance by LanSoSdk.
the class ViewLayerDemoActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.vview_drawimage_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();
}
drawPadView = (DrawPadView) findViewById(R.id.id_vview_realtime_drawpadview);
initView();
// 在手机的默认路径下创建一个文件名,用来保存生成的视频文件,(在onDestroy中删除)
editTmpPath = SDKFileUtils.newMp4PathInBox();
dstPath = SDKFileUtils.newMp4PathInBox();
// 演示例子用到的.
PaintConstants.SELECTOR.COLORING = true;
PaintConstants.SELECTOR.KEEP_IMAGE = true;
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
startPlayVideo();
}
}, 200);
}
use of com.lansosdk.videoeditor.MediaInfo in project LanSoEditor_advance by LanSoSdk.
the class ParticleDemoActivity method initDrawPad.
/**
* Step1: 设置DrawPad 容器的尺寸.
* 并设置是否实时录制容器上的内容.
*/
private void initDrawPad() {
MediaInfo info = new MediaInfo(mVideoPath, false);
if (info.prepare()) {
drawPadView.setRealEncodeEnable(480, 480, 1000000, (int) info.vFrameRate, editTmpPath);
drawPadView.setDrawPadSize(480, 480, new onDrawPadSizeChangedListener() {
@Override
public void onSizeChanged(int viewWidth, int viewHeight) {
startDrawPad();
}
});
}
}
use of com.lansosdk.videoeditor.MediaInfo in project LanSoEditor_advance by LanSoSdk.
the class ParticleDemoActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.particel_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();
}
drawPadView = (DrawPadView) findViewById(R.id.id_particle_drawpadview);
mLayerRelativeLayout = (ViewLayerRelativeLayout) findViewById(R.id.id_particle_viewlayerlayout);
particleLayout = (RelativeLayout) findViewById(R.id.id_particle_layout);
initView();
// 在手机的默认路径下创建一个文件名,用来保存生成的视频文件,(在onDestroy中删除)
editTmpPath = SDKFileUtils.newMp4PathInBox();
dstPath = SDKFileUtils.newMp4PathInBox();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
startPlayVideo();
}
}, 500);
}
use of com.lansosdk.videoeditor.MediaInfo in project LanSoEditor_advance by LanSoSdk.
the class ListMainActivity method checkPath.
private boolean checkPath() {
if (tvVideoPath.getText() != null && tvVideoPath.getText().toString().isEmpty()) {
Toast.makeText(ListMainActivity.this, "请输入视频地址", Toast.LENGTH_SHORT).show();
return false;
} else {
String path = tvVideoPath.getText().toString();
if ((new File(path)).exists() == false) {
Toast.makeText(ListMainActivity.this, "文件不存在", Toast.LENGTH_SHORT).show();
return false;
} else {
MediaInfo info = new MediaInfo(path, false);
boolean ret = info.prepare();
Log.i(TAG, "info:" + info.toString());
return ret;
}
}
}
Aggregations