Merge "Camera2: Add user tag to CaptureRequest" into klp-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
448c339596
@@ -10925,7 +10925,9 @@ package android.hardware.camera2 {
|
|||||||
|
|
||||||
public final class CaptureRequest extends android.hardware.camera2.CameraMetadata implements android.os.Parcelable {
|
public final class CaptureRequest extends android.hardware.camera2.CameraMetadata implements android.os.Parcelable {
|
||||||
method public void addTarget(android.view.Surface);
|
method public void addTarget(android.view.Surface);
|
||||||
|
method public java.lang.Object getTag();
|
||||||
method public void removeTarget(android.view.Surface);
|
method public void removeTarget(android.view.Surface);
|
||||||
|
method public void setTag(java.lang.Object);
|
||||||
field public static final android.hardware.camera2.CameraMetadata.Key BLACK_LEVEL_LOCK;
|
field public static final android.hardware.camera2.CameraMetadata.Key BLACK_LEVEL_LOCK;
|
||||||
field public static final android.hardware.camera2.CameraMetadata.Key COLOR_CORRECTION_GAINS;
|
field public static final android.hardware.camera2.CameraMetadata.Key COLOR_CORRECTION_GAINS;
|
||||||
field public static final android.hardware.camera2.CameraMetadata.Key COLOR_CORRECTION_MODE;
|
field public static final android.hardware.camera2.CameraMetadata.Key COLOR_CORRECTION_MODE;
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ public final class CaptureRequest extends CameraMetadata implements Parcelable {
|
|||||||
|
|
||||||
private final Object mLock = new Object();
|
private final Object mLock = new Object();
|
||||||
private final HashSet<Surface> mSurfaceSet = new HashSet<Surface>();
|
private final HashSet<Surface> mSurfaceSet = new HashSet<Surface>();
|
||||||
|
private Object mUserTag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @hide
|
* @hide
|
||||||
@@ -89,6 +90,42 @@ public final class CaptureRequest extends CameraMetadata implements Parcelable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set a tag for this request.
|
||||||
|
*
|
||||||
|
* <p>This tag is not used for anything by the camera device, but can be
|
||||||
|
* used by an application to easily identify a CaptureRequest when it is
|
||||||
|
* returned by
|
||||||
|
* {@link CameraDevice.CaptureListener#onCaptureComplete CaptureListener.onCaptureComplete}
|
||||||
|
*
|
||||||
|
* @param tag an arbitrary Object to store with this request
|
||||||
|
* @see #getTag
|
||||||
|
*/
|
||||||
|
public void setTag(Object tag) {
|
||||||
|
synchronized (mLock) {
|
||||||
|
mUserTag = tag;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve the tag for this request, if any.
|
||||||
|
*
|
||||||
|
* <p>This tag is not used for anything by the camera device, but can be
|
||||||
|
* used by an application to easily identify a CaptureRequest when it is
|
||||||
|
* returned by
|
||||||
|
* {@link CameraDevice.CaptureListener#onCaptureComplete CaptureListener.onCaptureComplete}
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @return the last tag Object set on this request, or {@code null} if
|
||||||
|
* no tag has been set.
|
||||||
|
* @see #setTag
|
||||||
|
*/
|
||||||
|
public Object getTag() {
|
||||||
|
synchronized (mLock) {
|
||||||
|
return mUserTag;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static final Parcelable.Creator<CaptureRequest> CREATOR =
|
public static final Parcelable.Creator<CaptureRequest> CREATOR =
|
||||||
new Parcelable.Creator<CaptureRequest>() {
|
new Parcelable.Creator<CaptureRequest>() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user