Camera2: Immutable metadata
Make all camera metadata immutable once created; requests are
created using CameraRequest.Builder.
- Separate CameraMetadata implementation from interface
- Implement deep copying of metadata
- Requests/results/properties have-a native implementation
Bug: 10360518
Change-Id: Ia6300c237219d39f70c63156fa9ca666d951a36e
diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java
index bd151a2..f83dad7 100644
--- a/core/java/android/hardware/camera2/CaptureResult.java
+++ b/core/java/android/hardware/camera2/CaptureResult.java
@@ -18,6 +18,7 @@
import android.graphics.Point;
import android.graphics.Rect;
+import android.hardware.camera2.impl.CameraMetadataNative;
/**
* <p>The results of a single image capture from the image sensor.</p>
@@ -34,10 +35,20 @@
*
*/
public final class CaptureResult extends CameraMetadata {
+
+ private final CameraMetadataNative mResults;
+
/**
+ * Takes ownership of the passed-in properties object
* @hide
*/
- public CaptureResult() {
+ public CaptureResult(CameraMetadataNative results) {
+ mResults = results;
+ }
+
+ @Override
+ public <T> T get(Key<T> key) {
+ return mResults.get(key);
}
/**