CaptureResult.h revision cb0652e5a850b2fcd919e977247e87239efaf70e
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 17#ifndef ANDROID_HARDWARE_CAPTURERESULT_H 18#define ANDROID_HARDWARE_CAPTURERESULT_H 19 20#include <utils/RefBase.h> 21#include <camera/CameraMetadata.h> 22 23namespace android { 24 25/** 26 * CaptureResultExtras is a structure to encapsulate various indices for a capture result. 27 * These indices are framework-internal and not sent to the HAL. 28 */ 29struct CaptureResultExtras { 30 /** 31 * An integer to index the request sequence that this result belongs to. 32 */ 33 int32_t requestId; 34 35 /** 36 * An integer to index this result inside a request sequence, starting from 0. 37 */ 38 int32_t burstId; 39 40 /** 41 * TODO: Add documentation for this field. 42 */ 43 int32_t afTriggerId; 44 45 /** 46 * TODO: Add documentation for this field. 47 */ 48 int32_t precaptureTriggerId; 49 50 /** 51 * A 64bit integer to index the frame number associated with this result. 52 */ 53 int64_t frameNumber; 54 55 /** 56 * Constructor initializes object as invalid by setting requestId to be -1. 57 */ 58 CaptureResultExtras() 59 : requestId(-1), 60 burstId(0), 61 afTriggerId(0), 62 precaptureTriggerId(0), 63 frameNumber(0) { 64 } 65 66 /** 67 * This function returns true if it's a valid CaptureResultExtras object. 68 * Otherwise, returns false. It is valid only when requestId is non-negative. 69 */ 70 bool isValid(); 71 72 status_t readFromParcel(Parcel* parcel); 73 status_t writeToParcel(Parcel* parcel) const; 74}; 75 76struct CaptureResult : public virtual LightRefBase<CaptureResult> { 77 CameraMetadata mMetadata; 78 CaptureResultExtras mResultExtras; 79 80 CaptureResult(); 81 82 CaptureResult(const CaptureResult& otherResult); 83 84 status_t readFromParcel(Parcel* parcel); 85 status_t writeToParcel(Parcel* parcel) const; 86}; 87 88} 89 90#endif /* ANDROID_HARDWARE_CAPTURERESULT_H */ 91