use of com.lansosdk.videoeditor.MediaInfo in project LanSoEditor_advance by LanSoSdk.
the class Video2LayoutActivity method initDrawPad.
/**
* Step1: init Drawpad 初始化DrawPad
*/
private void initDrawPad() {
if (mplayerReady && mplayer2Ready) {
mInfo = new MediaInfo(mVideoPath, false);
if (mInfo.prepare()) {
drawPadView.setUpdateMode(DrawPadUpdateMode.ALL_VIDEO_READY, 25);
drawPadView.setRealEncodeEnable(480, 480, 1200000, (int) mInfo.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 VideoLayerAutoUpdateActivity method initDrawPad.
// Step1: 设置DrawPad 容器的尺寸.并设置是否实时录制容器上的内容.
private void initDrawPad() {
MediaInfo info = new MediaInfo(mVideoPath, false);
if (info.prepare()) {
mDrawPad.setRealEncodeEnable(480, 480, 1000000, (int) info.vFrameRate, dstPath);
// 25是帧率.
mDrawPad.setUpdateMode(DrawPadUpdateMode.AUTO_FLUSH, 25);
mDrawPad.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 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.MediaInfo in project LanSoEditor_advance by LanSoSdk.
the class VideoSpeedDemoActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.test_layplayer_layout);
drawPadView = (DrawPadView) findViewById(R.id.id_test_playerview);
findViewById(R.id.id_test_btn_pause).setOnClickListener(this);
findViewById(R.id.id_test_btn_speedslow).setOnClickListener(this);
findViewById(R.id.id_test_btn_speedfast).setOnClickListener(this);
findViewById(R.id.id_test_btn_speednormal).setOnClickListener(this);
skProgress = (SeekBar) findViewById(R.id.id_test_seekbar_play);
skProgress.setOnSeekBarChangeListener(this);
SeekBar speed = (SeekBar) findViewById(R.id.id_test_seekbar_speed);
speed.setOnSeekBarChangeListener(this);
mVideoPath = getIntent().getStringExtra("videopath");
mInfo = new MediaInfo(mVideoPath, false);
if (mInfo.prepare()) {
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 ViewLayerDemoActivity method initDrawPad.
/**
* Step1: 设置DrawPad 容器的尺寸.
* 并设置是否实时录制容器上的内容.
*/
private void initDrawPad() {
MediaInfo info = new MediaInfo(mVideoPath, false);
if (info.prepare()) {
drawPadView.setUpdateMode(DrawPadUpdateMode.AUTO_FLUSH, 25);
drawPadView.setRealEncodeEnable(480, 480, 1000000, (int) info.vFrameRate, editTmpPath);
drawPadView.setOnDrawPadProgressListener(new onDrawPadProgressListener() {
@Override
public void onProgress(DrawPad v, long currentTimeUs) {
if (// 在第7秒的时候, 不再显示.
currentTimeUs > 10 * 1000 * 1000) {
hideWord();
} else if (// 在第三秒的时候, 显示tvWord
currentTimeUs > 3 * 1000 * 1000) {
showWord();
}
}
});
drawPadView.setDrawPadSize(480, 480, new onDrawPadSizeChangedListener() {
@Override
public void onSizeChanged(int viewWidth, int viewHeight) {
startDrawPad();
}
});
}
}
Aggregations