Home | History | Annotate | Download | only in 2.0
      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 compliance with the License.
      6  * You may obtaa 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 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 
     18 package android.frameworks.cameraservice.device@2.0;
     19 
     20 interface ICameraDeviceCallback {
     21     /**
     22      *  Callback called when the device encounters an error.
     23      *
     24      *  @param errorCode the error code corresponding to the error.
     25      *  @param resultExtras data structure containing information about the
     26      *         frame number, request id, etc, of the request on which the device
     27      *         error occured, in case the errorCode was CAMERA_BUFFER.
     28      */
     29     oneway onDeviceError(ErrorCode errorCode,
     30                          CaptureResultExtras resultExtras);
     31 
     32     /**
     33      *  Callback called when the device is idle.
     34      */
     35     oneway onDeviceIdle();
     36 
     37     /**
     38      *  Callback called when capture starts.
     39      *
     40      *  @param resultExtras data structure containing information about the
     41      *         frame number, request id, etc, of the request.
     42      *  @param timestamp corresponding to the start (in nanoseconds)
     43      */
     44     oneway onCaptureStarted(CaptureResultExtras resultExtras,
     45                             uint64_t timestamp);
     46     /**
     47      * Callback called when a capture request is completed.
     48      *
     49      * Note: The framework must call this callback serially if it opts to
     50      *       utilize an fmq for either the result metadata and/or any of the
     51      *       physicalCaptureResultInfo.physicalCameraMetadata values.
     52      *
     53      * @param result result metadata
     54      * @param resultExtras data structure containing information about the
     55      *        frame number, request id, etc of the request.
     56      * @param physicalCaptureResultInfos a list of physicalCaptureResultInfo,
     57      *        which contains the camera id and metadata related to the physical
     58      *        cameras involved for the particular capture request, if any.
     59      */
     60     onResultReceived(
     61             FmqSizeOrMetadata result,
     62             CaptureResultExtras resultExtras,
     63             vec<PhysicalCaptureResultInfo> physicalCaptureResultInfos);
     64 
     65     /**
     66      * Repeating request encountered an error and was stopped.
     67      *
     68      * @param lastFrameNumber Frame number of the last frame of the streaming
     69      *        request.
     70      * @param repeatingRequestId the ID of the repeating request
     71      *        being stopped
     72      */
     73     oneway onRepeatingRequestError(uint64_t lastFrameNumber,
     74                                    int32_t repeatingRequestId);
     75 
     76 };
     77