Commit 9fa158c4 authored by luo's avatar luo

[UPDATE]SDK 2.5.0.5.1.2

parent c1f9a37a
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
}; };
chosen { chosen {
bootargs = "console=ttyS2,115200 mem=64M quiet"; bootargs = "console=ttyS2,115200 mem=96M quiet";
stdout-path = "serial2:115200n8"; stdout-path = "serial2:115200n8";
}; };
......
{
"doc": "media",
"version": "1.0.0.1",
"#note": [
"scene: capture,record,captureaddrecord,visual"
],
"scene": "capture",
"video": {
"#note0": [
"SensorType 0:4d10,1:4a10,2:2n10,3:imx681,4:5l10,5:sc535,6:4j10,7:4l10",
"SensorMode 0:linear,1:hdr"
],
"SensorType": 3, "SensorMode": 0,
"#note1": [
"Rotation 0:0,1:90,2:180,3:270",
"FilterColor 0:off,1:pink,2:blue,3:cowboy,4:cyantone,5:prettypure,6:moody"
],
"ViDev": 0, "MaxFps": 15.0, "MinFps": 15.0, "Mirror": 0, "Flip": 0, "Rotation": 0,
"Gdc": 0, "FilterColor": 0,
"IspFile": [ "/acme/conf/681/imx681_capture_Color_Outdoor.bin","/acme/conf/681/imx681_capture_Color_Outdoor_diff.bin", "/acme/conf/681/imx681_capture_Color_Indoor_diff.bin","/acme/conf/681/imx681_capture_Color_Outdoor_diff.bin","","","","","","/acme/conf/681/imx681_capture_Color_Blc_diff.bin"],
"AinrFile": "/acme/conf/681/imx681_v01_001_800_rtl.bin",
"ProEnable": 0, "ISO": 100, "AWBCt": 5000, "SportEnable": 0, "MaxIntTime": 30000,
"venc": [
{
"#note-capture channel": [
"SmartEncoder 0:none,1:roi,2:qp"
],
"Width": 4032, "Height": 3024, "Bitrate": 2048000, "SmartEncoder": 0, "SmartSEI": 0,
"region": [
{
"#note": [
"Type 0:image,1:timestamp,2:timestamp+mode,3:timestamp+week,4:timestamp+week(EN)"
],
"Enable": 0, "Type": 0,
"X": 32, "Y": 32, "Width": 256, "Height": 128,
"Color0": 16777215, "Color1": 6171602, "Color2": 16745541,
"ImageFile": "/acme/bin/logo256x128.2bpp"
},
{
"Enable": 0, "Type": 0,
"X": 32, "Y": 32, "Width": 256, "Height": 128,
"Color0": 16777215, "Color1": 6171602, "Color2": 16745541,
"ImageFile": "/acme/bin/logo256x128.2bpp"
}
]
},
{
"#note-record channel": [
"CodeType 0:h264,1:h265,2:jpeg",
"RcMode 0:QP,1:cbr,2:vbr,3:low latency,4:capped vbr,5:adaptive vbr,7:min br,63:bypass,64:jpeg fxiQP",
"SmartEncoder 0:none,1:roi,2:QP"
],
"CodeType": 1, "Qfactor": 80, "RcMode": 1,
"Width": 1920, "Height": 1080, "Bitrate": 2048000, "SmartEncoder": 0, "SmartSEI": 0,
"region": [
{
"Enable": 0, "Type": 0,
"X": 32, "Y": 32, "Width": 256, "Height": 128,
"Color0": 16777215, "Color1": 6171602, "Color2": 16745541,
"ImageFile": "/acme/bin/logo256x128.2bpp"
},
{
"Enable": 0, "Type": 0,
"X": 32, "Y": 32, "Width": 256, "Height": 128,
"Color0": 16777215, "Color1": 6171602, "Color2": 16745541,
"ImageFile": "/acme/bin/logo256x128.2bpp"
}
]
}
],
"sd":
{
"#note": [
"SdMode 0:auto,1:manual",
"SceneType 0:outdoor,1:indoor,2:ainr,8:backlight",
"WdrMode 0:linear,1:hdr,2:auto",
"StrategyMode 0:normal,1:blc,2:hs"
],
"SdMode": 0, "SceneType": 0, "WdrMode": 0,
"MaxInttimeEnable": 0, "IntTimeMax": 30000,
"RoiEnable": 0, "X": 0, "Y": 0, "Width": 1920, "Height": 1080,
"StrategyMode": 0, "Strength": 100,
"FlickerEnable": 0, "Frequency": 50
}
},
"capture":
{
"#note": [
"SaveFormat 0:jpeg,1:heif"
],
"BokehEnable": 0, "MFNREnable": 0, "HDREnable": 0, "ZSLEnable": 0,
"BeautyEnable": 0, "Strength": 50,
"SaveEnable": 1, "SaveFormat": 1, "SaveFilePath": "/mnt/sdcard"
},
"record":
{
"EISMode": 0,
"audio":
{
"#note": [
"SampleRate 8000 16000 32000 48000",
"SoundMode 1:mono,2:stereo",
"EncType 1:lcaac,2:g711a,3:g711u,4:pcm"
],
"AudioEnable": 0,
"SampleRate": 16000,
"SoundMode": 1,
"EncType": 0,
"VqeEnable": 0,"VqeParamFile": "/acme/bin/vqe.bin"
},
"#note": [
"SaveFormat 0:mp4,1:h265,2:h264,3:jpg"
],
"SaveEnable": 1, "SaveFormat": 1, "SaveFilePath": "/mnt/sdcard"
},
"svp":
{
"OCREnable": 0,
"QRCodeEnable": 0,
"FaceDetEnable": 0,
"PeopleDetEnable": 0,
"SmartAeEnable": 0
}
}
{
"doc": "media",
"version": "1.0.0.1",
"#note": [
"scene: capture,record,captureaddrecord,visual"
],
"scene": "record",
"video": {
"#note0": [
"SensorType 0:4d10,1:4a10,2:2n10,3:imx681,4:5l10,5:sc535,6:4j10,7:4l10",
"SensorMode 0:linear,1:hdr"
],
"SensorType": 3, "SensorMode": 0,
"#note1": [
"Rotation 0:0,1:90,2:180,3:270",
"FilterColor 0:off,1:pink,2:blue,3:cowboy,4:cyantone,5:prettypure,6:moody"
],
"ViDev": 0, "MaxFps": 30.0, "MinFps": 30.0, "Mirror": 0, "Flip": 0, "Rotation": 0,
"Gdc": 0, "FilterColor": 0,
"IspFile": [ "/acme/conf/681/imx681_video_Color_Outdoor.bin","/acme/conf/681/imx681_video_Color_Outdoor_diff.bin", "/acme/conf/681/imx681_video_Color_Indoor_diff.bin","/acme/conf/681/imx681_video_Color_Outdoor_diff.bin","","","","","","/acme/conf/681/imx681_video_Color_Blc_diff.bin"],
"AinrFile": "/acme/conf/681/imx681_v01_001_800_rtl.bin",
"ProEnable": 0, "ISO": 100, "AWBCt": 5000, "SportEnable": 0, "MaxIntTime": 30000,
"venc": [
{
"#note-capture channel": [
"SmartEncoder 0:none,1:roi,2:qp"
],
"Width": 4032, "Height": 3024, "Bitrate": 2048000, "SmartEncoder": 0, "SmartSEI": 0,
"region": [
{
"#note": [
"Type 0:image,1:timestamp,2:timestamp+mode,3:timestamp+week,4:timestamp+week(EN)"
],
"Enable": 0, "Type": 0,
"X": 32, "Y": 32, "Width": 256, "Height": 128,
"Color0": 16777215, "Color1": 6171602, "Color2": 16745541,
"ImageFile": "/acme/bin/logo256x128.2bpp"
},
{
"Enable": 0, "Type": 0,
"X": 32, "Y": 32, "Width": 256, "Height": 128,
"Color0": 16777215, "Color1": 6171602, "Color2": 16745541,
"ImageFile": "/acme/bin/logo256x128.2bpp"
}
]
},
{
"#note-record channel": [
"CodeType 0:h264,1:h265,2:jpeg",
"RcMode 0:QP,1:cbr,2:vbr,3:low latency,4:capped vbr,5:adaptive vbr,7:min br,63:bypass,64:jpeg fxiQP",
"SmartEncoder 0:none,1:roi,2:QP"
],
"CodeType": 1, "Qfactor": 80, "RcMode": 1,
"Width": 1920, "Height": 1080, "Bitrate": 2048000, "SmartEncoder": 0, "SmartSEI": 0,
"region": [
{
"Enable": 0, "Type": 0,
"X": 32, "Y": 32, "Width": 256, "Height": 128,
"Color0": 16777215, "Color1": 6171602, "Color2": 16745541,
"ImageFile": "/acme/bin/logo256x128.2bpp"
},
{
"Enable": 0, "Type": 0,
"X": 32, "Y": 32, "Width": 256, "Height": 128,
"Color0": 16777215, "Color1": 6171602, "Color2": 16745541,
"ImageFile": "/acme/bin/logo256x128.2bpp"
}
]
}
],
"sd":
{
"#note": [
"SdMode 0:auto,1:manual",
"SceneType 0:outdoor,1:indoor,2:ainr,8:backlight",
"WdrMode 0:linear,1:hdr,2:auto",
"StrategyMode 0:normal,1:blc,2:hs"
],
"SdMode": 0, "SceneType": 0, "WdrMode": 0,
"MaxInttimeEnable": 0, "IntTimeMax": 30000,
"RoiEnable": 0, "X": 0, "Y": 0, "Width": 1920, "Height": 1080,
"StrategyMode": 0, "Strength": 100,
"FlickerEnable": 0, "Frequency": 50
}
},
"capture":
{
"#note": [
"SaveFormat 0:jpeg,1:heif"
],
"BokehEnable": 0, "MFNREnable": 0, "HDREnable": 0, "ZSLEnable": 0,
"BeautyEnable": 0, "Strength": 50,
"SaveEnable": 1, "SaveFormat": 1, "SaveFilePath": "/mnt/sdcard"
},
"record":
{
"EISMode": 0,
"audio":
{
"#note": [
"SampleRate 8000 16000 32000 48000",
"SoundMode 1:mono,2:stereo",
"EncType 1:lcaac,2:g711a,3:g711u,4:pcm"
],
"AudioEnable": 0,
"SampleRate": 16000,
"SoundMode": 1,
"EncType": 0,
"VqeEnable": 0,"VqeParamFile": "/acme/bin/vqe.bin"
},
"#note": [
"SaveFormat 0:mp4,1:h265,2:h264,3:jpg"
],
"SaveEnable": 1, "SaveFormat": 1, "SaveFilePath": "/mnt/sdcard"
},
"svp":
{
"OCREnable": 0,
"QRCodeEnable": 0,
"FaceDetEnable": 0,
"PeopleDetEnable": 0,
"SmartAeEnable": 0
}
}
...@@ -94,9 +94,9 @@ parse_and_upgrade() { ...@@ -94,9 +94,9 @@ parse_and_upgrade() {
if $force_upgrade || version_greater "$ota_version" "$current_ota_version"; then if $force_upgrade || version_greater "$ota_version" "$current_ota_version"; then
echo "OTA_VERSION is greater or force upgrade is enabled. Proceeding with OTA upgrade." echo "OTA_VERSION is greater or force upgrade is enabled. Proceeding with OTA upgrade."
parse_image_info "$content" parse_image_info "$content"
perform_wifi_fw_upgrade $first
perform_kernel_upgrade perform_kernel_upgrade
perform_system_upgrade perform_system_upgrade
perform_wifi_fw_upgrade $first
update_ota_version "$ota_version_full" update_ota_version "$ota_version_full"
else else
echo "OTA_VERSION is not greater and force upgrade is not enabled. No upgrade needed." echo "OTA_VERSION is not greater and force upgrade is not enabled. No upgrade needed."
......
...@@ -54,6 +54,11 @@ rootfs_copy_file() { ...@@ -54,6 +54,11 @@ rootfs_copy_file() {
mkdir system_temp/conf/681/ -p mkdir system_temp/conf/681/ -p
cp common/conf/681/* system_temp/conf/681/ cp common/conf/681/* system_temp/conf/681/
cp common/bin/lite_imx681* system_temp/bin/ cp common/bin/lite_imx681* system_temp/bin/
cp sdk/bin/streamer system_temp/bin/
cp sdk/bin/user_imx681* system_temp/bin/
cp sdk/bin/user_os04d10_normal.json system_temp/bin/
cp sdk/lib/libsvp_*.so system_temp/lib/
cp sdk/conf system_temp/ -r
fi fi
if [ "$type" == "qa" ];then if [ "$type" == "qa" ];then
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
#notice follows path in ota_pack #notice follows path in ota_pack
bootinfo_version="2.5.6" bootinfo_version="2.5.6"
OTA_VERSION="S04_16NRALXSW1Y1_V1.0.5_250123" OTA_VERSION="S04_16NRALXSW1Y1_V1.0.6_250213"
OTA_KERNEL_PATH="../burn_img_nor/bootimg-XIP-6920E-0P55-outdoor-ipc-linux.bin" OTA_KERNEL_PATH="../burn_img_nor/bootimg-XIP-6920E-0P55-outdoor-ipc-linux.bin"
OTA_SYSTEM_PATH="../burn_img_nor/system.squashfs.bin" OTA_SYSTEM_PATH="../burn_img_nor/system.squashfs.bin"
OTA_SDK_VERSION="V2.5.0.2.9" OTA_SDK_VERSION="V2.5.0.5.1"
OTA_WIFI_FW_PATH="../third_party/longse/wifi/AiW4211L_demo_ota_V2025.1.23.bin" OTA_WIFI_FW_PATH="../third_party/longse/wifi/AiW4211L_demo_ota_V2025.2.14.bin"
OTA_BURN_SH_PATH="./device_ota_pack/ota_burn.sh" OTA_BURN_SH_PATH="./device_ota_pack/ota_burn.sh"
OTA_EXT_SH_PATH="./device_ota_pack/sample_ota.sh" OTA_EXT_SH_PATH="./device_ota_pack/sample_ota.sh"
OTA_EXT_CMD="" OTA_EXT_CMD=""
......
...@@ -313,7 +313,7 @@ typedef enum { ...@@ -313,7 +313,7 @@ typedef enum {
SA_MEDIA_RECORD_SAVE_MP4 = 0, SA_MEDIA_RECORD_SAVE_MP4 = 0,
SA_MEDIA_RECORD_SAVE_265 = 1, SA_MEDIA_RECORD_SAVE_265 = 1,
SA_MEDIA_RECORD_SAVE_264 = 2, SA_MEDIA_RECORD_SAVE_264 = 2,
SA_MEDIA_RECORD_SAVE_JPG = 2, SA_MEDIA_RECORD_SAVE_JPG = 3,
} SA_MEDIA_RECORD_SAVE_FORMAT_E; } SA_MEDIA_RECORD_SAVE_FORMAT_E;
typedef struct { typedef struct {
...@@ -360,7 +360,7 @@ typedef struct { ...@@ -360,7 +360,7 @@ typedef struct {
VI_DEV_ATTR_S stViDevAttr; VI_DEV_ATTR_S stViDevAttr;
VI_PIPE_ATTR_S stViPipeAttr; VI_PIPE_ATTR_S stViPipeAttr;
SA_BOOL bMdEnable; SA_BOOL bMdEnable;
VI_GDC_ROTATE_E enRotation; VI_GDC_ATTR_S stViGdcAttr;
VI_EIS_MODE_E enEisMode; VI_EIS_MODE_E enEisMode;
} SA_MEDIA_VI_ATTR_S; } SA_MEDIA_VI_ATTR_S;
...@@ -465,11 +465,11 @@ typedef struct { ...@@ -465,11 +465,11 @@ typedef struct {
SA_U32 u32EvDiffThr; SA_U32 u32EvDiffThr;
SA_U32 u32DrDiffThr; SA_U32 u32DrDiffThr;
SA_U32 u32WdrEnvLumaThr; SA_U32 u32WdrEnvLumaThr;
SA_U32 u32LinearEnvLumaThr; SA_U32 u32LinearEnvLumaThr;
SA_U8 u8BacklightEn; SA_U8 u8BacklightEn;
SA_F32 f32BacklightB2mBvK; SA_F32 f32BacklightB2mBvK;
SA_U32 u32BacklightB2mBvB; SA_U32 u32BacklightB2mBvB;
SA_S32 s32BacklightM2dThd; SA_S32 s32BacklightM2dThd;
} SA_MEDIA_SD_LIB_ATTR_S; } SA_MEDIA_SD_LIB_ATTR_S;
typedef struct { typedef struct {
......
...@@ -313,7 +313,7 @@ typedef enum { ...@@ -313,7 +313,7 @@ typedef enum {
SA_MEDIA_RECORD_SAVE_MP4 = 0, SA_MEDIA_RECORD_SAVE_MP4 = 0,
SA_MEDIA_RECORD_SAVE_265 = 1, SA_MEDIA_RECORD_SAVE_265 = 1,
SA_MEDIA_RECORD_SAVE_264 = 2, SA_MEDIA_RECORD_SAVE_264 = 2,
SA_MEDIA_RECORD_SAVE_JPG = 2, SA_MEDIA_RECORD_SAVE_JPG = 3,
} SA_MEDIA_RECORD_SAVE_FORMAT_E; } SA_MEDIA_RECORD_SAVE_FORMAT_E;
typedef struct { typedef struct {
...@@ -360,7 +360,7 @@ typedef struct { ...@@ -360,7 +360,7 @@ typedef struct {
VI_DEV_ATTR_S stViDevAttr; VI_DEV_ATTR_S stViDevAttr;
VI_PIPE_ATTR_S stViPipeAttr; VI_PIPE_ATTR_S stViPipeAttr;
SA_BOOL bMdEnable; SA_BOOL bMdEnable;
VI_GDC_ROTATE_E enRotation; VI_GDC_ATTR_S stViGdcAttr;
VI_EIS_MODE_E enEisMode; VI_EIS_MODE_E enEisMode;
} SA_MEDIA_VI_ATTR_S; } SA_MEDIA_VI_ATTR_S;
......
...@@ -25,17 +25,19 @@ extern "C" { ...@@ -25,17 +25,19 @@ extern "C" {
#include "sa_inner_hapi_media_sd.h" #include "sa_inner_hapi_media_sd.h"
#endif #endif
// VI_GDC_ATTR_S MEDIA_GDC_PARAM_DEFAULT = VI_GDC_ATTR_S MEDIA_GDC_PARAM_DEFAULT =
// { {
// .bGdcEn = SA_TRUE, .enGdcMode = VI_GDC_WARP,
// .stGdcParam = { .stGdcWarpParam = {
// .bFishEye = 0, .bFishEye = 0,
// .f32CameraK = { {803.651143, 0.000000, 1280.500000}, .f32FovScale = 1.0,
// {0.000000, 803.651143, 720.500000}, .f32CameraK = { {803.651143, 0.000000, 1280.500000},
// {0.000000, 0.000000, 1.000000}}, {0.000000, 803.651143, 720.500000},
// .f32UndistortCoefs = {-0.064685, 0.003107, 0.000000, 0.000000, -0.000904, 0.0776239, -0.016690, 0.000808}, {0.000000, 0.000000, 1.000000}},
// }, .f32UndistortCoefs = {-0.064685, 0.003107, 0.000000, 0.000000, -0.000904, 0.0776239, -0.016690, 0.000808},
// }; },
};
#define MEDIA_LTM_SIZE_WIDTH_MAX (3840) #define MEDIA_LTM_SIZE_WIDTH_MAX (3840)
#define MEDIA_LTM_SIZE_HEIGHT_MAX (2736) #define MEDIA_LTM_SIZE_HEIGHT_MAX (2736)
#ifndef MEDIA_ALIGN_UP #ifndef MEDIA_ALIGN_UP
...@@ -709,19 +711,18 @@ static SA_S32 INNER_HAPI_VIN_GetAttr(SA_MEDIA_SCENE_E enScene, SA_MEDIA_VIDEO_CO ...@@ -709,19 +711,18 @@ static SA_S32 INNER_HAPI_VIN_GetAttr(SA_MEDIA_SCENE_E enScene, SA_MEDIA_VIDEO_CO
} }
// gdc // gdc
// if (pstSceneConfig->bGdc) { if (pstSceneConfig->bGdc) {
// memcpy(&pstVinAttr->stViAttr.stViGdcAttr, &MEDIA_GDC_PARAM_DEFAULT, sizeof(VI_GDC_ATTR_S)); memcpy(&pstVinAttr->stViAttr.stViGdcAttr, &MEDIA_GDC_PARAM_DEFAULT, sizeof(VI_GDC_ATTR_S));
// pstVinAttr->stViAttr.stViGdcAttr.stGdcParam.enGdcRotate = pstSceneConfig->enRotation; if ((abs(stSnsRes.u32Width / 2 - (SA_S32)pstVinAttr->stViAttr.stViGdcAttr.stGdcWarpParam.f32CameraK[0][2]) > 100) ||
// if ((abs(stSnsRes.u32Width / 2 - (SA_S32)pstVinAttr->stViAttr.stViGdcAttr.stGdcParam.f32CameraK[0][2]) > 100) || (abs(stSnsRes.u32Height / 2 - (SA_S32)pstVinAttr->stViAttr.stViGdcAttr.stGdcWarpParam.f32CameraK[1][2]) > 100)) {
// (abs(stSnsRes.u32Height / 2 - (SA_S32)pstVinAttr->stViAttr.stViGdcAttr.stGdcParam.f32CameraK[1][2]) > 100)) { HAPI_MEDIA_LOG_E("gdc cameraK param is out of range, please check the param.\n");
// HAPI_MEDIA_LOG_E("gdc cameraK param is out of range, please check the param.\n"); pstVinAttr->stViAttr.stViGdcAttr.stGdcWarpParam.f32CameraK[0][2] = stSnsRes.u32Width / 2;
// pstVinAttr->stViAttr.stViGdcAttr.stGdcParam.f32CameraK[0][2] = stSnsRes.u32Width / 2; pstVinAttr->stViAttr.stViGdcAttr.stGdcWarpParam.f32CameraK[1][2] = stSnsRes.u32Height / 2;
// pstVinAttr->stViAttr.stViGdcAttr.stGdcParam.f32CameraK[1][2] = stSnsRes.u32Height / 2; }
// } } else if (pstSceneConfig->enRotation != VI_GDC_ROTATE_0) {
// } else if (pstSceneConfig->enRotation != VI_GDC_ROTATE_0) { pstVinAttr->stViAttr.stViGdcAttr.enGdcMode = VI_GDC_ROTATION;
// pstVinAttr->stViAttr.stViGdcAttr.bGdcEn = SA_TRUE; pstVinAttr->stViAttr.stViGdcAttr.stGdcRotationParam.enGdcRotate = pstSceneConfig->enRotation;
// pstVinAttr->stViAttr.stViGdcAttr.stGdcParam.enGdcRotate = pstSceneConfig->enRotation; }
// }
pstVinAttr->stIspAttr.u32IspPipeId = ViPipe; pstVinAttr->stIspAttr.u32IspPipeId = ViPipe;
memcpy(&pstVinAttr->stIspAttr.astrIspFile[pstVinAttr->stIspAttr.u32IspPipeId][0][0],pstSceneConfig->astrIspFile[0],SA_MEDIA_ISP_BIN_PATH_NUM*sizeof(pstSceneConfig->astrIspFile[0])); memcpy(&pstVinAttr->stIspAttr.astrIspFile[pstVinAttr->stIspAttr.u32IspPipeId][0][0],pstSceneConfig->astrIspFile[0],SA_MEDIA_ISP_BIN_PATH_NUM*sizeof(pstSceneConfig->astrIspFile[0]));
...@@ -1012,15 +1013,8 @@ static SA_S32 INNER_HAPI_VIN_SetPipeParam(VI_PIPE u32ViPipeId, SA_MEDIA_VIN_ATTR ...@@ -1012,15 +1013,8 @@ static SA_S32 INNER_HAPI_VIN_SetPipeParam(VI_PIPE u32ViPipeId, SA_MEDIA_VIN_ATTR
memcpy(&stPipeParam.stViMdAttr, &stMdAttr, sizeof(VI_MD_ATTR_S)); memcpy(&stPipeParam.stViMdAttr, &stMdAttr, sizeof(VI_MD_ATTR_S));
} }
if (pstChnAttr->stViAttr.enRotation) { if (pstChnAttr->stViAttr.stViGdcAttr.enGdcMode) {
VI_GDC_ATTR_S stGdcAttr = { memcpy(&stPipeParam.stViGdcAttr, &pstChnAttr->stViAttr.stViGdcAttr, sizeof(VI_GDC_ATTR_S));
.enGdcMode = VI_GDC_ROTATION,
.stGdcRotationParam = {
.enGdcRotate = pstChnAttr->stViAttr.enRotation,
}
};
memcpy(&stPipeParam.stViGdcAttr, &stGdcAttr, sizeof(VI_GDC_ATTR_S));
} }
if(pstChnAttr->stViAttr.enEisMode) { if(pstChnAttr->stViAttr.enEisMode) {
...@@ -1031,7 +1025,6 @@ static SA_S32 INNER_HAPI_VIN_SetPipeParam(VI_PIPE u32ViPipeId, SA_MEDIA_VIN_ATTR ...@@ -1031,7 +1025,6 @@ static SA_S32 INNER_HAPI_VIN_SetPipeParam(VI_PIPE u32ViPipeId, SA_MEDIA_VIN_ATTR
memcpy(&stPipeParam.stViEisAttr, &eis_attr, sizeof(VI_EIS_ATTR_S)); memcpy(&stPipeParam.stViEisAttr, &eis_attr, sizeof(VI_EIS_ATTR_S));
} }
stPipeParam.stViPyrAttr.bPyrBypass = 2;
stPipeParam.stViPyrAttr.u32Depth = (pstChnAttr->stSensorAttr.f32Fps >= 20.0) ? 3 : 0; stPipeParam.stViPyrAttr.u32Depth = (pstChnAttr->stSensorAttr.f32Fps >= 20.0) ? 3 : 0;
s32Ret = SA_MAPI_VI_SetPipeParam(u32ViPipeId, &stPipeParam); s32Ret = SA_MAPI_VI_SetPipeParam(u32ViPipeId, &stPipeParam);
......
...@@ -302,7 +302,7 @@ ifeq ("$(SNS_SUPPORT_OS05L10_SOC)","y") ...@@ -302,7 +302,7 @@ ifeq ("$(SNS_SUPPORT_OS05L10_SOC)","y")
CFLAGS += -DSNS_OS05L10 CFLAGS += -DSNS_OS05L10
SRC_OS05L10_SOC := $(wildcard $(src)/os05l10_soc/*.c) SRC_OS05L10_SOC := $(wildcard $(src)/os05l10_soc/*.c)
SRC_OS05L10_SOC += $(wildcard $(src)/os05l10_soc/driver/*.c) SRC_OS05L10_SOC += $(wildcard $(src)/os05l10_soc/driver/*.c)
JSON_SOC += $(src)/os05l10_soc/user_os05l10.json #JSON_SOC += $(src)/os05l10_soc/user_os05l10.json
TARGET_MAKE += LIB_OS05L10_SOC TARGET_MAKE += LIB_OS05L10_SOC
TARGET_CLEAN += LIB_OS05L10_SOC_CLEAN TARGET_CLEAN += LIB_OS05L10_SOC_CLEAN
OBJ_OS05L10_SOC := $(patsubst %.c, %.o, ${SRC_OS05L10_SOC}) OBJ_OS05L10_SOC := $(patsubst %.c, %.o, ${SRC_OS05L10_SOC})
......
...@@ -31,6 +31,14 @@ extern "C" { ...@@ -31,6 +31,14 @@ extern "C" {
#include "sa_comm.h" #include "sa_comm.h"
#include "messagelite.h" #include "messagelite.h"
#define MEDIA_VER_MAJOR (1)
#define MEDIA_VER_MINOR (0)
#define MEDIA_VER_DEVELOP (0)
#define MEDIA_VER_DEBUG (1)
#define MEDIA_JSON_NODE_ASSERT(x) { if (SA_SUCCESS != (x)) { HAPI_MEDIA_LOG_E("%s %d Illegal json param!\n", __func__, __LINE__); return SA_FAILURE; } }
#define MEDIA_JSON_NULL_ASSERT(x) { if(SA_NULL == (x)) { HAPI_MEDIA_LOG_E("%s %d section read error!\n", __func__, __LINE__); return SA_FAILURE; } }
#define IMX681 #define IMX681
static HAPI_MEDIA_THREAD_T g_stSceneTh = {0}; static HAPI_MEDIA_THREAD_T g_stSceneTh = {0};
...@@ -424,9 +432,9 @@ static void SAMPLE_MEDIA_Help(char* sAppName) ...@@ -424,9 +432,9 @@ static void SAMPLE_MEDIA_Help(char* sAppName)
HAPI_MEDIA_LOG_I("Usage : %s <command> \n", sAppName); HAPI_MEDIA_LOG_I("Usage : %s <command> \n", sAppName);
HAPI_MEDIA_LOG_I("-c [capture] capture frames num\n"); HAPI_MEDIA_LOG_I("-c [capture] capture frames num\n");
HAPI_MEDIA_LOG_I("-r [record] record duration\n"); HAPI_MEDIA_LOG_I("-r [record] record duration\n");
HAPI_MEDIA_LOG_I("-a [capture + record]\n");
HAPI_MEDIA_LOG_I("-d [drop frames]\n"); HAPI_MEDIA_LOG_I("-d [drop frames]\n");
HAPI_MEDIA_LOG_I("-g [rtsp]\n"); HAPI_MEDIA_LOG_I("-g [rtsp]\n");
HAPI_MEDIA_LOG_I("-j [load json]\n");
} }
static SA_VOID SAMPLE_MEDIA_Exit(SA_S32 s32Sig) static SA_VOID SAMPLE_MEDIA_Exit(SA_S32 s32Sig)
...@@ -439,11 +447,294 @@ static SA_VOID SAMPLE_MEDIA_Exit(SA_S32 s32Sig) ...@@ -439,11 +447,294 @@ static SA_VOID SAMPLE_MEDIA_Exit(SA_S32 s32Sig)
} }
} }
SA_S32 SAMPLE_MEDIA_DupFile(const SA_CHAR *pcFileName, SA_U8 **ppu8FileBuf, SA_U32 *pu32FileSize)
{
SA_S32 s32Ret = SA_SUCCESS;
SA_U32 u32MallocSize = 0;
SA_U32 u32ReadSize = 0;
FILE *pstFD = SA_NULL;
SA_U8 *pu8Buf = SA_NULL;
if (SA_NULL == pcFileName) {
HAPI_MEDIA_LOG_E("file name is null pointer!\n");
return SA_FAILURE;
}
pstFD = fopen(pcFileName, "rb");
if (SA_NULL == pstFD) {
HAPI_MEDIA_LOG_E("open file %s failed!\n", pcFileName);
return SA_FAILURE;
}
fseek(pstFD, 0L, SEEK_END);
u32MallocSize = ftell(pstFD);
if (0 == u32MallocSize) {
fclose(pstFD);
HAPI_MEDIA_LOG_E("file '%s' is empty!\n", pcFileName);
return SA_FAILURE;
}
pu8Buf = HAPI_MEDIA_MALLOC(u32MallocSize);
if (SA_NULL == pu8Buf) {
fclose(pstFD);
HAPI_MEDIA_LOG_E("malloc file buffer failed!\n");
return SA_FAILURE;
}
fseek(pstFD, 0L, SEEK_SET);
u32ReadSize = fread(pu8Buf, 1, u32MallocSize, pstFD);
if (u32ReadSize != u32MallocSize) {
HAPI_MEDIA_LOG_E("read file '%s' failed!\n", pcFileName);
HAPI_MEDIA_FREE(pu8Buf);
pu8Buf = SA_NULL;
s32Ret = SA_FAILURE;
}
fclose(pstFD);
*pu32FileSize = u32ReadSize;
*ppu8FileBuf = pu8Buf;
return s32Ret;
}
SA_U32 SAMPLE_MEDIA_Aton(SA_CHAR *strIp, SA_BOOL bEndian)
{
struct in_addr stInAddr;
inet_aton(strIp, &stInAddr);
if (SA_TRUE == bEndian) {
return ntohl(stInAddr.s_addr);
} else {
return stInAddr.s_addr;
}
}
SA_S32 SAMPLE_MEDIA_Load_Config(const SA_CHAR *strConfigFile)
{
SA_S32 s32Ret = SA_SUCCESS;
SA_U32 u32Pos = 0;
SA_U32 u32PosSecond = 0;
SA_U32 u32Size = 0;
SA_U32 s32Count = 0;
SA_U32 s32CountSecond = 0;
SA_U32 u32ReadLen = 0;
SA_CHAR strValue[64] = {0};
SA_U8 *pu8Buffer = SA_NULL;
saJSON *pstRoot = SA_NULL;
SA_MEDIA_VIDEO_CONFIG_S *pstVideoConfig = &g_stMediaCfg.stVideoConfig;
SA_MEDIA_CAPTURE_CONFIG_S *pstCaptureConfig = &g_stMediaCfg.stCaptureConfig;
SA_MEDIA_RECORD_CONFIG_S *pstRecordConfig = &g_stMediaCfg.stRecordConfig;
SA_MEDIA_SVP_CONFIG_S *pstSvpConfig = &g_stMediaCfg.stSvpConfig;
if (SA_NULL == strConfigFile) {
HAPI_MEDIA_LOG_E("config file name is null!");
return SA_FAILURE;
}
s32Ret = SAMPLE_MEDIA_DupFile(strConfigFile, &pu8Buffer, &u32ReadLen);
if (SA_SUCCESS != s32Ret) {
HAPI_MEDIA_LOG_W("SAMPLE_MEDIA_DupFile failed with %#x!", s32Ret);
return s32Ret;
}
pstRoot = saJSON_Parse((const char*)pu8Buffer);
if (SA_NULL == pstRoot) {
HAPI_MEDIA_FREE(pu8Buffer);
HAPI_MEDIA_LOG_E("parse config file '%s' failed!", strConfigFile);
return SA_FAILURE;
}
SA_CHAR strJsonDoc[32] = {0};
saJSON_GetString_Default(pstRoot, "doc", strJsonDoc, "");
if (strcmp(strJsonDoc, "media")) {
HAPI_MEDIA_LOG_E("using wrong config file!");
return SA_FAILURE;
}
SA_CHAR strJsonVer[32] = {0};
MEDIA_JSON_NODE_ASSERT(saJSON_GetString(pstRoot, "version", strJsonVer, SA_TRUE));
SA_U32 u32Version = SAMPLE_MEDIA_Aton(strJsonVer, SA_TRUE);
if (((u32Version >> 24) & 0xFF) != MEDIA_VER_MAJOR || ((u32Version >> 16) & 0xFF) != MEDIA_VER_MINOR || ((u32Version >> 8) & 0xFF) != MEDIA_VER_DEVELOP) {
HAPI_MEDIA_LOG_E("json version(%s) is not match to media version(%d.%d.%d.x)", strJsonVer, MEDIA_VER_MAJOR, MEDIA_VER_MINOR, MEDIA_VER_DEVELOP);
return SA_FAILURE;
}
//scene
memset(strValue, 0, sizeof(strValue));
MEDIA_JSON_NODE_ASSERT(saJSON_GetString(pstRoot, "scene", strValue, SA_TRUE));
if (strcmp(strValue, "capture") == SA_SUCCESS) {
g_enSampleScene = SA_MEDIA_SCENE_CAPTURE;
} else if (strcmp(strValue, "record") == SA_SUCCESS) {
g_enSampleScene = SA_MEDIA_SCENE_RECORD;
} else if (strcmp(strValue, "captureaddrecord") == SA_SUCCESS) {
g_enSampleScene = SA_MEDIA_SCENE_CAPTURE_RECORD;
} else if (strcmp(strValue, "visual") == SA_SUCCESS) {
g_enSampleScene = SA_MEDIA_SCENE_VISUAL;
} else {
HAPI_MEDIA_LOG_E("wrong scene '%s'.", strValue);
}
//video
saJSON *pstVideo = saJSON_GetObjectItem(pstRoot, "video");
MEDIA_JSON_NULL_ASSERT(pstVideo);
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstVideo, "SensorType", &pstVideoConfig->enSensorType, SA_MEDIA_SNS_TYPE_IMX681));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstVideo, "SensorMode", &pstVideoConfig->enSensorMode, SA_MEDIA_SNS_MODE_LINEAR));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstVideo, "ViDev", &pstVideoConfig->s32ViDev, 0));
MEDIA_JSON_NODE_ASSERT(saJSON_GetFloat(pstVideo, "MaxFps", &pstVideoConfig->f32MaxFps, 15.0));
MEDIA_JSON_NODE_ASSERT(saJSON_GetFloat(pstVideo, "MinFps", &pstVideoConfig->f32MinFps, 15.0));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstVideo, "Mirror", &pstVideoConfig->bMirror, SA_FALSE));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstVideo, "Flip", &pstVideoConfig->bFlip, SA_FALSE));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstVideo, "Rotation", &pstVideoConfig->enRotation, VI_GDC_ROTATE_0));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstVideo, "Gdc", &pstVideoConfig->bGdc, SA_FALSE));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstVideo, "FilterColor", &pstVideoConfig->enFilterColor, SA_MEDIA_COLOR_FILTER_NORMAL));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstVideo, "ProEnable", &pstVideoConfig->stProAttr.bProEnable, SA_FALSE));
if (SA_TRUE == pstVideoConfig->stProAttr.bProEnable) {
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstVideo, "ISO", &pstVideoConfig->stProAttr.u16ISO, 100));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstVideo, "AWBCt", &pstVideoConfig->stProAttr.u16AWBCt, 5000));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstVideo, "SportEnable", &pstVideoConfig->stProAttr.stSportMode.bSportEnable, 5000));
if (SA_TRUE == pstVideoConfig->stProAttr.stSportMode.bSportEnable) {
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstVideo, "MaxIntTime", &pstVideoConfig->stProAttr.stSportMode.u32MaxIntTime, 66000));
}
}
saJSON *pstVencArray = saJSON_GetObjectItem(pstVideo, "venc");
MEDIA_JSON_NULL_ASSERT(pstVencArray);
s32Count = saJSON_GetArraySize(pstVencArray);
for (u32Pos = 0; u32Pos < s32Count && u32Pos < SA_MEDIA_SCENE_CAPTURE_RECORD; u32Pos++) {
saJSON *pstVencNode = saJSON_GetArrayItem(pstVencArray, u32Pos);
MEDIA_JSON_NULL_ASSERT(pstVencNode);
if(1 == u32Pos) {
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstVencNode, "CodeType", &pstVideoConfig->astVencConfig[u32Pos].enEncodeType, VENC_ENCODE_TYPE_H265));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstVencNode, "Qfactor", &pstVideoConfig->astVencConfig[u32Pos].u8Qfactor, 80));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstVencNode, "RcMode", &pstVideoConfig->astVencConfig[u32Pos].enRcMode, VENC_RC_MODE_CBR));
}
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstVencNode, "Width", &pstVideoConfig->astVencConfig[u32Pos].stResolution.u32Width, 1920));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstVencNode, "Height", &pstVideoConfig->astVencConfig[u32Pos].stResolution.u32Height, 1080));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstVencNode, "Bitrate", &pstVideoConfig->astVencConfig[u32Pos].u32Bitrate, 2048000));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstVencNode, "SmartEncoder", &pstVideoConfig->astVencConfig[u32Pos].enSmartEncoder, SA_MEDIA_SMART_ENCODER_NONE));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstVencNode, "SmartSEI", &pstVideoConfig->astVencConfig[u32Pos].bSmartSEI, SA_FALSE));
saJSON *pstRegionArray = saJSON_GetObjectItem(pstVencNode, "region");
MEDIA_JSON_NULL_ASSERT(pstRegionArray);
s32CountSecond = saJSON_GetArraySize(pstRegionArray);
for (u32PosSecond = 0; u32PosSecond < s32CountSecond && u32PosSecond < SA_MEDIA_RGN_CHN_MAX; u32PosSecond++) {
saJSON *pstRegionNode = saJSON_GetArrayItem(pstRegionArray, u32PosSecond);
MEDIA_JSON_NULL_ASSERT(pstRegionNode);
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstRegionNode, "Enable", &pstVideoConfig->astVencConfig[u32Pos].astRegion[u32PosSecond].bEnable, SA_FALSE));
if (SA_TRUE == pstVideoConfig->astVencConfig[u32Pos].astRegion[u32PosSecond].bEnable) {
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstRegionNode, "Type", &pstVideoConfig->astVencConfig[u32Pos].astRegion[u32PosSecond].enType, SA_MEDIA_RGN_TYPE_TIMESTAMP));
if (SA_MEDIA_RGN_TYPE_IMAGE == pstVideoConfig->astVencConfig[u32Pos].astRegion[u32PosSecond].enType) {
MEDIA_JSON_NODE_ASSERT(saJSON_GetString(pstRegionNode, "ImageFile", pstVideoConfig->astVencConfig[u32Pos].astRegion[u32PosSecond].astrImageFile, SA_TRUE));
}
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstRegionNode, "X", &pstVideoConfig->astVencConfig[u32Pos].astRegion[u32PosSecond].stRect.s32X, 32));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstRegionNode, "Y", &pstVideoConfig->astVencConfig[u32Pos].astRegion[u32PosSecond].stRect.s32Y, 32));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstRegionNode, "Width", &pstVideoConfig->astVencConfig[u32Pos].astRegion[u32PosSecond].stRect.u32Width, 256));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstRegionNode, "Height", &pstVideoConfig->astVencConfig[u32Pos].astRegion[u32PosSecond].stRect.u32Height, 128));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstRegionNode, "Color0", &pstVideoConfig->astVencConfig[u32Pos].astRegion[u32PosSecond].u32RgbColor[0], 0xFFFFFF));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstRegionNode, "Color1", &pstVideoConfig->astVencConfig[u32Pos].astRegion[u32PosSecond].u32RgbColor[1], 0x5E2BD2));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstRegionNode, "Color2", &pstVideoConfig->astVencConfig[u32Pos].astRegion[u32PosSecond].u32RgbColor[2], 0xFF8445));
}
}
}
saJSON *pstSdNode = saJSON_GetObjectItem(pstVideo, "sd");
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstSdNode, "SdMode", &pstVideoConfig->stSdConfig.enSdMode, SA_MEDIA_SD_AUTO));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstSdNode, "SceneType", &pstVideoConfig->stSdConfig.enSceneType, SA_MEDIA_SD_COLOR_OUTDOOR));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstSdNode, "WdrMode", &pstVideoConfig->stSdConfig.enWdrMode, SA_MEDIA_SD_WDRMODE_NONE));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstSdNode, "MaxInttimeEnable", &pstVideoConfig->stSdConfig.stExpAttr.stIntTimeAttr.bEnable, SA_FALSE));
if (SA_TRUE == pstVideoConfig->stSdConfig.stExpAttr.stIntTimeAttr.bEnable) {
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstSdNode, "IntTimeMax", &pstVideoConfig->stSdConfig.stExpAttr.stIntTimeAttr.u32IntTimeMax, 30000));
}
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstSdNode, "RoiEnable", &pstVideoConfig->stSdConfig.stExpAttr.stRoiAttr.bEnable, SA_FALSE));
if (SA_TRUE == pstVideoConfig->stSdConfig.stExpAttr.stRoiAttr.bEnable) {
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstSdNode, "X", &pstVideoConfig->stSdConfig.stExpAttr.stRoiAttr.stRoiSizeAttr.u16X, 0));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstSdNode, "Y", &pstVideoConfig->stSdConfig.stExpAttr.stRoiAttr.stRoiSizeAttr.u16Y, 0));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstSdNode, "Width", &pstVideoConfig->stSdConfig.stExpAttr.stRoiAttr.stRoiSizeAttr.u16Width, 1920));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstSdNode, "Height", &pstVideoConfig->stSdConfig.stExpAttr.stRoiAttr.stRoiSizeAttr.u16Height, 1080));
}
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstSdNode, "StrategyMode", &pstVideoConfig->stSdConfig.stExpAttr.stStrategyAttr.enMode, EXP_STRATEGY_NORMAL));
if (EXP_STRATEGY_NORMAL != pstVideoConfig->stSdConfig.stExpAttr.stStrategyAttr.enMode) {
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstSdNode, "Strength", &pstVideoConfig->stSdConfig.stExpAttr.stStrategyAttr.u32Strength, 100));
}
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstSdNode, "FlickerEnable", &pstVideoConfig->stSdConfig.stExpAttr.stFlickerAttr.bEnable, SA_FALSE));
if (SA_TRUE == pstVideoConfig->stSdConfig.stExpAttr.stFlickerAttr.bEnable) {
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstSdNode, "Frequency", &pstVideoConfig->stSdConfig.stExpAttr.stFlickerAttr.u8Frequency, 50));
}
saJSON *pstIspFileArray = saJSON_GetObjectItem(pstVideo, "IspFile");
if (SA_NULL != pstIspFileArray) {
u32Size = saJSON_GetArraySize(pstIspFileArray);
for (SA_S32 i = 0; i < u32Size && i < SA_MEDIA_ISP_BIN_PATH_NUM; i++) {
saJSON *pstIspFileNode = saJSON_GetArrayItem(pstIspFileArray, i);
MEDIA_JSON_NULL_ASSERT(pstIspFileNode);
MEDIA_JSON_NODE_ASSERT(saJSON_GetString(pstIspFileNode, SA_NULL, pstVideoConfig->astrIspFile[i], SA_TRUE));
}
}
MEDIA_JSON_NODE_ASSERT(saJSON_GetString(pstVideo, "AinrFile", pstVideoConfig->astrAinrFile, SA_TRUE));
//end of video
//capture
saJSON *pstCapture = saJSON_GetObjectItem(pstRoot, "capture");
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstCapture, "BokehEnable", &pstCaptureConfig->bBokehEnable, SA_FALSE));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstCapture, "MFNREnable", &pstCaptureConfig->bMFNREnable, SA_FALSE));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstCapture, "HDREnable", &pstCaptureConfig->bHDREnable, SA_FALSE));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstCapture, "ZSLEnable", &pstCaptureConfig->bZSLEnable, SA_FALSE));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstCapture, "BeautyEnable", &pstCaptureConfig->stBeautyCfg.bBeautyEnable, SA_FALSE));
if (SA_TRUE == pstCaptureConfig->stBeautyCfg.bBeautyEnable) {
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstCapture, "Strength", &pstCaptureConfig->stBeautyCfg.u8Strength, 50));
}
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstCapture, "SaveEnable", &pstCaptureConfig->stSaveCfg.bSaveEnable, SA_TRUE));
if (SA_TRUE == pstCaptureConfig->stSaveCfg.bSaveEnable) {
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstCapture, "SaveFormat", &pstCaptureConfig->stSaveCfg.enSaveFormat, SA_MEDIA_CAPTURE_SAVE_JPEG));
MEDIA_JSON_NODE_ASSERT(saJSON_GetString(pstCapture, "SaveFilePath", pstCaptureConfig->stSaveCfg.astrSaveFilePath, SA_TRUE));
}
//end of capture
//record
saJSON *pstRecord = saJSON_GetObjectItem(pstRoot, "record");
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstRecord, "EISMode", &pstRecordConfig->enEISMode, VI_EIS_DISABLE));
saJSON *pstAudio = saJSON_GetObjectItem(pstRecord, "audio");
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstAudio, "AudioEnable", &pstRecordConfig->stAudioConfig.stAudioInConfig.bAudioEnable, SA_FALSE));
if (SA_TRUE == pstRecordConfig->stAudioConfig.stAudioInConfig.bAudioEnable) {
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstAudio, "SampleRate", &pstRecordConfig->stAudioConfig.stAudioInConfig.enSampleRate, SA_MEDIA_AUDIO_SAMPLE_RATE_16000));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstAudio, "SoundMode", &pstRecordConfig->stAudioConfig.stAudioInConfig.enSoundMode, SA_MEDIA_AUDIO_SOUND_MODE_MONO));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstAudio, "EncType", &pstRecordConfig->stAudioConfig.stAudioInConfig.enEncType, SA_MEDIA_AUDIO_CODEC_TYPE_LCAAC));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstAudio, "VqeEnable", &pstRecordConfig->stAudioConfig.stAudioInConfig.bVqeEnable, SA_FALSE));
if (SA_TRUE == pstRecordConfig->stAudioConfig.stAudioInConfig.bAudioEnable) {
MEDIA_JSON_NODE_ASSERT(saJSON_GetString(pstCapture, "VqeParamFile", pstRecordConfig->stAudioConfig.stAudioInConfig.strVqeParamFile, SA_TRUE));
}
}
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstCapture, "SaveEnable", &pstRecordConfig->stSaveCfg.bSaveEnable, SA_TRUE));
if (SA_TRUE == pstRecordConfig->stSaveCfg.bSaveEnable) {
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstCapture, "SaveFormat", &pstRecordConfig->stSaveCfg.enSaveFormat, SA_MEDIA_RECORD_SAVE_265));
MEDIA_JSON_NODE_ASSERT(saJSON_GetString(pstCapture, "SaveFilePath", pstRecordConfig->stSaveCfg.astrSaveFilePath, SA_TRUE));
}
//end of record
//svp
saJSON *pstSvp = saJSON_GetObjectItem(pstRoot, "svp");
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstSvp, "OCREnable", &pstSvpConfig->bOCREnable, SA_FALSE));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstSvp, "QRCodeEnable", &pstSvpConfig->bQRCodeEnable, SA_FALSE));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstSvp, "FaceDetEnable", &pstSvpConfig->bFaceDetEnable, SA_FALSE));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstSvp, "PeopleDetEnable", &pstSvpConfig->bPeopleDetEnable, SA_FALSE));
MEDIA_JSON_NODE_ASSERT(saJSON_GetInt(pstSvp, "SmartAeEnable", &pstSvpConfig->bSmartAeEnable, SA_FALSE));
//end of svp
saJSON_Delete(pstRoot);
HAPI_MEDIA_FREE(pu8Buffer);
HAPI_MEDIA_LOG_I("load config file '%s' successful!\n", strConfigFile);
return SA_SUCCESS;
}
static int SAMPLE_MEDIA_Args(int s32Argc, char **ppArgv) static int SAMPLE_MEDIA_Args(int s32Argc, char **ppArgv)
{ {
int s32Ret = SA_SUCCESS; int s32Ret = SA_SUCCESS;
int s32Opt = 0; int s32Opt = 0;
char *pOptString = "h:x:c:r:a:d:g:"; char *pOptString = "h:x:c:r:a:d:g:j:";
optind = 0;//rtt need clear. optind = 0;//rtt need clear.
if (s32Argc < 2) { if (s32Argc < 2) {
...@@ -454,29 +745,29 @@ static int SAMPLE_MEDIA_Args(int s32Argc, char **ppArgv) ...@@ -454,29 +745,29 @@ static int SAMPLE_MEDIA_Args(int s32Argc, char **ppArgv)
while ((s32Opt = getopt(s32Argc, ppArgv, pOptString)) != -1) { while ((s32Opt = getopt(s32Argc, ppArgv, pOptString)) != -1) {
switch (s32Opt) { switch (s32Opt) {
case 'c': case 'c':
g_enSampleScene = SA_MEDIA_SCENE_CAPTURE;
g_s32CaptureNum = atoi(optarg); g_s32CaptureNum = atoi(optarg);
HAPI_MEDIA_LOG_I("MediaScene:SA_MEDIA_SCENE_CAPTURE,capture num:%d\n",g_s32CaptureNum); HAPI_MEDIA_LOG_I("capture num:%d\n",g_s32CaptureNum);
break; break;
case 'r': case 'r':
g_enSampleScene = SA_MEDIA_SCENE_RECORD;
g_u32RecordDuration = atoi(optarg); g_u32RecordDuration = atoi(optarg);
HAPI_MEDIA_LOG_I("MediaScene:SA_MEDIA_SCENE_RECORD,record duration:%dms\n",g_u32RecordDuration); HAPI_MEDIA_LOG_I("record duration:%dms\n",g_u32RecordDuration);
break;
case 'a':
g_enSampleScene = SA_MEDIA_SCENE_CAPTURE_RECORD;
HAPI_MEDIA_LOG_I("MediaScene:SA_MEDIA_SCENE_RECORD,capture num:1,record duration:3000ms\n");
break; break;
case 'd': case 'd':
g_s8DropFrame = atoi(optarg); g_s8DropFrame = atoi(optarg);
HAPI_MEDIA_LOG_I("drop frames num:%d\n",g_s8DropFrame); HAPI_MEDIA_LOG_I("drop frames num:%d\n",g_s8DropFrame);
break; break;
case 'g': case 'g':
g_enSampleScene = SA_MEDIA_SCENE_CAPTURE_RECORD;
g_s32TestMode = 1; g_s32TestMode = 1;
g_bRtsp = SA_TRUE; g_bRtsp = SA_TRUE;
HAPI_MEDIA_LOG_I("rtsp mode\n"); HAPI_MEDIA_LOG_I("rtsp mode\n");
break; break;
case 'j':
s32Ret = SAMPLE_MEDIA_Load_Config(optarg);
if (SA_SUCCESS != s32Ret) {
HAPI_MEDIA_LOG_E("SAMPLE_MEDIA_Load_Config failed with %#x!\n", s32Ret);
return s32Ret;
}
break;
case 'h': case 'h':
SAMPLE_MEDIA_Help(ppArgv[0]); SAMPLE_MEDIA_Help(ppArgv[0]);
return SA_FAILURE; return SA_FAILURE;
...@@ -575,15 +866,6 @@ SA_VOID SAMPLE_MEDIA_VencProc(SA_VOID *p) ...@@ -575,15 +866,6 @@ SA_VOID SAMPLE_MEDIA_VencProc(SA_VOID *p)
} else { } else {
s32OffsetChn = 0; s32OffsetChn = 0;
} }
// if(-1 == fdStream){
// fdStream = open("/acme/leo.h265", O_RDWR | O_CREAT | O_TRUNC, 0666);
// printf("leo############fdStream:%d\n",fdStream);
// }
// if(-1 != fdStream){
// writeret = write(fdStream,pstPack->pu8Addr, pstPack->u32Len);
// printf("leo############writeret:%d\n",writeret);
// }
s32Ret = RTSP_SendFrame(s32OffsetChn, pstPack->pu8Addr, pstPack->u32Len, pstPack->u64PTS / 1000); s32Ret = RTSP_SendFrame(s32OffsetChn, pstPack->pu8Addr, pstPack->u32Len, pstPack->u64PTS / 1000);
if (SA_SUCCESS != s32Ret) { if (SA_SUCCESS != s32Ret) {
...@@ -691,8 +973,7 @@ void SAMPLE_MEDIA_Work(void *p) ...@@ -691,8 +973,7 @@ void SAMPLE_MEDIA_Work(void *p)
HAPI_MEDIA_LOG_E("SA_HAPI_SYS_SetWorkMode %d failed with %#x!\n", stMediaAttr.enSysMode, s32Ret); HAPI_MEDIA_LOG_E("SA_HAPI_SYS_SetWorkMode %d failed with %#x!\n", stMediaAttr.enSysMode, s32Ret);
return; return;
} }
HAPI_MEDIA_LOG_I("media scene:%d\n",*penSceneEntry);
//测试旋转
s32Ret = SA_HAPI_MEDIA_GetAttr(*penSceneEntry, &g_stMediaCfg, &stMediaAttr); s32Ret = SA_HAPI_MEDIA_GetAttr(*penSceneEntry, &g_stMediaCfg, &stMediaAttr);
if (SA_SUCCESS != s32Ret) { if (SA_SUCCESS != s32Ret) {
HAPI_MEDIA_LOG_E("SA_HAPI_MEDIA_GetAttr failed with %#x!\n", s32Ret); HAPI_MEDIA_LOG_E("SA_HAPI_MEDIA_GetAttr failed with %#x!\n", s32Ret);
...@@ -769,10 +1050,13 @@ void SAMPLE_MEDIA_Work(void *p) ...@@ -769,10 +1050,13 @@ void SAMPLE_MEDIA_Work(void *p)
HAPI_MEDIA_MDELAY(g_u32RecordDuration); HAPI_MEDIA_MDELAY(g_u32RecordDuration);
SA_HAPI_MEDIA_Record(SA_FALSE); SA_HAPI_MEDIA_Record(SA_FALSE);
} else if (SA_MEDIA_SCENE_CAPTURE_RECORD == *penSceneEntry) { } else if (SA_MEDIA_SCENE_CAPTURE_RECORD == *penSceneEntry) {
s32Ret = SA_HAPI_MEDIA_Capture(SA_NULL); for (int i = 0; i < g_s32CaptureNum; i++) {
if (SA_SUCCESS != s32Ret) { s32Ret = SA_HAPI_MEDIA_Capture(SA_NULL);
HAPI_MEDIA_LOG_E("SA_HAPI_MEDIA_Capture failed with %#x!\n", s32Ret); if (SA_SUCCESS != s32Ret) {
goto EXIT_VIDEO_STOP; HAPI_MEDIA_LOG_E("SA_HAPI_MEDIA_Capture failed with %#x!\n", s32Ret);
goto EXIT_VIDEO_STOP;
}
HAPI_MEDIA_LOG_I("SA_HAPI_MEDIA_Capture[%d] ok\n",i);
} }
SA_HAPI_MEDIA_Record(SA_TRUE); SA_HAPI_MEDIA_Record(SA_TRUE);
HAPI_MEDIA_MDELAY(g_u32RecordDuration); HAPI_MEDIA_MDELAY(g_u32RecordDuration);
......
...@@ -18,19 +18,25 @@ if [ $# -ne 1 ]; then ...@@ -18,19 +18,25 @@ if [ $# -ne 1 ]; then
else else
printf "convert image ...\n" printf "convert image ...\n"
${simg2img} $1 /mnt/sdcard/system.raw ${simg2img} $1 /mnt/sdcard/system.raw
rm ${simg2img}
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
printf "convert image failed!\n" printf "convert image failed!\n"
exit exit
fi fi
rm ${simg2img}
printf "write image ...\n" printf "write image ...\n"
lsof |grep "/acme" |awk '{print $1}' |xargs kill -9
umount /acme
lsof
dd if=/mnt/sdcard/system.raw of=/dev/mmcblk0p2 bs=1M dd if=/mnt/sdcard/system.raw of=/dev/mmcblk0p2 bs=1M
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
printf "write image failed!\n" printf "write image failed!\n"
exit exit
fi fi
sync sync
rm -rf /mnt/sdcard/system.raw dd if=/dev/mmcblk0p2 of=/mnt/sdcard/system.raw.new bs=1M
sync
md5sum /mnt/sdcard/system.raw*
rm -rf /mnt/sdcard/system.raw*
printf "write image success!\n" printf "write image success!\n"
fi fi
exit exit
diff --git a/sdk/opensource/lib/libhapi_open.so.2.5.0.4.9 b/sdk/opensource/lib/libhapi_open.so.2.5.0.4.9
index d5cc4fd72..e0b6e3261 100755
Binary files a/sdk/opensource/lib/libhapi_open.so.2.5.0.4.9 and b/sdk/opensource/lib/libhapi_open.so.2.5.0.4.9 differ
diff --git a/sdk/opensource/lib/libhapi_open_static.a b/sdk/opensource/lib/libhapi_open_static.a
index 31c5f3d77..51ecf1b5b 100644
Binary files a/sdk/opensource/lib/libhapi_open_static.a and b/sdk/opensource/lib/libhapi_open_static.a differ
diff --git a/sdk/opensource/lib/libsns_os04d10_soc30.so.2.5.0.4.9 b/sdk/opensource/lib/libsns_os04d10_soc30.so.2.5.0.4.9
index a76baabbb..93fec0e57 100755
Binary files a/sdk/opensource/lib/libsns_os04d10_soc30.so.2.5.0.4.9 and b/sdk/opensource/lib/libsns_os04d10_soc30.so.2.5.0.4.9 differ
diff --git a/sdk/opensource/source/sensor/comm/isp_ext.c b/sdk/opensource/source/sensor/comm/isp_ext.c diff --git a/sdk/opensource/source/sensor/comm/isp_ext.c b/sdk/opensource/source/sensor/comm/isp_ext.c
index 9939fff8a..b847aaf7a 100755 index 9939fff8a..b847aaf7a 100755
--- a/sdk/opensource/source/sensor/comm/isp_ext.c --- a/sdk/opensource/source/sensor/comm/isp_ext.c
......
...@@ -6,6 +6,17 @@ max_retries=20 ...@@ -6,6 +6,17 @@ max_retries=20
check_interval=2 check_interval=2
retries=0 retries=0
check_ip_address() {
ip_address=$(ifconfig wlan0 | grep 'inet ' | awk '{print $2}')
if [ "$ip_address" = "0.0.0.0" ]; then
echo "WIFI IP address is 0.0.0.0, indicating a problem with the connection."
return 1
else
echo "WIFI IP address is $ip_address."
return 0
fi
}
if lsmod | grep -q socchannel; then if lsmod | grep -q socchannel; then
echo "Module socchannel has already been installed." echo "Module socchannel has already been installed."
else else
...@@ -42,7 +53,7 @@ while [ ! -f "$file_path" ]; do ...@@ -42,7 +53,7 @@ while [ ! -f "$file_path" ]; do
done done
echo "link......." echo "link......."
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 for i in 1 2 3 4 5 6
do do
sample_cli getmac sample_cli getmac
sample_cli getip sample_cli getip
...@@ -52,6 +63,8 @@ do ...@@ -52,6 +63,8 @@ do
exit 1 exit 1
else else
echo "WIFI access to internet error, wait sometime!" echo "WIFI access to internet error, wait sometime!"
exit 0
fi fi
done done
\ No newline at end of file echo "Failed to access the internet after multiple attempts."
exit 0
\ No newline at end of file
#!/bin/sh
#if [ -e "/sys/devices/system/cpu/cpufreq/policy0/scaling_governor" ]; then
#echo "performance" >/sys/devices/system/cpu/cpufreq/policy0/scaling_governor
#fi
ko_dir=/acme/lib/modules
echo 1 >/proc/acme-wdt
# Enable TMI8150B
if [ ! -e /sys/class/gpio/gpio89 ]; then
echo 89 >/sys/class/gpio/export
fi
echo out >/sys/class/gpio/gpio89/direction
echo 1 >/sys/class/gpio/gpio89/value
machine=`uname -m`
if [ ${machine} = "aarch64" ];then
/sbin/insmod ${ko_dir}/osal/osaldrv.ko anony=1 mmz_allocator=superacme mmz=anonymous,0,0x68000000,128M:sram,0,0x201E0000,4352K
else
/sbin/insmod ${ko_dir}/osal/osaldrv.ko anony=1 mmz_allocator=superacme mmz=anonymous,0,0x66000000,160M:sram,0,0x201E0000,4352K
fi
# dtbo
mkdir -p /sys/kernel/config/device-tree/overlays/sdk
cat ${ko_dir}/sa6920-ipc-sdk.dtbo >/sys/kernel/config/device-tree/overlays/sdk/dtbo
# common ko
/sbin/insmod ${ko_dir}/hwticks.ko
/sbin/insmod ${ko_dir}/osal/savdma.ko
/sbin/insmod ${ko_dir}/osal/sys.ko
/sbin/insmod ${ko_dir}/dvfs.ko
# vpu drivers
/sbin/insmod ${ko_dir}/venc.ko
/sbin/insmod ${ko_dir}/jpege.ko
/sbin/insmod ${ko_dir}/jpegd.ko
/sbin/insmod ${ko_dir}/vi.ko
/sbin/insmod ${ko_dir}/sa_mipi_rx.ko
/sbin/insmod ${ko_dir}/imu_i2c.ko
# ISP drivers
/sbin/insmod ${ko_dir}/isp_lli.ko
/sbin/insmod ${ko_dir}/isp_h3a.ko
/sbin/insmod ${ko_dir}/isp_fe.ko
/sbin/insmod ${ko_dir}/vpss.ko
/sbin/insmod ${ko_dir}/isp_pe.ko
/sbin/insmod ${ko_dir}/isp_be.ko
/sbin/insmod ${ko_dir}/isp_gdc.ko
/sbin/insmod ${ko_dir}/isp.ko
# filter drivers
/sbin/insmod ${ko_dir}/isplite.ko
/sbin/insmod ${ko_dir}/ispctrl.ko
# anne drivers & audio drivers
model=$(cat /proc/device-tree/model)
echo $model
if echo "$model" | grep -q "pt2l" ; then
/sbin/insmod ${ko_dir}/snd-soc-sa8901.ko async_probe=1
elif echo "$model" | grep -q "c2" ; then
/sbin/insmod ${ko_dir}/snd-soc-sa8901.ko async_probe=1
elif echo "$model" | grep -q "bc4e" ; then
/sbin/insmod ${ko_dir}/snd-soc-sa8901.ko async_probe=1
else
/sbin/insmod ${ko_dir}/snd-soc-sa8900.ko async_probe=1
fi
/sbin/insmod ${ko_dir}/designware_i2s.ko async_probe=1
/sbin/insmod ${ko_dir}/snd-soc-simple-card-utils.ko async_probe=1
/sbin/insmod ${ko_dir}/snd-soc-simple-card.ko async_probe=1
/sbin/insmod ${ko_dir}/anne.ko
/sbin/insmod ${ko_dir}/audio_ctrl.ko
# bpm
/sbin/insmod ${ko_dir}/osal/bpm.ko
# sensor i2c
mkdir -p /sys/kernel/config/device-tree/overlays/i2c
cat ${ko_dir}/sa6920-i2c.dtbo >/sys/kernel/config/device-tree/overlays/i2c/dtbo
#dmatest
#/sbin/insmod ${ko_dir}/dmatest.ko
# vnne
/sbin/insmod ${ko_dir}/vnne.ko
# npu
/sbin/insmod ${ko_dir}/npu_heron_svp.ko g_phy_addr=0xa0000000
# aisp
/sbin/insmod ${ko_dir}/aisp.ko
# pwm
/sbin/insmod ${ko_dir}/pwm-acme.ko
#pstore
/sbin/insmod ${ko_dir}/pstore.ko
/sbin/insmod ${ko_dir}/reed_solomon.ko
/sbin/insmod ${ko_dir}/ramoops.ko
# bus qos
/acme/bin/tzc400 -R 0x5d042100 -V 0x1 # filter read qos
/acme/bin/tzc400 -R 0x5d042104 -V 0x1 # filter write qos
/acme/bin/tzc400 -R 0x5d043100 -V 0x0 # cpu read qos
/acme/bin/tzc400 -R 0x5d043104 -V 0x0 # cpu write qos
/acme/bin/tzc400 -R 0x5d044100 -V 0x1 # isp read qos
/acme/bin/tzc400 -R 0x5d044104 -V 0x1 # isp write qos
/acme/bin/tzc400 -R 0x5d047100 -V 0x0 # vpu read qos
/acme/bin/tzc400 -R 0x5d047104 -V 0x0 # vpu write qos
/acme/bin/tzc400 -R 0x5d048100 -V 0x0 # npu read qos
/acme/bin/tzc400 -R 0x5d048104 -V 0x0 # npu write qos
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
/usr/bin/head -n 9 /dev/mtdblock5 > /tmp/devinfo.config /usr/bin/head -n 9 /dev/mtdblock5 > /tmp/devinfo.config
/sbin/insmod /acme/lib/modules/acme_rpmsg_rpc_app.ko /sbin/insmod /acme/lib/modules/acme_rpmsg_rpc_app.ko
/sbin/insmod /acme/lib/modules/pt_motor.ko /sbin/insmod /acme/lib/modules/pt_motor.ko
/bin/sh /acme/scripts/load_pt2_linux_all.sh /bin/sh /acme/scripts/load_longse_linux_all.sh
/sbin/insmod /acme/lib/modules/socchannel.ko int_gpio=25 /sbin/insmod /acme/lib/modules/socchannel.ko int_gpio=25
/acme/bin/vlink_socchannel_main > /dev/null 2>&1 & /acme/bin/vlink_socchannel_main > /dev/null 2>&1 &
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment