|
1 | 1 | #pragma once |
2 | 2 |
|
| 3 | +#include <string> |
| 4 | + |
3 | 5 | // Module |
4 | | -#define DEFAULT_SOCKET_PATH "/tmp/viam.csi.sock" |
5 | | -#define RESOURCE_TYPE "CSICamera" |
6 | | -#define API_NAMESPACE "viam" |
7 | | -#define API_TYPE "camera" |
8 | | -#define DEFAULT_API_SUBTYPE "csi" |
| 6 | +constexpr const char* DEFAULT_SOCKET_PATH = "/tmp/viam.csi.sock"; |
| 7 | +constexpr const char* RESOURCE_TYPE = "CSICamera"; |
| 8 | +constexpr const char* API_NAMESPACE = "viam"; |
| 9 | +constexpr const char* API_TYPE = "camera"; |
| 10 | +constexpr const char* DEFAULT_API_SUBTYPE = "csi"; |
9 | 11 |
|
10 | 12 | // GST |
11 | | -#define GST_GET_STATE_TIMEOUT 1 |
12 | | -#define GST_CHANGE_STATE_TIMEOUT 5 |
| 13 | +constexpr int GST_GET_STATE_TIMEOUT = 1; |
| 14 | +constexpr int GST_CHANGE_STATE_TIMEOUT = 5; |
13 | 15 |
|
14 | 16 | // Pipeline |
15 | | -#define DEFAULT_INPUT_SOURCE "libcamerasrc" |
16 | | -#define DEFAULT_INPUT_SENSOR "0" |
17 | | -#define DEFAULT_INPUT_FORMAT "video/x-raw" |
18 | | -#define DEFAULT_INPUT_WIDTH 1920 |
19 | | -#define DEFAULT_INPUT_HEIGHT 1080 |
20 | | -#define DEFAULT_INPUT_FRAMERATE 30 |
21 | | -#define DEFAULT_VIDEO_CONVERTER "videoconvert" |
22 | | -#define DEFAULT_OUTPUT_ENCODER "nvjpegenc" |
23 | | -#define DEFAULT_OUTPUT_MIMETYPE "image/jpeg" |
| 17 | +constexpr const char* DEFAULT_INPUT_SOURCE = "libcamerasrc"; |
| 18 | +constexpr const char* DEFAULT_INPUT_SENSOR = "0"; |
| 19 | +constexpr const char* DEFAULT_INPUT_FORMAT = "video/x-raw"; |
| 20 | +constexpr int DEFAULT_INPUT_WIDTH = 1920; |
| 21 | +constexpr int DEFAULT_INPUT_HEIGHT = 1080; |
| 22 | +constexpr int DEFAULT_INPUT_FRAMERATE = 30; |
| 23 | +constexpr const char* DEFAULT_VIDEO_CONVERTER = "videoconvert"; |
| 24 | +constexpr const char* DEFAULT_OUTPUT_ENCODER = "nvjpegenc"; |
| 25 | +constexpr const char* DEFAULT_OUTPUT_MIMETYPE = "image/jpeg"; |
24 | 26 |
|
25 | 27 | // Jetson |
26 | | -#define JETSON_API_SUBTYPE "csi" |
27 | | -#define JETSON_INPUT_SOURCE "nvarguscamerasrc" |
28 | | -#define JETSON_INPUT_FORMAT "video/x-raw(memory:NVMM)" |
29 | | -#define JETSON_VIDEO_CONVERTER "nvvidconv" |
30 | | -#define JETSON_OUTPUT_ENCODER "nvjpegenc" |
| 28 | +constexpr const char* JETSON_API_SUBTYPE = "csi"; |
| 29 | +constexpr const char* JETSON_INPUT_SOURCE = "nvarguscamerasrc"; |
| 30 | +constexpr const char* JETSON_INPUT_FORMAT = "video/x-raw(memory:NVMM)"; |
| 31 | +constexpr const char* JETSON_VIDEO_CONVERTER = "nvvidconv"; |
| 32 | +constexpr const char* JETSON_OUTPUT_ENCODER = "nvjpegenc"; |
31 | 33 |
|
32 | 34 | // Pi |
33 | | -#define PI_API_SUBTYPE "csi-pi" |
34 | | -#define PI_INPUT_SOURCE "libcamerasrc" |
35 | | -#define PI_INPUT_FORMAT "video/x-raw,format=NV12" |
36 | | -#define PI_VIDEO_CONVERTER "videoconvert" |
37 | | -#define PI_OUTPUT_ENCODER "jpegenc" |
| 35 | +constexpr const char* PI_API_SUBTYPE = "csi-pi"; |
| 36 | +constexpr const char* PI_INPUT_SOURCE = "libcamerasrc"; |
| 37 | +constexpr const char* PI_INPUT_FORMAT = "video/x-raw,format=NV12"; |
| 38 | +constexpr const char* PI_VIDEO_CONVERTER = "videoconvert"; |
| 39 | +constexpr const char* PI_OUTPUT_ENCODER = "jpegenc"; |
38 | 40 |
|
39 | 41 | // Integration Tests |
40 | 42 | inline const std::string TEST_GST_PIPELINE = |
|
0 commit comments