Home | History | Annotate | Download | only in camera2
      1 /*
      2  * Copyright (C) 2013 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_PHOTOGRAPHY_CALLBACKS_H
     18 #define ANDROID_HARDWARE_PHOTOGRAPHY_CALLBACKS_H
     19 
     20 #include <utils/RefBase.h>
     21 #include <binder/IInterface.h>
     22 #include <binder/Parcel.h>
     23 #include <binder/IMemory.h>
     24 #include <utils/Timers.h>
     25 #include <system/camera.h>
     26 
     27 namespace android {
     28 class CameraMetadata;
     29 
     30 class ICameraDeviceCallbacks : public IInterface
     31 {
     32     /**
     33      * Keep up-to-date with ICameraDeviceCallbacks.aidl in frameworks/base
     34      */
     35 public:
     36     DECLARE_META_INTERFACE(CameraDeviceCallbacks);
     37 
     38     /**
     39      * Error codes for CAMERA_MSG_ERROR
     40      */
     41     enum CameraErrorCode {
     42         ERROR_CAMERA_DISCONNECTED = 0,
     43         ERROR_CAMERA_DEVICE = 1,
     44         ERROR_CAMERA_SERVICE = 2
     45     };
     46 
     47     // One way
     48     virtual void            onDeviceError(CameraErrorCode errorCode) = 0;
     49 
     50     // One way
     51     virtual void            onDeviceIdle() = 0;
     52 
     53     // One way
     54     virtual void            onCaptureStarted(int32_t requestId,
     55                                              int64_t timestamp) = 0;
     56 
     57     // One way
     58     virtual void            onResultReceived(int32_t requestId,
     59                                              const CameraMetadata& result) = 0;
     60 };
     61 
     62 // ----------------------------------------------------------------------------
     63 
     64 class BnCameraDeviceCallbacks : public BnInterface<ICameraDeviceCallbacks>
     65 {
     66 public:
     67     virtual status_t    onTransact( uint32_t code,
     68                                     const Parcel& data,
     69                                     Parcel* reply,
     70                                     uint32_t flags = 0);
     71 };
     72 
     73 }; // namespace android
     74 
     75 #endif
     76