diff options
author | Yu Shan Emily Lau <yslau@google.com> | 2009-08-06 17:35:51 -0700 |
---|---|---|
committer | Yu Shan Emily Lau <yslau@google.com> | 2009-08-06 17:42:29 -0700 |
commit | 3397f16949d2e86442c32f3b82d5ee3ace99ba82 (patch) | |
tree | 74fc8234e8d01bb5158f9b58beac813a1b9a8910 /media | |
parent | a7a3b6ef0fdaf6b17993642b76baf90a03ae0077 (diff) | |
download | frameworks_base-3397f16949d2e86442c32f3b82d5ee3ace99ba82.zip frameworks_base-3397f16949d2e86442c32f3b82d5ee3ace99ba82.tar.gz frameworks_base-3397f16949d2e86442c32f3b82d5ee3ace99ba82.tar.bz2 |
Capture the start and end memory usage in the output file. Move the start memory catpure after 10 loops.
Diffstat (limited to 'media')
-rw-r--r-- | media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java | 39 |
1 files changed, 31 insertions, 8 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 bd4c88e..442c35b 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java @@ -304,7 +304,8 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase<Medi public boolean validateMemoryResult (int startPid, int startMemory, Writer output) throws Exception { mEndPid = getMediaserverPid(); mEndMemory = getMediaserverVsize(); - + Log.v(TAG, "End Memory " + mEndMemory); + output.write("End Memory :" + mEndMemory + "\n"); //Write the total memory different into the output file output.write("The total diff = " + (mEndMemory - startMemory)); output.write("\n\n"); @@ -331,13 +332,17 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase<Medi public void testH263VideoPlaybackMemoryUsage() throws Exception { boolean memoryResult = false; mStartPid = getMediaserverPid(); - mStartMemory = getMediaserverVsize(); File h263MemoryOut = new File(MEDIA_MEMORY_OUTPUT); Writer output = new BufferedWriter(new FileWriter(h263MemoryOut, true)); output.write("H263 Video Playback Only\n"); for (int i = 0; i < NUM_STRESS_LOOP; i++) { mediaStressPlayback(MediaNames.VIDEO_HIGHRES_H263); + if (i == 0) { + mStartMemory = getMediaserverVsize(); + output.write("Start memory : " + mStartMemory + "\n"); + Log.v(TAG, "first mem : " + mStartMemory); + } getMemoryWriteToLog(output); } output.write("\n"); @@ -351,13 +356,16 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase<Medi public void testH264VideoPlaybackMemoryUsage() throws Exception { boolean memoryResult = false; mStartPid = getMediaserverPid(); - mStartMemory = getMediaserverVsize(); File h264MemoryOut = new File(MEDIA_MEMORY_OUTPUT); Writer output = new BufferedWriter(new FileWriter(h264MemoryOut, true)); output.write("H264 Video Playback only\n"); for (int i = 0; i < NUM_STRESS_LOOP; i++) { mediaStressPlayback(MediaNames.VIDEO_H264_AMR); + if (i == 0) { + mStartMemory = getMediaserverVsize(); + output.write("Start memory : " + mStartMemory + "\n"); + } getMemoryWriteToLog(output); } output.write("\n"); @@ -371,13 +379,16 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase<Medi public void testWMVVideoPlaybackMemoryUsage() throws Exception { boolean memoryResult = false; mStartPid = getMediaserverPid(); - mStartMemory = getMediaserverVsize(); File wmvMemoryOut = new File(MEDIA_MEMORY_OUTPUT); Writer output = new BufferedWriter(new FileWriter(wmvMemoryOut, true)); output.write("WMV video playback only\n"); for (int i = 0; i < NUM_STRESS_LOOP; i++) { mediaStressPlayback(MediaNames.VIDEO_WMV); + if (i == 0) { + mStartMemory = getMediaserverVsize(); + output.write("Start memory : " + mStartMemory + "\n"); + } getMemoryWriteToLog(output); } output.write("\n"); @@ -391,7 +402,6 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase<Medi public void testH263RecordVideoOnlyMemoryUsage() throws Exception { boolean memoryResult = false; mStartPid = getMediaserverPid(); - mStartMemory = getMediaserverVsize(); File videoH263RecordOnlyMemoryOut = new File(MEDIA_MEMORY_OUTPUT); Writer output = new BufferedWriter(new FileWriter(videoH263RecordOnlyMemoryOut, true)); @@ -399,6 +409,10 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase<Medi for (int i = 0; i < NUM_STRESS_LOOP; i++) { stressVideoRecord(20, 352, 288, MediaRecorder.VideoEncoder.H263, MediaRecorder.OutputFormat.MPEG_4, MediaNames.RECORDED_VIDEO_3GP, true); + if (i == 0) { + mStartMemory = getMediaserverVsize(); + output.write("Start memory : " + mStartMemory + "\n"); + } getMemoryWriteToLog(output); } output.write("\n"); @@ -412,7 +426,6 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase<Medi public void testMpeg4RecordVideoOnlyMemoryUsage() throws Exception { boolean memoryResult = false; mStartPid = getMediaserverPid(); - mStartMemory = getMediaserverVsize(); File videoMp4RecordOnlyMemoryOut = new File(MEDIA_MEMORY_OUTPUT); Writer output = new BufferedWriter(new FileWriter(videoMp4RecordOnlyMemoryOut, true)); @@ -420,6 +433,10 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase<Medi for (int i = 0; i < NUM_STRESS_LOOP; i++) { stressVideoRecord(20, 352, 288, MediaRecorder.VideoEncoder.MPEG_4_SP, MediaRecorder.OutputFormat.MPEG_4, MediaNames.RECORDED_VIDEO_3GP, true); + if (i == 0) { + mStartMemory = getMediaserverVsize(); + output.write("Start memory : " + mStartMemory + "\n"); + } getMemoryWriteToLog(output); } output.write("\n"); @@ -434,7 +451,6 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase<Medi public void testRecordVidedAudioMemoryUsage() throws Exception { boolean memoryResult = false; mStartPid = getMediaserverPid(); - mStartMemory = getMediaserverVsize(); File videoRecordAudioMemoryOut = new File(MEDIA_MEMORY_OUTPUT); Writer output = new BufferedWriter(new FileWriter(videoRecordAudioMemoryOut, true)); @@ -442,6 +458,10 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase<Medi for (int i = 0; i < NUM_STRESS_LOOP; i++) { stressVideoRecord(20, 352, 288, MediaRecorder.VideoEncoder.H263, MediaRecorder.OutputFormat.MPEG_4, MediaNames.RECORDED_VIDEO_3GP, false); + if (i == 0) { + mStartMemory = getMediaserverVsize(); + output.write("Start memory : " + mStartMemory + "\n"); + } getMemoryWriteToLog(output); } output.write("\n"); @@ -455,13 +475,16 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase<Medi public void testRecordAudioOnlyMemoryUsage() throws Exception { boolean memoryResult = false; mStartPid = getMediaserverPid(); - mStartMemory = getMediaserverVsize(); File audioOnlyMemoryOut = new File(MEDIA_MEMORY_OUTPUT); Writer output = new BufferedWriter(new FileWriter(audioOnlyMemoryOut, true)); output.write("Audio record only\n"); for (int i = 0; i < NUM_STRESS_LOOP; i++) { stressAudioRecord(MediaNames.RECORDER_OUTPUT); + if (i == 0) { + mStartMemory = getMediaserverVsize(); + output.write("Start memory : " + mStartMemory + "\n"); + } getMemoryWriteToLog(output); } output.write("\n"); |