Camera2: Add user tag to CaptureRequest

Bug: 10360518
Change-Id: I781341b4c598c28ee5dd7551b8e05ab19b8fff0d
This commit is contained in:
Eino-Ville Talvala
2013-08-08 16:56:28 -07:00
parent 0a94b9ce27
commit 4068388bee
2 changed files with 39 additions and 0 deletions

View File

@@ -10925,7 +10925,9 @@ package android.hardware.camera2 {
public final class CaptureRequest extends android.hardware.camera2.CameraMetadata implements android.os.Parcelable {
method public void addTarget(android.view.Surface);
method public java.lang.Object getTag();
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 COLOR_CORRECTION_GAINS;
field public static final android.hardware.camera2.CameraMetadata.Key COLOR_CORRECTION_MODE;

View File

@@ -53,6 +53,7 @@ public final class CaptureRequest extends CameraMetadata implements Parcelable {
private final Object mLock = new Object();
private final HashSet<Surface> mSurfaceSet = new HashSet<Surface>();
private Object mUserTag;
/**
* @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 =
new Parcelable.Creator<CaptureRequest>() {
@Override