From 95acf6dbb8a48c3f6da091d745d809036073b5b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20B=C3=A9rub=C3=A9?= Date: Wed, 5 Jun 2024 20:34:27 -0400 Subject: [PATCH] Removing code not meant to be run on target arch at compile-time to save space --- src/error.c | 2 + src/hal/hisi/v3_hal.c | 2 + src/hal/hisi/v4_hal.c | 2 + src/hal/hisi/v4_quirks.c | 6 ++- src/hal/inge/t31_hal.c | 2 + src/hal/sstar/i6_hal.c | 4 +- src/hal/sstar/i6c_hal.c | 4 +- src/hal/sstar/i6f_hal.c | 4 +- src/hal/support.c | 11 ++++- src/hal/support.h | 13 ++++-- src/jpeg.c | 30 ++++++++++---- src/main.c | 7 +++- src/region.c | 20 +++++++--- src/video.c | 86 +++++++++++++++++++++++++++++++--------- 14 files changed, 152 insertions(+), 41 deletions(-) diff --git a/src/error.c b/src/error.c index f94c84f..be68459 100644 --- a/src/error.c +++ b/src/error.c @@ -7,6 +7,7 @@ char *errstr(int error) { int module = (error >> 16) & 0xFF; switch (plat) { +#ifdef __arm__ case HAL_PLATFORM_I6: level = (error >> 12) & 0xF; error = error & 0xFF000FFF | (level > 0 ? (4 << 13) : 0); @@ -97,6 +98,7 @@ char *errstr(int error) { error |= (module << 16); break; } break; +#endif } switch (error) { diff --git a/src/hal/hisi/v3_hal.c b/src/hal/hisi/v3_hal.c index 5a05bd1..52cffd1 100644 --- a/src/hal/hisi/v3_hal.c +++ b/src/hal/hisi/v3_hal.c @@ -1,3 +1,4 @@ +#ifdef __arm__ #include "v3_hal.h" v3_isp_alg v3_ae_lib = { .id = 0, .libName = "ae_lib" }; @@ -840,3 +841,4 @@ int v3_system_init(char *snrConfig) return EXIT_SUCCESS; } +#endif \ No newline at end of file diff --git a/src/hal/hisi/v4_hal.c b/src/hal/hisi/v4_hal.c index 5cbf045..244791e 100644 --- a/src/hal/hisi/v4_hal.c +++ b/src/hal/hisi/v4_hal.c @@ -1,3 +1,4 @@ +#ifdef __arm__ #include "v4_hal.h" v4_isp_alg v4_ae_lib = { .id = 0, .libName = "ae_lib" }; @@ -895,3 +896,4 @@ int v4_system_init(char *snrConfig) return EXIT_SUCCESS; } +#endif \ No newline at end of file diff --git a/src/hal/hisi/v4_quirks.c b/src/hal/hisi/v4_quirks.c index 6c035d9..10ccdfa 100644 --- a/src/hal/hisi/v4_quirks.c +++ b/src/hal/hisi/v4_quirks.c @@ -1,3 +1,5 @@ +#ifdef __arm__ + int (*fnISP_AlgRegisterDehaze)(int); int (*fnISP_AlgRegisterDrc)(int); int (*fnISP_AlgRegisterLdci)(int); @@ -14,4 +16,6 @@ int ISP_AlgRegisterLdci(int pipeId) { } int MPI_ISP_IrAutoRunOnce(int pipeId, void *irAttr) { return fnMPI_ISP_IrAutoRunOnce(pipeId, irAttr); -} \ No newline at end of file +} + +#endif \ No newline at end of file diff --git a/src/hal/inge/t31_hal.c b/src/hal/inge/t31_hal.c index 0d2d165..0032667 100644 --- a/src/hal/inge/t31_hal.c +++ b/src/hal/inge/t31_hal.c @@ -1,3 +1,4 @@ +#ifdef __mips__ #include "t31_hal.h" t31_aud_impl t31_aud; @@ -638,3 +639,4 @@ int t31_system_init(void) return EXIT_SUCCESS; } +#endif \ No newline at end of file diff --git a/src/hal/sstar/i6_hal.c b/src/hal/sstar/i6_hal.c index 113800b..5c1811a 100644 --- a/src/hal/sstar/i6_hal.c +++ b/src/hal/sstar/i6_hal.c @@ -1,3 +1,4 @@ +#ifdef __arm__ #include "i6_hal.h" i6_aud_impl i6_aud; @@ -827,4 +828,5 @@ int i6_system_init(void) return ret; return EXIT_SUCCESS; -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/src/hal/sstar/i6c_hal.c b/src/hal/sstar/i6c_hal.c index f4c07ad..d077868 100644 --- a/src/hal/sstar/i6c_hal.c +++ b/src/hal/sstar/i6c_hal.c @@ -1,3 +1,4 @@ +#ifdef __arm__ #include "i6c_hal.h" i6c_aud_impl i6c_aud; @@ -945,4 +946,5 @@ int i6c_system_init(void) return ret; return EXIT_SUCCESS; -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/src/hal/sstar/i6f_hal.c b/src/hal/sstar/i6f_hal.c index e1c95de..55991e4 100644 --- a/src/hal/sstar/i6f_hal.c +++ b/src/hal/sstar/i6f_hal.c @@ -1,3 +1,4 @@ +#ifdef __arm__ #include "i6f_hal.h" i6f_aud_impl i6f_aud; @@ -904,4 +905,5 @@ int i6f_system_init(void) return ret; return EXIT_SUCCESS; -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/src/hal/support.c b/src/hal/support.c index 514057f..9c41c54 100644 --- a/src/hal/support.c +++ b/src/hal/support.c @@ -59,6 +59,7 @@ void hal_identify(void) { char *endMark; char line[200] = {0}; +#ifdef __arm__ if (!access("/proc/mi_modules", 0) && hal_registry(0x1F003C00, &val, OP_READ)) switch (val) { @@ -88,7 +89,10 @@ void hal_identify(void) { venc_thread = i6f_video_thread; return; } - else if (!access("/proc/jz", 0) && +#endif + +#ifdef __mips__ + if (!access("/proc/jz", 0) && hal_registry(0x1300002C, &val, OP_READ)) { unsigned int type; hal_registry(0x13540238, &type, OP_READ); @@ -114,6 +118,10 @@ void hal_identify(void) { } } + return; +#endif + +#ifdef __arm__ if (file = fopen("/proc/iomem", "r")) while (fgets(line, 200, file)) if (strstr(line, "uart")) { @@ -169,4 +177,5 @@ void hal_identify(void) { chnState = (hal_chnstate*)v4_state; isp_thread = v4_image_thread; venc_thread = v4_video_thread; +#endif } diff --git a/src/hal/support.h b/src/hal/support.h index 9fe3d2f..e4696d6 100644 --- a/src/hal/support.h +++ b/src/hal/support.h @@ -1,10 +1,13 @@ #include "types.h" +#if defined(__arm__) #include "hisi/v3_hal.h" #include "hisi/v4_hal.h" -#include "inge/t31_hal.h" #include "sstar/i6_hal.h" #include "sstar/i6c_hal.h" #include "sstar/i6f_hal.h" +#elif defined(__mips__) +#include "inge/t31_hal.h" +#endif #include #include @@ -19,15 +22,13 @@ extern hal_chnstate *chnState; extern hal_platform plat; extern char series[16]; +#if defined(__arm__) extern void *v3_video_thread(void); extern hal_chnstate v3_state[V4_VENC_CHN_NUM]; extern void *v4_video_thread(void); extern hal_chnstate v4_state[V4_VENC_CHN_NUM]; -extern void *t31_video_thread(void); -extern hal_chnstate t31_state[T31_VENC_CHN_NUM]; - extern void *i6_video_thread(void); extern hal_chnstate i6_state[I6_VENC_CHN_NUM]; @@ -36,6 +37,10 @@ extern hal_chnstate i6c_state[I6C_VENC_CHN_NUM]; extern void *i6f_video_thread(void); extern hal_chnstate i6f_state[I6F_VENC_CHN_NUM]; +#elif defined(__mips__) +extern void *t31_video_thread(void); +extern hal_chnstate t31_state[T31_VENC_CHN_NUM]; +#endif bool hal_registry(unsigned int addr, unsigned int *data, hal_register_op op); void hal_identify(void); diff --git a/src/jpeg.c b/src/jpeg.c index 6be5b3f..8db66e6 100644 --- a/src/jpeg.c +++ b/src/jpeg.c @@ -26,7 +26,13 @@ int jpeg_init() { pthread_mutex_lock(&jpeg_mutex); - if (app_config.mjpeg_enable) goto mjpeg_active; + switch (plat) { +#ifdef __mips__ + case HAL_PLATFORM_T31: + if (app_config.mjpeg_enable) goto mjpeg_active; + break; +#endif + } jpeg_index = take_next_free_channel(false); @@ -47,12 +53,15 @@ int jpeg_init() { config.minQual = config.maxQual = app_config.jpeg_qfactor; switch (plat) { +#if defined(__arm__) case HAL_PLATFORM_I6: ret = i6_video_create(jpeg_index, &config); break; case HAL_PLATFORM_I6C: ret = i6c_video_create(jpeg_index, &config); break; case HAL_PLATFORM_I6F: ret = i6f_video_create(jpeg_index, &config); break; - case HAL_PLATFORM_T31: ret = t31_video_create(jpeg_index, &config); break; case HAL_PLATFORM_V3: ret = v3_video_create(jpeg_index, &config); break; case HAL_PLATFORM_V4: ret = v4_video_create(jpeg_index, &config); break; +#elif defined(__mips__) + case HAL_PLATFORM_T31: ret = t31_video_create(jpeg_index, &config); break; +#endif default: pthread_mutex_unlock(&jpeg_mutex); return EXIT_FAILURE; @@ -78,15 +87,19 @@ int jpeg_init() { void jpeg_deinit() { pthread_mutex_lock(&jpeg_mutex); - if (app_config.mjpeg_enable) goto mjpeg_active; - switch (plat) { +#if defined(__arm__) case HAL_PLATFORM_I6: i6_video_destroy(jpeg_index); break; case HAL_PLATFORM_I6C: i6c_video_destroy(jpeg_index, 1); break; case HAL_PLATFORM_I6F: i6f_video_destroy(jpeg_index, 1); break; - case HAL_PLATFORM_T31: t31_video_destroy(jpeg_index); break; case HAL_PLATFORM_V3: v3_video_destroy(jpeg_index); break; case HAL_PLATFORM_V4: v4_video_destroy(jpeg_index); break; +#elif defined(__mips__) + case HAL_PLATFORM_T31: + if (app_config.mjpeg_enable) goto mjpeg_active; + t31_video_destroy(jpeg_index); + break; +#endif default: pthread_mutex_unlock(&jpeg_mutex); return; @@ -109,16 +122,19 @@ int jpeg_get(short width, short height, char quality, char grayscale, int ret; switch (plat) { +#if defined(__arm__) case HAL_PLATFORM_I6: ret = i6_video_snapshot_grab(jpeg_index, quality, grayscale, jpeg); break; case HAL_PLATFORM_I6C: ret = i6c_video_snapshot_grab(jpeg_index, quality, grayscale, jpeg); break; case HAL_PLATFORM_I6F: ret = i6f_video_snapshot_grab(jpeg_index, quality, grayscale, jpeg); break; - case HAL_PLATFORM_T31: ret = t31_video_snapshot_grab(app_config.mjpeg_enable ? - -1 : jpeg_index, jpeg); break; case HAL_PLATFORM_V3: ret = v3_video_snapshot_grab(jpeg_index, jpeg); break; case HAL_PLATFORM_V4: ret = v4_video_snapshot_grab(jpeg_index, jpeg); break; +#elif defined(__mips__) + case HAL_PLATFORM_T31: ret = t31_video_snapshot_grab(app_config.mjpeg_enable ? + -1 : jpeg_index, jpeg); break; +#endif } if (ret) { if (jpeg->data) diff --git a/src/main.c b/src/main.c index 98ee499..ad49649 100644 --- a/src/main.c +++ b/src/main.c @@ -19,18 +19,21 @@ rtsp_handle rtspHandle; int main(int argc, char *argv[]) { hal_identify(); switch (plat) { +#if defined(__arm__) case HAL_PLATFORM_I6: fprintf(stderr, "Divinus for infinity6(b0/e)\n"); break; case HAL_PLATFORM_I6C: fprintf(stderr, "Divinus for infinity6c\n"); break; case HAL_PLATFORM_I6F: fprintf(stderr, "Divinus for infinity6f\n"); break; - case HAL_PLATFORM_T31: - fprintf(stderr, "Divinus for ingenic t31\n"); break; case HAL_PLATFORM_V3: fprintf(stderr, "Divinus for hisi-gen3\n"); break; case HAL_PLATFORM_V4: fprintf(stderr, "Divinus for hisi-gen4\n"); break; +#elif defined(__mips__) + case HAL_PLATFORM_T31: + fprintf(stderr, "Divinus for ingenic t31\n"); break; +#endif default: fprintf(stderr, "Unsupported chip family! Quitting...\n"); return EXIT_FAILURE; diff --git a/src/region.c b/src/region.c index 16c35e8..b3dd36d 100644 --- a/src/region.c +++ b/src/region.c @@ -99,11 +99,13 @@ void region_fill_formatted(char* str) void *region_thread(void) { +#ifdef __arm__ switch (plat) { case HAL_PLATFORM_I6: i6_region_init(); break; case HAL_PLATFORM_I6C: i6c_region_init(); break; case HAL_PLATFORM_I6F: i6f_region_init(); break; } +#endif for (char id = 0; id < MAX_OSD; id++) { @@ -138,6 +140,7 @@ void *region_thread(void) hal_rect rect = { .height = bitmap.dim.height, .width = bitmap.dim.width, .x = osds[id].posx, .y = osds[id].posy }; switch (plat) { +#if defined(__arm__) case HAL_PLATFORM_I6: i6_region_create(id, rect, osds[id].opal); i6_region_setbitmap(id, &bitmap); @@ -150,10 +153,6 @@ void *region_thread(void) i6f_region_create(id, rect, osds[id].opal); i6f_region_setbitmap(id, &bitmap); break; - case HAL_PLATFORM_T31: - t31_region_create(&osds[id].hand, rect, osds[id].opal); - t31_region_setbitmap(&osds[id].hand, &bitmap); - break; case HAL_PLATFORM_V3: v3_region_create(id, rect, osds[id].opal); v3_region_setbitmap(id, &bitmap); @@ -162,6 +161,12 @@ void *region_thread(void) v4_region_create(id, rect, osds[id].opal); v4_region_setbitmap(id, &bitmap); break; +#elif defined(__mips__) + case HAL_PLATFORM_T31: + t31_region_create(&osds[id].hand, rect, osds[id].opal); + t31_region_setbitmap(&osds[id].hand, &bitmap); + break; +#endif } free(bitmap.data); } @@ -170,12 +175,15 @@ void *region_thread(void) else if (empty(osds[id].text) && osds[id].updt) { switch (plat) { +#if defined(__arm__) case HAL_PLATFORM_I6: i6_region_destroy(id); break; case HAL_PLATFORM_I6C: i6c_region_destroy(id); break; case HAL_PLATFORM_I6F: i6f_region_destroy(id); break; - case HAL_PLATFORM_T31: t31_region_destroy(&osds[id].hand); break; case HAL_PLATFORM_V3: v3_region_destroy(id); break; case HAL_PLATFORM_V4: v4_region_destroy(id); break; +#elif defined(__mips__) + case HAL_PLATFORM_T31: t31_region_destroy(&osds[id].hand); break; +#endif } } osds[id].updt = 0; @@ -184,9 +192,11 @@ void *region_thread(void) } switch (plat) { +#ifdef __arm__ case HAL_PLATFORM_I6: i6_region_deinit(); break; case HAL_PLATFORM_I6C: i6c_region_deinit(); break; case HAL_PLATFORM_I6F: i6f_region_deinit(); break; +#endif } } diff --git a/src/video.c b/src/video.c index 8e0807f..830df26 100644 --- a/src/video.c +++ b/src/video.c @@ -99,62 +99,77 @@ int take_next_free_channel(bool mainLoop) { void set_grayscale(bool active) { pthread_mutex_lock(&mutex); switch (plat) { +#if defined(__arm__) case HAL_PLATFORM_I6: i6_channel_grayscale(active); break; case HAL_PLATFORM_I6C: i6c_channel_grayscale(active); break; case HAL_PLATFORM_I6F: i6f_channel_grayscale(active); break; - case HAL_PLATFORM_T31: t31_channel_grayscale(active); break; case HAL_PLATFORM_V3: v3_channel_grayscale(active); break; +#elif defined(__mips__) + case HAL_PLATFORM_T31: t31_channel_grayscale(active); break; +#endif } pthread_mutex_unlock(&mutex); } int create_vpss_chn(char index, short width, short height, char framerate, char jpeg) { switch (plat) { +#if defined(__arm__) case HAL_PLATFORM_I6: return i6_channel_create(index, width, height, app_config.mirror, app_config.flip, jpeg); case HAL_PLATFORM_I6C: return i6c_channel_create(index, width, height, app_config.mirror, app_config.flip, jpeg); case HAL_PLATFORM_I6F: return i6f_channel_create(index, width, height, app_config.mirror, app_config.flip, jpeg); - case HAL_PLATFORM_T31: return t31_channel_create(index, width, height, - framerate); case HAL_PLATFORM_V3: return v3_channel_create(index, app_config.mirror, app_config.flip, framerate); case HAL_PLATFORM_V4: return v4_channel_create(index, app_config.mirror, app_config.flip, framerate); +#elif defined(__mips__) + case HAL_PLATFORM_T31: return t31_channel_create(index, width, height, + framerate); +#endif } } int bind_vpss_venc(char index, char framerate, char jpeg) { switch (plat) { +#if defined(__arm__) case HAL_PLATFORM_I6: return i6_channel_bind(index, framerate, jpeg); case HAL_PLATFORM_I6C: return i6c_channel_bind(index, framerate, jpeg); case HAL_PLATFORM_I6F: return i6f_channel_bind(index, framerate, jpeg); - case HAL_PLATFORM_T31: return t31_channel_bind(index); case HAL_PLATFORM_V3: return v3_channel_bind(index); case HAL_PLATFORM_V4: return v4_channel_bind(index); +#elif defined(__mips__) + case HAL_PLATFORM_T31: return t31_channel_bind(index); +#endif } } int unbind_vpss_venc(char index, char jpeg) { switch (plat) { +#if defined(__arm__) case HAL_PLATFORM_I6: return i6_channel_unbind(index); case HAL_PLATFORM_I6C: return i6c_channel_unbind(index, jpeg); case HAL_PLATFORM_I6F: return i6f_channel_unbind(index, jpeg); - case HAL_PLATFORM_T31: return t31_channel_unbind(index); case HAL_PLATFORM_V3: return v3_channel_unbind(index); case HAL_PLATFORM_V4: return v4_channel_unbind(index); +#elif defined(__mips__) + case HAL_PLATFORM_T31: return t31_channel_unbind(index); +#endif } } int disable_venc_chn(char index, char jpeg) { switch (plat) { +#if defined(__arm__) case HAL_PLATFORM_I6: return i6_video_destroy(index); case HAL_PLATFORM_I6C: return i6c_video_destroy(index, jpeg); case HAL_PLATFORM_I6F: return i6f_video_destroy(index, jpeg); - case HAL_PLATFORM_T31: return t31_video_destroy(index); case HAL_PLATFORM_V3: return v3_video_destroy(index); case HAL_PLATFORM_V4: return v4_video_destroy(index); +#elif defined(__mips__) + case HAL_PLATFORM_T31: return t31_video_destroy(index); +#endif } return 0; }; @@ -163,12 +178,15 @@ int start_sdk() { int ret; switch (plat) { +#if defined(__arm__) case HAL_PLATFORM_I6: ret = i6_hal_init(); break; case HAL_PLATFORM_I6C: ret = i6c_hal_init(); break; case HAL_PLATFORM_I6F: ret = i6f_hal_init(); break; - case HAL_PLATFORM_T31: ret = t31_hal_init(); break; case HAL_PLATFORM_V3: ret = v3_hal_init(); break; case HAL_PLATFORM_V4: ret = v4_hal_init(); break; +#elif defined(__mips__) + case HAL_PLATFORM_T31: ret = t31_hal_init(); break; +#endif } if (ret) { fprintf(stderr, "HAL initialization failed with %#x!\n%s\n", @@ -177,21 +195,27 @@ int start_sdk() { } switch (plat) { +#if defined(__arm__) case HAL_PLATFORM_I6: i6_venc_cb = save_stream; break; case HAL_PLATFORM_I6C: i6c_venc_cb = save_stream; break; case HAL_PLATFORM_I6F: i6f_venc_cb = save_stream; break; - case HAL_PLATFORM_T31: t31_venc_cb = save_stream; break; case HAL_PLATFORM_V3: v3_venc_cb = save_stream; break; case HAL_PLATFORM_V4: v4_venc_cb = save_stream; break; +#elif defined(__mips__) + case HAL_PLATFORM_T31: t31_venc_cb = save_stream; break; +#endif } switch (plat) { +#if defined(__arm__) case HAL_PLATFORM_I6: ret = i6_system_init(); break; case HAL_PLATFORM_I6C: ret = i6c_system_init(); break; case HAL_PLATFORM_I6F: ret = i6f_system_init(); break; - case HAL_PLATFORM_T31: ret = t31_system_init(); break; case HAL_PLATFORM_V3: ret = v3_system_init(app_config.sensor_config); break; case HAL_PLATFORM_V4: ret = v4_system_init(app_config.sensor_config); break; +#elif defined(__mips__) + case HAL_PLATFORM_T31: ret = t31_system_init(); break; +#endif } if (ret) { fprintf(stderr, "System initialization failed with %#x!\n%s\n", @@ -204,16 +228,19 @@ int start_sdk() { short framerate = MAX(app_config.mp4_fps, app_config.mjpeg_fps); switch (plat) { +#if defined(__arm__) case HAL_PLATFORM_I6: ret = i6_pipeline_create(0, width, height, framerate); break; case HAL_PLATFORM_I6C: ret = i6c_pipeline_create(0, width, height, framerate); break; case HAL_PLATFORM_I6F: ret = i6f_pipeline_create(0, width, height, framerate); break; - case HAL_PLATFORM_T31: ret = t31_pipeline_create(app_config.mirror, - app_config.flip, app_config.antiflicker, framerate); break; case HAL_PLATFORM_V3: ret = v3_pipeline_create(); break; case HAL_PLATFORM_V4: ret = v4_pipeline_create(); break; +#elif defined(__mips__) + case HAL_PLATFORM_T31: ret = t31_pipeline_create(app_config.mirror, + app_config.flip, app_config.antiflicker, framerate); break; +#endif } if (ret) { fprintf(stderr, "Pipeline creation failed with %#x!\n%s\n", @@ -265,12 +292,15 @@ int start_sdk() { config.bitrate = app_config.mp4_bitrate; switch (plat) { +#if defined(__arm__) case HAL_PLATFORM_I6: ret = i6_video_create(index, &config); break; case HAL_PLATFORM_I6C: ret = i6c_video_create(index, &config); break; case HAL_PLATFORM_I6F: ret = i6f_video_create(index, &config); break; - case HAL_PLATFORM_T31: ret = t31_video_create(index, &config); break; case HAL_PLATFORM_V3: ret = v3_video_create(index, &config); break; case HAL_PLATFORM_V4: ret = v4_video_create(index, &config); break; +#elif defined(__mips__) + case HAL_PLATFORM_T31: ret = t31_video_create(index, &config); break; +#endif } if (ret) { @@ -312,12 +342,15 @@ int start_sdk() { config.bitrate = app_config.mjpeg_bitrate; switch (plat) { +#if defined(__arm__) case HAL_PLATFORM_I6: ret = i6_video_create(index, &config); break; case HAL_PLATFORM_I6C: ret = i6c_video_create(index, &config); break; case HAL_PLATFORM_I6F: ret = i6f_video_create(index, &config); break; - case HAL_PLATFORM_T31: ret = t31_video_create(index, &config); break; case HAL_PLATFORM_V3: ret = v3_video_create(index, &config); break; case HAL_PLATFORM_V4: ret = v4_video_create(index, &config); break; +#elif defined(__mips__) + case HAL_PLATFORM_T31: ret = t31_video_create(index, &config); break; +#endif } if (ret) { @@ -366,10 +399,13 @@ int start_sdk() { if (!access(app_config.sensor_config, 0) && !sleep(1)) switch (plat) { +#if defined(__arm__) case HAL_PLATFORM_I6: i6_config_load(app_config.sensor_config); break; case HAL_PLATFORM_I6C: i6c_config_load(app_config.sensor_config); break; - case HAL_PLATFORM_I6F: i6f_config_load(app_config.sensor_config); break; + case HAL_PLATFORM_I6F: i6f_config_load(app_config.sensor_config); break; +#elif defined(__mips__) case HAL_PLATFORM_T31: t31_config_load(app_config.sensor_config); break; +#endif } fprintf(stderr, "SDK has started successfully!\n"); @@ -384,47 +420,61 @@ int stop_sdk() { jpeg_deinit(); switch (plat) { +#if defined(__arm__) case HAL_PLATFORM_I6: i6_video_destroy_all(); break; case HAL_PLATFORM_I6C: i6c_video_destroy_all(); break; case HAL_PLATFORM_I6F: i6f_video_destroy_all(); break; - case HAL_PLATFORM_T31: t31_video_destroy_all(); break; case HAL_PLATFORM_V3: v3_video_destroy_all(); break; case HAL_PLATFORM_V4: v4_video_destroy_all(); break; +#elif defined(__mips__) + case HAL_PLATFORM_T31: t31_video_destroy_all(); break; +#endif } switch (plat) { +#if defined(__arm__) case HAL_PLATFORM_I6: i6_pipeline_destroy(); break; case HAL_PLATFORM_I6C: i6c_pipeline_destroy(); break; case HAL_PLATFORM_I6F: i6f_pipeline_destroy(); break; - case HAL_PLATFORM_T31: t31_pipeline_destroy(); break; case HAL_PLATFORM_V3: v3_pipeline_destroy(); break; case HAL_PLATFORM_V4: v4_pipeline_destroy(); break; +#elif defined(__mips__) + case HAL_PLATFORM_T31: t31_pipeline_destroy(); break; +#endif } if (isp_thread) pthread_join(ispPid, NULL); switch (plat) { +#if defined(__arm__) case HAL_PLATFORM_I6: i6_system_deinit(); break; case HAL_PLATFORM_I6C: i6c_system_deinit(); break; case HAL_PLATFORM_I6F: i6f_system_deinit(); break; - case HAL_PLATFORM_T31: t31_system_deinit(); break; case HAL_PLATFORM_V3: v3_system_deinit(); break; case HAL_PLATFORM_V4: v4_system_deinit(); break; +#elif defined(__mips__) + case HAL_PLATFORM_T31: t31_system_deinit(); break; +#endif } +#ifdef __arm__ switch (plat) { case HAL_PLATFORM_V3: v3_sensor_deinit(); break; case HAL_PLATFORM_V4: v4_sensor_deinit(); break; } +#endif switch (plat) { +#if defined(__arm__) case HAL_PLATFORM_I6: i6_hal_deinit(); break; case HAL_PLATFORM_I6C: i6c_hal_deinit(); break; case HAL_PLATFORM_I6F: i6f_hal_deinit(); break; - case HAL_PLATFORM_T31: t31_hal_deinit(); break; case HAL_PLATFORM_V3: v3_hal_deinit(); break; case HAL_PLATFORM_V4: v4_hal_deinit(); break; +#elif defined(__mips__) + case HAL_PLATFORM_T31: t31_hal_deinit(); break; +#endif } fprintf(stderr, "SDK had stopped successfully!\n");