Search in sources :

Example 6 with PreviewProgressListener

use of android.media.videoeditor.VideoEditor.PreviewProgressListener in project android_frameworks_base by ParanoidAndroid.

the class VideoEditorPreviewTest method testStartPreviewWithoutMediaItems.

/**
     * To Test Preview : Without any Media Items in the story Board
     */
@LargeTest
public void testStartPreviewWithoutMediaItems() throws Exception {
    boolean flagForException = false;
    final SurfaceHolder surfaceHolder = MediaFrameworkTest.mSurfaceView.getHolder();
    try {
        mVideoEditor.startPreview(surfaceHolder, 0, -1, false, 1, new PreviewProgressListener() {

            public void onProgress(VideoEditor videoEditor, long timeMs, OverlayData overlayData) {
            }

            public void onStart(VideoEditor videoEditor) {
                setPreviewStart();
            }

            public void onStop(VideoEditor videoEditor) {
                setPreviewStop();
            }

            public void onError(VideoEditor videoEditor, int error) {
                setPreviewError();
            }
        });
    } catch (IllegalArgumentException e) {
        flagForException = true;
    }
    assertTrue("Preview without Media Items", flagForException);
}
Also used : SurfaceHolder(android.view.SurfaceHolder) VideoEditor(android.media.videoeditor.VideoEditor) PreviewProgressListener(android.media.videoeditor.VideoEditor.PreviewProgressListener) OverlayData(android.media.videoeditor.VideoEditor.OverlayData) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Aggregations

VideoEditor (android.media.videoeditor.VideoEditor)6 OverlayData (android.media.videoeditor.VideoEditor.OverlayData)6 PreviewProgressListener (android.media.videoeditor.VideoEditor.PreviewProgressListener)6 SurfaceHolder (android.view.SurfaceHolder)6 LargeTest (android.test.suitebuilder.annotation.LargeTest)5 MediaVideoItem (android.media.videoeditor.MediaVideoItem)4 MediaProcessingProgressListener (android.media.videoeditor.VideoEditor.MediaProcessingProgressListener)4 IOException (java.io.IOException)4 Semaphore (java.util.concurrent.Semaphore)4 MediaImageItem (android.media.videoeditor.MediaImageItem)2 TransitionAlpha (android.media.videoeditor.TransitionAlpha)2 EffectColor (android.media.videoeditor.EffectColor)1 Transition (android.media.videoeditor.Transition)1 TransitionCrossfade (android.media.videoeditor.TransitionCrossfade)1 TransitionFadeBlack (android.media.videoeditor.TransitionFadeBlack)1 TransitionSliding (android.media.videoeditor.TransitionSliding)1 ExportProgressListener (android.media.videoeditor.VideoEditor.ExportProgressListener)1