1*4d7e907cSAndroid Build Coastguard Worker/* 2*4d7e907cSAndroid Build Coastguard Worker * Copyright (C) 2017-2018 The Android Open Source Project 3*4d7e907cSAndroid Build Coastguard Worker * 4*4d7e907cSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*4d7e907cSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*4d7e907cSAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*4d7e907cSAndroid Build Coastguard Worker * 8*4d7e907cSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*4d7e907cSAndroid Build Coastguard Worker * 10*4d7e907cSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*4d7e907cSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*4d7e907cSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*4d7e907cSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*4d7e907cSAndroid Build Coastguard Worker * limitations under the License. 15*4d7e907cSAndroid Build Coastguard Worker */ 16*4d7e907cSAndroid Build Coastguard Worker 17*4d7e907cSAndroid Build Coastguard Workerpackage [email protected]; 18*4d7e907cSAndroid Build Coastguard Worker 19*4d7e907cSAndroid Build Coastguard Workerimport [email protected]::Status; 20*4d7e907cSAndroid Build Coastguard Workerimport @3.2::CameraMetadata; 21*4d7e907cSAndroid Build Coastguard Workerimport @3.3::ICameraDeviceSession; 22*4d7e907cSAndroid Build Coastguard Workerimport @3.3::HalStreamConfiguration; 23*4d7e907cSAndroid Build Coastguard Workerimport @3.2::BufferCache; 24*4d7e907cSAndroid Build Coastguard Worker 25*4d7e907cSAndroid Build Coastguard Worker/** 26*4d7e907cSAndroid Build Coastguard Worker * Camera device active session interface. 27*4d7e907cSAndroid Build Coastguard Worker * 28*4d7e907cSAndroid Build Coastguard Worker * Obtained via ICameraDevice::open(), this interface contains the methods to 29*4d7e907cSAndroid Build Coastguard Worker * configure and request captures from an active camera device. 30*4d7e907cSAndroid Build Coastguard Worker */ 31*4d7e907cSAndroid Build Coastguard Workerinterface ICameraDeviceSession extends @3.3::ICameraDeviceSession { 32*4d7e907cSAndroid Build Coastguard Worker 33*4d7e907cSAndroid Build Coastguard Worker /** 34*4d7e907cSAndroid Build Coastguard Worker * configureStreams_3_4: 35*4d7e907cSAndroid Build Coastguard Worker * 36*4d7e907cSAndroid Build Coastguard Worker * Identical to @3.3::ICameraDeviceSession.configureStreams, except that: 37*4d7e907cSAndroid Build Coastguard Worker * 38*4d7e907cSAndroid Build Coastguard Worker * - The requested configuration includes session parameters. 39*4d7e907cSAndroid Build Coastguard Worker * 40*4d7e907cSAndroid Build Coastguard Worker * @return Status Status code for the operation, one of: 41*4d7e907cSAndroid Build Coastguard Worker * OK: 42*4d7e907cSAndroid Build Coastguard Worker * On successful stream configuration. 43*4d7e907cSAndroid Build Coastguard Worker * INTERNAL_ERROR: 44*4d7e907cSAndroid Build Coastguard Worker * If there has been a fatal error and the device is no longer 45*4d7e907cSAndroid Build Coastguard Worker * operational. Only close() can be called successfully by the 46*4d7e907cSAndroid Build Coastguard Worker * framework after this error is returned. 47*4d7e907cSAndroid Build Coastguard Worker * ILLEGAL_ARGUMENT: 48*4d7e907cSAndroid Build Coastguard Worker * If the requested stream configuration is invalid. Some examples 49*4d7e907cSAndroid Build Coastguard Worker * of invalid stream configurations include: 50*4d7e907cSAndroid Build Coastguard Worker * - Including more than 1 INPUT stream 51*4d7e907cSAndroid Build Coastguard Worker * - Not including any OUTPUT streams 52*4d7e907cSAndroid Build Coastguard Worker * - Including streams with unsupported formats, or an unsupported 53*4d7e907cSAndroid Build Coastguard Worker * size for that format. 54*4d7e907cSAndroid Build Coastguard Worker * - Including too many output streams of a certain format. 55*4d7e907cSAndroid Build Coastguard Worker * - Unsupported rotation configuration 56*4d7e907cSAndroid Build Coastguard Worker * - Stream sizes/formats don't satisfy the 57*4d7e907cSAndroid Build Coastguard Worker * StreamConfigurationMode requirements 58*4d7e907cSAndroid Build Coastguard Worker * for non-NORMAL mode, or the requested operation_mode is not 59*4d7e907cSAndroid Build Coastguard Worker * supported by the HAL. 60*4d7e907cSAndroid Build Coastguard Worker * - Unsupported usage flag 61*4d7e907cSAndroid Build Coastguard Worker * The camera service cannot filter out all possible illegal stream 62*4d7e907cSAndroid Build Coastguard Worker * configurations, since some devices may support more simultaneous 63*4d7e907cSAndroid Build Coastguard Worker * streams or larger stream resolutions than the minimum required 64*4d7e907cSAndroid Build Coastguard Worker * for a given camera device hardware level. The HAL must return an 65*4d7e907cSAndroid Build Coastguard Worker * ILLEGAL_ARGUMENT for any unsupported stream set, and then be 66*4d7e907cSAndroid Build Coastguard Worker * ready to accept a future valid stream configuration in a later 67*4d7e907cSAndroid Build Coastguard Worker * configureStreams call. 68*4d7e907cSAndroid Build Coastguard Worker * @return halConfiguration The stream parameters desired by the HAL for 69*4d7e907cSAndroid Build Coastguard Worker * each stream, including maximum buffers, the usage flags, and the 70*4d7e907cSAndroid Build Coastguard Worker * override format. 71*4d7e907cSAndroid Build Coastguard Worker */ 72*4d7e907cSAndroid Build Coastguard Worker configureStreams_3_4(@3.4::StreamConfiguration requestedConfiguration) 73*4d7e907cSAndroid Build Coastguard Worker generates (Status status, 74*4d7e907cSAndroid Build Coastguard Worker @3.4::HalStreamConfiguration halConfiguration); 75*4d7e907cSAndroid Build Coastguard Worker 76*4d7e907cSAndroid Build Coastguard Worker /** 77*4d7e907cSAndroid Build Coastguard Worker * processCaptureRequest_3_4: 78*4d7e907cSAndroid Build Coastguard Worker * 79*4d7e907cSAndroid Build Coastguard Worker * Identical to @3.2::ICameraDeviceSession.processCaptureRequest, except that: 80*4d7e907cSAndroid Build Coastguard Worker * 81*4d7e907cSAndroid Build Coastguard Worker * - The capture request can include individual settings for physical camera devices 82*4d7e907cSAndroid Build Coastguard Worker * backing a logical multi-camera. 83*4d7e907cSAndroid Build Coastguard Worker * 84*4d7e907cSAndroid Build Coastguard Worker * @return status Status code for the operation, one of: 85*4d7e907cSAndroid Build Coastguard Worker * OK: 86*4d7e907cSAndroid Build Coastguard Worker * On a successful start to processing the capture request 87*4d7e907cSAndroid Build Coastguard Worker * ILLEGAL_ARGUMENT: 88*4d7e907cSAndroid Build Coastguard Worker * If the input is malformed (the settings are empty when not 89*4d7e907cSAndroid Build Coastguard Worker * allowed, the physical camera settings are invalid, there are 0 90*4d7e907cSAndroid Build Coastguard Worker * output buffers, etc) and capture processing 91*4d7e907cSAndroid Build Coastguard Worker * cannot start. Failures during request processing must be 92*4d7e907cSAndroid Build Coastguard Worker * handled by calling ICameraDeviceCallback::notify(). In case of 93*4d7e907cSAndroid Build Coastguard Worker * this error, the framework retains responsibility for the 94*4d7e907cSAndroid Build Coastguard Worker * stream buffers' fences and the buffer handles; the HAL must not 95*4d7e907cSAndroid Build Coastguard Worker * close the fences or return these buffers with 96*4d7e907cSAndroid Build Coastguard Worker * ICameraDeviceCallback::processCaptureResult(). 97*4d7e907cSAndroid Build Coastguard Worker * INTERNAL_ERROR: 98*4d7e907cSAndroid Build Coastguard Worker * If the camera device has encountered a serious error. After this 99*4d7e907cSAndroid Build Coastguard Worker * error is returned, only the close() method can be successfully 100*4d7e907cSAndroid Build Coastguard Worker * called by the framework. 101*4d7e907cSAndroid Build Coastguard Worker * @return numRequestProcessed Number of requests successfully processed by 102*4d7e907cSAndroid Build Coastguard Worker * camera HAL. When status is OK, this must be equal to the size of 103*4d7e907cSAndroid Build Coastguard Worker * requests. When the call fails, this number is the number of requests 104*4d7e907cSAndroid Build Coastguard Worker * that HAL processed successfully before HAL runs into an error. 105*4d7e907cSAndroid Build Coastguard Worker * 106*4d7e907cSAndroid Build Coastguard Worker */ 107*4d7e907cSAndroid Build Coastguard Worker processCaptureRequest_3_4(vec<CaptureRequest> requests, vec<BufferCache> cachesToRemove) 108*4d7e907cSAndroid Build Coastguard Worker generates (Status status, uint32_t numRequestProcessed); 109*4d7e907cSAndroid Build Coastguard Worker}; 110