Merge change 539 into donut
* changes: Modify and turn on the test case for video recording in portrait mode.
This commit is contained in:
@@ -464,6 +464,7 @@ public class MediaNames {
|
|||||||
public static final String RECORDED_SQVGA_H263 = "/sdcard/SQVGA_H263.3gp";
|
public static final String RECORDED_SQVGA_H263 = "/sdcard/SQVGA_H263.3gp";
|
||||||
public static final String RECORDED_CIF_H263 = "/sdcard/CIF_H263.3gp";
|
public static final String RECORDED_CIF_H263 = "/sdcard/CIF_H263.3gp";
|
||||||
public static final String RECORDED_QCIF_H263 = "/sdcard/QCIF_H263.3gp";
|
public static final String RECORDED_QCIF_H263 = "/sdcard/QCIF_H263.3gp";
|
||||||
|
public static final String RECORDED_PORTRAIT_H263 = "/sdcard/QCIF_mp4.3gp";
|
||||||
|
|
||||||
public static final String RECORDED_HVGA_MP4 = "/sdcard/HVGA_mp4.mp4";
|
public static final String RECORDED_HVGA_MP4 = "/sdcard/HVGA_mp4.mp4";
|
||||||
public static final String RECORDED_QVGA_MP4 = "/sdcard/QVGA_mp4.mp4";
|
public static final String RECORDED_QVGA_MP4 = "/sdcard/QVGA_mp4.mp4";
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.android.mediaframeworktest.MediaNames;
|
|||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.hardware.Camera;
|
||||||
import android.media.MediaPlayer;
|
import android.media.MediaPlayer;
|
||||||
import android.media.MediaRecorder;
|
import android.media.MediaRecorder;
|
||||||
import android.test.ActivityInstrumentationTestCase;
|
import android.test.ActivityInstrumentationTestCase;
|
||||||
@@ -46,6 +47,7 @@ public class MediaRecorderTest extends ActivityInstrumentationTestCase<MediaFram
|
|||||||
private SurfaceHolder mSurfaceHolder = null;
|
private SurfaceHolder mSurfaceHolder = null;
|
||||||
private MediaRecorder mRecorder;
|
private MediaRecorder mRecorder;
|
||||||
Context mContext;
|
Context mContext;
|
||||||
|
Camera mCamera;
|
||||||
|
|
||||||
public MediaRecorderTest() {
|
public MediaRecorderTest() {
|
||||||
super("com.android.mediaframeworktest", MediaFrameworkTest.class);
|
super("com.android.mediaframeworktest", MediaFrameworkTest.class);
|
||||||
@@ -234,12 +236,32 @@ public class MediaRecorderTest extends ActivityInstrumentationTestCase<MediaFram
|
|||||||
assertTrue("QCIFH263 Video Only", videoRecordedResult);
|
assertTrue("QCIFH263 Video Only", videoRecordedResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress
|
@LargeTest
|
||||||
public void testPortraitH263() throws Exception {
|
/*
|
||||||
|
* This test case set the camera in portrait mode.
|
||||||
|
* Verification: validate the video dimension and the duration.
|
||||||
|
*/
|
||||||
|
public void testPortraitH263() throws Exception {
|
||||||
boolean videoRecordedResult = false;
|
boolean videoRecordedResult = false;
|
||||||
recordVideo(15, 144, 176, MediaRecorder.VideoEncoder.H263,
|
try {
|
||||||
MediaRecorder.OutputFormat.MPEG_4, MediaNames.RECORDED_VIDEO_3GP, true);
|
mCamera = Camera.open();
|
||||||
videoRecordedResult = validateVideo(MediaNames.RECORDED_VIDEO_3GP, 144, 176);
|
Camera.Parameters parameters = mCamera.getParameters();
|
||||||
|
parameters.setPreviewSize(352, 288);
|
||||||
|
parameters.set("orientation", "portrait");
|
||||||
|
mCamera.setParameters(parameters);
|
||||||
|
mCamera.unlock();
|
||||||
|
mRecorder.setCamera(mCamera);
|
||||||
|
Thread.sleep(1000);
|
||||||
|
recordVideo(15, 352, 288, MediaRecorder.VideoEncoder.H263,
|
||||||
|
MediaRecorder.OutputFormat.THREE_GPP,
|
||||||
|
MediaNames.RECORDED_PORTRAIT_H263, true);
|
||||||
|
videoRecordedResult =
|
||||||
|
validateVideo(MediaNames.RECORDED_PORTRAIT_H263, 352, 288);
|
||||||
|
mCamera.lock();
|
||||||
|
mCamera.release();
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.v(TAG, e.toString());
|
||||||
|
}
|
||||||
assertTrue("PortraitH263", videoRecordedResult);
|
assertTrue("PortraitH263", videoRecordedResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user