Search in sources :

Example 86 with LargeTest

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

the class MediaPropertiesTest method testPropertiesPNG.

/**
     *To test Media Properties for Image file of PNG Type
     */
@LargeTest
public void testPropertiesPNG() throws Exception {
    final String imageItemFilename = INPUT_FILE_PATH + "IMG_640x480.png";
    final int imageItemDuration = 10000;
    final int aspectRatio = MediaProperties.ASPECT_RATIO_4_3;
    final int fileType = MediaProperties.FILE_PNG;
    final int width = 640;
    final int height = 480;
    final int renderingMode = MediaItem.RENDERING_MODE_BLACK_BORDER;
    final MediaImageItem mii = mVideoEditorHelper.createMediaItem(mVideoEditor, "m1", imageItemFilename, imageItemDuration, renderingMode);
    validateImageProperties(aspectRatio, fileType, width, height, mii);
}
Also used : MediaImageItem(android.media.videoeditor.MediaImageItem) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 87 with LargeTest

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

the class MediaPropertiesTest method testPropertiesH263QCIF.

/**
     *To To test media properties for H263 176x144 (QCIF) + AAC (mono) file.
     */
@LargeTest
public void testPropertiesH263QCIF() throws Exception {
    final String videoItemFilename = INPUT_FILE_PATH + "H263_profile0_176x144_15fps_256kbps_AACLC_16kHz_32kbps_m_0_26.3gp";
    final int aspectRatio = MediaProperties.ASPECT_RATIO_11_9;
    final int fileType = MediaProperties.FILE_3GP;
    final int videoCodecType = MediaProperties.VCODEC_H263;
    final int duration = 26933;
    final int videoBitrate = 384000;
    final int audioBitrate = 64000;
    final int fps = 15;
    final int audioCodecType = MediaProperties.ACODEC_AAC_LC;
    final int audioSamplingFrequency = 16000;
    final int audioChannel = 1;
    final int videoProfile = MediaProperties.H263Profile.H263ProfileBaseline;
    final int videoLevel = MediaProperties.H263Level.H263Level10;
    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)

Example 88 with LargeTest

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

the class MediaPropertiesTest method testPropertiesH264HD1080WithoutAudio.

/**
     *To test Media Properties for file H264 HD1080
     */
@LargeTest
public void testPropertiesH264HD1080WithoutAudio() throws Exception {
    final String videoItemFilename = INPUT_FILE_PATH + "H264_BP_1080x720_30fps_800kbps_1_17.mp4";
    final int aspectRatio = MediaProperties.ASPECT_RATIO_3_2;
    final int fileType = MediaProperties.FILE_MP4;
    final int videoCodecType = MediaProperties.VCODEC_H264;
    final int duration = 77366;
    final int videoBitrate = 859000;
    final int audioBitrate = 0;
    final int fps = 30;
    final int audioCodecType = -1;
    final int audioSamplingFrequency = 0;
    final int audioChannel = 0;
    final int videoProfile = MediaProperties.H264Profile.H264ProfileBaseline;
    final int videoLevel = MediaProperties.H264Level.H264Level13;
    final int width = 1080;
    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 89 with LargeTest

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

the class MediaAudioEffectTest method test1_0ConstructorFromType.

//Test case 1.0: test constructor from effect type and get effect ID
@LargeTest
public void test1_0ConstructorFromType() throws Exception {
    boolean result = true;
    String msg = "test1_0ConstructorFromType()";
    AudioEffect.Descriptor[] desc = AudioEffect.queryEffects();
    assertTrue(msg + ": no effects found", (desc.length != 0));
    try {
        int sessionId;
        AudioRecord ar = null;
        if (AudioEffect.EFFECT_PRE_PROCESSING.equals(desc[0].connectMode)) {
            ar = getAudioRecord();
            sessionId = ar.getAudioSessionId();
        } else {
            sessionId = 0;
        }
        AudioEffect effect = new AudioEffect(desc[0].type, AudioEffect.EFFECT_TYPE_NULL, 0, sessionId);
        assertNotNull(msg + ": could not create AudioEffect", effect);
        try {
            assertTrue(msg + ": invalid effect ID", (effect.getId() != 0));
        } catch (IllegalStateException e) {
            msg = msg.concat(": AudioEffect not initialized");
            result = false;
        } finally {
            effect.release();
            if (ar != null) {
                ar.release();
            }
        }
    } catch (IllegalArgumentException e) {
        msg = msg.concat(": Effect not found: " + desc[0].name);
        result = false;
    } catch (UnsupportedOperationException e) {
        msg = msg.concat(": Effect library not loaded");
        result = false;
    }
    assertTrue(msg, result);
}
Also used : AudioRecord(android.media.AudioRecord) AssetFileDescriptor(android.content.res.AssetFileDescriptor) AudioEffect(android.media.audiofx.AudioEffect) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 90 with LargeTest

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

the class MediaAudioTrackTest method testSetLoopPointsEndTooFar.

//Test case 9: setLoopPoints() fails with end beyond what can be written for the track
@LargeTest
public void testSetLoopPointsEndTooFar() throws Exception {
    // constants for test
    final String TEST_NAME = "testSetLoopPointsEndTooFar";
    final int TEST_SR = 22050;
    final int TEST_CONF = AudioFormat.CHANNEL_OUT_MONO;
    final int TEST_FORMAT = AudioFormat.ENCODING_PCM_16BIT;
    final int TEST_MODE = AudioTrack.MODE_STATIC;
    final int TEST_STREAM_TYPE = AudioManager.STREAM_MUSIC;
    //-------- initialization --------------
    int minBuffSize = AudioTrack.getMinBufferSize(TEST_SR, TEST_CONF, TEST_FORMAT);
    AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT, minBuffSize, TEST_MODE);
    byte[] data = new byte[minBuffSize];
    //16bit data
    int dataSizeInFrames = minBuffSize / 2;
    //--------    test        --------------
    assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_NO_STATIC_DATA);
    track.write(data, 0, data.length);
    assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
    assertTrue(TEST_NAME, track.setLoopPoints(dataSizeInFrames - 10, dataSizeInFrames + 50, 2) == AudioTrack.ERROR_BAD_VALUE);
    //-------- tear down      --------------
    track.release();
}
Also used : AudioTrack(android.media.AudioTrack) 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