diff options
author | James Dong <jdong@google.com> | 2009-11-02 17:46:36 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-11-02 17:46:36 -0800 |
commit | ffca7606120da2e1b36873cc79776f66cc7e0e3a (patch) | |
tree | d9ca290d261bd011cabcf2a9e512f6c031d8f6fd /media/tests | |
parent | 56c93389a2e5a25d9b6620b9bdfbf4ac9ec0462d (diff) | |
parent | 763701408b09195a2b82bd088fc83c61b27c9be4 (diff) | |
download | frameworks_base-ffca7606120da2e1b36873cc79776f66cc7e0e3a.zip frameworks_base-ffca7606120da2e1b36873cc79776f66cc7e0e3a.tar.gz frameworks_base-ffca7606120da2e1b36873cc79776f66cc7e0e3a.tar.bz2 |
am 76370140: am 9d4dcf28: am f67eff17: Merge change Ib0036762 into eclair
Merge commit '763701408b09195a2b82bd088fc83c61b27c9be4'
* commit '763701408b09195a2b82bd088fc83c61b27c9be4':
Add windows media support check in MediaMetadataRetrieverTest
Diffstat (limited to 'media/tests')
-rw-r--r-- | media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaMetadataRetrieverTest.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaMetadataRetrieverTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaMetadataRetrieverTest.java index 9927eda..8750098 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaMetadataRetrieverTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaMetadataRetrieverTest.java @@ -22,6 +22,7 @@ import android.graphics.Bitmap; import java.io.FileOutputStream; import android.test.AndroidTestCase; import com.android.mediaframeworktest.MediaNames; +import com.android.mediaframeworktest.MediaProfileReader; import android.test.suitebuilder.annotation.*; /** @@ -38,10 +39,19 @@ public class MediaMetadataRetrieverTest extends AndroidTestCase { public static void testAlbumArt() throws Exception { Log.v(TAG, "testAlbumArt starts."); MediaMetadataRetriever retriever = new MediaMetadataRetriever(); + MediaProfileReader reader = new MediaProfileReader(); + boolean supportWMA = reader.getWMAEnable(); + boolean supportWMV = reader.getWMVEnable(); retriever.setMode(MediaMetadataRetriever.MODE_GET_METADATA_ONLY); for (int i = 0, n = MediaNames.ALBUMART_TEST_FILES.length; i < n; ++i) { try { Log.v(TAG, "File " + i + ": " + MediaNames.ALBUMART_TEST_FILES[i]); + if ((MediaNames.ALBUMART_TEST_FILES[i].endsWith(".wma") && !supportWMA) || + (MediaNames.ALBUMART_TEST_FILES[i].endsWith(".wmv") && !supportWMV) + ) { + Log.v(TAG, "windows media is not supported and thus we will skip the test for this file"); + continue; + } retriever.setDataSource(MediaNames.ALBUMART_TEST_FILES[i]); byte[] albumArt = retriever.extractAlbumArt(); @@ -64,11 +74,20 @@ public class MediaMetadataRetrieverTest extends AndroidTestCase { @LargeTest public static void testThumbnailCapture() throws Exception { MediaMetadataRetriever retriever = new MediaMetadataRetriever(); + MediaProfileReader reader = new MediaProfileReader(); + boolean supportWMA = reader.getWMAEnable(); + boolean supportWMV = reader.getWMVEnable(); Log.v(TAG, "Thumbnail processing starts"); long startedAt = System.currentTimeMillis(); for(int i = 0, n = MediaNames.THUMBNAIL_CAPTURE_TEST_FILES.length; i < n; ++i) { try { Log.v(TAG, "File " + i + ": " + MediaNames.THUMBNAIL_CAPTURE_TEST_FILES[i]); + if ((MediaNames.THUMBNAIL_CAPTURE_TEST_FILES[i].endsWith(".wma") && !supportWMA) || + (MediaNames.THUMBNAIL_CAPTURE_TEST_FILES[i].endsWith(".wmv") && !supportWMV) + ) { + Log.v(TAG, "windows media is not supported and thus we will skip the test for this file"); + continue; + } retriever.setDataSource(MediaNames.THUMBNAIL_CAPTURE_TEST_FILES[i]); Bitmap bitmap = retriever.captureFrame(); assertTrue(bitmap != null); @@ -91,10 +110,20 @@ public class MediaMetadataRetrieverTest extends AndroidTestCase { @LargeTest public static void testMetadataRetrieval() throws Exception { + MediaProfileReader reader = new MediaProfileReader(); + boolean supportWMA = reader.getWMAEnable(); + boolean supportWMV = reader.getWMVEnable(); MediaMetadataRetriever retriever = new MediaMetadataRetriever(); retriever.setMode(MediaMetadataRetriever.MODE_GET_METADATA_ONLY); for(int i = 0, n = MediaNames.METADATA_RETRIEVAL_TEST_FILES.length; i < n; ++i) { try { + Log.v(TAG, "File " + i + ": " + MediaNames.METADATA_RETRIEVAL_TEST_FILES[i]); + if ((MediaNames.METADATA_RETRIEVAL_TEST_FILES[i].endsWith(".wma") && !supportWMA) || + (MediaNames.METADATA_RETRIEVAL_TEST_FILES[i].endsWith(".wmv") && !supportWMV) + ) { + Log.v(TAG, "windows media is not supported and thus we will skip the test for this file"); + continue; + } retriever.setDataSource(MediaNames.METADATA_RETRIEVAL_TEST_FILES[i]); extractAllSupportedMetadataValues(retriever); } catch(Exception e) { |