Ocean
NativeCameraLibrary.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_MEDIA_ANDROID_NATIVE_CAMERA_LIBRARY_H
9 #define META_OCEAN_MEDIA_ANDROID_NATIVE_CAMERA_LIBRARY_H
10 
12 
15 #include "ocean/base/Singleton.h"
16 
17 #if defined(__ANDROID_API__) && __ANDROID_API__ >= 24
18 
19 #ifndef OCEAN_MEDIA_ANDROID_NATIVECAMERALIBRARY_AVAILABLE
20  #define OCEAN_MEDIA_ANDROID_NATIVECAMERALIBRARY_AVAILABLE
21 #endif
22 
23 #include <camera/NdkCaptureRequest.h>
24 
25 #include <camera/NdkCameraCaptureSession.h>
26 #include <camera/NdkCameraDevice.h>
27 #include <camera/NdkCameraManager.h>
28 
29 namespace Ocean
30 {
31 
32 namespace Media
33 {
34 
35 namespace Android
36 {
37 
38 /**
39  * This class is an interface for Android's shared native library camera2ndk.
40  * @ingroup mediaandroid
41  */
42 class OCEAN_MEDIA_A_EXPORT NativeCameraLibrary : public Singleton<NativeCameraLibrary>
43 {
44  friend class Singleton<NativeCameraLibrary>;
45 
46  public:
47 
48  /**
49  * Definition of a subscription object.
50  */
52 
53  /**
54  * Definition of a scoped object for ACameraManager objects.
55  */
56  class ScopedACameraManager : public ScopedObjectT<ACameraManager*, ACameraManager*, std::function<void(ACameraManager*)>>
57  {
58  public:
59 
60  /**
61  * Default constructor creating an invalid object.
62  */
63  ScopedACameraManager() = default;
64 
65  /**
66  * Creates a new scoped object and takes over the ownership of the given camera manager.
67  * @param cameraManager The camera manager to take over, can be nullptr to create an invalid object.
68  */
69  explicit inline ScopedACameraManager(ACameraManager* cameraManager);
70  };
71 
72  /**
73  * Definition of a scoped object for ACameraIdList objects.
74  */
75  class ScopedACameraIdList : public ScopedObjectT<ACameraIdList*, ACameraIdList*, std::function<void(ACameraIdList*)>>
76  {
77  public:
78 
79  /**
80  * Default constructor creating an invalid object.
81  */
82  ScopedACameraIdList() = default;
83 
84  /**
85  * Creates a new scoped object and takes over the ownership of the created camera id list.
86  * @param cameraManager The camera manager which will be used to create the camera id list, must be valid
87  */
88  explicit ScopedACameraIdList(ACameraManager* cameraManager);
89  };
90 
91  /**
92  * Definition of a scoped object for ACaptureSessionOutputContainer objects.
93  */
94  class ScopedACaptureSessionOutputContainer : public ScopedObjectT<ACaptureSessionOutputContainer*, ACaptureSessionOutputContainer*, std::function<void(ACaptureSessionOutputContainer*)>>
95  {
96  public:
97 
98  /**
99  * Default constructor creating an invalid object.
100  */
102 
103  /**
104  * Creates a new scoped object and takes over the ownership of the created capture session output.
105  * @param captureSessionOutputContainer The capture session output container to take over, can be nullptr to create an invalid object.
106  */
107  explicit inline ScopedACaptureSessionOutputContainer(ACaptureSessionOutputContainer* captureSessionOutputContainer);
108  };
109 
110  /**
111  * Definition of a scoped object for ACaptureSessionOutput objects.
112  */
113  class ScopedACaptureSessionOutput : public ScopedObjectT<ACaptureSessionOutput*, ACaptureSessionOutput*, std::function<void(ACaptureSessionOutput*)>>
114  {
115  public:
116 
117  /**
118  * Default constructor creating an invalid object.
119  */
121 
122  /**
123  * Creates a new scoped object and takes over the ownership of the created capture session output.
124  * @param nativeWindow The native window to which the session output will be attached, must be valid
125  */
126  explicit ScopedACaptureSessionOutput(ANativeWindow* nativeWindow);
127  };
128 
129  protected:
130 
131  /**
132  * Definition of the individual function pointers of ACameraDevice.
133  */
134  using Function_ACameraDevice_close = camera_status_t (ACameraDevice* device);
135  using Function_ACameraDevice_getId = const char* (const ACameraDevice* device);
136  using Function_ACameraDevice_createCaptureRequest = camera_status_t (const ACameraDevice* device, ACameraDevice_request_template templateId, ACaptureRequest** request);
137  using Function_ACaptureSessionOutputContainer_create = camera_status_t (ACaptureSessionOutputContainer** container);
138  using Function_ACaptureSessionOutputContainer_free = void (ACaptureSessionOutputContainer* container);
139  using Function_ACaptureSessionOutput_create = camera_status_t (ANativeWindow* anw, ACaptureSessionOutput** output);
140  using Function_ACaptureSessionOutput_free = void (ACaptureSessionOutput* output);
141  using Function_ACaptureSessionOutputContainer_add = camera_status_t (ACaptureSessionOutputContainer* container, const ACaptureSessionOutput* output);
142  using Function_ACaptureSessionOutputContainer_remove = camera_status_t (ACaptureSessionOutputContainer* container, const ACaptureSessionOutput* output);
143  using Function_ACameraDevice_createCaptureSession = camera_status_t (ACameraDevice* device, const ACaptureSessionOutputContainer* outputs, const ACameraCaptureSession_stateCallbacks* callbacks, ACameraCaptureSession** session);
144 
145  /**
146  * Definition of the individual function pointers of ACameraManager.
147  */
148  using Function_ACameraManager_create = ACameraManager*();
149  using Function_ACameraManager_delete = void (ACameraManager*);
150  using Function_ACameraManager_getCameraIdList = camera_status_t (ACameraManager* manager, ACameraIdList** cameraIdList);
151  using Function_ACameraManager_deleteCameraIdList = void (ACameraIdList* cameraIdList);
152  using Function_ACameraManager_registerAvailabilityCallback = camera_status_t (ACameraManager* manager, const ACameraManager_AvailabilityCallbacks* callback);
153  using Function_ACameraManager_unregisterAvailabilityCallback = camera_status_t (ACameraManager* manager, const ACameraManager_AvailabilityCallbacks* callback);
154  using Function_ACameraManager_getCameraCharacteristics = camera_status_t (ACameraManager* manager, const char* cameraId, ACameraMetadata** characteristics);
155  using Function_ACameraManager_openCamera = camera_status_t (ACameraManager* manager, const char* cameraId, ACameraDevice_StateCallbacks* callback, ACameraDevice** device);
156 
157  /**
158  * Definition of the individual function pointers of ACameraMetadata.
159  */
160  using Function_ACameraMetadata_getConstEntry = camera_status_t (const ACameraMetadata* metadata, uint32_t tag, ACameraMetadata_const_entry* entry);
161  using Function_ACameraMetadata_getAllTags = camera_status_t (const ACameraMetadata* metadata, int32_t* numEntries, const uint32_t** tags);
162  using Function_ACameraMetadata_copy = ACameraMetadata* (const ACameraMetadata* src);
163  using Function_ACameraMetadata_free = void (ACameraMetadata* metadata);
164 
165  /**
166  * Definition of the individual function pointers for capture requests.
167  */
168  using Function_ACameraOutputTarget_create = camera_status_t (ANativeWindow* window, ACameraOutputTarget** output);
169  using Function_ACameraOutputTarget_free = void (ACameraOutputTarget* output);
170  using Function_ACaptureRequest_addTarget = camera_status_t (ACaptureRequest* request, const ACameraOutputTarget* output);
171  using Function_ACaptureRequest_removeTarget = camera_status_t (ACaptureRequest* request, const ACameraOutputTarget* output);
172  using Function_ACaptureRequest_getConstEntry = camera_status_t (const ACaptureRequest* request, uint32_t tag, ACameraMetadata_const_entry* entry);
173  using Function_ACaptureRequest_getAllTags = camera_status_t (const ACaptureRequest* request, int32_t* numTags, const uint32_t** tags);
174  using Function_ACaptureRequest_setEntry_u8 = camera_status_t (ACaptureRequest* request, uint32_t tag, uint32_t count, const uint8_t* data);
175  using Function_ACaptureRequest_setEntry_i32 = camera_status_t (ACaptureRequest* request, uint32_t tag, uint32_t count, const int32_t* data);
176  using Function_ACaptureRequest_setEntry_float = camera_status_t (ACaptureRequest* request, uint32_t tag, uint32_t count, const float* data);
177  using Function_ACaptureRequest_setEntry_i64 = camera_status_t (ACaptureRequest* request, uint32_t tag, uint32_t count, const int64_t* data);
178  using Function_ACaptureRequest_setEntry_double = camera_status_t (ACaptureRequest* request, uint32_t tag, uint32_t count, const double* data);
179  using Function_ACaptureRequest_setEntry_rational = camera_status_t (ACaptureRequest* request, uint32_t tag, uint32_t count, const ACameraMetadata_rational* data);
180  using Function_ACaptureRequest_free = void (ACaptureRequest* request);
181 
182  /**
183  * Definition of individual function pointers for ACameraCaptureSession.
184  */
185  using Function_ACameraCaptureSession_close = void (ACameraCaptureSession* session);
186  using Function_ACameraCaptureSession_getDevice = camera_status_t (ACameraCaptureSession* session, /*out*/ACameraDevice** device);
187  using Function_ACameraCaptureSession_capture = camera_status_t (ACameraCaptureSession* session, ACameraCaptureSession_captureCallbacks* callbacks, int numRequests, ACaptureRequest** requests, int* captureSequenceId);
188  using Function_ACameraCaptureSession_setRepeatingRequest = camera_status_t (ACameraCaptureSession* session, ACameraCaptureSession_captureCallbacks* callbacks, int numRequests, ACaptureRequest** requests, int* captureSequenceId);
189  using Function_ACameraCaptureSession_stopRepeating = camera_status_t (ACameraCaptureSession* session);
190  using Function_ACameraCaptureSession_abortCaptures = camera_status_t (ACameraCaptureSession* session);
191 
192  public:
193 
194  /**
195  * Initializes the camera library.
196  * The library will be initialized as long as the resulting subscription object exists.
197  * @return The subscription object, invalid in case the library could not be initialized
198  */
200 
201  /**
202  * Returns whether the library is initialized.
203  * @return True, if so
204  */
205  inline bool isInitialized() const;
206 
207  /**
208  * The individual functions of ACameraDevice.
209  */
210  inline camera_status_t ACameraDevice_close(ACameraDevice* device);
211  inline const char* ACameraDevice_getId(const ACameraDevice* device);
212  inline camera_status_t ACameraDevice_createCaptureRequest(const ACameraDevice* device, ACameraDevice_request_template templateId, ACaptureRequest** request);
213  inline camera_status_t ACaptureSessionOutputContainer_create(ACaptureSessionOutputContainer** container);
214  inline void ACaptureSessionOutputContainer_free(ACaptureSessionOutputContainer* container);
215  inline camera_status_t ACaptureSessionOutput_create(ANativeWindow* anw, ACaptureSessionOutput** output);
216  inline void ACaptureSessionOutput_free(ACaptureSessionOutput* output);
217  inline camera_status_t ACaptureSessionOutputContainer_add(ACaptureSessionOutputContainer* container, const ACaptureSessionOutput* output);
218  inline camera_status_t ACaptureSessionOutputContainer_remove(ACaptureSessionOutputContainer* container, const ACaptureSessionOutput* output);
219  inline camera_status_t ACameraDevice_createCaptureSession(ACameraDevice* device, const ACaptureSessionOutputContainer* outputs, const ACameraCaptureSession_stateCallbacks* callbacks, ACameraCaptureSession** session);
220 
221  /**
222  * The individual functions of ACameraManager.
223  */
224  inline ACameraManager* ACameraManager_create();
225  inline void ACameraManager_delete(ACameraManager* manager);
226  inline camera_status_t ACameraManager_getCameraIdList(ACameraManager* manager, ACameraIdList** cameraIdList);
227  inline void ACameraManager_deleteCameraIdList(ACameraIdList* cameraIdList);
228  inline camera_status_t ACameraManager_registerAvailabilityCallback(ACameraManager* manager, const ACameraManager_AvailabilityCallbacks* callback);
229  inline camera_status_t ACameraManager_unregisterAvailabilityCallback(ACameraManager* manager, const ACameraManager_AvailabilityCallbacks* callback);
230  inline camera_status_t ACameraManager_getCameraCharacteristics(ACameraManager* manager, const char* cameraId, ACameraMetadata** characteristics);
231  inline camera_status_t ACameraManager_openCamera(ACameraManager* manager, const char* cameraId, ACameraDevice_StateCallbacks* callback, ACameraDevice** device);
232 
233  /**
234  * The individual functions of ACameraMetadata.
235  */
236  inline camera_status_t ACameraMetadata_getConstEntry(const ACameraMetadata* metadata, uint32_t tag, ACameraMetadata_const_entry* entry);
237  inline camera_status_t ACameraMetadata_getAllTags(const ACameraMetadata* metadata, int32_t* numEntries, const uint32_t** tags);
238  inline ACameraMetadata* ACameraMetadata_copy(const ACameraMetadata* src);
239  inline void ACameraMetadata_free(ACameraMetadata* metadata);
240 
241  /**
242  * The individual functions for capture requests.
243  */
244  inline camera_status_t ACameraOutputTarget_create(ANativeWindow* window, ACameraOutputTarget** output);
245  inline void ACameraOutputTarget_free(ACameraOutputTarget* output);
246  inline camera_status_t ACaptureRequest_addTarget(ACaptureRequest* request, const ACameraOutputTarget* output);
247  inline camera_status_t ACaptureRequest_removeTarget(ACaptureRequest* request, const ACameraOutputTarget* output);
248  inline camera_status_t ACaptureRequest_getConstEntry(const ACaptureRequest* request, uint32_t tag, ACameraMetadata_const_entry* entry);
249  inline camera_status_t ACaptureRequest_getAllTags(const ACaptureRequest* request, int32_t* numTags, const uint32_t** tags);
250  inline camera_status_t ACaptureRequest_setEntry_u8(ACaptureRequest* request, uint32_t tag, uint32_t count, const uint8_t* data);
251  inline camera_status_t ACaptureRequest_setEntry_i32(ACaptureRequest* request, uint32_t tag, uint32_t count, const int32_t* data);
252  inline camera_status_t ACaptureRequest_setEntry_float(ACaptureRequest* request, uint32_t tag, uint32_t count, const float* data);
253  inline camera_status_t ACaptureRequest_setEntry_i64(ACaptureRequest* request, uint32_t tag, uint32_t count, const int64_t* data);
254  inline camera_status_t ACaptureRequest_setEntry_double(ACaptureRequest* request, uint32_t tag, uint32_t count, const double* data);
255  inline camera_status_t ACaptureRequest_setEntry_rational(ACaptureRequest* request, uint32_t tag, uint32_t count, const ACameraMetadata_rational* data);
256  inline void ACaptureRequest_free(ACaptureRequest* request);
257 
258  /**
259  * The individual functions of ACameraCaptureSession.
260  */
261  inline void ACameraCaptureSession_close(ACameraCaptureSession* session);
262  inline camera_status_t ACameraCaptureSession_getDevice(ACameraCaptureSession* session, ACameraDevice** device);
263  inline camera_status_t ACameraCaptureSession_capture(ACameraCaptureSession* session, ACameraCaptureSession_captureCallbacks* callbacks, int numRequests, ACaptureRequest** requests, int* captureSequenceId);
264  inline camera_status_t ACameraCaptureSession_setRepeatingRequest(ACameraCaptureSession* session, ACameraCaptureSession_captureCallbacks* callbacks, int numRequests, ACaptureRequest** requests, int* captureSequenceId);
265  inline camera_status_t ACameraCaptureSession_stopRepeating(ACameraCaptureSession* session);
266  inline camera_status_t ACameraCaptureSession_abortCaptures(ACameraCaptureSession* session);
267 
268  protected:
269 
270  /**
271  * Protected default constructor.
272  */
274 
275  /**
276  * Destructs the library
277  */
278  inline ~NativeCameraLibrary();
279 
280  /**
281  * Uninitializes the library.
282  * @param unused An unused id
283  */
284  void uninitialize(const unsigned int unused);
285 
286  /**
287  * Releases the library.
288  */
289  void release();
290 
291  protected:
292 
293  /// The handle of the library.
294  void* libraryHandle_ = nullptr;
295 
296  /// All ACameraDevice function pointers.
297  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACameraDevice_close* ACameraDevice_close_ = nullptr;
298  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACameraDevice_getId* ACameraDevice_getId_ = nullptr;
299  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACameraDevice_createCaptureRequest* ACameraDevice_createCaptureRequest_ = nullptr;
300  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACaptureSessionOutputContainer_create* ACaptureSessionOutputContainer_create_ = nullptr;
301  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACaptureSessionOutputContainer_free* ACaptureSessionOutputContainer_free_ = nullptr;
302  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACaptureSessionOutput_create* ACaptureSessionOutput_create_ = nullptr;
303  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACaptureSessionOutput_free* ACaptureSessionOutput_free_ = nullptr;
304  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACaptureSessionOutputContainer_add* ACaptureSessionOutputContainer_add_ = nullptr;
305  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACaptureSessionOutputContainer_remove* ACaptureSessionOutputContainer_remove_ = nullptr;
306  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACameraDevice_createCaptureSession* ACameraDevice_createCaptureSession_ = nullptr;
307 
308  /// All ACameraManager function pointers.
309  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACameraManager_create* ACameraManager_create_ = nullptr;
310  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACameraManager_delete* ACameraManager_delete_ = nullptr;
311  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACameraManager_getCameraIdList* ACameraManager_getCameraIdList_ = nullptr;
312  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACameraManager_deleteCameraIdList* ACameraManager_deleteCameraIdList_ = nullptr;
313  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACameraManager_registerAvailabilityCallback* ACameraManager_registerAvailabilityCallback_ = nullptr;
314  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACameraManager_unregisterAvailabilityCallback* ACameraManager_unregisterAvailabilityCallback_ = nullptr;
315  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACameraManager_getCameraCharacteristics* ACameraManager_getCameraCharacteristics_ = nullptr;
316  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACameraManager_openCamera* ACameraManager_openCamera_ = nullptr;
317 
318  /// All ACameraMetadata function pointers.
319  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACameraMetadata_getConstEntry* ACameraMetadata_getConstEntry_ = nullptr;
320  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACameraMetadata_getAllTags* ACameraMetadata_getAllTags_ = nullptr;
321  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACameraMetadata_copy* ACameraMetadata_copy_ = nullptr;
322  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACameraMetadata_free* ACameraMetadata_free_ = nullptr;
323 
324  /// All capture request function pointers.
325  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACameraOutputTarget_create* ACameraOutputTarget_create_ = nullptr;
326  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACameraOutputTarget_free* ACameraOutputTarget_free_ = nullptr;
327  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACaptureRequest_addTarget* ACaptureRequest_addTarget_ = nullptr;
328  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACaptureRequest_removeTarget* ACaptureRequest_removeTarget_ = nullptr;
329  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACaptureRequest_getConstEntry* ACaptureRequest_getConstEntry_ = nullptr;
330  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACaptureRequest_getAllTags* ACaptureRequest_getAllTags_ = nullptr;
331  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACaptureRequest_setEntry_u8* ACaptureRequest_setEntry_u8_ = nullptr;
332  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACaptureRequest_setEntry_i32* ACaptureRequest_setEntry_i32_ = nullptr;
333  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACaptureRequest_setEntry_float* ACaptureRequest_setEntry_float_ = nullptr;
334  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACaptureRequest_setEntry_i64* ACaptureRequest_setEntry_i64_ = nullptr;
335  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACaptureRequest_setEntry_double* ACaptureRequest_setEntry_double_ = nullptr;
336  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACaptureRequest_setEntry_rational* ACaptureRequest_setEntry_rational_ = nullptr;
337  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACaptureRequest_free* ACaptureRequest_free_ = nullptr;
338 
339  /// All ACameraCaptureSession function pointers.
340  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACameraCaptureSession_close* ACameraCaptureSession_close_ = nullptr;
341  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACameraCaptureSession_getDevice* ACameraCaptureSession_getDevice_ = nullptr;
342  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACameraCaptureSession_capture* ACameraCaptureSession_capture_ = nullptr;
343  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACameraCaptureSession_setRepeatingRequest* ACameraCaptureSession_setRepeatingRequest_ = nullptr;
344  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACameraCaptureSession_stopRepeating* ACameraCaptureSession_stopRepeating_ = nullptr;
345  __attribute__((annotate("dynamic_fn_ptr"))) Function_ACameraCaptureSession_abortCaptures* ACameraCaptureSession_abortCaptures_ = nullptr;
346 
347  /// The counter for counting the usage of this library.
348  unsigned int initializationCounter_ = 0u;
349 
350  /// The library's lock.
351  mutable Lock lock_;
352 };
353 
354 inline NativeCameraLibrary::ScopedACameraManager::ScopedACameraManager(ACameraManager* cameraManager) :
355  ScopedObjectT(cameraManager, std::bind(&NativeCameraLibrary::ACameraManager_delete, &NativeCameraLibrary::get(), cameraManager), cameraManager != nullptr)
356 {
357  // nothing to do here
358 }
359 
360 inline NativeCameraLibrary::ScopedACaptureSessionOutputContainer::ScopedACaptureSessionOutputContainer(ACaptureSessionOutputContainer* captureSessionOutputContainer) :
361  ScopedObjectT(captureSessionOutputContainer, std::bind(&NativeCameraLibrary::ACaptureSessionOutputContainer_free, &NativeCameraLibrary::get(), captureSessionOutputContainer), captureSessionOutputContainer != nullptr)
362 {
363  // nothing to do here
364 }
365 
367 {
368  ocean_assert(initializationCounter_ == 0u);
369 }
370 
372 {
373  const ScopedLock scopedLock(lock_);
374 
375  return initializationCounter_ != 0u;
376 }
377 
378 inline camera_status_t NativeCameraLibrary::ACameraDevice_close(ACameraDevice* device)
379 {
380  ocean_assert(isInitialized());
381  ocean_assert(ACameraDevice_close_ != nullptr);
382 
383  return ACameraDevice_close_(device);
384 }
385 
386 inline const char* NativeCameraLibrary::ACameraDevice_getId(const ACameraDevice* device)
387 {
388  ocean_assert(isInitialized());
389  ocean_assert(ACameraDevice_getId_ != nullptr);
390 
391  return ACameraDevice_getId_(device);
392 }
393 
394 inline camera_status_t NativeCameraLibrary::ACameraDevice_createCaptureRequest(const ACameraDevice* device, ACameraDevice_request_template templateId, ACaptureRequest** request)
395 {
396  ocean_assert(isInitialized());
397  ocean_assert(ACameraDevice_createCaptureRequest_ != nullptr);
398 
399  return ACameraDevice_createCaptureRequest_(device, templateId, request);
400 }
401 
402 inline camera_status_t NativeCameraLibrary::ACaptureSessionOutputContainer_create(ACaptureSessionOutputContainer** container)
403 {
404  ocean_assert(isInitialized());
405  ocean_assert(ACaptureSessionOutputContainer_create_ != nullptr);
406 
407  return ACaptureSessionOutputContainer_create_(container);
408 }
409 
410 inline void NativeCameraLibrary::ACaptureSessionOutputContainer_free(ACaptureSessionOutputContainer* container)
411 {
412  ocean_assert(isInitialized());
413  ocean_assert(ACaptureSessionOutputContainer_free_ != nullptr);
414 
415  ACaptureSessionOutputContainer_free_(container);
416 }
417 
418 inline camera_status_t NativeCameraLibrary::ACaptureSessionOutput_create(ANativeWindow* anw, ACaptureSessionOutput** output)
419 {
420  ocean_assert(isInitialized());
421  ocean_assert(ACaptureSessionOutput_create_ != nullptr);
422 
423  return ACaptureSessionOutput_create_(anw, output);
424 }
425 
426 inline void NativeCameraLibrary::ACaptureSessionOutput_free(ACaptureSessionOutput* output)
427 {
428  ocean_assert(isInitialized());
429  ocean_assert(ACaptureSessionOutput_free_ != nullptr);
430 
431  ACaptureSessionOutput_free_(output);
432 }
433 
434 inline camera_status_t NativeCameraLibrary::ACaptureSessionOutputContainer_add(ACaptureSessionOutputContainer* container, const ACaptureSessionOutput* output)
435 {
436  ocean_assert(isInitialized());
437  ocean_assert(ACaptureSessionOutputContainer_add_ != nullptr);
438 
439  return ACaptureSessionOutputContainer_add_(container, output);
440 }
441 
442 inline camera_status_t NativeCameraLibrary::ACaptureSessionOutputContainer_remove(ACaptureSessionOutputContainer* container, const ACaptureSessionOutput* output)
443 {
444  ocean_assert(isInitialized());
445  ocean_assert(ACaptureSessionOutputContainer_remove_ != nullptr);
446 
447  return ACaptureSessionOutputContainer_remove_(container, output);
448 }
449 
450 inline camera_status_t NativeCameraLibrary::ACameraDevice_createCaptureSession(ACameraDevice* device, const ACaptureSessionOutputContainer* outputs, const ACameraCaptureSession_stateCallbacks* callbacks, ACameraCaptureSession** session)
451 {
452  ocean_assert(isInitialized());
453  ocean_assert(ACameraDevice_createCaptureSession_ != nullptr);
454 
455  return ACameraDevice_createCaptureSession_(device, outputs, callbacks, session);
456 }
457 
459 {
460  ocean_assert(isInitialized());
461  ocean_assert(ACameraManager_create_ != nullptr);
462 
463  return ACameraManager_create_();
464 }
465 
466 inline void NativeCameraLibrary::ACameraManager_delete(ACameraManager* manager)
467 {
468  ocean_assert(isInitialized());
469  ocean_assert(ACameraManager_delete_ != nullptr);
470 
471  ACameraManager_delete_(manager);
472 }
473 
474 inline camera_status_t NativeCameraLibrary::ACameraManager_getCameraIdList(ACameraManager* manager, ACameraIdList** cameraIdList)
475 {
476  ocean_assert(isInitialized());
477  ocean_assert(ACameraManager_getCameraIdList_ != nullptr);
478 
479  return ACameraManager_getCameraIdList_(manager, cameraIdList);
480 }
481 
482 inline void NativeCameraLibrary::ACameraManager_deleteCameraIdList(ACameraIdList* cameraIdList)
483 {
484  ocean_assert(isInitialized());
485  ocean_assert(ACameraManager_deleteCameraIdList_ != nullptr);
486 
487  ACameraManager_deleteCameraIdList_(cameraIdList);
488 }
489 
490 inline camera_status_t NativeCameraLibrary::ACameraManager_registerAvailabilityCallback(ACameraManager* manager, const ACameraManager_AvailabilityCallbacks* callback)
491 {
492  ocean_assert(isInitialized());
493  ocean_assert(ACameraManager_registerAvailabilityCallback_ != nullptr);
494 
495  return ACameraManager_registerAvailabilityCallback_(manager, callback);
496 }
497 
498 inline camera_status_t NativeCameraLibrary::ACameraManager_unregisterAvailabilityCallback(ACameraManager* manager, const ACameraManager_AvailabilityCallbacks* callback)
499 {
500  ocean_assert(isInitialized());
501  ocean_assert(ACameraManager_unregisterAvailabilityCallback_ != nullptr);
502 
503  return ACameraManager_unregisterAvailabilityCallback_(manager, callback);
504 }
505 
506 inline camera_status_t NativeCameraLibrary::ACameraManager_getCameraCharacteristics(ACameraManager* manager, const char* cameraId, ACameraMetadata** characteristics)
507 {
508  ocean_assert(isInitialized());
509  ocean_assert(ACameraManager_getCameraCharacteristics_ != nullptr);
510 
511  return ACameraManager_getCameraCharacteristics_(manager, cameraId, characteristics);
512 }
513 
514 inline camera_status_t NativeCameraLibrary::ACameraManager_openCamera(ACameraManager* manager, const char* cameraId, ACameraDevice_StateCallbacks* callback, ACameraDevice** device)
515 {
516  ocean_assert(isInitialized());
517  ocean_assert(ACameraManager_openCamera_ != nullptr);
518 
519  return ACameraManager_openCamera_(manager, cameraId, callback, device);
520 }
521 
522 inline camera_status_t NativeCameraLibrary::ACameraMetadata_getConstEntry(const ACameraMetadata* metadata, uint32_t tag, ACameraMetadata_const_entry* entry)
523 {
524  ocean_assert(isInitialized());
525  ocean_assert(ACameraMetadata_getConstEntry_ != nullptr);
526 
527  return ACameraMetadata_getConstEntry_(metadata, tag, entry);
528 }
529 
530 inline camera_status_t NativeCameraLibrary::ACameraMetadata_getAllTags(const ACameraMetadata* metadata, int32_t* numEntries, const uint32_t** tags)
531 {
532  ocean_assert(isInitialized());
533  ocean_assert(ACameraMetadata_getAllTags_ != nullptr);
534 
535  return ACameraMetadata_getAllTags_(metadata, numEntries, tags);
536 }
537 
538 inline ACameraMetadata* NativeCameraLibrary::ACameraMetadata_copy(const ACameraMetadata* src)
539 {
540  ocean_assert(isInitialized());
541  ocean_assert(ACameraMetadata_copy_ != nullptr);
542 
543  return ACameraMetadata_copy_(src);
544 }
545 
546 inline void NativeCameraLibrary::ACameraMetadata_free(ACameraMetadata* metadata)
547 {
548  ocean_assert(isInitialized());
549  ocean_assert(ACameraMetadata_free_ != nullptr);
550 
551  ACameraMetadata_free_(metadata);
552 }
553 
554 inline camera_status_t NativeCameraLibrary::ACameraOutputTarget_create(ANativeWindow* window, ACameraOutputTarget** output)
555 {
556  ocean_assert(isInitialized());
557  ocean_assert(ACameraOutputTarget_create_ != nullptr);
558 
559  return ACameraOutputTarget_create_(window, output);
560 }
561 
562 inline void NativeCameraLibrary::ACameraOutputTarget_free(ACameraOutputTarget* output)
563 {
564  ocean_assert(isInitialized());
565  ocean_assert(ACameraOutputTarget_free_ != nullptr);
566 
567  return ACameraOutputTarget_free_(output);
568 }
569 
570 inline camera_status_t NativeCameraLibrary::ACaptureRequest_addTarget(ACaptureRequest* request, const ACameraOutputTarget* output)
571 {
572  ocean_assert(isInitialized());
573  ocean_assert(ACaptureRequest_addTarget_ != nullptr);
574 
575  return ACaptureRequest_addTarget_(request, output);
576 }
577 
578 inline camera_status_t NativeCameraLibrary::ACaptureRequest_removeTarget(ACaptureRequest* request, const ACameraOutputTarget* output)
579 {
580  ocean_assert(isInitialized());
581  ocean_assert(ACaptureRequest_removeTarget_ != nullptr);
582 
583  return ACaptureRequest_removeTarget_(request, output);
584 }
585 
586 inline camera_status_t NativeCameraLibrary::ACaptureRequest_getConstEntry(const ACaptureRequest* request, uint32_t tag, ACameraMetadata_const_entry* entry)
587 {
588  ocean_assert(isInitialized());
589  ocean_assert(ACaptureRequest_getConstEntry_ != nullptr);
590 
591  return ACaptureRequest_getConstEntry_(request, tag, entry);
592 }
593 
594 inline camera_status_t NativeCameraLibrary::ACaptureRequest_getAllTags(const ACaptureRequest* request, int32_t* numTags, const uint32_t** tags)
595 {
596  ocean_assert(isInitialized());
597  ocean_assert(ACaptureRequest_getAllTags_ != nullptr);
598 
599  return ACaptureRequest_getAllTags_(request, numTags, tags);
600 }
601 
602 inline camera_status_t NativeCameraLibrary::ACaptureRequest_setEntry_u8(ACaptureRequest* request, uint32_t tag, uint32_t count, const uint8_t* data)
603 {
604  ocean_assert(isInitialized());
605  ocean_assert(ACaptureRequest_setEntry_u8_ != nullptr);
606 
607  return ACaptureRequest_setEntry_u8_(request, tag, count, data);
608 }
609 
610 inline camera_status_t NativeCameraLibrary::ACaptureRequest_setEntry_i32(ACaptureRequest* request, uint32_t tag, uint32_t count, const int32_t* data)
611 {
612  ocean_assert(isInitialized());
613  ocean_assert(ACaptureRequest_setEntry_i32_ != nullptr);
614 
615  return ACaptureRequest_setEntry_i32_(request, tag, count, data);
616 }
617 
618 inline camera_status_t NativeCameraLibrary::ACaptureRequest_setEntry_float(ACaptureRequest* request, uint32_t tag, uint32_t count, const float* data)
619 {
620  ocean_assert(isInitialized());
621  ocean_assert(ACaptureRequest_setEntry_float_ != nullptr);
622 
623  return ACaptureRequest_setEntry_float_(request, tag, count, data);
624 }
625 
626 inline camera_status_t NativeCameraLibrary::ACaptureRequest_setEntry_i64(ACaptureRequest* request, uint32_t tag, uint32_t count, const int64_t* data)
627 {
628  ocean_assert(isInitialized());
629  ocean_assert(ACaptureRequest_setEntry_i64_ != nullptr);
630 
631  return ACaptureRequest_setEntry_i64_(request, tag, count, data);
632 }
633 
634 inline camera_status_t NativeCameraLibrary::ACaptureRequest_setEntry_double(ACaptureRequest* request, uint32_t tag, uint32_t count, const double* data)
635 {
636  ocean_assert(isInitialized());
637  ocean_assert(ACaptureRequest_setEntry_double_ != nullptr);
638 
639  return ACaptureRequest_setEntry_double_(request, tag, count, data);
640 }
641 
642 inline camera_status_t NativeCameraLibrary::ACaptureRequest_setEntry_rational(ACaptureRequest* request, uint32_t tag, uint32_t count, const ACameraMetadata_rational* data)
643 {
644  ocean_assert(isInitialized());
645  ocean_assert(ACaptureRequest_setEntry_rational_ != nullptr);
646 
647  return ACaptureRequest_setEntry_rational_(request, tag, count, data);
648 }
649 
650 inline void NativeCameraLibrary::ACaptureRequest_free(ACaptureRequest* request)
651 {
652  ocean_assert(isInitialized());
653  ocean_assert(ACaptureRequest_free_ != nullptr);
654 
655  ACaptureRequest_free_(request);
656 }
657 
658 inline void NativeCameraLibrary::ACameraCaptureSession_close(ACameraCaptureSession* session)
659 {
660  ocean_assert(isInitialized());
661  ocean_assert(ACameraCaptureSession_close_ != nullptr);
662 
663  ACameraCaptureSession_close_(session);
664 }
665 
666 inline camera_status_t NativeCameraLibrary::ACameraCaptureSession_getDevice(ACameraCaptureSession* session, ACameraDevice** device)
667 {
668  ocean_assert(isInitialized());
669  ocean_assert(ACameraCaptureSession_getDevice_ != nullptr);
670 
671  return ACameraCaptureSession_getDevice_(session, device);
672 }
673 
674 inline camera_status_t NativeCameraLibrary::ACameraCaptureSession_capture(ACameraCaptureSession* session, ACameraCaptureSession_captureCallbacks* callbacks, int numRequests, ACaptureRequest** requests, int* captureSequenceId)
675 {
676  ocean_assert(isInitialized());
677  ocean_assert(ACameraCaptureSession_capture_ != nullptr);
678 
679  return ACameraCaptureSession_capture_(session, callbacks, numRequests, requests, captureSequenceId);
680 }
681 
682 inline camera_status_t NativeCameraLibrary::ACameraCaptureSession_setRepeatingRequest(ACameraCaptureSession* session, ACameraCaptureSession_captureCallbacks* callbacks, int numRequests, ACaptureRequest** requests, int* captureSequenceId)
683 {
684  ocean_assert(isInitialized());
685  ocean_assert(ACameraCaptureSession_setRepeatingRequest_ != nullptr);
686 
687  return ACameraCaptureSession_setRepeatingRequest_(session, callbacks, numRequests, requests, captureSequenceId);
688 }
689 
690 inline camera_status_t NativeCameraLibrary::ACameraCaptureSession_stopRepeating(ACameraCaptureSession* session)
691 {
692  ocean_assert(isInitialized());
693  ocean_assert(ACameraCaptureSession_stopRepeating_ != nullptr);
694 
695  return ACameraCaptureSession_stopRepeating_(session);
696 }
697 
698 inline camera_status_t NativeCameraLibrary::ACameraCaptureSession_abortCaptures(ACameraCaptureSession* session)
699 {
700  ocean_assert(isInitialized());
701  ocean_assert(ACameraCaptureSession_abortCaptures_ != nullptr);
702 
703  return ACameraCaptureSession_abortCaptures_(session);
704 }
705 
706 }
707 
708 }
709 
710 }
711 
712 #endif // defined(__ANDROID_API__) && __ANDROID_API__ >= 24
713 
714 #endif // META_OCEAN_MEDIA_ANDROID_NATIVE_CAMERA_LIBRARY_H
This class implements a recursive lock object.
Definition: Lock.h:31
Definition of a scoped object for ACameraIdList objects.
Definition: NativeCameraLibrary.h:76
ScopedACameraIdList()=default
Default constructor creating an invalid object.
ScopedACameraIdList(ACameraManager *cameraManager)
Creates a new scoped object and takes over the ownership of the created camera id list.
Definition of a scoped object for ACameraManager objects.
Definition: NativeCameraLibrary.h:57
ScopedACameraManager()=default
Default constructor creating an invalid object.
Definition of a scoped object for ACaptureSessionOutputContainer objects.
Definition: NativeCameraLibrary.h:95
ScopedACaptureSessionOutputContainer()=default
Default constructor creating an invalid object.
Definition of a scoped object for ACaptureSessionOutput objects.
Definition: NativeCameraLibrary.h:114
ScopedACaptureSessionOutput(ANativeWindow *nativeWindow)
Creates a new scoped object and takes over the ownership of the created capture session output.
ScopedACaptureSessionOutput()=default
Default constructor creating an invalid object.
This class is an interface for Android's shared native library camera2ndk.
Definition: NativeCameraLibrary.h:43
void(ACameraCaptureSession *session) Function_ACameraCaptureSession_close
Definition of individual function pointers for ACameraCaptureSession.
Definition: NativeCameraLibrary.h:185
camera_status_t(ACameraManager *manager, ACameraIdList **cameraIdList) Function_ACameraManager_getCameraIdList
Definition: NativeCameraLibrary.h:150
camera_status_t ACaptureRequest_setEntry_i64(ACaptureRequest *request, uint32_t tag, uint32_t count, const int64_t *data)
Definition: NativeCameraLibrary.h:626
NativeCameraLibrary()
Protected default constructor.
camera_status_t ACameraMetadata_getAllTags(const ACameraMetadata *metadata, int32_t *numEntries, const uint32_t **tags)
Definition: NativeCameraLibrary.h:530
camera_status_t ACaptureRequest_setEntry_double(ACaptureRequest *request, uint32_t tag, uint32_t count, const double *data)
Definition: NativeCameraLibrary.h:634
camera_status_t ACaptureRequest_addTarget(ACaptureRequest *request, const ACameraOutputTarget *output)
Definition: NativeCameraLibrary.h:570
camera_status_t(ACameraManager *manager, const char *cameraId, ACameraMetadata **characteristics) Function_ACameraManager_getCameraCharacteristics
Definition: NativeCameraLibrary.h:154
camera_status_t ACameraMetadata_getConstEntry(const ACameraMetadata *metadata, uint32_t tag, ACameraMetadata_const_entry *entry)
The individual functions of ACameraMetadata.
Definition: NativeCameraLibrary.h:522
camera_status_t(ACameraDevice *device, const ACaptureSessionOutputContainer *outputs, const ACameraCaptureSession_stateCallbacks *callbacks, ACameraCaptureSession **session) Function_ACameraDevice_createCaptureSession
Definition: NativeCameraLibrary.h:143
ScopedSubscription initialize()
Initializes the camera library.
camera_status_t(ACaptureSessionOutputContainer *container, const ACaptureSessionOutput *output) Function_ACaptureSessionOutputContainer_remove
Definition: NativeCameraLibrary.h:142
void(ACaptureRequest *request) Function_ACaptureRequest_free
Definition: NativeCameraLibrary.h:180
void ACameraCaptureSession_close(ACameraCaptureSession *session)
The individual functions of ACameraCaptureSession.
Definition: NativeCameraLibrary.h:658
camera_status_t ACaptureRequest_setEntry_u8(ACaptureRequest *request, uint32_t tag, uint32_t count, const uint8_t *data)
Definition: NativeCameraLibrary.h:602
camera_status_t(ACaptureRequest *request, uint32_t tag, uint32_t count, const float *data) Function_ACaptureRequest_setEntry_float
Definition: NativeCameraLibrary.h:176
camera_status_t ACameraCaptureSession_getDevice(ACameraCaptureSession *session, ACameraDevice **device)
Definition: NativeCameraLibrary.h:666
void ACaptureSessionOutputContainer_free(ACaptureSessionOutputContainer *container)
Definition: NativeCameraLibrary.h:410
camera_status_t(const ACaptureRequest *request, int32_t *numTags, const uint32_t **tags) Function_ACaptureRequest_getAllTags
Definition: NativeCameraLibrary.h:173
void ACameraManager_delete(ACameraManager *manager)
Definition: NativeCameraLibrary.h:466
camera_status_t(ACaptureRequest *request, const ACameraOutputTarget *output) Function_ACaptureRequest_addTarget
Definition: NativeCameraLibrary.h:170
const char *(const ACameraDevice *device) Function_ACameraDevice_getId
Definition: NativeCameraLibrary.h:135
camera_status_t(ACameraManager *manager, const ACameraManager_AvailabilityCallbacks *callback) Function_ACameraManager_registerAvailabilityCallback
Definition: NativeCameraLibrary.h:152
camera_status_t(ACaptureRequest *request, uint32_t tag, uint32_t count, const double *data) Function_ACaptureRequest_setEntry_double
Definition: NativeCameraLibrary.h:178
camera_status_t ACameraOutputTarget_create(ANativeWindow *window, ACameraOutputTarget **output)
The individual functions for capture requests.
Definition: NativeCameraLibrary.h:554
camera_status_t(ACameraManager *manager, const char *cameraId, ACameraDevice_StateCallbacks *callback, ACameraDevice **device) Function_ACameraManager_openCamera
Definition: NativeCameraLibrary.h:155
camera_status_t(ACameraCaptureSession *session, ACameraDevice **device) Function_ACameraCaptureSession_getDevice
Definition: NativeCameraLibrary.h:186
camera_status_t(ACameraCaptureSession *session, ACameraCaptureSession_captureCallbacks *callbacks, int numRequests, ACaptureRequest **requests, int *captureSequenceId) Function_ACameraCaptureSession_capture
Definition: NativeCameraLibrary.h:187
camera_status_t ACameraCaptureSession_setRepeatingRequest(ACameraCaptureSession *session, ACameraCaptureSession_captureCallbacks *callbacks, int numRequests, ACaptureRequest **requests, int *captureSequenceId)
Definition: NativeCameraLibrary.h:682
camera_status_t ACaptureRequest_setEntry_rational(ACaptureRequest *request, uint32_t tag, uint32_t count, const ACameraMetadata_rational *data)
Definition: NativeCameraLibrary.h:642
camera_status_t(ANativeWindow *anw, ACaptureSessionOutput **output) Function_ACaptureSessionOutput_create
Definition: NativeCameraLibrary.h:139
camera_status_t ACaptureSessionOutputContainer_create(ACaptureSessionOutputContainer **container)
Definition: NativeCameraLibrary.h:402
camera_status_t(const ACaptureRequest *request, uint32_t tag, ACameraMetadata_const_entry *entry) Function_ACaptureRequest_getConstEntry
Definition: NativeCameraLibrary.h:172
camera_status_t(ANativeWindow *window, ACameraOutputTarget **output) Function_ACameraOutputTarget_create
Definition of the individual function pointers for capture requests.
Definition: NativeCameraLibrary.h:168
camera_status_t ACameraCaptureSession_abortCaptures(ACameraCaptureSession *session)
Definition: NativeCameraLibrary.h:698
camera_status_t ACaptureRequest_removeTarget(ACaptureRequest *request, const ACameraOutputTarget *output)
Definition: NativeCameraLibrary.h:578
void(ACameraMetadata *metadata) Function_ACameraMetadata_free
Definition: NativeCameraLibrary.h:163
Lock lock_
The library's lock.
Definition: NativeCameraLibrary.h:351
camera_status_t(ACaptureRequest *request, const ACameraOutputTarget *output) Function_ACaptureRequest_removeTarget
Definition: NativeCameraLibrary.h:171
camera_status_t ACaptureSessionOutput_create(ANativeWindow *anw, ACaptureSessionOutput **output)
Definition: NativeCameraLibrary.h:418
void ACaptureSessionOutput_free(ACaptureSessionOutput *output)
Definition: NativeCameraLibrary.h:426
camera_status_t ACameraManager_openCamera(ACameraManager *manager, const char *cameraId, ACameraDevice_StateCallbacks *callback, ACameraDevice **device)
Definition: NativeCameraLibrary.h:514
unsigned int initializationCounter_
The counter for counting the usage of this library.
Definition: NativeCameraLibrary.h:348
camera_status_t ACaptureRequest_getAllTags(const ACaptureRequest *request, int32_t *numTags, const uint32_t **tags)
Definition: NativeCameraLibrary.h:594
void(ACameraIdList *cameraIdList) Function_ACameraManager_deleteCameraIdList
Definition: NativeCameraLibrary.h:151
void ACameraOutputTarget_free(ACameraOutputTarget *output)
Definition: NativeCameraLibrary.h:562
ACameraMetadata *(const ACameraMetadata *src) Function_ACameraMetadata_copy
Definition: NativeCameraLibrary.h:162
bool isInitialized() const
Returns whether the library is initialized.
Definition: NativeCameraLibrary.h:371
void(ACaptureSessionOutput *output) Function_ACaptureSessionOutput_free
Definition: NativeCameraLibrary.h:140
camera_status_t ACameraManager_registerAvailabilityCallback(ACameraManager *manager, const ACameraManager_AvailabilityCallbacks *callback)
Definition: NativeCameraLibrary.h:490
camera_status_t(const ACameraMetadata *metadata, int32_t *numEntries, const uint32_t **tags) Function_ACameraMetadata_getAllTags
Definition: NativeCameraLibrary.h:161
camera_status_t(ACaptureRequest *request, uint32_t tag, uint32_t count, const uint8_t *data) Function_ACaptureRequest_setEntry_u8
Definition: NativeCameraLibrary.h:174
camera_status_t(ACameraCaptureSession *session) Function_ACameraCaptureSession_abortCaptures
Definition: NativeCameraLibrary.h:190
camera_status_t ACameraCaptureSession_stopRepeating(ACameraCaptureSession *session)
Definition: NativeCameraLibrary.h:690
void ACameraMetadata_free(ACameraMetadata *metadata)
Definition: NativeCameraLibrary.h:546
camera_status_t ACameraManager_unregisterAvailabilityCallback(ACameraManager *manager, const ACameraManager_AvailabilityCallbacks *callback)
Definition: NativeCameraLibrary.h:498
__attribute__((annotate("dynamic_fn_ptr"))) Function_ACameraDevice_close *ACameraDevice_close_
All ACameraDevice function pointers.
camera_status_t(ACaptureSessionOutputContainer *container, const ACaptureSessionOutput *output) Function_ACaptureSessionOutputContainer_add
Definition: NativeCameraLibrary.h:141
void(ACameraOutputTarget *output) Function_ACameraOutputTarget_free
Definition: NativeCameraLibrary.h:169
camera_status_t ACameraCaptureSession_capture(ACameraCaptureSession *session, ACameraCaptureSession_captureCallbacks *callbacks, int numRequests, ACaptureRequest **requests, int *captureSequenceId)
Definition: NativeCameraLibrary.h:674
camera_status_t(ACameraCaptureSession *session, ACameraCaptureSession_captureCallbacks *callbacks, int numRequests, ACaptureRequest **requests, int *captureSequenceId) Function_ACameraCaptureSession_setRepeatingRequest
Definition: NativeCameraLibrary.h:188
ACameraMetadata * ACameraMetadata_copy(const ACameraMetadata *src)
Definition: NativeCameraLibrary.h:538
camera_status_t ACameraDevice_createCaptureRequest(const ACameraDevice *device, ACameraDevice_request_template templateId, ACaptureRequest **request)
Definition: NativeCameraLibrary.h:394
void(ACaptureSessionOutputContainer *container) Function_ACaptureSessionOutputContainer_free
Definition: NativeCameraLibrary.h:138
void uninitialize(const unsigned int unused)
Uninitializes the library.
camera_status_t(ACameraManager *manager, const ACameraManager_AvailabilityCallbacks *callback) Function_ACameraManager_unregisterAvailabilityCallback
Definition: NativeCameraLibrary.h:153
camera_status_t ACameraManager_getCameraIdList(ACameraManager *manager, ACameraIdList **cameraIdList)
Definition: NativeCameraLibrary.h:474
camera_status_t(ACaptureSessionOutputContainer **container) Function_ACaptureSessionOutputContainer_create
Definition: NativeCameraLibrary.h:137
camera_status_t ACaptureRequest_setEntry_float(ACaptureRequest *request, uint32_t tag, uint32_t count, const float *data)
Definition: NativeCameraLibrary.h:618
camera_status_t(const ACameraDevice *device, ACameraDevice_request_template templateId, ACaptureRequest **request) Function_ACameraDevice_createCaptureRequest
Definition: NativeCameraLibrary.h:136
const char * ACameraDevice_getId(const ACameraDevice *device)
Definition: NativeCameraLibrary.h:386
camera_status_t ACaptureRequest_setEntry_i32(ACaptureRequest *request, uint32_t tag, uint32_t count, const int32_t *data)
Definition: NativeCameraLibrary.h:610
~NativeCameraLibrary()
Destructs the library.
Definition: NativeCameraLibrary.h:366
camera_status_t ACameraDevice_createCaptureSession(ACameraDevice *device, const ACaptureSessionOutputContainer *outputs, const ACameraCaptureSession_stateCallbacks *callbacks, ACameraCaptureSession **session)
Definition: NativeCameraLibrary.h:450
camera_status_t ACaptureSessionOutputContainer_remove(ACaptureSessionOutputContainer *container, const ACaptureSessionOutput *output)
Definition: NativeCameraLibrary.h:442
camera_status_t(ACaptureRequest *request, uint32_t tag, uint32_t count, const ACameraMetadata_rational *data) Function_ACaptureRequest_setEntry_rational
Definition: NativeCameraLibrary.h:179
void ACaptureRequest_free(ACaptureRequest *request)
Definition: NativeCameraLibrary.h:650
camera_status_t(ACameraCaptureSession *session) Function_ACameraCaptureSession_stopRepeating
Definition: NativeCameraLibrary.h:189
void(ACameraManager *) Function_ACameraManager_delete
Definition: NativeCameraLibrary.h:149
camera_status_t(ACameraDevice *device) Function_ACameraDevice_close
Definition of the individual function pointers of ACameraDevice.
Definition: NativeCameraLibrary.h:134
void release()
Releases the library.
camera_status_t ACameraManager_getCameraCharacteristics(ACameraManager *manager, const char *cameraId, ACameraMetadata **characteristics)
Definition: NativeCameraLibrary.h:506
camera_status_t(const ACameraMetadata *metadata, uint32_t tag, ACameraMetadata_const_entry *entry) Function_ACameraMetadata_getConstEntry
Definition of the individual function pointers of ACameraMetadata.
Definition: NativeCameraLibrary.h:160
camera_status_t ACameraDevice_close(ACameraDevice *device)
The individual functions of ACameraDevice.
Definition: NativeCameraLibrary.h:378
camera_status_t(ACaptureRequest *request, uint32_t tag, uint32_t count, const int64_t *data) Function_ACaptureRequest_setEntry_i64
Definition: NativeCameraLibrary.h:177
ACameraManager *() Function_ACameraManager_create
Definition of the individual function pointers of ACameraManager.
Definition: NativeCameraLibrary.h:148
void ACameraManager_deleteCameraIdList(ACameraIdList *cameraIdList)
Definition: NativeCameraLibrary.h:482
camera_status_t(ACaptureRequest *request, uint32_t tag, uint32_t count, const int32_t *data) Function_ACaptureRequest_setEntry_i32
Definition: NativeCameraLibrary.h:175
ACameraManager * ACameraManager_create()
The individual functions of ACameraManager.
Definition: NativeCameraLibrary.h:458
camera_status_t ACaptureSessionOutputContainer_add(ACaptureSessionOutputContainer *container, const ACaptureSessionOutput *output)
Definition: NativeCameraLibrary.h:434
camera_status_t ACaptureRequest_getConstEntry(const ACaptureRequest *request, uint32_t tag, ACameraMetadata_const_entry *entry)
Definition: NativeCameraLibrary.h:586
This class implements a scoped lock object for recursive lock objects.
Definition: Lock.h:135
This class wraps an unmanaged object (or reference) which needs to be released after usage.
Definition: ScopedObject.h:28
This template class is the base class for all singleton objects.
Definition: Singleton.h:71
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15