1 /* 2 * Copyright (C) 2019 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 #ifndef HARDWARE_GOOGLE_CAMERA_HAL_SESSION_DATA_DEFS_H 18 #define HARDWARE_GOOGLE_CAMERA_HAL_SESSION_DATA_DEFS_H 19 20 #include <cstdint> 21 22 namespace android { 23 namespace google_camera_hal { 24 25 // The session data API is a generic low-overhead mechanism for 26 // internal data exchange across the (user-mode) driver stack. It 27 // allows any component to set a key/value per a device session 28 // and any other component to get that value in that session. It 29 // does not care about the semantics of the key/value pair: it is 30 // up to the usage parties (i.e. setters/getters) to agree on 31 // the semantics, including the life cycle and validity of the 32 // values. This is acceptable since this API is intended for 33 // internal communication and therefore, it's expected that its 34 // usage is part of a design where the assumptions / expectations 35 // and roles of the parties are clearly defined. 36 // Since there is no "type" associated with the keys, it is a 37 // good practice to include hints about the type in the key name. 38 // 39 // The keys defined in here are visible across GCH and HWL. The 40 // keys that are only visible within the HWL should be defined 41 // in HWL but extend below key domain (i.e. respect the defined 42 // range to avoid clashes.) 43 44 enum SessionDataKey : uint64_t { 45 kSessionDataKeyInvalidKey = 0, 46 // Add HAL-visible keys here (visible to GCH and HWL). 47 // A pointer to an int variable that indicates current 48 // Eis frame delay number. 49 // The pointer will be valid for the entire session. 50 kSessionDataKeyEisFrameDelayIntPtr, 51 kSessionDataKeyBeginHwlKeys = 0xFFFFFFFF 52 }; 53 54 } // namespace google_camera_hal 55 } // namespace android 56 57 #endif // HARDWARE_GOOGLE_CAMERA_HAL_SESSION_DATA_DEFS_H