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 package android.hardware.camera2;
     18 
     19 import android.view.Surface;
     20 import android.hardware.camera2.impl.CameraMetadataNative;
     21 import android.hardware.camera2.CaptureRequest;
     22 
     23 import android.hardware.camera2.utils.LongParcelable;
     24 
     25 /** @hide */
     26 interface ICameraDeviceUser
     27 {
     28     /**
     29      * Keep up-to-date with frameworks/av/include/camera/camera2/ICameraDeviceUser.h and
     30      * frameworks/base/core/java/android/hardware/camera2/legacy/CameraDeviceUserShim.java
     31      */
     32     void disconnect();
     33 
     34     // ints here are status_t
     35 
     36     // non-negative value is the requestId. negative value is status_t
     37     int submitRequest(in CaptureRequest request, boolean streaming,
     38                       out LongParcelable lastFrameNumber);
     39 
     40     int submitRequestList(in List<CaptureRequest> requestList, boolean streaming,
     41                           out LongParcelable lastFrameNumber);
     42 
     43     int cancelRequest(int requestId, out LongParcelable lastFrameNumber);
     44 
     45     /**
     46      * Begin the device configuration.
     47      *
     48      * <p>
     49      * beginConfigure must be called before any call to deleteStream, createStream,
     50      * or endConfigure.  It is not valid to call this when the device is not idle.
     51      * <p>
     52      */
     53     int beginConfigure();
     54 
     55     /**
     56      * End the device configuration.
     57      *
     58      * <p>
     59      * endConfigure must be called after stream configuration is complete (i.e. after
     60      * a call to beginConfigure and subsequent createStream/deleteStream calls).  This
     61      * must be called before any requests can be submitted.
     62      * <p>
     63      */
     64     int endConfigure();
     65 
     66     int deleteStream(int streamId);
     67 
     68     // non-negative value is the stream ID. negative value is status_t
     69     int createStream(int width, int height, int format, in Surface surface);
     70 
     71     int createDefaultRequest(int templateId, out CameraMetadataNative request);
     72 
     73     int getCameraInfo(out CameraMetadataNative info);
     74 
     75     int waitUntilIdle();
     76 
     77     int flush(out LongParcelable lastFrameNumber);
     78 }
     79