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;
}
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() {
// push all the property into one big table
String encoderType = getVideoCodecProperty();

View File

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

View File

@@ -239,7 +239,7 @@ public class MediaRecorderTest extends ActivityInstrumentationTestCase<MediaFram
validVideo = true;
}
Log.v(TAG, "width = " + mOutputVideoWidth + " height = " + mOutputVideoHeight + " Duration = " + mOutputDuration);
removeFile(filePath);
//removeFile(filePath);
return validVideo;
}
@@ -428,8 +428,9 @@ public class MediaRecorderTest extends ActivityInstrumentationTestCase<MediaFram
}
@LargeTest
//est cases for the new codec
//test cases for the new codec
public void testDeviceSpecificCodec() throws Exception {
int noOfFailure = 0;
boolean recordSuccess = false;
String deviceType = MediaProfileReader.getDeviceType();
Log.v(TAG, "deviceType = " + deviceType);
@@ -450,10 +451,18 @@ public class MediaRecorderTest extends ActivityInstrumentationTestCase<MediaFram
} else {
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);
}
}
}