summaryrefslogtreecommitdiffstats
path: root/tests/src/com
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2009-11-10 18:32:09 +0800
committerWu-cheng Li <wuchengli@google.com>2009-11-12 11:41:24 +0800
commit9324f11afe9366cd5479828a214dc8de8696a5ab (patch)
tree23ba2cdd90c6d7483637eb53768c2a757a79df08 /tests/src/com
parent01ed85fbf71fd89db9d031d1cc5529afd7b624f0 (diff)
downloadLegacyCamera-9324f11afe9366cd5479828a214dc8de8696a5ab.zip
LegacyCamera-9324f11afe9366cd5479828a214dc8de8696a5ab.tar.gz
LegacyCamera-9324f11afe9366cd5479828a214dc8de8696a5ab.tar.bz2
Add postview callback to know when the captured image is shown. b2237074
Some platform display the captured image to the screen in postview callback. Some do that in raw picture callback. The camera application wants to make sure the captured image is displayed for at least 1.2 seconds. But orginally the app does not register postview callback and always start the timer in raw picture callback. Currently postview callback always arrives before raw callback. Without this change, the camera app may think the captured image is not displyed long enough and add some delay before starting preview, which will increase the shot-to-shot latency (ex: 0.8s) unexpectedly.
Diffstat (limited to 'tests/src/com')
-rwxr-xr-xtests/src/com/android/camera/stress/CameraLatency.java54
1 files changed, 27 insertions, 27 deletions
diff --git a/tests/src/com/android/camera/stress/CameraLatency.java b/tests/src/com/android/camera/stress/CameraLatency.java
index 221e7b1..0c5059f 100755
--- a/tests/src/com/android/camera/stress/CameraLatency.java
+++ b/tests/src/com/android/camera/stress/CameraLatency.java
@@ -40,14 +40,14 @@ public class CameraLatency extends ActivityInstrumentationTestCase2 <Camera> {
private long mTotalAutoFocusTime;
private long mTotalShutterLag;
- private long mTotalShutterAndRawPictureCallbackTime;
- private long mTotalJpegPictureCallbackTimeLag;
- private long mTotalRawPictureAndJpegPictureCallbackTime;
+ private long mTotalShutterToPictureDisplayedTime;
+ private long mTotalPictureDisplayedToJpegCallbackTime;
+ private long mTotalJpegCallbackToFirstFrameTime;
private long mAvgAutoFocusTime;
private long mAvgShutterLag = mTotalShutterLag;
- private long mAvgShutterAndRawPictureCallbackTime;
- private long mAveJpegPictureCallbackTimeLag;
- private long mAvgRawPictureAndJpegPictureCallbackTime;
+ private long mAvgShutterToPictureDisplayedTime;
+ private long mAvgPictureDisplayedToJpegCallbackTime;
+ private long mAvgJpegCallbackToFirstFrameTime;
public CameraLatency() {
super("com.android.camera", Camera.class);
@@ -78,11 +78,11 @@ public class CameraLatency extends ActivityInstrumentationTestCase2 <Camera> {
Camera c = getActivity();
mTotalAutoFocusTime += c.mAutoFocusTime;
mTotalShutterLag += c.mShutterLag;
- mTotalShutterAndRawPictureCallbackTime +=
- c.mShutterAndRawPictureCallbackTime;
- mTotalJpegPictureCallbackTimeLag += c.mJpegPictureCallbackTimeLag;
- mTotalRawPictureAndJpegPictureCallbackTime +=
- c.mRawPictureAndJpegPictureCallbackTime;
+ mTotalShutterToPictureDisplayedTime +=
+ c.mShutterToPictureDisplayedTime;
+ mTotalPictureDisplayedToJpegCallbackTime +=
+ c.mPictureDisplayedToJpegCallbackTime;
+ mTotalJpegCallbackToFirstFrameTime += c.mJpegCallbackToFirstFrameTime;
}
}
} catch (Exception e) {
@@ -96,12 +96,12 @@ public class CameraLatency extends ActivityInstrumentationTestCase2 <Camera> {
int numberofRun = TOTAL_NUMBER_OF_IMAGECAPTURE - 1;
mAvgAutoFocusTime = mTotalAutoFocusTime / numberofRun;
mAvgShutterLag = mTotalShutterLag / numberofRun;
- mAvgShutterAndRawPictureCallbackTime =
- mTotalShutterAndRawPictureCallbackTime / numberofRun;
- mAveJpegPictureCallbackTimeLag =
- mTotalJpegPictureCallbackTimeLag / numberofRun;
- mAvgRawPictureAndJpegPictureCallbackTime =
- mTotalRawPictureAndJpegPictureCallbackTime / numberofRun;
+ mAvgShutterToPictureDisplayedTime =
+ mTotalShutterToPictureDisplayedTime / numberofRun;
+ mAvgPictureDisplayedToJpegCallbackTime =
+ mTotalPictureDisplayedToJpegCallbackTime / numberofRun;
+ mAvgJpegCallbackToFirstFrameTime =
+ mTotalJpegCallbackToFirstFrameTime / numberofRun;
try {
FileWriter fstream = null;
@@ -111,11 +111,11 @@ public class CameraLatency extends ActivityInstrumentationTestCase2 <Camera> {
out.write("Number of loop: " + TOTAL_NUMBER_OF_IMAGECAPTURE + "\n");
out.write("Avg AutoFocus = " + mAvgAutoFocusTime + "\n");
out.write("Avg mShutterLag = " + mAvgShutterLag + "\n");
- out.write("Avg mShutterAndRawPictureCallbackTime = "
- + mAvgShutterAndRawPictureCallbackTime + "\n");
- out.write("Avg mJpegPictureCallbackTimeLag = " + mAveJpegPictureCallbackTimeLag + "\n");
- out.write("Avg mRawPictureAndJpegPictureCallbackTime = "
- + mAvgRawPictureAndJpegPictureCallbackTime + "\n");
+ out.write("Avg mShutterToPictureDisplayedTime = "
+ + mAvgShutterToPictureDisplayedTime + "\n");
+ out.write("Avg mPictureDisplayedToJpegCallbackTime = "
+ + mAvgPictureDisplayedToJpegCallbackTime + "\n");
+ out.write("Avg mJpegCallbackToFirstFrameTime = " + mAvgJpegCallbackToFirstFrameTime + "\n");
out.close();
fstream.close();
} catch (Exception e) {
@@ -124,11 +124,11 @@ public class CameraLatency extends ActivityInstrumentationTestCase2 <Camera> {
Log.v(TAG, "Avg AutoFocus = " + mAvgAutoFocusTime);
Log.v(TAG, "Avg mShutterLag = " + mAvgShutterLag);
- Log.v(TAG, "Avg mShutterAndRawPictureCallbackTime = "
- + mAvgShutterAndRawPictureCallbackTime);
- Log.v(TAG, "Avg mJpegPictureCallbackTimeLag = " + mAveJpegPictureCallbackTimeLag);
- Log.v(TAG, "Avg mRawPictureAndJpegPictureCallbackTime = "
- + mAvgRawPictureAndJpegPictureCallbackTime);
+ Log.v(TAG, "Avg mShutterToPictureDisplayedTime = "
+ + mAvgShutterToPictureDisplayedTime);
+ Log.v(TAG, "Avg mPictureDisplayedToJpegCallbackTime = "
+ + mAvgPictureDisplayedToJpegCallbackTime);
+ Log.v(TAG, "Avg mJpegCallbackToFirstFrameTime = " + mAvgJpegCallbackToFirstFrameTime);
assertTrue("testImageCapture", true);
}
}