Search in sources :

Example 81 with LargeTest

use of android.test.suitebuilder.annotation.LargeTest in project android_frameworks_base by ParanoidAndroid.

the class MediaPresetReverbTest method test0_0ConstructorAndRelease.

//-----------------------------------------------------------------
// PRESET REVEB TESTS:
//----------------------------------
//-----------------------------------------------------------------
// 0 - constructor
//----------------------------------
//Test case 0.0: test constructor and release
@LargeTest
public void test0_0ConstructorAndRelease() throws Exception {
    boolean result = false;
    String msg = "test1_0ConstructorAndRelease()";
    PresetReverb reverb = null;
    try {
        reverb = new PresetReverb(0, 0);
        assertNotNull(msg + ": could not create PresetReverb", reverb);
        try {
            assertTrue(msg + ": invalid effect ID", (reverb.getId() != 0));
        } catch (IllegalStateException e) {
            msg = msg.concat(": PresetReverb not initialized");
        }
        result = true;
    } catch (IllegalArgumentException e) {
        msg = msg.concat(": PresetReverb not found");
    } catch (UnsupportedOperationException e) {
        msg = msg.concat(": Effect library not loaded");
    } finally {
        if (reverb != null) {
            reverb.release();
        }
    }
    assertTrue(msg, result);
}
Also used : PresetReverb(android.media.audiofx.PresetReverb) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 82 with LargeTest

use of android.test.suitebuilder.annotation.LargeTest in project android_frameworks_base by ParanoidAndroid.

the class MediaItemThumbnailTest method testThumbnailListMPEG4QCIF.

/**
     *To test ThumbnailList for MPEG4 QCIF
     */
@LargeTest
public void testThumbnailListMPEG4QCIF() throws Exception {
    final String videoItemFilename = INPUT_FILE_PATH + "MPEG4_SP_176x144_30fps_256kbps_AACLC_44.1kHz_96kbps_s_1_17.3gp";
    final int tnCount = 10;
    final int renderingMode = MediaItem.RENDERING_MODE_BLACK_BORDER;
    final MediaVideoItem mediaVideoItem = mVideoEditorHelper.createMediaItem(mVideoEditor, "m1", videoItemFilename, renderingMode);
    final int outWidth = mediaVideoItem.getWidth() / 2;
    final int outHeight = mediaVideoItem.getHeight() / 2;
    final long startTime = mediaVideoItem.getDuration() / 2;
    final long endTime = mediaVideoItem.getDuration();
    final Bitmap[] thumbNailBmp = mediaVideoItem.getThumbnailList(outWidth, outHeight, startTime, endTime, tnCount);
    assertNotNull("Thumbnail Retrived is Null", thumbNailBmp);
    assertEquals("Thumbnail Count", tnCount, thumbNailBmp.length);
    for (int i = 0; i < thumbNailBmp.length; i++) {
        validateThumbnail(thumbNailBmp[i], outWidth, outHeight);
        thumbNailBmp[i] = null;
    }
}
Also used : Bitmap(android.graphics.Bitmap) MediaVideoItem(android.media.videoeditor.MediaVideoItem) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 83 with LargeTest

use of android.test.suitebuilder.annotation.LargeTest in project android_frameworks_base by ParanoidAndroid.

the class MediaPropertiesTest method testPropertiesH264HD1280.

/**
     *To test Media Properties for file H264 HD1280
     */
@LargeTest
public void testPropertiesH264HD1280() throws Exception {
    final String videoItemFilename = INPUT_FILE_PATH + "H264_BP_1280x720_15fps_512kbps_AACLC_16khz_48kbps_s_1_17.mp4";
    final int aspectRatio = MediaProperties.ASPECT_RATIO_16_9;
    final int fileType = MediaProperties.FILE_MP4;
    final int videoCodecType = MediaProperties.VCODEC_H264;
    final int duration = 77600;
    final int videoBitrate = 606000;
    final int audioBitrate = 48000;
    final int fps = 15;
    final int audioCodecType = MediaProperties.ACODEC_AAC_LC;
    final int audioSamplingFrequency = 16000;
    final int audioChannel = 2;
    final int videoProfile = MediaProperties.H264Profile.H264ProfileBaseline;
    final int videoLevel = MediaProperties.H264Level.H264Level13;
    final int width = 1280;
    final int height = MediaProperties.HEIGHT_720;
    final int renderingMode = MediaItem.RENDERING_MODE_BLACK_BORDER;
    final MediaVideoItem mvi = mVideoEditorHelper.createMediaItem(mVideoEditor, "m1", videoItemFilename, renderingMode);
    validateVideoProperties(aspectRatio, fileType, videoCodecType, duration, videoBitrate, fps, videoProfile, videoLevel, width, height, audioCodecType, audioSamplingFrequency, audioChannel, audioBitrate, mvi);
}
Also used : MediaVideoItem(android.media.videoeditor.MediaVideoItem) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 84 with LargeTest

use of android.test.suitebuilder.annotation.LargeTest in project android_frameworks_base by ParanoidAndroid.

the class MediaPropertiesTest method testPropertiesH264MainLineProfile.

/**
     *To test media properties for H.264 Main/Advanced profile.
     */
@LargeTest
public void testPropertiesH264MainLineProfile() throws Exception {
    final String videoItemFilename = INPUT_FILE_PATH + "H264_MP_960x720_25fps_800kbps_AACLC_48Khz_192Kbps_s_1_17.mp4";
    final int aspectRatio = MediaProperties.ASPECT_RATIO_4_3;
    final int videoCodecType = MediaProperties.VCODEC_H264;
    final int fileType = MediaProperties.FILE_MP4;
    final int duration = 77500;
    final int videoBitrate = 800000;
    final int audioBitrate = 192000;
    final int fps = 25;
    final int audioCodecType = MediaProperties.ACODEC_AAC_LC;
    final int audioSamplingFrequency = 48000;
    final int audioChannel = 2;
    final int videoProfile = MediaProperties.H264Profile.H264ProfileMain;
    final int videoLevel = MediaProperties.H264Level.H264Level31;
    final int width = 960;
    final int height = MediaProperties.HEIGHT_720;
    final int renderingMode = MediaItem.RENDERING_MODE_BLACK_BORDER;
    final MediaVideoItem mvi = mVideoEditorHelper.createMediaItem(mVideoEditor, "m1", videoItemFilename, renderingMode);
    validateVideoProperties(aspectRatio, fileType, videoCodecType, duration, videoBitrate, fps, videoProfile, videoLevel, width, height, audioCodecType, audioSamplingFrequency, audioChannel, audioBitrate, mvi);
}
Also used : MediaVideoItem(android.media.videoeditor.MediaVideoItem) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 85 with LargeTest

use of android.test.suitebuilder.annotation.LargeTest in project android_frameworks_base by ParanoidAndroid.

the class MediaPropertiesTest method testPropertiesMPEGQCIF.

/**
     *To test Media Properties for file MPEG4 QCIF
     */
@LargeTest
public void testPropertiesMPEGQCIF() throws Exception {
    final String videoItemFilename = INPUT_FILE_PATH + "MPEG4_SP_176x144_12fps_92kbps_AMRNB_8KHz_12.2kbps_m_0_27.3gp";
    final int aspectRatio = MediaProperties.ASPECT_RATIO_11_9;
    final int fileType = MediaProperties.FILE_3GP;
    final int videoCodecType = MediaProperties.VCODEC_MPEG4;
    final int duration = 27000;
    final int videoBitrate = 384000;
    final int audioBitrate = 12200;
    final int fps = 12;
    final int audioCodecType = MediaProperties.ACODEC_AMRNB;
    final int audioSamplingFrequency = 8000;
    final int audioChannel = 1;
    final int videoProfile = MediaProperties.MPEG4Profile.MPEG4ProfileSimple;
    final int videoLevel = MediaProperties.MPEG4Level.MPEG4Level1;
    final int width = 176;
    final int height = MediaProperties.HEIGHT_144;
    final int renderingMode = MediaItem.RENDERING_MODE_BLACK_BORDER;
    final MediaVideoItem mvi = mVideoEditorHelper.createMediaItem(mVideoEditor, "m1", videoItemFilename, renderingMode);
    validateVideoProperties(aspectRatio, fileType, videoCodecType, duration, videoBitrate, fps, videoProfile, videoLevel, width, height, audioCodecType, audioSamplingFrequency, audioChannel, audioBitrate, mvi);
}
Also used : MediaVideoItem(android.media.videoeditor.MediaVideoItem) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Aggregations

LargeTest (android.test.suitebuilder.annotation.LargeTest)1579 AudioEffect (android.media.audiofx.AudioEffect)234 AudioTrack (android.media.AudioTrack)222 View (android.view.View)147 File (java.io.File)144 MediaVideoItem (android.media.videoeditor.MediaVideoItem)115 Uri (android.net.Uri)99 ListView (android.widget.ListView)72 Cursor (android.database.Cursor)69 Bitmap (android.graphics.Bitmap)62 Instrumentation (android.app.Instrumentation)61 MediaPlayer (android.media.MediaPlayer)60 WifiConfiguration (android.net.wifi.WifiConfiguration)53 SurfaceHolder (android.view.SurfaceHolder)50 MediaImageItem (android.media.videoeditor.MediaImageItem)49 IOException (java.io.IOException)48 AudioManager (android.media.AudioManager)42 LegacyVpnInfo (com.android.internal.net.LegacyVpnInfo)42 VpnProfile (com.android.internal.net.VpnProfile)42 Request (android.app.DownloadManager.Request)41