SLProject  4.3.020
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SENSAndroidCameraUtils.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 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 #ifndef SENS_CAMERA_UTILS_H
17 #define SENS_CAMERA_UTILS_H
18 
19 #include <camera/NdkCameraManager.h>
20 #include <camera/NdkCameraError.h>
21 
22 /*
23  * A set of macros to call into Camera APIs. The API is grouped with a few
24  * objects, with object name as the prefix of function names.
25  */
26 /*
27 #define CALL_CAMERA(func) \
28  { \
29  camera_status_t status = func; \
30  ASSERT(status == ACAMERA_OK, "%s call failed with code: %#x, %s", \
31  __FUNCTION__, status, GetErrorStr(status)); \
32  }
33 #define CALL_MGR(func) CALL_CAMERA(ACameraManager_##func)
34 #define CALL_DEV(func) CALL_CAMERA(ACameraDevice_##func)
35 #define CALL_METADATA(func) CALL_CAMERA(ACameraMetadata_##func)
36 #define CALL_CONTAINER(func) CALL_CAMERA(ACaptureSessionOutputContainer_##func)
37 #define CALL_OUTPUT(func) CALL_CAMERA(ACaptureSessionOutput_##func)
38 #define CALL_TARGET(func) CALL_CAMERA(ACameraOutputTarget_##func)
39 #define CALL_REQUEST(func) CALL_CAMERA(ACaptureRequest_##func)
40 #define CALL_SESSION(func) CALL_CAMERA(ACameraCaptureSession_##func)
41 */
42 /*
43  * A few debugging functions for error code strings etc
44  */
45 const char* GetErrorStr(camera_status_t err);
46 const char* GetTagStr(acamera_metadata_tag_t tag);
47 const char* GetFormatStr(int fmt);
48 void PrintMetadataTags(int32_t entries, const uint32_t* pTags);
49 void PrintLensFacing(ACameraMetadata_const_entry& lensData);
50 void PrintCameras(ACameraManager* cameraMgr);
51 void PrintCameraDeviceError(int err);
52 
53 void PrintRequestMetadata(ACaptureRequest* req);
54 #endif // SENS_CAMERA_UTILS_H
void PrintCameraDeviceError(int err)
void PrintLensFacing(ACameraMetadata_const_entry &lensData)
void PrintMetadataTags(int32_t entries, const uint32_t *pTags)
const char * GetErrorStr(camera_status_t err)
const char * GetTagStr(acamera_metadata_tag_t tag)
const char * GetFormatStr(int fmt)
void PrintCameras(ACameraManager *cameraMgr)
void PrintRequestMetadata(ACaptureRequest *req)