am 008fc5d1: Merge change 26332 into eclair

Merge commit '008fc5d142b58688a3827a544c524dff11204c62' into eclair-plus-aosp

* commit '008fc5d142b58688a3827a544c524dff11204c62':
  1) Add the wma / wmv profile reader.
This commit is contained in:
Yu Shan Emily Lau
2009-09-22 12:32:29 -07:00
committed by Android Git Automerger
3 changed files with 71 additions and 18 deletions

View File

@@ -32,6 +32,29 @@ public class MediaProfileReader {
return s; return s;
} }
public static boolean getWMAEnable() {
// push all the property into one big table
int wmaEnable = 1;
wmaEnable = SystemProperties.getInt("ro.media.dec.aud.wma.enabled",
wmaEnable);
if (wmaEnable == 1) {
return true;
} else {
return false;
}
}
public static boolean getWMVEnable(){
int wmvEnable = 1;
wmvEnable = SystemProperties.getInt("ro.media.dec.vid.wmv.enabled",
wmvEnable);
if (wmvEnable == 1) {
return true;
} else {
return false;
}
}
public static void createVideoProfileTable() { public static void createVideoProfileTable() {
// push all the property into one big table // push all the property into one big table
String encoderType = getVideoCodecProperty(); String encoderType = getVideoCodecProperty();

View File

@@ -18,6 +18,7 @@ package com.android.mediaframeworktest.functional;
import com.android.mediaframeworktest.MediaFrameworkTest; import com.android.mediaframeworktest.MediaFrameworkTest;
import com.android.mediaframeworktest.MediaNames; import com.android.mediaframeworktest.MediaNames;
import com.android.mediaframeworktest.MediaProfileReader;
import android.content.Context; import android.content.Context;
import android.test.ActivityInstrumentationTestCase; import android.test.ActivityInstrumentationTestCase;
@@ -35,11 +36,15 @@ import java.io.File;
public class MediaPlayerApiTest extends ActivityInstrumentationTestCase<MediaFrameworkTest> { public class MediaPlayerApiTest extends ActivityInstrumentationTestCase<MediaFrameworkTest> {
private boolean duratoinWithinTolerence = false; private boolean duratoinWithinTolerence = false;
private String TAG = "MediaPlayerApiTest"; private String TAG = "MediaPlayerApiTest";
private boolean isWMAEnable = false;
private boolean isWMVEnable = false;
Context mContext; Context mContext;
public MediaPlayerApiTest() { public MediaPlayerApiTest() {
super("com.android.mediaframeworktest", MediaFrameworkTest.class); super("com.android.mediaframeworktest", MediaFrameworkTest.class);
isWMAEnable = MediaProfileReader.getWMAEnable();
isWMVEnable = MediaProfileReader.getWMVEnable();
} }
protected void setUp() throws Exception { protected void setUp() throws Exception {
@@ -82,9 +87,11 @@ public class MediaPlayerApiTest extends ActivityInstrumentationTestCase<MediaFra
@MediumTest @MediumTest
public void testWMA9GetDuration() throws Exception { public void testWMA9GetDuration() throws Exception {
int duration = CodecTest.getDuration(MediaNames.WMA9); if (isWMAEnable) {
duratoinWithinTolerence = verifyDuration(duration, MediaNames.WMA9_LENGTH); int duration = CodecTest.getDuration(MediaNames.WMA9);
assertTrue("WMA9 getDuration", duratoinWithinTolerence); duratoinWithinTolerence = verifyDuration(duration, MediaNames.WMA9_LENGTH);
assertTrue("WMA9 getDuration", duratoinWithinTolerence);
}
} }
@MediumTest @MediumTest
@@ -123,8 +130,10 @@ public class MediaPlayerApiTest extends ActivityInstrumentationTestCase<MediaFra
@LargeTest @LargeTest
public void testWMA9GetCurrentPosition() throws Exception { public void testWMA9GetCurrentPosition() throws Exception {
boolean currentPosition = CodecTest.getCurrentPosition(MediaNames.WMA9); if (isWMAEnable) {
assertTrue("WMA9 GetCurrentPosition", currentPosition); boolean currentPosition = CodecTest.getCurrentPosition(MediaNames.WMA9);
assertTrue("WMA9 GetCurrentPosition", currentPosition);
}
} }
@LargeTest @LargeTest
@@ -160,8 +169,10 @@ public class MediaPlayerApiTest extends ActivityInstrumentationTestCase<MediaFra
@LargeTest @LargeTest
public void testWMA9Pause() throws Exception { public void testWMA9Pause() throws Exception {
boolean isPaused = CodecTest.pause(MediaNames.WMA9); if (isWMAEnable) {
assertTrue("WMA9 Pause", isPaused); boolean isPaused = CodecTest.pause(MediaNames.WMA9);
assertTrue("WMA9 Pause", isPaused);
}
} }
@LargeTest @LargeTest
@@ -269,8 +280,10 @@ public class MediaPlayerApiTest extends ActivityInstrumentationTestCase<MediaFra
@LargeTest @LargeTest
public void testWMA9SeekTo() throws Exception { public void testWMA9SeekTo() throws Exception {
boolean isLoop = CodecTest.seekTo(MediaNames.WMA9); if (isWMAEnable) {
assertTrue("WMA9 seekTo", isLoop); boolean isLoop = CodecTest.seekTo(MediaNames.WMA9);
assertTrue("WMA9 seekTo", isLoop);
}
} }
@LargeTest @LargeTest
@@ -309,8 +322,10 @@ public class MediaPlayerApiTest extends ActivityInstrumentationTestCase<MediaFra
@Suppress @Suppress
@LargeTest @LargeTest
public void testWMA9SeekToEnd() throws Exception { public void testWMA9SeekToEnd() throws Exception {
boolean isEnd = CodecTest.seekToEnd(MediaNames.WMA9); if (isWMAEnable) {
assertTrue("WMA9 seekToEnd", isEnd); boolean isEnd = CodecTest.seekToEnd(MediaNames.WMA9);
assertTrue("WMA9 seekToEnd", isEnd);
}
} }
@LargeTest @LargeTest
@@ -327,8 +342,10 @@ public class MediaPlayerApiTest extends ActivityInstrumentationTestCase<MediaFra
@LargeTest @LargeTest
public void testWAVSeekToEnd() throws Exception { public void testWAVSeekToEnd() throws Exception {
boolean isEnd = CodecTest.seekToEnd(MediaNames.WAV); if (isWMVEnable) {
assertTrue("WAV seekToEnd", isEnd); boolean isEnd = CodecTest.seekToEnd(MediaNames.WAV);
assertTrue("WAV seekToEnd", isEnd);
}
} }
@MediumTest @MediumTest
@@ -385,8 +402,12 @@ public class MediaPlayerApiTest extends ActivityInstrumentationTestCase<MediaFra
@LargeTest @LargeTest
public void testVideoWMVSeekTo() throws Exception { public void testVideoWMVSeekTo() throws Exception {
boolean isSeek = CodecTest.videoSeekTo(MediaNames.VIDEO_WMV); Log.v(TAG, "wmv not enable");
assertTrue("WMV SeekTo", isSeek); if (isWMVEnable) {
Log.v(TAG, "wmv enable");
boolean isSeek = CodecTest.videoSeekTo(MediaNames.VIDEO_WMV);
assertTrue("WMV SeekTo", isSeek);
}
} }
@LargeTest @LargeTest

View File

@@ -239,7 +239,7 @@ public class MediaRecorderTest extends ActivityInstrumentationTestCase<MediaFram
validVideo = true; validVideo = true;
} }
Log.v(TAG, "width = " + mOutputVideoWidth + " height = " + mOutputVideoHeight + " Duration = " + mOutputDuration); Log.v(TAG, "width = " + mOutputVideoWidth + " height = " + mOutputVideoHeight + " Duration = " + mOutputDuration);
removeFile(filePath); //removeFile(filePath);
return validVideo; return validVideo;
} }
@@ -428,8 +428,9 @@ public class MediaRecorderTest extends ActivityInstrumentationTestCase<MediaFram
} }
@LargeTest @LargeTest
//est cases for the new codec //test cases for the new codec
public void testDeviceSpecificCodec() throws Exception { public void testDeviceSpecificCodec() throws Exception {
int noOfFailure = 0;
boolean recordSuccess = false; boolean recordSuccess = false;
String deviceType = MediaProfileReader.getDeviceType(); String deviceType = MediaProfileReader.getDeviceType();
Log.v(TAG, "deviceType = " + deviceType); Log.v(TAG, "deviceType = " + deviceType);
@@ -450,10 +451,18 @@ public class MediaRecorderTest extends ActivityInstrumentationTestCase<MediaFram
} else { } else {
recordSuccess = recordVideoWithPara(encoder[i], audio[j], "low"); recordSuccess = recordVideoWithPara(encoder[i], audio[j], "low");
} }
assertTrue((encoder[i] + audio[j]), recordSuccess); if (!recordSuccess){
Log.v(TAG, "testDeviceSpecificCodec failed");
Log.v(TAG, "Encoder = " + encoder[i] + "Audio Encoder = " + audio[j]);
noOfFailure++;
}
//assertTrue((encoder[i] + audio[j]), recordSuccess);
} }
} }
} }
} }
if (noOfFailure != 0){
assertTrue("testDeviceSpecificCodec", false);
}
} }
} }