summaryrefslogtreecommitdiffstats
path: root/media/tests
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2009-11-02 17:19:51 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-11-02 17:19:51 -0800
commit9d4dcf287cb74d8d82a89df8d93301cd9c6b27d8 (patch)
treebcc838d03761d2a7469dc7304dfc2a466e58e33f /media/tests
parent4aa7e0aae14d2f05afb85bc1e0a7d523ebcb3da7 (diff)
parentf67eff177515baa421d8717ee20efdc516fde580 (diff)
downloadframeworks_base-9d4dcf287cb74d8d82a89df8d93301cd9c6b27d8.zip
frameworks_base-9d4dcf287cb74d8d82a89df8d93301cd9c6b27d8.tar.gz
frameworks_base-9d4dcf287cb74d8d82a89df8d93301cd9c6b27d8.tar.bz2
am f67eff17: Merge change Ib0036762 into eclair
Merge commit 'f67eff177515baa421d8717ee20efdc516fde580' into eclair-mr2 * commit 'f67eff177515baa421d8717ee20efdc516fde580': Add windows media support check in MediaMetadataRetrieverTest
Diffstat (limited to 'media/tests')
-rw-r--r--media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaMetadataRetrieverTest.java29
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) {