Search in sources :

Example 16 with MediaInfo

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();
                }
            }
        });
    }
}
Also used : com.lansosdk.box.onDrawPadSizeChangedListener(com.lansosdk.box.onDrawPadSizeChangedListener) MediaInfo(com.lansosdk.videoeditor.MediaInfo)

Example 17 with MediaInfo

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);
}
Also used : MediaInfo(com.lansosdk.videoeditor.MediaInfo) Handler(android.os.Handler)

Example 18 with MediaInfo

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();
            }
        });
    }
}
Also used : com.lansosdk.box.onDrawPadSizeChangedListener(com.lansosdk.box.onDrawPadSizeChangedListener) MediaInfo(com.lansosdk.videoeditor.MediaInfo) Paint(android.graphics.Paint)

Example 19 with MediaInfo

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);
}
Also used : MediaInfo(com.lansosdk.videoeditor.MediaInfo) Handler(android.os.Handler)

Example 20 with MediaInfo

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;
        }
    }
}
Also used : MediaInfo(com.lansosdk.videoeditor.MediaInfo) File(java.io.File)

Aggregations

MediaInfo (com.lansosdk.videoeditor.MediaInfo)59 Handler (android.os.Handler)12 com.lansosdk.box.onDrawPadSizeChangedListener (com.lansosdk.box.onDrawPadSizeChangedListener)9 Paint (android.graphics.Paint)8 TextView (android.widget.TextView)6 Intent (android.content.Intent)5 View (android.view.View)5 OnClickListener (android.view.View.OnClickListener)5 CanvasRunnable (com.lansosdk.box.CanvasRunnable)5 DrawPad (com.lansosdk.box.DrawPad)5 Bitmap (android.graphics.Bitmap)4 DrawPadView (com.lansosdk.videoeditor.DrawPadView)4 File (java.io.File)3 SurfaceTexture (android.graphics.SurfaceTexture)2 MediaPlayer (android.media.MediaPlayer)2 DisplayMetrics (android.util.DisplayMetrics)2 Surface (android.view.Surface)2 SurfaceTextureListener (android.view.TextureView.SurfaceTextureListener)2 VideoPlayerActivity (com.example.advanceDemo.VideoPlayerActivity)2 DrawPadVideoRunnable (com.lansosdk.box.DrawPadVideoRunnable)2