diff options
author | Yu Shan Emily Lau <yslau@google.com> | 2009-05-19 15:46:22 -0700 |
---|---|---|
committer | Yu Shan Emily Lau <yslau@google.com> | 2009-05-19 15:46:22 -0700 |
commit | be467b579e06443bc79ea6a04ba0b4d4746da994 (patch) | |
tree | c216554148b3d331479a24762e19f1d9831bbf6e /media/tests | |
parent | 65ff54c44bbd8c1dd6818d42b7c91c634c644aa9 (diff) | |
download | frameworks_base-be467b579e06443bc79ea6a04ba0b4d4746da994.zip frameworks_base-be467b579e06443bc79ea6a04ba0b4d4746da994.tar.gz frameworks_base-be467b579e06443bc79ea6a04ba0b4d4746da994.tar.bz2 |
Replaced the old test media files with the new open source test media files.
Fix the bug in testGetThumbnail test.
Diffstat (limited to 'media/tests')
-rw-r--r-- | media/tests/MediaFrameworkTest/res/raw/testmidi.mid | bin | 38964 -> 2956 bytes | |||
-rw-r--r-- | media/tests/MediaFrameworkTest/res/raw/testmp3.mp3 | bin | 249241 -> 306196 bytes | |||
-rwxr-xr-x | media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaNames.java | 47 | ||||
-rw-r--r-- | media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/CodecTest.java | 27 | ||||
-rw-r--r-- | media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaPlayerApiTest.java | 4 |
5 files changed, 39 insertions, 39 deletions
diff --git a/media/tests/MediaFrameworkTest/res/raw/testmidi.mid b/media/tests/MediaFrameworkTest/res/raw/testmidi.mid Binary files differindex df84e20..d4ead53 100644 --- a/media/tests/MediaFrameworkTest/res/raw/testmidi.mid +++ b/media/tests/MediaFrameworkTest/res/raw/testmidi.mid diff --git a/media/tests/MediaFrameworkTest/res/raw/testmp3.mp3 b/media/tests/MediaFrameworkTest/res/raw/testmp3.mp3 Binary files differindex 89c44b0..b7d69f8 100644 --- a/media/tests/MediaFrameworkTest/res/raw/testmp3.mp3 +++ b/media/tests/MediaFrameworkTest/res/raw/testmp3.mp3 diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaNames.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaNames.java index 407b4b3..fd3a4ba 100755 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaNames.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaNames.java @@ -26,25 +26,24 @@ public class MediaNames { //A directory to hold all kinds of media files public static final String MEDIA_SAMPLE_POOL = "/sdcard/media_api/samples/"; //Audio files - public static final String MP3CBR = "/sdcard/media_api/music/MP3CBR.mp3"; - public static final String MP3VBR = "/sdcard/media_api/music/MP3VBR.mp3"; + public static final String MP3CBR = "/sdcard/media_api/music/MP3_256kbps_2ch.mp3"; + public static final String MP3VBR = "/sdcard/media_api/music/MP3_256kbps_2ch_VBR.mp3"; public static final String SHORTMP3 = "/sdcard/media_api/music/SHORTMP3.mp3"; - public static final String MIDI = "/sdcard/media_api/music/MIDI.mid"; + public static final String MIDI = "/sdcard/media_api/music/ants.mid"; public static final String WMA9 = "/sdcard/media_api/music/WMA9.wma"; public static final String WMA10 = "/sdcard/media_api/music/WMA10.wma"; - public static final String WAV = "/sdcard/media_api/music/complicated_wav.wav"; - public static final String AMR = "/sdcard/media_api/music/AMRNB.amr"; - public static final String OGG = "/sdcard/media_api/music/Mists_of_Time-4T.ogg"; - public static final String OGGSHORT = "/sdcard/media_api/music/Skippy.ogg"; + public static final String WAV = "/sdcard/media_api/music/rings_2ch.wav"; + public static final String AMR = "/sdcard/media_api/music/test_amr_ietf.amr"; + public static final String OGG = "/sdcard/media_api/music/Revelation.ogg"; - public static final int MP3CBR_LENGTH = 231116; - public static final int MP3VBR_LENGTH = 126407; + public static final int MP3CBR_LENGTH = 71000; + public static final int MP3VBR_LENGTH = 71000; public static final int SHORTMP3_LENGTH = 286; - public static final int MIDI_LENGTH = 210528; + public static final int MIDI_LENGTH = 17000; public static final int WMA9_LENGTH = 126559; public static final int WMA10_LENGTH = 126559; - public static final int AMR_LENGTH = 126540; - public static final int OGG_LENGTH = 40000; + public static final int AMR_LENGTH = 37000; + public static final int OGG_LENGTH = 4000; public static final int SEEK_TIME = 10000; public static final long PAUSE_WAIT_TIME = 3000; @@ -61,29 +60,21 @@ public class MediaNames { //public static final String VIDEO_RTSP3GP = "rtsp://193.159.241.21/sp/alizee05.3gp"; //local video - public static final String VIDEO_MP4 = "/sdcard/media_api/video/gingerkids.MP4"; + public static final String VIDEO_MP4 = "/sdcard/media_api/video/MPEG4_320_AAC_64.mp4"; public static final String VIDEO_LONG_3GP = "/sdcard/media_api/video/radiohead.3gp"; public static final String VIDEO_SHORT_3GP = "/sdcard/media_api/video/short.3gp"; public static final String VIDEO_LARGE_SIZE_3GP = "/sdcard/media_api/video/border_large.3gp"; - public static final String VIDEO_H263_AAC = "/sdcard/media_api/video/H263_AAC.3gp"; - public static final String VIDEO_H263_AMR = "/sdcard/media_api/video/H263_AMR.3gp"; - public static final String VIDEO_H264_AAC = "/sdcard/media_api/video/H264_AAC.3gp"; - public static final String VIDEO_H264_AMR = "/sdcard/media_api/video/H264_AMR.3gp"; + public static final String VIDEO_H263_AAC = "/sdcard/media_api/video/H263_56_AAC_24.3gp"; + public static final String VIDEO_H263_AMR = "/sdcard/media_api/video/H263_56_AMRNB_6.3gp"; + public static final String VIDEO_H264_AAC = "/sdcard/media_api/video/H264_320_AAC_64.3gp"; + public static final String VIDEO_H264_AMR = "/sdcard/media_api/video/H264_320_AMRNB_6.3gp"; public static final String VIDEO_WMV = "/sdcard/media_api/video/bugs.wmv"; - public static final String VIDEO_HIGHRES_H263 = "/sdcard/media_api/video/h263_qcif_30fps.3gp"; - public static final String VIDEO_HIGHRES_MP4 = "/sdcard/media_api/video/mpeg4_qvga_24fps.3gp"; + public static final String VIDEO_HIGHRES_H263 = "/sdcard/media_api/video/H263_500_AMRNB_12.3gp"; + public static final String VIDEO_HIGHRES_MP4 = "/sdcard/media_api/video/H264_500_AAC_128.3gp"; //ringtone public static final String ringtone = "/sdcard/media_api/ringtones/F1_NewVoicemail.mp3"; - - //streaming mp3 - public static final String STREAM_LARGE_MP3 = - "http://wms.pv.com:7070/MediaDownloadContent/mp3/BuenaVista_04_Pueblo_Nuevo.mp3"; - public static final String STREAM_SMALL_MP3 = - "http://wms.pv.com:7070/MediaDownloadContent/mp3/ID3V2_TestFile.mp3"; - public static final String STREAM_REGULAR_MP3 = - "http://wms.pv.com:7070/MediaDownloadContent/mp3/ElectricCosmo.mp3"; - + //streaming mp3 public static final String STREAM_MP3_1 = "http://wms.pv.com:7070/MediaDownloadContent/mp3/chadthi_jawani_128kbps.mp3"; diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/CodecTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/CodecTest.java index cbd44ab..0c0974c 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/CodecTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/CodecTest.java @@ -32,8 +32,13 @@ import android.os.Looper; import android.os.SystemClock; import android.util.Log; +import java.io.File; +import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; +import java.io.OutputStream; +import java.io.Writer; +import java.io.FileOutputStream; import java.util.Random; /** * Junit / Instrumentation test case for the media player api @@ -80,7 +85,9 @@ public class CodecTest { try{ mp.setDataSource(filePath); mp.prepare(); - }catch (Exception e){} + }catch (Exception e){ + Log.v(TAG, e.toString()); + } int duration = mp.getDuration(); Log.v(TAG, "Duration " + duration); mp.release(); @@ -529,7 +536,6 @@ public class CodecTest { //Verify the thumbnail Bitmap goldenBitmap = mBitmapFactory.decodeFile(goldenPath); - outputWidth = outThumbnail.getWidth(); outputHeight = outThumbnail.getHeight(); goldenHeight = goldenBitmap.getHeight(); @@ -539,15 +545,18 @@ public class CodecTest { if ((outputWidth != goldenWidth) || (outputHeight != goldenHeight)) return false; - //Check one line of pixel - int x = goldenHeight/2; - for (int j=0; j<goldenWidth; j++){ - if (goldenBitmap.getPixel(x, j) != outThumbnail.getPixel(x, j)){ + // Check half line of pixel + int x = goldenHeight / 2; + for (int j = 1; j < goldenWidth / 2; j++) { + if (goldenBitmap.getPixel(x, j) != outThumbnail.getPixel(x, j)) { Log.v(TAG, "pixel = " + goldenBitmap.getPixel(x, j)); - return false; + return false; } - } - }catch (Exception e){} + } + }catch (Exception e){ + Log.v(TAG, e.toString()); + return false; + } return true; } diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaPlayerApiTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaPlayerApiTest.java index 94c69a8..e01bd53 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaPlayerApiTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaPlayerApiTest.java @@ -410,7 +410,7 @@ public class MediaPlayerApiTest extends ActivityInstrumentationTestCase<MediaFra //Play a mid file which the duration is around 210 seconds @LargeTest public void testMidiResources() throws Exception { - boolean midiResources = CodecTest.resourcesPlayback(MediaFrameworkTest.midiafd,180000); + boolean midiResources = CodecTest.resourcesPlayback(MediaFrameworkTest.midiafd,16000); assertTrue("Play midi from resources", midiResources); } @@ -422,7 +422,7 @@ public class MediaPlayerApiTest extends ActivityInstrumentationTestCase<MediaFra @MediumTest public void testPrepareAsyncReset() throws Exception { - boolean isReset = CodecTest.prepareAsyncReset(MediaNames.STREAM_LARGE_MP3); + boolean isReset = CodecTest.prepareAsyncReset(MediaNames.STREAM_MP3); assertTrue("PrepareAsync Reset", isReset); } |