am 7756cbee: Merge change 27073 into eclair

Merge commit '7756cbeef475127ed56bfeabecb3c291366a952f' into eclair-plus-aosp

* commit '7756cbeef475127ed56bfeabecb3c291366a952f':
  Removed the device type checking
This commit is contained in:
Yu Shan Emily Lau
2009-09-25 16:47:24 -07:00
committed by Android Git Automerger
2 changed files with 39 additions and 36 deletions

View File

@ -58,19 +58,21 @@ public class MediaProfileReader {
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();
String encoder[] = encoderType.split(","); if (encoderType.length() != 0) {
for (int i = 0; i < encoder.length; i++) { String encoder[] = encoderType.split(",");
for (int j = 0; j < VIDEO_ENCODER_PROPERTY.length; j++) { for (int i = 0; i < encoder.length; i++) {
String propertyName = MEDIA_ENC_VID + encoder[i] + VIDEO_ENCODER_PROPERTY[j]; for (int j = 0; j < VIDEO_ENCODER_PROPERTY.length; j++) {
String prop = SystemProperties.get(propertyName); String propertyName = MEDIA_ENC_VID + encoder[i] + VIDEO_ENCODER_PROPERTY[j];
//push to the table String prop = SystemProperties.get(propertyName);
String propRange[] = prop.split(","); // push to the table
OUTPUT_FORMAT_TABLE.put((encoder[i] + VIDEO_ENCODER_PROPERTY[j] + "_low"), String propRange[] = prop.split(",");
Integer.parseInt(propRange[0])); OUTPUT_FORMAT_TABLE.put((encoder[i] + VIDEO_ENCODER_PROPERTY[j] + "_low"),
OUTPUT_FORMAT_TABLE.put((encoder[i] + VIDEO_ENCODER_PROPERTY[j] + "_high"), Integer.parseInt(propRange[0]));
Integer.parseInt(propRange[1])); OUTPUT_FORMAT_TABLE.put((encoder[i] + VIDEO_ENCODER_PROPERTY[j] + "_high"),
} Integer.parseInt(propRange[1]));
}
}
} }
} }
@ -78,18 +80,19 @@ public class MediaProfileReader {
// push all the property into one big table // push all the property into one big table
String audioType = getAudioCodecProperty(); String audioType = getAudioCodecProperty();
String encoder[] = audioType.split(","); String encoder[] = audioType.split(",");
for (int i = 0; i < encoder.length; i++) { if (audioType.length() != 0) {
for (int j = 0; j < AUDIO_ENCODER_PROPERTY.length; j++) { for (int i = 0; i < encoder.length; i++) {
String propertyName = MEDIA_AUD_VID + encoder[i] + AUDIO_ENCODER_PROPERTY[j]; for (int j = 0; j < AUDIO_ENCODER_PROPERTY.length; j++) {
String prop = SystemProperties.get(propertyName); String propertyName = MEDIA_AUD_VID + encoder[i] + AUDIO_ENCODER_PROPERTY[j];
//push to the table String prop = SystemProperties.get(propertyName);
String propRange[] = prop.split(","); // push to the table
OUTPUT_FORMAT_TABLE.put((encoder[i] + AUDIO_ENCODER_PROPERTY[j] + "_low"), String propRange[] = prop.split(",");
Integer.parseInt(propRange[0])); OUTPUT_FORMAT_TABLE.put((encoder[i] + AUDIO_ENCODER_PROPERTY[j] + "_low"),
OUTPUT_FORMAT_TABLE.put((encoder[i] + AUDIO_ENCODER_PROPERTY[j] + "_high"), Integer.parseInt(propRange[0]));
Integer.parseInt(propRange[1])); OUTPUT_FORMAT_TABLE.put((encoder[i] + AUDIO_ENCODER_PROPERTY[j] + "_high"),
Integer.parseInt(propRange[1]));
}
} }
} }
} }

View File

@ -434,15 +434,15 @@ public class MediaRecorderTest extends ActivityInstrumentationTestCase<MediaFram
boolean recordSuccess = false; boolean recordSuccess = false;
String deviceType = MediaProfileReader.getDeviceType(); String deviceType = MediaProfileReader.getDeviceType();
Log.v(TAG, "deviceType = " + deviceType); Log.v(TAG, "deviceType = " + deviceType);
if (deviceType.compareTo("voles") == 0) { // Test cases are device specified
// Test cases are device specified MediaProfileReader.createVideoProfileTable();
MediaProfileReader.createVideoProfileTable(); MediaProfileReader.createAudioProfileTable();
MediaProfileReader.createAudioProfileTable(); MediaProfileReader.createEncoderTable();
MediaProfileReader.createEncoderTable(); String encoderType = MediaProfileReader.getVideoCodecProperty();
String encoderType = MediaProfileReader.getVideoCodecProperty(); String audioType = MediaProfileReader.getAudioCodecProperty();
String encoder[] = encoderType.split(","); if ((encoderType.length() != 0) || (audioType.length() != 0)) {
String audioType = MediaProfileReader.getAudioCodecProperty();
String audio[] = audioType.split(","); String audio[] = audioType.split(",");
String encoder[] = encoderType.split(",");
for (int k = 0; k < 2; k++) { for (int k = 0; k < 2; k++) {
for (int i = 0; i < encoder.length; i++) { for (int i = 0; i < encoder.length; i++) {
for (int j = 0; j < audio.length; j++) { for (int j = 0; j < audio.length; j++) {
@ -451,18 +451,18 @@ public class MediaRecorderTest extends ActivityInstrumentationTestCase<MediaFram
} else { } else {
recordSuccess = recordVideoWithPara(encoder[i], audio[j], "low"); recordSuccess = recordVideoWithPara(encoder[i], audio[j], "low");
} }
if (!recordSuccess){ if (!recordSuccess) {
Log.v(TAG, "testDeviceSpecificCodec failed"); Log.v(TAG, "testDeviceSpecificCodec failed");
Log.v(TAG, "Encoder = " + encoder[i] + "Audio Encoder = " + audio[j]); Log.v(TAG, "Encoder = " + encoder[i] + "Audio Encoder = " + audio[j]);
noOfFailure++; noOfFailure++;
} }
//assertTrue((encoder[i] + audio[j]), recordSuccess); // assertTrue((encoder[i] + audio[j]), recordSuccess);
} }
} }
} }
} if (noOfFailure != 0) {
if (noOfFailure != 0){ assertTrue("testDeviceSpecificCodec", false);
assertTrue("testDeviceSpecificCodec", false); }
} }
} }
} }