Home | History | Annotate | Download | only in camera
      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 
     23 namespace 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  */
     29 struct 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      * The partial result count (index) for this capture result.
     57      */
     58     int32_t partialResultCount;
     59 
     60     /**
     61      * Constructor initializes object as invalid by setting requestId to be -1.
     62      */
     63     CaptureResultExtras()
     64         : requestId(-1),
     65           burstId(0),
     66           afTriggerId(0),
     67           precaptureTriggerId(0),
     68           frameNumber(0),
     69           partialResultCount(0) {
     70     }
     71 
     72     /**
     73      * This function returns true if it's a valid CaptureResultExtras object.
     74      * Otherwise, returns false. It is valid only when requestId is non-negative.
     75      */
     76     bool isValid();
     77 
     78     status_t                readFromParcel(Parcel* parcel);
     79     status_t                writeToParcel(Parcel* parcel) const;
     80 };
     81 
     82 struct CaptureResult : public virtual LightRefBase<CaptureResult> {
     83     CameraMetadata          mMetadata;
     84     CaptureResultExtras     mResultExtras;
     85 
     86     CaptureResult();
     87 
     88     CaptureResult(const CaptureResult& otherResult);
     89 
     90     status_t                readFromParcel(Parcel* parcel);
     91     status_t                writeToParcel(Parcel* parcel) const;
     92 };
     93 
     94 }
     95 
     96 #endif /* ANDROID_HARDWARE_CAPTURERESULT_H */
     97