Search in sources :

Example 1 with DrawPadCameraView

use of com.lansosdk.videoeditor.DrawPadCameraView in project LanSoEditor_advance by LanSoSdk.

the class CameraLayerFullPortActivity method initDrawPad.

/**
 * Step1: 开始运行 DrawPad 容器
 */
private void initDrawPad() {
    int padWidth = 544;
    int padHeight = 960;
    /**
     * 设置录制时的一些参数.
     */
    mDrawPadCamera.setRealEncodeEnable(padWidth, padHeight, 3000 * 1024, (int) 25, dstPath);
    /**
     * 设置录制处理进度监听.
     */
    mDrawPadCamera.setOnDrawPadProgressListener(drawPadProgressListener);
    /**
     * 相机前后置.是否设置滤镜.
     */
    mDrawPadCamera.setCameraParam(false, null, true);
    /**
     * 当手动聚焦的时候, 返回聚焦点的位置,让focusView去显示一个聚焦的动画.
     */
    mDrawPadCamera.setCameraFocusListener(new doFousEventListener() {

        @Override
        public void onFocus(int x, int y) {
            focusView.startFocus(x, y);
        }
    });
    mDrawPadCamera.setRecordMic(true);
    /**
     * UI界面有效后, 开始开启DrawPad线程, 来预览画面.
     */
    mDrawPadCamera.setOnViewAvailable(new onViewAvailable() {

        @Override
        public void viewAvailable(DrawPadCameraView v) {
            startDrawPad();
        }
    });
    mDrawPadCamera.setOnDrawPadErrorListener(new onDrawPadErrorListener() {

        @Override
        public void onError(DrawPad d, int what) {
            Log.e(TAG, "DrawPad容器线程运行出错!!!" + what);
        }
    });
}
Also used : DrawPad(com.lansosdk.box.DrawPad) DrawPadCameraView(com.lansosdk.videoeditor.DrawPadCameraView) DrawPadCameraView.doFousEventListener(com.lansosdk.videoeditor.DrawPadCameraView.doFousEventListener) DrawPadCameraView.onViewAvailable(com.lansosdk.videoeditor.DrawPadCameraView.onViewAvailable) com.lansosdk.box.onDrawPadErrorListener(com.lansosdk.box.onDrawPadErrorListener)

Example 2 with DrawPadCameraView

use of com.lansosdk.videoeditor.DrawPadCameraView in project LanSoEditor_advance by LanSoSdk.

the class CameraLayerFullSegmentActivity method initDrawPad.

/**
 * 初始化 DrawPad 容器
 */
private void initDrawPad() {
    // 设置使能 实时录制, 即把正在DrawPad中呈现的画面实时的保存下来,实现所见即所得的模式
    DisplayMetrics dm = new DisplayMetrics();
    dm = getResources().getDisplayMetrics();
    int padWidth = 544;
    int padHeight = 960;
    if (!isRecordMp3) {
        // 如果不是录制音乐,则认为是录制外音.
        drawPadCamera.setRecordMic(true);
    }
    // 设置录制
    drawPadCamera.setRealEncodeEnable(padWidth, padHeight, 3000000, (int) 25, SDKFileUtils.newMp4PathInBox());
    drawPadCamera.setCameraParam(false, null, false);
    // 设置处理进度监听.
    drawPadCamera.setOnDrawPadProgressListener(drawPadProgressListener);
    drawPadCamera.setOnViewAvailable(new onViewAvailable() {

        @Override
        public void viewAvailable(DrawPadCameraView v) {
            startDrawPad();
        }
    });
}
Also used : DrawPadCameraView(com.lansosdk.videoeditor.DrawPadCameraView) DrawPadCameraView.onViewAvailable(com.lansosdk.videoeditor.DrawPadCameraView.onViewAvailable) DisplayMetrics(android.util.DisplayMetrics)

Example 3 with DrawPadCameraView

use of com.lansosdk.videoeditor.DrawPadCameraView in project LanSoEditor_advance by LanSoSdk.

the class CameraLayerFullSegmentActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    LanSongUtil.hideBottomUIMenu(this);
    setContentView(R.layout.cameralayer_fullsegment_layout);
    if (LanSongUtil.checkRecordPermission(getBaseContext()) == false) {
        Toast.makeText(getApplicationContext(), "请打开权限后,重试!!!", Toast.LENGTH_LONG).show();
        finish();
    }
    drawPadCamera = (DrawPadCameraView) findViewById(R.id.id_fullscreen_padview);
    initView();
    recorderVideoBtn.setOnTouchListener(new OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            switch(event.getAction()) {
                case MotionEvent.ACTION_DOWN:
                    segmentStart();
                    break;
                case // 录制结束.
                MotionEvent.ACTION_UP:
                    segmentStop();
                    break;
            }
            return true;
        }
    });
    dstPath = SDKFileUtils.newMp4PathInBox();
    // 开始录制.
    initDrawPad();
}
Also used : OnTouchListener(android.view.View.OnTouchListener) View(android.view.View) DrawPadCameraView(com.lansosdk.videoeditor.DrawPadCameraView) VideoProgressView(com.example.advanceDemo.view.VideoProgressView) TextView(android.widget.TextView) VideoFocusView(com.example.advanceDemo.view.VideoFocusView) DrawPadView(com.lansosdk.videoeditor.DrawPadView) MotionEvent(android.view.MotionEvent)

Example 4 with DrawPadCameraView

use of com.lansosdk.videoeditor.DrawPadCameraView in project LanSoEditor_advance by LanSoSdk.

the class CameraLayerFullLandscapeActivity method initDrawPad.

/**
 * Step1: 开始运行 DrawPad 容器
 */
private void initDrawPad() {
    // 因手机屏幕是16:9;全屏模式,建议分辨率设置为960x544;
    int padWidth = 960;
    int padHeight = 544;
    int bitrate = 3000 * 1024;
    int frameRate = 25;
    mDrawPadCamera.setRealEncodeEnable(padWidth, padHeight, bitrate, frameRate, dstPath);
    /**
     * 设置进度回调
     */
    mDrawPadCamera.setOnDrawPadProgressListener(drawPadProgressListener);
    mDrawPadCamera.setRecordMic(true);
    // 设置是否前置.
    mDrawPadCamera.setCameraParam(true, null, true);
    /**
     * 设置当聚焦时的UI动画.
     */
    mDrawPadCamera.setCameraFocusListener(new doFousEventListener() {

        @Override
        public void onFocus(int x, int y) {
            focusView.startFocus(x, y);
        }
    });
    mDrawPadCamera.setOnViewAvailable(new onViewAvailable() {

        @Override
        public void viewAvailable(DrawPadCameraView v) {
            startDrawPad();
        }
    });
}
Also used : DrawPadCameraView(com.lansosdk.videoeditor.DrawPadCameraView) DrawPadCameraView.doFousEventListener(com.lansosdk.videoeditor.DrawPadCameraView.doFousEventListener) DrawPadCameraView.onViewAvailable(com.lansosdk.videoeditor.DrawPadCameraView.onViewAvailable)

Example 5 with DrawPadCameraView

use of com.lansosdk.videoeditor.DrawPadCameraView in project LanSoEditor_advance by LanSoSdk.

the class CameraLayerFullPortWithMp3Activity method initDrawPad.

/**
 * Step1: 开始运行 DrawPad 容器
 */
private void initDrawPad() {
    int padWidth = 544;
    int padHeight = 960;
    // 码率
    int bitrate = 3000 * 1024;
    /**
     * 设置录制时的一些参数.
     */
    drawPadCamera.setRealEncodeEnable(padWidth, padHeight, bitrate, (int) 25, dstPath);
    /**
     * 设置录制处理进度监听.
     */
    drawPadCamera.setOnDrawPadProgressListener(drawPadProgressListener);
    /**
     * 相机前后置.是否设置滤镜.
     */
    drawPadCamera.setCameraParam(false, null, true);
    /**
     * 当手动聚焦的时候, 返回聚焦点的位置,让focusView去显示一个聚焦的动画.
     */
    drawPadCamera.setCameraFocusListener(new doFousEventListener() {

        @Override
        public void onFocus(int x, int y) {
            focusView.startFocus(x, y);
        }
    });
    /**
     * UI界面有效后, 开始开启DrawPad线程, 来预览画面.
     */
    drawPadCamera.setOnViewAvailable(new onViewAvailable() {

        @Override
        public void viewAvailable(DrawPadCameraView v) {
            startDrawPad();
        }
    });
    drawPadCamera.setOnDrawPadErrorListener(new onDrawPadErrorListener() {

        @Override
        public void onError(DrawPad d, int what) {
            Log.e(TAG, "DrawPad容器线程运行出错!!!" + what);
        }
    });
}
Also used : DrawPad(com.lansosdk.box.DrawPad) DrawPadCameraView(com.lansosdk.videoeditor.DrawPadCameraView) DrawPadCameraView.doFousEventListener(com.lansosdk.videoeditor.DrawPadCameraView.doFousEventListener) DrawPadCameraView.onViewAvailable(com.lansosdk.videoeditor.DrawPadCameraView.onViewAvailable) com.lansosdk.box.onDrawPadErrorListener(com.lansosdk.box.onDrawPadErrorListener)

Aggregations

DrawPadCameraView (com.lansosdk.videoeditor.DrawPadCameraView)9 DrawPadCameraView.onViewAvailable (com.lansosdk.videoeditor.DrawPadCameraView.onViewAvailable)7 DrawPad (com.lansosdk.box.DrawPad)5 DrawPadCameraView.doFousEventListener (com.lansosdk.videoeditor.DrawPadCameraView.doFousEventListener)5 com.lansosdk.box.onDrawPadErrorListener (com.lansosdk.box.onDrawPadErrorListener)4 View (android.view.View)2 TextView (android.widget.TextView)2 DrawPadView (com.lansosdk.videoeditor.DrawPadView)2 Paint (android.graphics.Paint)1 DisplayMetrics (android.util.DisplayMetrics)1 MotionEvent (android.view.MotionEvent)1 Surface (android.view.Surface)1 OnClickListener (android.view.View.OnClickListener)1 OnTouchListener (android.view.View.OnTouchListener)1 ImageView (android.widget.ImageView)1 FaceView (com.example.advanceDemo.view.FaceView)1 FocusImageView (com.example.advanceDemo.view.FocusImageView)1 VideoFocusView (com.example.advanceDemo.view.VideoFocusView)1 VideoProgressView (com.example.advanceDemo.view.VideoProgressView)1 LanSongAlphaPixelFilter (com.lansosdk.box.LanSongAlphaPixelFilter)1