lin
2025-08-14 dae8bad597b6607a449b32bf76c523423f7720ed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
 * test_common.h - test common
 *
 *  Copyright (c) 2015 Intel Corporation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Author: Wind Yuan <feng.yuan@intel.com>
 * Author: John Ye <john.ye@intel.com>
 */
 
#ifndef XCAM_TEST_COMMON_H
#define XCAM_TEST_COMMON_H
 
#include <unistd.h>
#include <getopt.h>
 
#define TEST_CAMERA_POSITION_OFFSET_X 2000
 
#undef CHECK_DECLARE
#undef CHECK
#undef CHECK_CONTINUE
 
#define CHECK_DECLARE(level, exp, statement, msg, ...) \
    if (!(exp)) {        \
        XCAM_LOG_##level (msg, ## __VA_ARGS__);   \
        statement;                              \
    }
 
#define CHECK(ret, msg, ...)  \
    CHECK_DECLARE(ERROR, (ret) == XCAM_RETURN_NO_ERROR, return -1, msg, ## __VA_ARGS__)
 
#define CHECK_STATEMENT(ret, statement, msg, ...)  \
    CHECK_DECLARE(ERROR, (ret) == XCAM_RETURN_NO_ERROR, statement, msg, ## __VA_ARGS__)
 
#define CHECK_CONTINUE(ret, msg, ...)  \
    CHECK_DECLARE(WARNING, (ret) == XCAM_RETURN_NO_ERROR, , msg, ## __VA_ARGS__)
 
#define CHECK_EXP(exp, msg, ...) \
    CHECK_DECLARE(ERROR, exp, return -1, msg, ## __VA_ARGS__)
 
#define CAPTURE_DEVICE_VIDEO "/dev/video3"
#define CAPTURE_DEVICE_STILL "/dev/video0"
#define DEFAULT_CAPTURE_DEVICE CAPTURE_DEVICE_VIDEO
 
#define DEFAULT_EVENT_DEVICE   "/dev/v4l-subdev6"
#define DEFAULT_CPF_FILE       "/etc/atomisp/imx185.cpf"
#define DEFAULT_SAVE_FILE_NAME "capture_buffer"
#define DEFAULT_DYNAMIC_3A_LIB "/usr/lib/xcam/plugins/3a/libxcam_3a_aiq.so"
#define DEFAULT_HYBRID_3A_LIB "/usr/lib/xcam/plugins/3a/libxcam_3a_hybrid.so"
#define DEFAULT_SMART_ANALYSIS_LIB_DIR "/usr/lib/xcam/plugins/smart"
 
 
#define FPS_CALCULATION(objname, count) XCAM_STATIC_FPS_CALCULATION(objname, count)
 
#define PROFILING_START(name)  XCAM_STATIC_PROFILING_START(name)
#define PROFILING_END(name, times_of_print) XCAM_STATIC_PROFILING_END(name, times_of_print)
 
#endif  // XCAM_TEST_COMMON_H