am 448c3395: Merge "Camera2: Add user tag to CaptureRequest" into klp-dev

* commit '448c339596df2a6b08a6f93dbea1d6fc87ba676e':
  Camera2: Add user tag to CaptureRequest
This commit is contained in:
Eino-Ville Talvala
2013-08-16 12:20:24 -07:00
committed by Android Git Automerger
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