Search in sources :

Example 6 with AudioEncoderCap

use of android.media.EncoderCapabilities.AudioEncoderCap in project android_frameworks_base by DirtyUnicorns.

the class MediaRecorderTest method testDeviceSpecificCodec.

@LargeTest
public //test cases for the new codec
void testDeviceSpecificCodec() throws Exception {
    int noOfFailure = 0;
    boolean recordSuccess = false;
    String deviceType = MediaProfileReader.getDeviceType();
    Log.v(TAG, "deviceType = " + deviceType);
    List<VideoEncoderCap> videoEncoders = MediaProfileReader.getVideoEncoders();
    List<AudioEncoderCap> audioEncoders = MediaProfileReader.getAudioEncoders();
    for (int k = 0; k < 2; k++) {
        for (VideoEncoderCap videoEncoder : videoEncoders) {
            for (AudioEncoderCap audioEncoder : audioEncoders) {
                if (k == 0) {
                    recordSuccess = recordVideoWithPara(videoEncoder, audioEncoder, true);
                } else {
                    recordSuccess = recordVideoWithPara(videoEncoder, audioEncoder, false);
                }
                if (!recordSuccess) {
                    Log.v(TAG, "testDeviceSpecificCodec failed");
                    Log.v(TAG, "Encoder = " + videoEncoder.mCodec + "Audio Encoder = " + audioEncoder.mCodec);
                    noOfFailure++;
                }
            }
        }
    }
    if (noOfFailure != 0) {
        assertTrue("testDeviceSpecificCodec", false);
    }
}
Also used : AudioEncoderCap(android.media.EncoderCapabilities.AudioEncoderCap) Paint(android.graphics.Paint) VideoEncoderCap(android.media.EncoderCapabilities.VideoEncoderCap) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Aggregations

AudioEncoderCap (android.media.EncoderCapabilities.AudioEncoderCap)6 VideoEncoderCap (android.media.EncoderCapabilities.VideoEncoderCap)6 LargeTest (android.test.suitebuilder.annotation.LargeTest)6 Paint (android.graphics.Paint)5