Merge "Add the min fps option to set the min fps in the media recorder test. Add the procmem log to the media memory stress test." into ics-mr1
This commit is contained in:
committed by
Android (Google) Code Review
commit
4e5d3f2ca0
@@ -39,6 +39,7 @@ import com.android.mediaframeworktest.functional.videoeditor.VideoEditorExportTe
|
|||||||
import com.android.mediaframeworktest.functional.videoeditor.VideoEditorPreviewTest;
|
import com.android.mediaframeworktest.functional.videoeditor.VideoEditorPreviewTest;
|
||||||
import junit.framework.TestSuite;
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
import android.test.InstrumentationTestRunner;
|
import android.test.InstrumentationTestRunner;
|
||||||
import android.test.InstrumentationTestSuite;
|
import android.test.InstrumentationTestSuite;
|
||||||
|
|
||||||
@@ -54,6 +55,7 @@ import android.test.InstrumentationTestSuite;
|
|||||||
|
|
||||||
public class MediaFrameworkTestRunner extends InstrumentationTestRunner {
|
public class MediaFrameworkTestRunner extends InstrumentationTestRunner {
|
||||||
|
|
||||||
|
public static int mMinCameraFps = 0;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TestSuite getAllTests() {
|
public TestSuite getAllTests() {
|
||||||
@@ -87,4 +89,16 @@ public class MediaFrameworkTestRunner extends InstrumentationTestRunner {
|
|||||||
public ClassLoader getLoader() {
|
public ClassLoader getLoader() {
|
||||||
return MediaFrameworkTestRunner.class.getClassLoader();
|
return MediaFrameworkTestRunner.class.getClassLoader();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle icicle) {
|
||||||
|
super.onCreate(icicle);
|
||||||
|
|
||||||
|
String minCameraFps = (String) icicle.get("min_camera_fps");
|
||||||
|
System.out.print("min_camera_" + minCameraFps);
|
||||||
|
|
||||||
|
if (minCameraFps != null ) {
|
||||||
|
mMinCameraFps = Integer.parseInt(minCameraFps);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import android.util.Log;
|
|||||||
import android.view.SurfaceHolder;
|
import android.view.SurfaceHolder;
|
||||||
import android.view.SurfaceView;
|
import android.view.SurfaceView;
|
||||||
import com.android.mediaframeworktest.MediaProfileReader;
|
import com.android.mediaframeworktest.MediaProfileReader;
|
||||||
|
import com.android.mediaframeworktest.MediaFrameworkTestRunner;
|
||||||
|
|
||||||
import android.test.suitebuilder.annotation.LargeTest;
|
import android.test.suitebuilder.annotation.LargeTest;
|
||||||
import android.test.suitebuilder.annotation.Suppress;
|
import android.test.suitebuilder.annotation.Suppress;
|
||||||
@@ -115,9 +116,16 @@ public class MediaRecorderTest extends ActivityInstrumentationTestCase2<MediaFra
|
|||||||
int audioChannels = highQuality? audioCap.mMaxChannels: audioCap.mMinChannels ;
|
int audioChannels = highQuality? audioCap.mMaxChannels: audioCap.mMinChannels ;
|
||||||
int audioSamplingRate = highQuality? audioCap.mMaxSampleRate: audioCap.mMinSampleRate;
|
int audioSamplingRate = highQuality? audioCap.mMaxSampleRate: audioCap.mMinSampleRate;
|
||||||
|
|
||||||
|
//Overide the fps if the min_camera_fps is set
|
||||||
|
if (MediaFrameworkTestRunner.mMinCameraFps != 0 &&
|
||||||
|
MediaFrameworkTestRunner.mMinCameraFps > videoFps){
|
||||||
|
videoFps = MediaFrameworkTestRunner.mMinCameraFps;
|
||||||
|
}
|
||||||
|
|
||||||
if (videoFps < MIN_VIDEO_FPS) {
|
if (videoFps < MIN_VIDEO_FPS) {
|
||||||
videoFps = MIN_VIDEO_FPS;
|
videoFps = MIN_VIDEO_FPS;
|
||||||
}
|
}
|
||||||
|
|
||||||
mSurfaceHolder = MediaFrameworkTest.mSurfaceView.getHolder();
|
mSurfaceHolder = MediaFrameworkTest.mSurfaceView.getHolder();
|
||||||
String filename = ("/sdcard/" + videoEncoder + "_" + audioEncoder + "_" + highQuality + ".3gp");
|
String filename = ("/sdcard/" + videoEncoder + "_" + audioEncoder + "_" + highQuality + ".3gp");
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -37,11 +37,13 @@ import android.util.Log;
|
|||||||
import android.view.SurfaceHolder;
|
import android.view.SurfaceHolder;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.io.BufferedReader;
|
||||||
import java.io.FileDescriptor;
|
import java.io.FileDescriptor;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
import java.io.Writer;
|
import java.io.Writer;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
@@ -68,6 +70,8 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med
|
|||||||
private static final long MEDIA_STRESS_WAIT_TIME = 5000; //5 seconds
|
private static final long MEDIA_STRESS_WAIT_TIME = 5000; //5 seconds
|
||||||
private static final String MEDIA_MEMORY_OUTPUT =
|
private static final String MEDIA_MEMORY_OUTPUT =
|
||||||
"/sdcard/mediaMemOutput.txt";
|
"/sdcard/mediaMemOutput.txt";
|
||||||
|
private static final String MEDIA_PROCMEM_OUTPUT =
|
||||||
|
"/sdcard/mediaProcmemOutput.txt";
|
||||||
|
|
||||||
private static int mStartMemory = 0;
|
private static int mStartMemory = 0;
|
||||||
private static int mEndMemory = 0;
|
private static int mEndMemory = 0;
|
||||||
@@ -84,6 +88,9 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med
|
|||||||
private static int DECODER_LIMIT = 150;
|
private static int DECODER_LIMIT = 150;
|
||||||
private static int CAMERA_LIMIT = 80;
|
private static int CAMERA_LIMIT = 80;
|
||||||
|
|
||||||
|
private Writer mProcMemWriter;
|
||||||
|
private Writer mMemWriter;
|
||||||
|
|
||||||
private static List<VideoEncoderCap> videoEncoders = MediaProfileReader.getVideoEncoders();
|
private static List<VideoEncoderCap> videoEncoders = MediaProfileReader.getVideoEncoders();
|
||||||
|
|
||||||
Camera mCamera;
|
Camera mCamera;
|
||||||
@@ -97,12 +104,21 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med
|
|||||||
getActivity();
|
getActivity();
|
||||||
if (MediaFrameworkPerfTestRunner.mGetNativeHeapDump)
|
if (MediaFrameworkPerfTestRunner.mGetNativeHeapDump)
|
||||||
MediaTestUtil.getNativeHeapDump(this.getName() + "_before");
|
MediaTestUtil.getNativeHeapDump(this.getName() + "_before");
|
||||||
|
|
||||||
|
mProcMemWriter = new BufferedWriter(new FileWriter
|
||||||
|
(new File(MEDIA_PROCMEM_OUTPUT), true));
|
||||||
|
mProcMemWriter.write(this.getName() + "\n");
|
||||||
|
mMemWriter = new BufferedWriter(new FileWriter
|
||||||
|
(new File(MEDIA_MEMORY_OUTPUT), true));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void tearDown() throws Exception {
|
protected void tearDown() throws Exception {
|
||||||
super.tearDown();
|
|
||||||
if (MediaFrameworkPerfTestRunner.mGetNativeHeapDump)
|
if (MediaFrameworkPerfTestRunner.mGetNativeHeapDump)
|
||||||
MediaTestUtil.getNativeHeapDump(this.getName() + "_after");
|
MediaTestUtil.getNativeHeapDump(this.getName() + "_after");
|
||||||
|
mProcMemWriter.close();
|
||||||
|
mMemWriter.close();
|
||||||
|
super.tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeMessageLooper() {
|
private void initializeMessageLooper() {
|
||||||
@@ -247,24 +263,39 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Write the ps output to the file
|
//Write the ps output to the file
|
||||||
public void getMemoryWriteToLog(Writer output, int writeCount) {
|
public void getMemoryWriteToLog(int writeCount) {
|
||||||
String memusage = null;
|
String memusage = null;
|
||||||
try {
|
try {
|
||||||
if (writeCount == 0) {
|
if (writeCount == 0) {
|
||||||
mStartMemory = getMediaserverVsize();
|
mStartMemory = getMediaserverVsize();
|
||||||
output.write("Start memory : " + mStartMemory + "\n");
|
mMemWriter.write("Start memory : " + mStartMemory + "\n");
|
||||||
}
|
}
|
||||||
memusage = captureMediaserverInfo();
|
memusage = captureMediaserverInfo();
|
||||||
output.write(memusage);
|
mMemWriter.write(memusage);
|
||||||
if (writeCount == NUM_STRESS_LOOP - 1) {
|
if (writeCount == NUM_STRESS_LOOP - 1) {
|
||||||
mEndMemory = getMediaserverVsize();
|
mEndMemory = getMediaserverVsize();
|
||||||
output.write("End Memory :" + mEndMemory + "\n");
|
mMemWriter.write("End Memory :" + mEndMemory + "\n");
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.toString();
|
e.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void writeProcmemInfo() throws Exception{
|
||||||
|
String cmd = "procmem " + getMediaserverPid();
|
||||||
|
Process p = Runtime.getRuntime().exec(cmd);
|
||||||
|
|
||||||
|
InputStream inStream = p.getInputStream();
|
||||||
|
InputStreamReader inReader = new InputStreamReader(inStream);
|
||||||
|
BufferedReader inBuffer = new BufferedReader(inReader);
|
||||||
|
String s;
|
||||||
|
while ((s = inBuffer.readLine()) != null) {
|
||||||
|
mProcMemWriter.write(s);
|
||||||
|
mProcMemWriter.write("\n");
|
||||||
|
}
|
||||||
|
mProcMemWriter.write("\n\n");
|
||||||
|
}
|
||||||
|
|
||||||
public String captureMediaserverInfo() {
|
public String captureMediaserverInfo() {
|
||||||
String cm = "ps mediaserver";
|
String cm = "ps mediaserver";
|
||||||
String memoryUsage = null;
|
String memoryUsage = null;
|
||||||
@@ -306,7 +337,7 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med
|
|||||||
return vsizevalue;
|
return vsizevalue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean validateMemoryResult(int startPid, int startMemory, Writer output, int limit)
|
public boolean validateMemoryResult(int startPid, int startMemory, int limit)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
// Wait for 10 seconds to make sure the memory settle.
|
// Wait for 10 seconds to make sure the memory settle.
|
||||||
Thread.sleep(10000);
|
Thread.sleep(10000);
|
||||||
@@ -315,11 +346,11 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med
|
|||||||
if (memDiff < 0) {
|
if (memDiff < 0) {
|
||||||
memDiff = 0;
|
memDiff = 0;
|
||||||
}
|
}
|
||||||
output.write("The total diff = " + memDiff);
|
mMemWriter.write("The total diff = " + memDiff);
|
||||||
output.write("\n\n");
|
mMemWriter.write("\n\n");
|
||||||
// mediaserver crash
|
// mediaserver crash
|
||||||
if (startPid != mEndPid) {
|
if (startPid != mEndPid) {
|
||||||
output.write("mediaserver died. Test failed\n");
|
mMemWriter.write("mediaserver died. Test failed\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// memory leak greter than the tolerant
|
// memory leak greter than the tolerant
|
||||||
@@ -331,18 +362,16 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med
|
|||||||
@LargeTest
|
@LargeTest
|
||||||
public void testH263VideoPlaybackMemoryUsage() throws Exception {
|
public void testH263VideoPlaybackMemoryUsage() throws Exception {
|
||||||
boolean memoryResult = false;
|
boolean memoryResult = false;
|
||||||
mStartPid = getMediaserverPid();
|
|
||||||
|
|
||||||
File h263MemoryOut = new File(MEDIA_MEMORY_OUTPUT);
|
mStartPid = getMediaserverPid();
|
||||||
Writer output = new BufferedWriter(new FileWriter(h263MemoryOut, true));
|
mMemWriter.write("H263 Video Playback Only\n");
|
||||||
output.write("H263 Video Playback Only\n");
|
|
||||||
for (int i = 0; i < NUM_STRESS_LOOP; i++) {
|
for (int i = 0; i < NUM_STRESS_LOOP; i++) {
|
||||||
mediaStressPlayback(MediaNames.VIDEO_HIGHRES_H263);
|
mediaStressPlayback(MediaNames.VIDEO_HIGHRES_H263);
|
||||||
getMemoryWriteToLog(output, i);
|
getMemoryWriteToLog(i);
|
||||||
|
writeProcmemInfo();
|
||||||
}
|
}
|
||||||
output.write("\n");
|
mMemWriter.write("\n");
|
||||||
memoryResult = validateMemoryResult(mStartPid, mStartMemory, output, DECODER_LIMIT);
|
memoryResult = validateMemoryResult(mStartPid, mStartMemory, DECODER_LIMIT);
|
||||||
output.close();
|
|
||||||
assertTrue("H263 playback memory test", memoryResult);
|
assertTrue("H263 playback memory test", memoryResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -350,18 +379,16 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med
|
|||||||
@LargeTest
|
@LargeTest
|
||||||
public void testH264VideoPlaybackMemoryUsage() throws Exception {
|
public void testH264VideoPlaybackMemoryUsage() throws Exception {
|
||||||
boolean memoryResult = false;
|
boolean memoryResult = false;
|
||||||
mStartPid = getMediaserverPid();
|
|
||||||
|
|
||||||
File h264MemoryOut = new File(MEDIA_MEMORY_OUTPUT);
|
mStartPid = getMediaserverPid();
|
||||||
Writer output = new BufferedWriter(new FileWriter(h264MemoryOut, true));
|
mMemWriter.write("H264 Video Playback only\n");
|
||||||
output.write("H264 Video Playback only\n");
|
|
||||||
for (int i = 0; i < NUM_STRESS_LOOP; i++) {
|
for (int i = 0; i < NUM_STRESS_LOOP; i++) {
|
||||||
mediaStressPlayback(MediaNames.VIDEO_H264_AMR);
|
mediaStressPlayback(MediaNames.VIDEO_H264_AMR);
|
||||||
getMemoryWriteToLog(output, i);
|
getMemoryWriteToLog(i);
|
||||||
|
writeProcmemInfo();
|
||||||
}
|
}
|
||||||
output.write("\n");
|
mMemWriter.write("\n");
|
||||||
memoryResult = validateMemoryResult(mStartPid, mStartMemory, output, DECODER_LIMIT);
|
memoryResult = validateMemoryResult(mStartPid, mStartMemory, DECODER_LIMIT);
|
||||||
output.close();
|
|
||||||
assertTrue("H264 playback memory test", memoryResult);
|
assertTrue("H264 playback memory test", memoryResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -369,21 +396,19 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med
|
|||||||
@LargeTest
|
@LargeTest
|
||||||
public void testH263RecordVideoOnlyMemoryUsage() throws Exception {
|
public void testH263RecordVideoOnlyMemoryUsage() throws Exception {
|
||||||
boolean memoryResult = false;
|
boolean memoryResult = false;
|
||||||
mStartPid = getMediaserverPid();
|
|
||||||
|
|
||||||
File videoH263RecordOnlyMemoryOut = new File(MEDIA_MEMORY_OUTPUT);
|
mStartPid = getMediaserverPid();
|
||||||
Writer output = new BufferedWriter(new FileWriter(videoH263RecordOnlyMemoryOut, true));
|
mMemWriter.write("H263 video record only\n");
|
||||||
output.write("H263 video record only\n");
|
|
||||||
int frameRate = MediaProfileReader.getMaxFrameRateForCodec(MediaRecorder.VideoEncoder.H263);
|
int frameRate = MediaProfileReader.getMaxFrameRateForCodec(MediaRecorder.VideoEncoder.H263);
|
||||||
assertTrue("H263 video recording frame rate", frameRate != -1);
|
assertTrue("H263 video recording frame rate", frameRate != -1);
|
||||||
for (int i = 0; i < NUM_STRESS_LOOP; i++) {
|
for (int i = 0; i < NUM_STRESS_LOOP; i++) {
|
||||||
assertTrue(stressVideoRecord(frameRate, 352, 288, MediaRecorder.VideoEncoder.H263,
|
assertTrue(stressVideoRecord(frameRate, 352, 288, MediaRecorder.VideoEncoder.H263,
|
||||||
MediaRecorder.OutputFormat.MPEG_4, MediaNames.RECORDED_VIDEO_3GP, true));
|
MediaRecorder.OutputFormat.MPEG_4, MediaNames.RECORDED_VIDEO_3GP, true));
|
||||||
getMemoryWriteToLog(output, i);
|
getMemoryWriteToLog(i);
|
||||||
|
writeProcmemInfo();
|
||||||
}
|
}
|
||||||
output.write("\n");
|
mMemWriter.write("\n");
|
||||||
memoryResult = validateMemoryResult(mStartPid, mStartMemory, output, ENCODER_LIMIT);
|
memoryResult = validateMemoryResult(mStartPid, mStartMemory, ENCODER_LIMIT);
|
||||||
output.close();
|
|
||||||
assertTrue("H263 record only memory test", memoryResult);
|
assertTrue("H263 record only memory test", memoryResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -391,21 +416,19 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med
|
|||||||
@LargeTest
|
@LargeTest
|
||||||
public void testMpeg4RecordVideoOnlyMemoryUsage() throws Exception {
|
public void testMpeg4RecordVideoOnlyMemoryUsage() throws Exception {
|
||||||
boolean memoryResult = false;
|
boolean memoryResult = false;
|
||||||
mStartPid = getMediaserverPid();
|
|
||||||
|
|
||||||
File videoMp4RecordOnlyMemoryOut = new File(MEDIA_MEMORY_OUTPUT);
|
mStartPid = getMediaserverPid();
|
||||||
Writer output = new BufferedWriter(new FileWriter(videoMp4RecordOnlyMemoryOut, true));
|
mMemWriter.write("MPEG4 video record only\n");
|
||||||
output.write("MPEG4 video record only\n");
|
|
||||||
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);
|
assertTrue("MPEG4 video recording frame rate", frameRate != -1);
|
||||||
for (int i = 0; i < NUM_STRESS_LOOP; i++) {
|
for (int i = 0; i < NUM_STRESS_LOOP; i++) {
|
||||||
assertTrue(stressVideoRecord(frameRate, 352, 288, MediaRecorder.VideoEncoder.MPEG_4_SP,
|
assertTrue(stressVideoRecord(frameRate, 352, 288, MediaRecorder.VideoEncoder.MPEG_4_SP,
|
||||||
MediaRecorder.OutputFormat.MPEG_4, MediaNames.RECORDED_VIDEO_3GP, true));
|
MediaRecorder.OutputFormat.MPEG_4, MediaNames.RECORDED_VIDEO_3GP, true));
|
||||||
getMemoryWriteToLog(output, i);
|
getMemoryWriteToLog(i);
|
||||||
|
writeProcmemInfo();
|
||||||
}
|
}
|
||||||
output.write("\n");
|
mMemWriter.write("\n");
|
||||||
memoryResult = validateMemoryResult(mStartPid, mStartMemory, output, ENCODER_LIMIT);
|
memoryResult = validateMemoryResult(mStartPid, mStartMemory, ENCODER_LIMIT);
|
||||||
output.close();
|
|
||||||
assertTrue("mpeg4 record only memory test", memoryResult);
|
assertTrue("mpeg4 record only memory test", memoryResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -414,21 +437,19 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med
|
|||||||
@LargeTest
|
@LargeTest
|
||||||
public void testRecordVideoAudioMemoryUsage() throws Exception {
|
public void testRecordVideoAudioMemoryUsage() throws Exception {
|
||||||
boolean memoryResult = false;
|
boolean memoryResult = false;
|
||||||
mStartPid = getMediaserverPid();
|
|
||||||
|
|
||||||
File videoRecordAudioMemoryOut = new File(MEDIA_MEMORY_OUTPUT);
|
mStartPid = getMediaserverPid();
|
||||||
Writer output = new BufferedWriter(new FileWriter(videoRecordAudioMemoryOut, true));
|
|
||||||
int frameRate = MediaProfileReader.getMaxFrameRateForCodec(MediaRecorder.VideoEncoder.H263);
|
int frameRate = MediaProfileReader.getMaxFrameRateForCodec(MediaRecorder.VideoEncoder.H263);
|
||||||
assertTrue("H263 video recording frame rate", frameRate != -1);
|
assertTrue("H263 video recording frame rate", frameRate != -1);
|
||||||
output.write("Audio and h263 video record\n");
|
mMemWriter.write("Audio and h263 video record\n");
|
||||||
for (int i = 0; i < NUM_STRESS_LOOP; i++) {
|
for (int i = 0; i < NUM_STRESS_LOOP; i++) {
|
||||||
assertTrue(stressVideoRecord(frameRate, 352, 288, MediaRecorder.VideoEncoder.H263,
|
assertTrue(stressVideoRecord(frameRate, 352, 288, MediaRecorder.VideoEncoder.H263,
|
||||||
MediaRecorder.OutputFormat.MPEG_4, MediaNames.RECORDED_VIDEO_3GP, false));
|
MediaRecorder.OutputFormat.MPEG_4, MediaNames.RECORDED_VIDEO_3GP, false));
|
||||||
getMemoryWriteToLog(output, i);
|
getMemoryWriteToLog(i);
|
||||||
|
writeProcmemInfo();
|
||||||
}
|
}
|
||||||
output.write("\n");
|
mMemWriter.write("\n");
|
||||||
memoryResult = validateMemoryResult(mStartPid, mStartMemory, output, ENCODER_LIMIT);
|
memoryResult = validateMemoryResult(mStartPid, mStartMemory, ENCODER_LIMIT);
|
||||||
output.close();
|
|
||||||
assertTrue("H263 audio video record memory test", memoryResult);
|
assertTrue("H263 audio video record memory test", memoryResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -436,18 +457,16 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med
|
|||||||
@LargeTest
|
@LargeTest
|
||||||
public void testRecordAudioOnlyMemoryUsage() throws Exception {
|
public void testRecordAudioOnlyMemoryUsage() throws Exception {
|
||||||
boolean memoryResult = false;
|
boolean memoryResult = false;
|
||||||
mStartPid = getMediaserverPid();
|
|
||||||
|
|
||||||
File audioOnlyMemoryOut = new File(MEDIA_MEMORY_OUTPUT);
|
mStartPid = getMediaserverPid();
|
||||||
Writer output = new BufferedWriter(new FileWriter(audioOnlyMemoryOut, true));
|
mMemWriter.write("Audio record only\n");
|
||||||
output.write("Audio record only\n");
|
|
||||||
for (int i = 0; i < NUM_STRESS_LOOP; i++) {
|
for (int i = 0; i < NUM_STRESS_LOOP; i++) {
|
||||||
stressAudioRecord(MediaNames.RECORDER_OUTPUT);
|
stressAudioRecord(MediaNames.RECORDER_OUTPUT);
|
||||||
getMemoryWriteToLog(output, i);
|
getMemoryWriteToLog(i);
|
||||||
|
writeProcmemInfo();
|
||||||
}
|
}
|
||||||
output.write("\n");
|
mMemWriter.write("\n");
|
||||||
memoryResult = validateMemoryResult(mStartPid, mStartMemory, output, ENCODER_LIMIT);
|
memoryResult = validateMemoryResult(mStartPid, mStartMemory, ENCODER_LIMIT);
|
||||||
output.close();
|
|
||||||
assertTrue("audio record only memory test", memoryResult);
|
assertTrue("audio record only memory test", memoryResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -455,18 +474,16 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med
|
|||||||
@LargeTest
|
@LargeTest
|
||||||
public void testCameraPreviewMemoryUsage() throws Exception {
|
public void testCameraPreviewMemoryUsage() throws Exception {
|
||||||
boolean memoryResult = false;
|
boolean memoryResult = false;
|
||||||
mStartPid = getMediaserverPid();
|
|
||||||
|
|
||||||
File cameraPreviewMemoryOut = new File(MEDIA_MEMORY_OUTPUT);
|
mStartPid = getMediaserverPid();
|
||||||
Writer output = new BufferedWriter(new FileWriter(cameraPreviewMemoryOut, true));
|
mMemWriter.write("Camera Preview Only\n");
|
||||||
output.write("Camera Preview Only\n");
|
|
||||||
for (int i = 0; i < NUM_STRESS_LOOP; i++) {
|
for (int i = 0; i < NUM_STRESS_LOOP; i++) {
|
||||||
stressCameraPreview();
|
stressCameraPreview();
|
||||||
getMemoryWriteToLog(output, i);
|
getMemoryWriteToLog(i);
|
||||||
|
writeProcmemInfo();
|
||||||
}
|
}
|
||||||
output.write("\n");
|
mMemWriter.write("\n");
|
||||||
memoryResult = validateMemoryResult(mStartPid, mStartMemory, output, CAMERA_LIMIT);
|
memoryResult = validateMemoryResult(mStartPid, mStartMemory, CAMERA_LIMIT);
|
||||||
output.close();
|
|
||||||
assertTrue("camera preview memory test", memoryResult);
|
assertTrue("camera preview memory test", memoryResult);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user