1 /* 2 * Copyright (C) 2014 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.os.Parcel; 19 import android.os.Parcelable; 20 21 /** 22 * @hide 23 */ 24 public class CaptureResultExtras implements Parcelable { 25 private int requestId; 26 private int subsequenceId; 27 private int afTriggerId; 28 private int precaptureTriggerId; 29 private long frameNumber; 30 private int partialResultCount; 31 32 public static final Parcelable.Creator<CaptureResultExtras> CREATOR = 33 new Parcelable.Creator<CaptureResultExtras>() { 34 @Override 35 public CaptureResultExtras createFromParcel(Parcel in) { 36 return new CaptureResultExtras(in); 37 } 38 39 @Override 40 public CaptureResultExtras[] newArray(int size) { 41 return new CaptureResultExtras[size]; 42 } 43 }; 44 CaptureResultExtras(Parcel in)45 private CaptureResultExtras(Parcel in) { 46 readFromParcel(in); 47 } 48 CaptureResultExtras(int requestId, int subsequenceId, int afTriggerId, int precaptureTriggerId, long frameNumber, int partialResultCount)49 public CaptureResultExtras(int requestId, int subsequenceId, int afTriggerId, 50 int precaptureTriggerId, long frameNumber, 51 int partialResultCount) { 52 this.requestId = requestId; 53 this.subsequenceId = subsequenceId; 54 this.afTriggerId = afTriggerId; 55 this.precaptureTriggerId = precaptureTriggerId; 56 this.frameNumber = frameNumber; 57 this.partialResultCount = partialResultCount; 58 } 59 60 @Override describeContents()61 public int describeContents() { 62 return 0; 63 } 64 65 @Override writeToParcel(Parcel dest, int flags)66 public void writeToParcel(Parcel dest, int flags) { 67 dest.writeInt(requestId); 68 dest.writeInt(subsequenceId); 69 dest.writeInt(afTriggerId); 70 dest.writeInt(precaptureTriggerId); 71 dest.writeLong(frameNumber); 72 dest.writeInt(partialResultCount); 73 } 74 readFromParcel(Parcel in)75 public void readFromParcel(Parcel in) { 76 requestId = in.readInt(); 77 subsequenceId = in.readInt(); 78 afTriggerId = in.readInt(); 79 precaptureTriggerId = in.readInt(); 80 frameNumber = in.readLong(); 81 partialResultCount = in.readInt(); 82 } 83 getRequestId()84 public int getRequestId() { 85 return requestId; 86 } 87 getSubsequenceId()88 public int getSubsequenceId() { 89 return subsequenceId; 90 } 91 getAfTriggerId()92 public int getAfTriggerId() { 93 return afTriggerId; 94 } 95 getPrecaptureTriggerId()96 public int getPrecaptureTriggerId() { 97 return precaptureTriggerId; 98 } 99 getFrameNumber()100 public long getFrameNumber() { 101 return frameNumber; 102 } 103 getPartialResultCount()104 public int getPartialResultCount() { 105 return partialResultCount; 106 } 107 } 108