diff options
author | Yu Shan Emily Lau <yslau@google.com> | 2013-05-23 21:45:04 -0700 |
---|---|---|
committer | Yu Shan Emily Lau <yslau@google.com> | 2013-05-23 22:02:28 -0700 |
commit | 9c539e8511c88419b2f9bdf7d5aad6f91e521c7d (patch) | |
tree | 0476e5b626cb4ca9d11fa204e558b5d8849f634f /media/tests/MediaFrameworkTest/src | |
parent | 28d3dbf969c4c7965ea44bfe4b54095af5356970 (diff) | |
download | frameworks_base-9c539e8511c88419b2f9bdf7d5aad6f91e521c7d.zip frameworks_base-9c539e8511c88419b2f9bdf7d5aad6f91e521c7d.tar.gz frameworks_base-9c539e8511c88419b2f9bdf7d5aad6f91e521c7d.tar.bz2 |
Update test with CamercorderProfile video size.
Bug:9114681
Change-Id: Id8ac6e98849715d21cd4a983fc13935debea5e5f
Diffstat (limited to 'media/tests/MediaFrameworkTest/src')
-rw-r--r-- | media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java index be12c7f..074bfe4 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java @@ -24,23 +24,19 @@ import com.android.mediaframeworktest.MediaTestUtil; import android.database.sqlite.SQLiteDatabase; import android.hardware.Camera; import android.hardware.Camera.PreviewCallback; +import android.media.CamcorderProfile; import android.media.MediaPlayer; import android.media.MediaRecorder; import android.media.EncoderCapabilities.VideoEncoderCap; import android.os.ConditionVariable; import android.os.Looper; -import android.os.SystemClock; import android.test.ActivityInstrumentationTestCase2; import android.test.suitebuilder.annotation.LargeTest; -import android.test.suitebuilder.annotation.Suppress; import android.util.Log; import android.view.SurfaceHolder; import java.util.List; import java.io.BufferedReader; -import java.io.FileDescriptor; -import java.io.FileInputStream; -import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -49,7 +45,6 @@ import java.io.File; import java.io.FileWriter; import java.io.BufferedWriter; -import android.media.MediaMetadataRetriever; import com.android.mediaframeworktest.MediaProfileReader; /** @@ -63,7 +58,6 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med private String TAG = "MediaPlayerPerformance"; - private SQLiteDatabase mDB; private SurfaceHolder mSurfaceHolder = null; private static final int NUM_STRESS_LOOP = 10; private static final int NUM_PLAYBACk_IN_EACH_LOOP = 20; @@ -92,7 +86,9 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med private Writer mProcMemWriter; private Writer mMemWriter; - private static List<VideoEncoderCap> videoEncoders = MediaProfileReader.getVideoEncoders(); + private CamcorderProfile mCamcorderProfile = CamcorderProfile.get(CAMERA_ID); + private int mVideoWidth = mCamcorderProfile.videoFrameWidth; + private int mVideoHeight = mCamcorderProfile.videoFrameHeight; Camera mCamera; @@ -415,13 +411,13 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med @LargeTest public void testH263RecordVideoOnlyMemoryUsage() throws Exception { boolean memoryResult = false; - mStartPid = getMediaserverPid(); int frameRate = MediaProfileReader.getMaxFrameRateForCodec(MediaRecorder.VideoEncoder.H263); assertTrue("H263 video recording frame rate", frameRate != -1); for (int i = 0; i < NUM_STRESS_LOOP; i++) { - assertTrue(stressVideoRecord(frameRate, 352, 288, MediaRecorder.VideoEncoder.H263, - MediaRecorder.OutputFormat.MPEG_4, MediaNames.RECORDED_VIDEO_3GP, true)); + assertTrue(stressVideoRecord(frameRate, mVideoWidth, mVideoHeight, + MediaRecorder.VideoEncoder.H263, MediaRecorder.OutputFormat.MPEG_4, + MediaNames.RECORDED_VIDEO_3GP, true)); getMemoryWriteToLog(i); writeProcmemInfo(); } @@ -435,11 +431,13 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med boolean memoryResult = false; mStartPid = getMediaserverPid(); - int frameRate = MediaProfileReader.getMaxFrameRateForCodec(MediaRecorder.VideoEncoder.MPEG_4_SP); + int frameRate = MediaProfileReader.getMaxFrameRateForCodec + (MediaRecorder.VideoEncoder.MPEG_4_SP); assertTrue("MPEG4 video recording frame rate", frameRate != -1); for (int i = 0; i < NUM_STRESS_LOOP; i++) { - assertTrue(stressVideoRecord(frameRate, 352, 288, MediaRecorder.VideoEncoder.MPEG_4_SP, - MediaRecorder.OutputFormat.MPEG_4, MediaNames.RECORDED_VIDEO_3GP, true)); + assertTrue(stressVideoRecord(frameRate, mVideoWidth, mVideoHeight, + MediaRecorder.VideoEncoder.MPEG_4_SP, MediaRecorder.OutputFormat.MPEG_4, + MediaNames.RECORDED_VIDEO_3GP, true)); getMemoryWriteToLog(i); writeProcmemInfo(); } @@ -457,8 +455,9 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med int frameRate = MediaProfileReader.getMaxFrameRateForCodec(MediaRecorder.VideoEncoder.H263); assertTrue("H263 video recording frame rate", frameRate != -1); for (int i = 0; i < NUM_STRESS_LOOP; i++) { - assertTrue(stressVideoRecord(frameRate, 352, 288, MediaRecorder.VideoEncoder.H263, - MediaRecorder.OutputFormat.MPEG_4, MediaNames.RECORDED_VIDEO_3GP, false)); + assertTrue(stressVideoRecord(frameRate, mVideoWidth, mVideoHeight, + MediaRecorder.VideoEncoder.H263, MediaRecorder.OutputFormat.MPEG_4, + MediaNames.RECORDED_VIDEO_3GP, false)); getMemoryWriteToLog(i); writeProcmemInfo(); } |