diff options
author | Yu Shan Emily Lau <yslau@google.com> | 2011-06-01 16:33:35 -0700 |
---|---|---|
committer | Yu Shan Emily Lau <yslau@google.com> | 2011-06-01 16:33:35 -0700 |
commit | fa22e625896d0b1e0d02fce52fbdd88f2e11482d (patch) | |
tree | ea3a0381e07ba8f66862d2daf10d9ad53bbe9697 /media/tests | |
parent | 2978cef0a77550ea3a364ffbf42fc43f2029070e (diff) | |
download | frameworks_base-fa22e625896d0b1e0d02fce52fbdd88f2e11482d.zip frameworks_base-fa22e625896d0b1e0d02fce52fbdd88f2e11482d.tar.gz frameworks_base-fa22e625896d0b1e0d02fce52fbdd88f2e11482d.tar.bz2 |
Convert the video editor performance
test suite output from float to int.
Change-Id: I62fada18a4c34d06b8d0ed91885e5bd98f12523f
Diffstat (limited to 'media/tests')
-rw-r--r-- | media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/VideoEditorPerformance.java | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/VideoEditorPerformance.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/VideoEditorPerformance.java index 4c66a2d..7eb6d22 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/VideoEditorPerformance.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/VideoEditorPerformance.java @@ -112,12 +112,11 @@ public class VideoEditorPerformance extends private final int NUM_OF_ITERATIONS=20; - private float calculateTimeTaken(long beginTime, int numIterations) + private int calculateTimeTaken(long beginTime, int numIterations) throws Exception { final long duration2 = SystemClock.uptimeMillis(); final long durationToCreateMediaItem = (duration2 - beginTime); - final float timeTaken1 = (float)durationToCreateMediaItem * - 1.0f/(float)numIterations; + final int timeTaken1 = (int)(durationToCreateMediaItem / numIterations); return (timeTaken1); } @@ -208,7 +207,7 @@ public class VideoEditorPerformance extends final String[] loggingInfo = new String[3]; final MediaVideoItem[] mediaVideoItem = new MediaVideoItem[NUM_OF_ITERATIONS]; - float timeTaken = 0.0f; + int timeTaken = 0; long startTime = 0; /** Time Take for creation of Media Video Item */ @@ -251,7 +250,7 @@ public class VideoEditorPerformance extends final String[] loggingInfo = new String[3]; final MediaImageItem[] mediaImageItem = new MediaImageItem[NUM_OF_ITERATIONS]; - float timeTaken = 0.0f; + int timeTaken = 0; long beginTime = SystemClock.uptimeMillis(); createImageItems(mediaImageItem, imageItemFileName, renderingMode, @@ -296,7 +295,7 @@ public class VideoEditorPerformance extends final int transitionDuration = 5000; final int transitionBehavior = Transition.BEHAVIOR_MIDDLE_FAST; final String[] loggingInfo = new String[3]; - float timeTaken = 0.0f; + int timeTaken = 0; final MediaVideoItem[] mediaVideoItem = new MediaVideoItem[(NUM_OF_ITERATIONS *10) + 1]; @@ -514,7 +513,7 @@ public class VideoEditorPerformance extends /** 18.Enable Looping for Audio Track. * */ audioTrack.enableLoop(); - float timeTaken = 0.0f; + int timeTaken = 0; final long beginTime = SystemClock.uptimeMillis(); try { mVideoEditor.export(outFilename, outHeight, outBitrate, @@ -557,7 +556,7 @@ public class VideoEditorPerformance extends mediaVideoItem.setExtractBoundaries(videoItemStartTime, videoItemEndTime); - float timeTaken = 0.0f; + int timeTaken = 0; long beginTime = SystemClock.uptimeMillis(); for (int i = 0; i < NUM_OF_ITERATIONS; i++) { mediaVideoItem.getThumbnail(mediaVideoItem.getWidth() / 2, @@ -603,7 +602,7 @@ public class VideoEditorPerformance extends final OverlayFrame overlayFrame[] = new OverlayFrame[NUM_OF_ITERATIONS]; final Bitmap mBitmap = mVideoEditorHelper.getBitmap(overlayFilename, 640, 480); - float timeTaken = 0.0f; + int timeTaken = 0; long beginTime = SystemClock.uptimeMillis(); for (int i = 0; i < NUM_OF_ITERATIONS; i++) { overlayFrame[i] = new OverlayFrame(mediaVideoItem, "overlay" + i, @@ -647,7 +646,7 @@ public class VideoEditorPerformance extends final int videoProfile = MediaProperties.H264_PROFILE_0_LEVEL_1_3; final int width = 1080; final int height = MediaProperties.HEIGHT_720; - float timeTaken = 0.0f; + int timeTaken = 0; final String[] loggingInfo = new String[1]; final MediaVideoItem mediaVideoItem = new MediaVideoItem(mVideoEditor, "m0", videoItemFileName1, renderingMode); @@ -1006,7 +1005,7 @@ public class VideoEditorPerformance extends final int renderingMode = MediaItem.RENDERING_MODE_BLACK_BORDER; final int audioVolume = 50; final String[] loggingInfo = new String[2]; - float timeTaken = 0.0f; + int timeTaken = 0; final MediaVideoItem mediaVideoItem = new MediaVideoItem(mVideoEditor, "mediaItem1", videoItemFileName1, renderingMode); @@ -1057,7 +1056,7 @@ public class VideoEditorPerformance extends final int renderingMode = MediaItem.RENDERING_MODE_BLACK_BORDER; final String[] loggingInfo = new String[3]; - float timeTaken = 0.0f; + int timeTaken = 0; final MediaImageItem[] mediaImageItem = new MediaImageItem[NUM_OF_ITERATIONS]; |