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