• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.CameraMetadataInfo;
19 import android.hardware.camera2.impl.CameraMetadataNative;
20 
21 import android.os.Parcel;
22 import android.os.Parcelable;
23 
24 /**
25  * @hide
26  */
27 public class PhysicalCaptureResultInfo implements Parcelable {
28     private String cameraId;
29     private CameraMetadataInfo cameraMetadataInfo;
30 
31     public static final @android.annotation.NonNull Parcelable.Creator<PhysicalCaptureResultInfo> CREATOR =
32             new Parcelable.Creator<PhysicalCaptureResultInfo>() {
33         @Override
34         public PhysicalCaptureResultInfo createFromParcel(Parcel in) {
35             return new PhysicalCaptureResultInfo(in);
36         }
37 
38         @Override
39         public PhysicalCaptureResultInfo[] newArray(int size) {
40             return new PhysicalCaptureResultInfo[size];
41         }
42     };
43 
PhysicalCaptureResultInfo(Parcel in)44     private PhysicalCaptureResultInfo(Parcel in) {
45         readFromParcel(in);
46     }
47 
PhysicalCaptureResultInfo(String cameraId, CameraMetadataNative cameraMetadata)48     public PhysicalCaptureResultInfo(String cameraId, CameraMetadataNative cameraMetadata) {
49         this.cameraId = cameraId;
50         this.cameraMetadataInfo = CameraMetadataInfo.metadata(cameraMetadata);
51     }
52 
53     @Override
describeContents()54     public int describeContents() {
55         return 0;
56     }
57 
58     @Override
writeToParcel(Parcel dest, int flags)59     public void writeToParcel(Parcel dest, int flags) {
60         dest.writeString(cameraId);
61         cameraMetadataInfo.writeToParcel(dest, flags);
62     }
63 
readFromParcel(Parcel in)64     public void readFromParcel(Parcel in) {
65         cameraId = in.readString();
66         cameraMetadataInfo = CameraMetadataInfo.CREATOR.createFromParcel(in);
67     }
68 
getCameraId()69     public String getCameraId() {
70         return cameraId;
71     }
72 
getCameraMetadata()73     public CameraMetadataNative getCameraMetadata() {
74         return cameraMetadataInfo.getMetadata();
75     }
76 
getCameraMetadataInfo()77     public CameraMetadataInfo getCameraMetadataInfo() {
78         return cameraMetadataInfo;
79     }
80 
81 }