Merge "Camera: Add videoStabilizationMode to Camera session stats" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
ed57953565
@@ -62,6 +62,7 @@ public class CameraSessionStats implements Parcelable {
|
|||||||
private float mMaxPreviewFps;
|
private float mMaxPreviewFps;
|
||||||
private ArrayList<CameraStreamStats> mStreamStats;
|
private ArrayList<CameraStreamStats> mStreamStats;
|
||||||
private String mUserTag;
|
private String mUserTag;
|
||||||
|
private int mVideoStabilizationMode;
|
||||||
|
|
||||||
public CameraSessionStats() {
|
public CameraSessionStats() {
|
||||||
mFacing = -1;
|
mFacing = -1;
|
||||||
@@ -76,6 +77,7 @@ public class CameraSessionStats implements Parcelable {
|
|||||||
mResultErrorCount = 0;
|
mResultErrorCount = 0;
|
||||||
mDeviceError = false;
|
mDeviceError = false;
|
||||||
mStreamStats = new ArrayList<CameraStreamStats>();
|
mStreamStats = new ArrayList<CameraStreamStats>();
|
||||||
|
mVideoStabilizationMode = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CameraSessionStats(String cameraId, int facing, int newCameraState,
|
public CameraSessionStats(String cameraId, int facing, int newCameraState,
|
||||||
@@ -133,6 +135,7 @@ public class CameraSessionStats implements Parcelable {
|
|||||||
dest.writeBoolean(mDeviceError);
|
dest.writeBoolean(mDeviceError);
|
||||||
dest.writeTypedList(mStreamStats);
|
dest.writeTypedList(mStreamStats);
|
||||||
dest.writeString(mUserTag);
|
dest.writeString(mUserTag);
|
||||||
|
dest.writeInt(mVideoStabilizationMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void readFromParcel(Parcel in) {
|
public void readFromParcel(Parcel in) {
|
||||||
@@ -155,6 +158,7 @@ public class CameraSessionStats implements Parcelable {
|
|||||||
mStreamStats = streamStats;
|
mStreamStats = streamStats;
|
||||||
|
|
||||||
mUserTag = in.readString();
|
mUserTag = in.readString();
|
||||||
|
mVideoStabilizationMode = in.readInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCameraId() {
|
public String getCameraId() {
|
||||||
@@ -216,4 +220,8 @@ public class CameraSessionStats implements Parcelable {
|
|||||||
public String getUserTag() {
|
public String getUserTag() {
|
||||||
return mUserTag;
|
return mUserTag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getVideoStabilizationMode() {
|
||||||
|
return mVideoStabilizationMode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -241,6 +241,7 @@ public class CameraServiceProxy extends SystemService
|
|||||||
public boolean mDeviceError;
|
public boolean mDeviceError;
|
||||||
public List<CameraStreamStats> mStreamStats;
|
public List<CameraStreamStats> mStreamStats;
|
||||||
public String mUserTag;
|
public String mUserTag;
|
||||||
|
public int mVideoStabilizationMode;
|
||||||
|
|
||||||
private long mDurationOrStartTimeMs; // Either start time, or duration once completed
|
private long mDurationOrStartTimeMs; // Either start time, or duration once completed
|
||||||
|
|
||||||
@@ -260,7 +261,8 @@ public class CameraServiceProxy extends SystemService
|
|||||||
|
|
||||||
public void markCompleted(int internalReconfigure, long requestCount,
|
public void markCompleted(int internalReconfigure, long requestCount,
|
||||||
long resultErrorCount, boolean deviceError,
|
long resultErrorCount, boolean deviceError,
|
||||||
List<CameraStreamStats> streamStats, String userTag) {
|
List<CameraStreamStats> streamStats, String userTag,
|
||||||
|
int videoStabilizationMode) {
|
||||||
if (mCompleted) {
|
if (mCompleted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -272,6 +274,7 @@ public class CameraServiceProxy extends SystemService
|
|||||||
mDeviceError = deviceError;
|
mDeviceError = deviceError;
|
||||||
mStreamStats = streamStats;
|
mStreamStats = streamStats;
|
||||||
mUserTag = userTag;
|
mUserTag = userTag;
|
||||||
|
mVideoStabilizationMode = videoStabilizationMode;
|
||||||
if (CameraServiceProxy.DEBUG) {
|
if (CameraServiceProxy.DEBUG) {
|
||||||
Slog.v(TAG, "A camera facing " + cameraFacingToString(mCameraFacing) +
|
Slog.v(TAG, "A camera facing " + cameraFacingToString(mCameraFacing) +
|
||||||
" was in use by " + mClientName + " for " +
|
" was in use by " + mClientName + " for " +
|
||||||
@@ -809,7 +812,8 @@ public class CameraServiceProxy extends SystemService
|
|||||||
+ ", resultErrorCount " + e.mResultErrorCount
|
+ ", resultErrorCount " + e.mResultErrorCount
|
||||||
+ ", deviceError " + e.mDeviceError
|
+ ", deviceError " + e.mDeviceError
|
||||||
+ ", streamCount is " + streamCount
|
+ ", streamCount is " + streamCount
|
||||||
+ ", userTag is " + e.mUserTag);
|
+ ", userTag is " + e.mUserTag
|
||||||
|
+ ", videoStabilizationMode " + e.mVideoStabilizationMode);
|
||||||
}
|
}
|
||||||
// Convert from CameraStreamStats to CameraStreamProto
|
// Convert from CameraStreamStats to CameraStreamProto
|
||||||
CameraStreamProto[] streamProtos = new CameraStreamProto[MAX_STREAM_STATISTICS];
|
CameraStreamProto[] streamProtos = new CameraStreamProto[MAX_STREAM_STATISTICS];
|
||||||
@@ -867,7 +871,7 @@ public class CameraServiceProxy extends SystemService
|
|||||||
MessageNano.toByteArray(streamProtos[2]),
|
MessageNano.toByteArray(streamProtos[2]),
|
||||||
MessageNano.toByteArray(streamProtos[3]),
|
MessageNano.toByteArray(streamProtos[3]),
|
||||||
MessageNano.toByteArray(streamProtos[4]),
|
MessageNano.toByteArray(streamProtos[4]),
|
||||||
e.mUserTag);
|
e.mUserTag, e.mVideoStabilizationMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1055,6 +1059,7 @@ public class CameraServiceProxy extends SystemService
|
|||||||
boolean deviceError = cameraState.getDeviceErrorFlag();
|
boolean deviceError = cameraState.getDeviceErrorFlag();
|
||||||
List<CameraStreamStats> streamStats = cameraState.getStreamStats();
|
List<CameraStreamStats> streamStats = cameraState.getStreamStats();
|
||||||
String userTag = cameraState.getUserTag();
|
String userTag = cameraState.getUserTag();
|
||||||
|
int videoStabilizationMode = cameraState.getVideoStabilizationMode();
|
||||||
synchronized(mLock) {
|
synchronized(mLock) {
|
||||||
// Update active camera list and notify NFC if necessary
|
// Update active camera list and notify NFC if necessary
|
||||||
boolean wasEmpty = mActiveCameraUsage.isEmpty();
|
boolean wasEmpty = mActiveCameraUsage.isEmpty();
|
||||||
@@ -1109,7 +1114,7 @@ public class CameraServiceProxy extends SystemService
|
|||||||
Slog.w(TAG, "Camera " + cameraId + " was already marked as active");
|
Slog.w(TAG, "Camera " + cameraId + " was already marked as active");
|
||||||
oldEvent.markCompleted(/*internalReconfigure*/0, /*requestCount*/0,
|
oldEvent.markCompleted(/*internalReconfigure*/0, /*requestCount*/0,
|
||||||
/*resultErrorCount*/0, /*deviceError*/false, streamStats,
|
/*resultErrorCount*/0, /*deviceError*/false, streamStats,
|
||||||
/*userTag*/"");
|
/*userTag*/"", /*videoStabilizationMode*/-1);
|
||||||
mCameraUsageHistory.add(oldEvent);
|
mCameraUsageHistory.add(oldEvent);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1119,7 +1124,8 @@ public class CameraServiceProxy extends SystemService
|
|||||||
if (doneEvent != null) {
|
if (doneEvent != null) {
|
||||||
|
|
||||||
doneEvent.markCompleted(internalReconfigureCount, requestCount,
|
doneEvent.markCompleted(internalReconfigureCount, requestCount,
|
||||||
resultErrorCount, deviceError, streamStats, userTag);
|
resultErrorCount, deviceError, streamStats, userTag,
|
||||||
|
videoStabilizationMode);
|
||||||
mCameraUsageHistory.add(doneEvent);
|
mCameraUsageHistory.add(doneEvent);
|
||||||
|
|
||||||
// Check current active camera IDs to see if this package is still
|
// Check current active camera IDs to see if this package is still
|
||||||
|
|||||||
Reference in New Issue
Block a user