diff options
author | Yu Shan Emily Lau <yslau@google.com> | 2013-05-25 01:51:40 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-05-25 01:51:40 +0000 |
commit | b830d527deb75a36aa78367026d6631a9b4e1126 (patch) | |
tree | 14d450df3eaaa619e20da6ae0d05272819f2c403 /media | |
parent | 4a47f17a9db8fd2b8b17ad10a629216cc3c6333c (diff) | |
parent | 9c539e8511c88419b2f9bdf7d5aad6f91e521c7d (diff) | |
download | frameworks_base-b830d527deb75a36aa78367026d6631a9b4e1126.zip frameworks_base-b830d527deb75a36aa78367026d6631a9b4e1126.tar.gz frameworks_base-b830d527deb75a36aa78367026d6631a9b4e1126.tar.bz2 |
Merge "Update test with CamercorderProfile video size." into jb-mr2-dev
Diffstat (limited to 'media')
-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(); } |