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