Search in sources :

Example 1 with DrawPadView

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);
}
Also used : OnItemClickListener(android.widget.AdapterView.OnItemClickListener) SeekBar(android.widget.SeekBar) Intent(android.content.Intent) OnSeekBarChangeListener(android.widget.SeekBar.OnSeekBarChangeListener) GLSurfaceView(android.opengl.GLSurfaceView) HorizontalScrollView(android.widget.HorizontalScrollView) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) DrawPadView(com.lansosdk.videoeditor.DrawPadView) HorizontalListView(com.example.advanceDemo.view.HorizontalListView) Paint(android.graphics.Paint) GPUImageFilter(jp.co.cyberagent.lansongsdk.gpuimage.GPUImageFilter) OnClickListener(android.view.View.OnClickListener)

Example 2 with DrawPadView

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);
}
Also used : MediaInfo(com.lansosdk.videoeditor.MediaInfo) OnClickListener(android.view.View.OnClickListener) Handler(android.os.Handler) Intent(android.content.Intent) View(android.view.View) DrawPadView(com.lansosdk.videoeditor.DrawPadView) VideoPlayerActivity(com.example.advanceDemo.VideoPlayerActivity)

Example 3 with DrawPadView

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

Example 4 with DrawPadView

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);
}
Also used : OnClickListener(android.view.View.OnClickListener) Handler(android.os.Handler) Intent(android.content.Intent) GLSurfaceView(android.opengl.GLSurfaceView) View(android.view.View) TextView(android.widget.TextView) DrawPadView(com.lansosdk.videoeditor.DrawPadView)

Example 5 with DrawPadView

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);
}
Also used : MediaInfo(com.lansosdk.videoeditor.MediaInfo) OnClickListener(android.view.View.OnClickListener) Handler(android.os.Handler) Intent(android.content.Intent) GLSurfaceView(android.opengl.GLSurfaceView) ImageView(android.widget.ImageView) View(android.view.View) StereoView(com.example.advanceDemo.view.StereoView) TextView(android.widget.TextView) DrawPadView(com.lansosdk.videoeditor.DrawPadView) VideoPlayerActivity(com.example.advanceDemo.VideoPlayerActivity)

Aggregations

DrawPadView (com.lansosdk.videoeditor.DrawPadView)10 View (android.view.View)8 OnClickListener (android.view.View.OnClickListener)8 Handler (android.os.Handler)7 Intent (android.content.Intent)6 TextView (android.widget.TextView)5 MediaInfo (com.lansosdk.videoeditor.MediaInfo)4 GLSurfaceView (android.opengl.GLSurfaceView)3 CanvasRunnable (com.lansosdk.box.CanvasRunnable)3 Paint (android.graphics.Paint)2 SeekBar (android.widget.SeekBar)2 OnSeekBarChangeListener (android.widget.SeekBar.OnSeekBarChangeListener)2 VideoPlayerActivity (com.example.advanceDemo.VideoPlayerActivity)2 DrawPad (com.lansosdk.box.DrawPad)2 com.lansosdk.box.onDrawPadProgressListener (com.lansosdk.box.onDrawPadProgressListener)2 com.lansosdk.box.onDrawPadSizeChangedListener (com.lansosdk.box.onDrawPadSizeChangedListener)2 DrawPadView.onViewAvailable (com.lansosdk.videoeditor.DrawPadView.onViewAvailable)2 AdapterView (android.widget.AdapterView)1 OnItemClickListener (android.widget.AdapterView.OnItemClickListener)1 HorizontalScrollView (android.widget.HorizontalScrollView)1