blob: 6e915907bb5274cc73f041633afd813bc3506f3c [file] [log] [blame]
Bob Badour07562132020-05-20 13:18:00 +00001//
2// Copyright (C) 2020 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// clang-format off
18#include "native_bridge_support/vdso/interceptable_functions.h"
19
20DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraCaptureSession_abortCaptures);
21DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraCaptureSession_capture);
22DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraCaptureSession_close);
23DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraCaptureSession_getDevice);
24DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraCaptureSession_logicalCamera_capture);
25DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraCaptureSession_logicalCamera_setRepeatingRequest);
26DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraCaptureSession_setRepeatingRequest);
27DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraCaptureSession_stopRepeating);
28DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraCaptureSession_updateSharedOutput);
29DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraDevice_close);
30DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraDevice_createCaptureRequest);
31DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraDevice_createCaptureRequest_withPhysicalIds);
32DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraDevice_createCaptureSession);
33DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraDevice_createCaptureSessionWithSessionParameters);
34DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraDevice_getId);
35DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraDevice_isSessionConfigurationSupported);
36DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraManager_create);
37DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraManager_delete);
38DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraManager_deleteCameraIdList);
39DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraManager_getCameraCharacteristics);
40DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraManager_getCameraIdList);
41DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraManager_openCamera);
42DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraManager_registerAvailabilityCallback);
43DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraManager_registerExtendedAvailabilityCallback);
44DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraManager_unregisterAvailabilityCallback);
45DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraManager_unregisterExtendedAvailabilityCallback);
46DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraMetadata_copy);
47DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraMetadata_free);
Evgeny Eltsin9c7d4622020-07-15 15:30:51 +020048DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraMetadata_fromCameraMetadata);
Bob Badour07562132020-05-20 13:18:00 +000049DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraMetadata_getAllTags);
50DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraMetadata_getConstEntry);
51DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraMetadata_isLogicalMultiCamera);
52DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraOutputTarget_create);
53DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACameraOutputTarget_free);
54DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureRequest_addTarget);
55DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureRequest_copy);
56DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureRequest_free);
57DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureRequest_getAllTags);
58DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureRequest_getConstEntry);
59DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureRequest_getConstEntry_physicalCamera);
60DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureRequest_getUserContext);
61DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureRequest_removeTarget);
62DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureRequest_setEntry_double);
63DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureRequest_setEntry_float);
64DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureRequest_setEntry_i32);
65DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureRequest_setEntry_i64);
66DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureRequest_setEntry_physicalCamera_double);
67DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureRequest_setEntry_physicalCamera_float);
68DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureRequest_setEntry_physicalCamera_i32);
69DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureRequest_setEntry_physicalCamera_i64);
70DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureRequest_setEntry_physicalCamera_rational);
71DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureRequest_setEntry_physicalCamera_u8);
72DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureRequest_setEntry_rational);
73DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureRequest_setEntry_u8);
74DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureRequest_setUserContext);
75DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureSessionOutputContainer_add);
76DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureSessionOutputContainer_create);
77DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureSessionOutputContainer_free);
78DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureSessionOutputContainer_remove);
79DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureSessionOutput_create);
80DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureSessionOutput_free);
81DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureSessionPhysicalOutput_create);
82DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureSessionSharedOutput_add);
83DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureSessionSharedOutput_create);
84DEFINE_INTERCEPTABLE_STUB_FUNCTION(ACaptureSessionSharedOutput_remove);
85
86static void __attribute__((constructor(0))) init_stub_library() {
87 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraCaptureSession_abortCaptures);
88 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraCaptureSession_capture);
89 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraCaptureSession_close);
90 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraCaptureSession_getDevice);
91 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraCaptureSession_logicalCamera_capture);
92 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraCaptureSession_logicalCamera_setRepeatingRequest);
93 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraCaptureSession_setRepeatingRequest);
94 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraCaptureSession_stopRepeating);
95 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraCaptureSession_updateSharedOutput);
96 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraDevice_close);
97 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraDevice_createCaptureRequest);
98 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraDevice_createCaptureRequest_withPhysicalIds);
99 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraDevice_createCaptureSession);
100 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraDevice_createCaptureSessionWithSessionParameters);
101 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraDevice_getId);
102 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraDevice_isSessionConfigurationSupported);
103 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraManager_create);
104 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraManager_delete);
105 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraManager_deleteCameraIdList);
106 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraManager_getCameraCharacteristics);
107 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraManager_getCameraIdList);
108 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraManager_openCamera);
109 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraManager_registerAvailabilityCallback);
110 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraManager_registerExtendedAvailabilityCallback);
111 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraManager_unregisterAvailabilityCallback);
112 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraManager_unregisterExtendedAvailabilityCallback);
113 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraMetadata_copy);
114 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraMetadata_free);
Evgeny Eltsin9c7d4622020-07-15 15:30:51 +0200115 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraMetadata_fromCameraMetadata);
Bob Badour07562132020-05-20 13:18:00 +0000116 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraMetadata_getAllTags);
117 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraMetadata_getConstEntry);
118 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraMetadata_isLogicalMultiCamera);
119 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraOutputTarget_create);
120 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACameraOutputTarget_free);
121 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureRequest_addTarget);
122 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureRequest_copy);
123 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureRequest_free);
124 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureRequest_getAllTags);
125 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureRequest_getConstEntry);
126 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureRequest_getConstEntry_physicalCamera);
127 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureRequest_getUserContext);
128 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureRequest_removeTarget);
129 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureRequest_setEntry_double);
130 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureRequest_setEntry_float);
131 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureRequest_setEntry_i32);
132 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureRequest_setEntry_i64);
133 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureRequest_setEntry_physicalCamera_double);
134 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureRequest_setEntry_physicalCamera_float);
135 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureRequest_setEntry_physicalCamera_i32);
136 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureRequest_setEntry_physicalCamera_i64);
137 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureRequest_setEntry_physicalCamera_rational);
138 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureRequest_setEntry_physicalCamera_u8);
139 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureRequest_setEntry_rational);
140 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureRequest_setEntry_u8);
141 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureRequest_setUserContext);
142 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureSessionOutputContainer_add);
143 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureSessionOutputContainer_create);
144 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureSessionOutputContainer_free);
145 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureSessionOutputContainer_remove);
146 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureSessionOutput_create);
147 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureSessionOutput_free);
148 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureSessionPhysicalOutput_create);
149 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureSessionSharedOutput_add);
150 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureSessionSharedOutput_create);
151 INIT_INTERCEPTABLE_STUB_FUNCTION("libcamera2ndk.so", ACaptureSessionSharedOutput_remove);
152}
153// clang-format on