Shuzhen Wang | 0960fb4 | 2018-01-10 20:35:11 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package android.hardware.camera2.impl; |
| 17 | |
| 18 | import android.hardware.camera2.impl.CameraMetadataNative; |
| 19 | |
| 20 | import android.os.Parcel; |
| 21 | import android.os.Parcelable; |
| 22 | |
| 23 | /** |
| 24 | * @hide |
| 25 | */ |
| 26 | public class PhysicalCaptureResultInfo implements Parcelable { |
| 27 | private String cameraId; |
| 28 | private CameraMetadataNative cameraMetadata; |
| 29 | |
Jeff Sharkey | 9e8f83d | 2019-02-28 12:06:45 -0700 | [diff] [blame^] | 30 | public static final @android.annotation.NonNull Parcelable.Creator<PhysicalCaptureResultInfo> CREATOR = |
Shuzhen Wang | 0960fb4 | 2018-01-10 20:35:11 -0800 | [diff] [blame] | 31 | new Parcelable.Creator<PhysicalCaptureResultInfo>() { |
| 32 | @Override |
| 33 | public PhysicalCaptureResultInfo createFromParcel(Parcel in) { |
| 34 | return new PhysicalCaptureResultInfo(in); |
| 35 | } |
| 36 | |
| 37 | @Override |
| 38 | public PhysicalCaptureResultInfo[] newArray(int size) { |
| 39 | return new PhysicalCaptureResultInfo[size]; |
| 40 | } |
| 41 | }; |
| 42 | |
| 43 | private PhysicalCaptureResultInfo(Parcel in) { |
| 44 | readFromParcel(in); |
| 45 | } |
| 46 | |
| 47 | public PhysicalCaptureResultInfo(String cameraId, CameraMetadataNative cameraMetadata) { |
| 48 | this.cameraId = cameraId; |
| 49 | this.cameraMetadata = cameraMetadata; |
| 50 | } |
| 51 | |
| 52 | @Override |
| 53 | public int describeContents() { |
| 54 | return 0; |
| 55 | } |
| 56 | |
| 57 | @Override |
| 58 | public void writeToParcel(Parcel dest, int flags) { |
| 59 | dest.writeString(cameraId); |
| 60 | cameraMetadata.writeToParcel(dest, flags); |
| 61 | } |
| 62 | |
| 63 | public void readFromParcel(Parcel in) { |
| 64 | cameraId = in.readString(); |
| 65 | cameraMetadata = new CameraMetadataNative(); |
| 66 | cameraMetadata.readFromParcel(in); |
| 67 | } |
| 68 | |
| 69 | public String getCameraId() { |
| 70 | return cameraId; |
| 71 | } |
| 72 | |
| 73 | public CameraMetadataNative getCameraMetadata() { |
| 74 | return cameraMetadata; |
| 75 | } |
| 76 | } |