blob: aa4ad22ac581f5b448e4864acccf8ad2700eff6b [file] [log] [blame]
Yin-Chia Yeh6a6fe0f2018-09-06 15:38:34 -07001/*
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 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.camera.device@3.5;
18
19import @3.2::StreamBuffer;
20import @3.4::ICameraDeviceCallback;
21
22/**
23 * Callback methods for the HAL to call into the framework.
24 */
25interface ICameraDeviceCallback extends @3.4::ICameraDeviceCallback {
26
27 /**
28 * requestStreamBuffers:
29 *
30 * Synchronous callback for HAL to ask for output buffers from camera service.
31 *
32 * This call may be serialized in camera service so it is strongly
33 * recommended to only call this method from one thread.
34 *
35 * When camera device advertises
36 * (CameraMetadataEnumAndroidInfoSupportedBufferManagementVersion ==
37 * ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_HIDL_DEVICE_3_5), HAL
38 * can use this method to request buffers from camera service.
39 *
40 * @return status Status code for the operation, one of:
41 * OK: all requested buffers are returned
42 * FAILED_PARTIAL: some streams failed while some succeeds. Check
43 * individual StreamBufferRet for details.
44 * FAILED_CONFIGURING: the request failed because camera servicve is
45 * performing configureStreams and no buffers are returned.
46 * FAILED_UNKNOWN: the request failed for unknown reason and no buffers
47 * are returned.
48 *
49 * Performance requirements:
50 * This is a blocking call that takes more time with more buffers requested.
51 * HAL must not request large amount of buffers on a latency critical code
52 * path. It is highly recommended to use a dedicated thread to perform
53 * all requestStreamBuffers calls, and adjust the thread priority and/or
54 * timing of making the call in order for buffers to arrive before HAL is
55 * ready to fill the buffer.
56 */
57 requestStreamBuffers(vec<BufferRequest> bufReqs)
58 generates (BufferRequestStatus st, vec<StreamBufferRet> buffers);
59
60 /**
61 * returnStreamBuffers:
62 *
63 * Synchronous callback for HAL to return output buffers to camera service.
64 *
65 * If this method is called during a configureStreams call, it must be blocked
66 * until camera service finishes the ongoing configureStreams call.
67 */
68 returnStreamBuffers(vec<StreamBuffer> buffers);
69
70};