1 /* 2 * Copyright (C) 2011 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 /* 18 * Contains implementation of the camera HAL layer in the system running 19 * under the emulator. 20 * 21 * This file contains only required HAL header, which directs all the API calls 22 * to the EmulatedCameraFactory class implementation, wich is responsible for 23 * managing emulated cameras. 24 */ 25 26 #include "EmulatedCameraFactory.h" 27 #include "guest/libs/platform_support/api_level_fixes.h" 28 29 /* 30 * Required HAL header. 31 */ 32 camera_module_t HAL_MODULE_INFO_SYM = { 33 VSOC_STATIC_INITIALIZER(common){ 34 VSOC_STATIC_INITIALIZER(tag) HARDWARE_MODULE_TAG, 35 #if VSOC_PLATFORM_SDK_AFTER(L_MR1) 36 VSOC_STATIC_INITIALIZER(module_api_version) 37 CAMERA_MODULE_API_VERSION_2_4, 38 #elif VSOC_PLATFORM_SDK_AFTER(K) 39 VSOC_STATIC_INITIALIZER(module_api_version) 40 CAMERA_MODULE_API_VERSION_2_3, 41 #elif VSOC_PLATFORM_SDK_AFTER(J_MR2) 42 VSOC_STATIC_INITIALIZER(module_api_version) 43 CAMERA_MODULE_API_VERSION_2_2, 44 #else 45 VSOC_STATIC_INITIALIZER(module_api_version) 46 CAMERA_MODULE_API_VERSION_2_0, 47 #endif 48 VSOC_STATIC_INITIALIZER(hal_api_version) HARDWARE_HAL_API_VERSION, 49 VSOC_STATIC_INITIALIZER(id) CAMERA_HARDWARE_MODULE_ID, 50 VSOC_STATIC_INITIALIZER(name) "Emulated Camera Module", 51 VSOC_STATIC_INITIALIZER(author) "The Android Open Source Project", 52 VSOC_STATIC_INITIALIZER(methods) & 53 android::EmulatedCameraFactory::mCameraModuleMethods, 54 VSOC_STATIC_INITIALIZER(dso) NULL, 55 VSOC_STATIC_INITIALIZER(reserved){0}, 56 }, 57 VSOC_STATIC_INITIALIZER(get_number_of_cameras) 58 android::EmulatedCameraFactory::get_number_of_cameras, 59 VSOC_STATIC_INITIALIZER(get_camera_info) 60 android::EmulatedCameraFactory::get_camera_info, 61 #if VSOC_PLATFORM_SDK_AFTER(J_MR2) 62 VSOC_STATIC_INITIALIZER(set_callbacks) 63 android::EmulatedCameraFactory::set_callbacks, 64 VSOC_STATIC_INITIALIZER(get_vendor_tag_ops) 65 android::EmulatedCameraFactory::get_vendor_tag_ops, 66 #endif 67 #if VSOC_PLATFORM_SDK_AFTER(K) 68 VSOC_STATIC_INITIALIZER(open_legacy) 69 android::EmulatedCameraFactory::open_legacy, 70 #endif 71 #if VSOC_PLATFORM_SDK_AFTER(L_MR1) 72 VSOC_STATIC_INITIALIZER(set_torch_mode) 73 android::EmulatedCameraFactory::set_torch_mode, 74 #endif 75 }; 76