• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.hardware.camera2.CaptureRequest;
20 import android.hardware.camera2.impl.CameraMetadataNative;
21 import android.hardware.camera2.params.OutputConfiguration;
22 import android.hardware.camera2.utils.SubmitInfo;
23 import android.view.Surface;
24 
25 /** @hide */
26 interface ICameraDeviceUser
27 {
disconnect()28     void disconnect();
29 
30     const int NO_IN_FLIGHT_REPEATING_FRAMES = -1;
31 
submitRequest(in CaptureRequest request, boolean streaming)32     SubmitInfo submitRequest(in CaptureRequest request, boolean streaming);
submitRequestList(in CaptureRequest[] requestList, boolean streaming)33     SubmitInfo submitRequestList(in CaptureRequest[] requestList, boolean streaming);
34 
35     /**
36      * Cancel the repeating request specified by requestId
37      * Returns the frame number of the last frame that will be produced from this
38      * repeating request, or NO_IN_FLIGHT_REPEATING_FRAMES if no frames were produced
39      * by this repeating request.
40      *
41      * Repeating request may be stopped by camera device due to an error. Canceling a stopped
42      * repeating request will trigger ERROR_ILLEGAL_ARGUMENT.
43      */
cancelRequest(int requestId)44     long cancelRequest(int requestId);
45 
46     /**
47      * Begin the device configuration.
48      *
49      * <p>
50      * beginConfigure must be called before any call to deleteStream, createStream,
51      * or endConfigure.  It is not valid to call this when the device is not idle.
52      * <p>
53      */
beginConfigure()54     void beginConfigure();
55 
56     /**
57      * End the device configuration.
58      *
59      * <p>
60      * endConfigure must be called after stream configuration is complete (i.e. after
61      * a call to beginConfigure and subsequent createStream/deleteStream calls).  This
62      * must be called before any requests can be submitted.
63      * <p>
64      */
endConfigure(boolean isConstrainedHighSpeed)65     void endConfigure(boolean isConstrainedHighSpeed);
66 
deleteStream(int streamId)67     void deleteStream(int streamId);
68 
69     /**
70      * Create an output stream
71      *
72      * <p>Create an output stream based on the given output configuration</p>
73      *
74      * @param outputConfiguration size, format, and other parameters for the stream
75      * @return new stream ID
76      */
createStream(in OutputConfiguration outputConfiguration)77     int createStream(in OutputConfiguration outputConfiguration);
78 
79     /**
80      * Create an input stream
81      *
82      * <p>Create an input stream of width, height, and format</p>
83      *
84      * @param width Width of the input buffers
85      * @param height Height of the input buffers
86      * @param format Format of the input buffers. One of HAL_PIXEL_FORMAT_*.
87      *
88      * @return new stream ID
89      */
createInputStream(int width, int height, int format)90     int createInputStream(int width, int height, int format);
91 
92     /**
93      * Get the surface of the input stream.
94      *
95      * <p>It's valid to call this method only after a stream configuration is completed
96      * successfully and the stream configuration includes a input stream.</p>
97      *
98      * @param surface An output argument for the surface of the input stream buffer queue.
99      */
getInputSurface()100     Surface getInputSurface();
101 
102     // Keep in sync with public API in
103     // frameworks/base/core/java/android/hardware/camera2/CameraDevice.java
104     const int TEMPLATE_PREVIEW = 1;
105     const int TEMPLATE_STILL_CAPTURE = 2;
106     const int TEMPLATE_RECORD = 3;
107     const int TEMPLATE_VIDEO_SNAPSHOT = 4;
108     const int TEMPLATE_ZERO_SHUTTER_LAG = 5;
109     const int TEMPLATE_MANUAL = 6;
110 
createDefaultRequest(int templateId)111     CameraMetadataNative createDefaultRequest(int templateId);
112 
getCameraInfo()113     CameraMetadataNative getCameraInfo();
114 
waitUntilIdle()115     void waitUntilIdle();
116 
flush()117     long flush();
118 
prepare(int streamId)119     void prepare(int streamId);
120 
tearDown(int streamId)121     void tearDown(int streamId);
122 
prepare2(int maxCount, int streamId)123     void prepare2(int maxCount, int streamId);
124 
setDeferredConfiguration(int streamId, in OutputConfiguration outputConfiguration)125     void setDeferredConfiguration(int streamId, in OutputConfiguration outputConfiguration);
126 }
127