这边文章记录的是1280x800=1.6屏幕分辨率预览窗口大小,sensor预览实际出图为4656x3496。
(1)App设置不同的预览Size的Log分析
(A)预览Size=960x720=1.333(Surface窗口设置为4:3)——Hal层会进行resize成1280x976
//config
mtkcam-dev3-hidl: [0-hidl-session::configureStreams_3_6] +
mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] {.v3_2 = {.id = 0, .streamType = OUTPUT, .width = 960, .height = 720, .format = IMPLEMENTATION_DEFINED, .usage = CPU_READ_NEVER | CPU_WRITE_NEVER | GPU_TEXTURE (0x100), .dataSpace = UNKNOWN | STANDARD_UNSPECIFIED | TRANSFER_UNSPECIFIED | RANGE_UNSPECIFIED (0), .rotation = ROTATION_0}, .physicalCameraId = "", .bufferSize = 0}
mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] {.v3_2 = {.id = 1, .streamType = OUTPUT, .width = 4608, .height = 3456, .format = BLOB, .usage = CPU_READ_NEVER | CPU_READ_RARELY | CPU_READ_OFTEN | CPU_WRITE_NEVER (0x3), .dataSpace = UNKNOWN | STANDARD_UNSPECIFIED | STANDARD_BT601_625 | TRANSFER_UNSPECIFIED | TRANSFER_LINEAR | TRANSFER_SRGB | TRANSFER_SMPTE_170M | RANGE_UNSPECIFIED | RANGE_FULL | V0_JFIF (0x8c20000), .rotation = ROTATION_0}, .physicalCameraId = "", .bufferSize = 24346616}
mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] {.v3_2 = {.id = 2, .streamType = OUTPUT, .width = 192, .height = 144, .format = YCBCR_420_888, .usage = CPU_READ_NEVER | CPU_READ_RARELY | CPU_READ_OFTEN | CPU_WRITE_NEVER (0x3), .dataSpace = UNKNOWN | STANDARD_UNSPECIFIED | STANDARD_BT601_625 | TRANSFER_UNSPECIFIED | TRANSFER_LINEAR | TRANSFER_SRGB | TRANSFER_SMPTE_170M | RANGE_UNSPECIFIED | RANGE_FULL | V0_JFIF (0x8c20000), .rotation = ROTATION_0}, .physicalCameraId = "", .bufferSize = 0}
mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] operationMode=0
mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] streamId:0 type:OUT (w,h) = (960,720) format:34 usage:0x100 dataSpace:0 rotation:0 physicalCameraId: bufferSize:0
mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] streamId:1 type:OUT (w,h) = (4608,3456) format:33 usage:0x3 dataSpace:8c20000 rotation:0 physicalCameraId: bufferSize:1737ff8
mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] streamId:2 type:OUT (w,h) = (192,144) format:35 usage:0x3 dataSpace:8c20000 rotation:0 physicalCameraId: bufferSize:0//预览窗口
CamAp_PreviewManager: updatePreviewSize: new size (960 , 720 ) current size (0 , 0 )
CamAp_PreviewTextureView: previewWidth = 800, previewHeight = 1066, mAspectRatio = 1.3333333333333333//P1HwPolicy
mtkcam-P1HwSettingPolicy: [configP1HwSetting] max_rrzo_size: target size(2560x1922)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] maxYuvStreamSize is too small(960x720)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] maxYuvStreamSize set rrzo to 1280x960
mtkcam-P1HwSettingPolicy: [configP1HwSetting] sensor size: target size(4656x3496)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] target rrzo stream: target size(1280x961)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] eis lower bound limitation: target size(1280x962)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] preview upper bound limitation: target size(1280x962)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] rrzo size(1280x962)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] sensor size upper bound limitation: target size(1280x976)
mtkcam-P1HwSettingPolicy: aligned rrzo size(1280x976)//Hal resize
mtkcam-P1HwSettingPolicy: [queryRecommendResizeMaxRatio] Resize-Ratio-Percentage 25 for isp quality
MtkCam/HwInfoHelper: [querySupportResizeRatio] Support Resize-Ratio-Percentage: 25
MtkCam/HwInfoHelper: [alignRrzoHwLimitation] exceeding sensor size, modified size: 1280x976, original target size: 1280x976, crop size: 4656x3496
MtkCam/HwInfoHelper: [alignPass1HwLimitation] rrzo size 1280x976, stride 2400//P1Node
MtkCam/P1NodeImp: [setupAction] [Cam::0 R5 S5 E5 D2 O2 #1] [P1::ENQ][Num Q:5 M:5 F:4 R:4 @3][Type:1 Out:x15 Rec:x0 Raw:1 Cap:0 Exe:1 Flush:x0] [Exp:3068000ns] [MetaCtrl][SCALER_CROP(1) (0,0_4656x3496) ][SENSOR_CROP(0)][RESIZER_SET(0)]
MtkCam/P1NodeImp: [releaseAction] [Cam::0 R6 S6 E5 D3 O2 #1] [P1::DEQ][Num Q:3 M:3 F:2 R:2 @0][Type:1 Out:x15 Rec:x0 Raw:1 Cap:0 Exe:3 Flush:x0] job(0/1) IMG(pure) RRZ0(0-0-4656x3496)(0-0-1280x976)(1280x976) T-ns(EXP: 0)(Src:0)(SOF: m_1078259426000 b_22763963455000)(SS: 1078259426000) ExpExtend(0, 0)Q(SensorTs:1078
(B)预览Size=1600x1200=1.333(Surface窗口设置为4:3)——Hal层会进行resize成1600x1216
//config
10-27 06:09:30.267 940 940 D mtkcam-dev3-hidl: [0-hidl-session::configureStreams_3_6] +
10-27 06:09:30.267 940 940 D mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] {.v3_2 = {.id = 0, .streamType = OUTPUT, .width = 1600, .height = 1200, .format = IMPLEMENTATION_DEFINED, .usage = CPU_READ_NEVER | CPU_WRITE_NEVER | GPU_TEXTURE (0x100), .dataSpace = UNKNOWN | STANDARD_UNSPECIFIED | TRANSFER_UNSPECIFIED | RANGE_UNSPECIFIED (0), .rotation = ROTATION_0}, .physicalCameraId = "", .bufferSize = 0}
10-27 06:09:30.267 940 940 D mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] {.v3_2 = {.id = 1, .streamType = OUTPUT, .width = 4608, .height = 3456, .format = BLOB, .usage = CPU_READ_NEVER | CPU_READ_RARELY | CPU_READ_OFTEN | CPU_WRITE_NEVER (0x3), .dataSpace = UNKNOWN | STANDARD_UNSPECIFIED | STANDARD_BT601_625 | TRANSFER_UNSPECIFIED | TRANSFER_LINEAR | TRANSFER_SRGB | TRANSFER_SMPTE_170M | RANGE_UNSPECIFIED | RANGE_FULL | V0_JFIF (0x8c20000), .rotation = ROTATION_0}, .physicalCameraId = "", .bufferSize = 24346616}
10-27 06:09:30.267 940 940 D mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] {.v3_2 = {.id = 2, .streamType = OUTPUT, .width = 192, .height = 144, .format = YCBCR_420_888, .usage = CPU_READ_NEVER | CPU_READ_RARELY | CPU_READ_OFTEN | CPU_WRITE_NEVER (0x3), .dataSpace = UNKNOWN | STANDARD_UNSPECIFIED | STANDARD_BT601_625 | TRANSFER_UNSPECIFIED | TRANSFER_LINEAR | TRANSFER_SRGB | TRANSFER_SMPTE_170M | RANGE_UNSPECIFIED | RANGE_FULL | V0_JFIF (0x8c20000), .rotation = ROTATION_0}, .physicalCameraId = "", .bufferSize = 0}
10-27 06:09:30.267 940 940 D mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] operationMode=0
10-27 06:09:30.267 940 940 D mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] streamId:0 type:OUT (w,h) = (1600,1200) format:34 usage:0x100 dataSpace:0 rotation:0 physicalCameraId: bufferSize:0
10-27 06:09:30.267 940 940 D mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] streamId:1 type:OUT (w,h) = (4608,3456) format:33 usage:0x3 dataSpace:8c20000 rotation:0 physicalCameraId: bufferSize:1737ff8
10-27 06:09:30.267 940 940 D mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] streamId:2 type:OUT (w,h) = (192,144) format:35 usage:0x3 dataSpace:8c20000 rotation:0 physicalCameraId: bufferSize:0//预览窗口
CamAp_PreviewManager: updatePreviewSize: new size (1600 , 1200 ) current size (0 , 0 )
CamAp_PreviewTextureView: previewWidth = 800, previewHeight = 1066, mAspectRatio = 1.3333333333333333//P1HwPolicy
mtkcam-P1HwSettingPolicy: [configP1HwSetting] max_rrzo_size: target size(2560x1922)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] sensor size: target size(4656x3496)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] target rrzo stream: target size(1600x1201)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] eis lower bound limitation: target size(1600x1202)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] preview upper bound limitation: target size(1600x1202)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] rrzo size(1600x1202)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] sensor size upper bound limitation: target size(1600x1216)
mtkcam-P1HwSettingPolicy: aligned rrzo size(1600x1216)//Hal resize
mtkcam-P1HwSettingPolicy: [queryRecommendResizeMaxRatio] Resize-Ratio-Percentage 25 for isp quality
MtkCam/HwInfoHelper: [querySupportResizeRatio] Support Resize-Ratio-Percentage: 25
MtkCam/HwInfoHelper: [alignRrzoHwLimitation] exceeding sensor size, modified size: 1600x1216, original target size: 1600x1216, crop size: 4656x3496
MtkCam/HwInfoHelper: [alignPass1HwLimitation] rrzo size 1600x1216, stride 3008//P1Node
MtkCam/P1NodeImp: [setupAction] [Cam::0 R5 S5 E5 D2 O2 #1] [P1::ENQ][Num Q:5 M:5 F:4 R:4 @3][Type:1 Out:x15 Rec:x0 Raw:1 Cap:0 Exe:1 Flush:x0] [Exp:49995000ns] [MetaCtrl][SCALER_CROP(1) (0,0_4656x3496) ][SENSOR_CROP(0)][RESIZER_SET(0)]
MtkCam/P1NodeImp: [releaseAction] [Cam::0 R6 S6 E5 D3 O2 #1] [P1::DEQ][Num Q:3 M:3 F:2 R:2 @0][Type:1 Out:x15 Rec:x0 Raw:1 Cap:0 Exe:3 Flush:x0] job(0/1) IMG(pure) RRZ0(0-0-4656x3496)(0-0-1600x1216)(1600x1216) T-ns(EXP: 0)(Src:0)(SOF: m_1673252407000 b_23358956441000)(SS: 1673252407000) ExpExtend(0, 0)Q(SensorTs:16
(C)预览Size=1280x798=1.604(Surface窗口设置为4:3)——Hal层会进行resize成1280x976
//config
11-23 17:17:33.012 946 1133 D mtkcam-dev3-hidl: [0-hidl-session::configureStreams_3_6] +
11-23 17:17:33.012 946 1133 D mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] {.v3_2 = {.id = 0, .streamType = OUTPUT, .width = 1280, .height = 798, .format = IMPLEMENTATION_DEFINED, .usage = CPU_READ_NEVER | CPU_WRITE_NEVER | GPU_TEXTURE (0x100), .dataSpace = UNKNOWN | STANDARD_UNSPECIFIED | TRANSFER_UNSPECIFIED | RANGE_UNSPECIFIED (0), .rotation = ROTATION_0}, .physicalCameraId = "", .bufferSize = 0}
11-23 17:17:33.012 946 1133 D mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] {.v3_2 = {.id = 1, .streamType = OUTPUT, .width = 4608, .height = 3456, .format = BLOB, .usage = CPU_READ_NEVER | CPU_READ_RARELY | CPU_READ_OFTEN | CPU_WRITE_NEVER (0x3), .dataSpace = UNKNOWN | STANDARD_UNSPECIFIED | STANDARD_BT601_625 | TRANSFER_UNSPECIFIED | TRANSFER_LINEAR | TRANSFER_SRGB | TRANSFER_SMPTE_170M | RANGE_UNSPECIFIED | RANGE_FULL | V0_JFIF (0x8c20000), .rotation = ROTATION_0}, .physicalCameraId = "", .bufferSize = 24346616}
11-23 17:17:33.012 946 1133 D mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] {.v3_2 = {.id = 2, .streamType = OUTPUT, .width = 192, .height = 144, .format = YCBCR_420_888, .usage = CPU_READ_NEVER | CPU_READ_RARELY | CPU_READ_OFTEN | CPU_WRITE_NEVER (0x3), .dataSpace = UNKNOWN | STANDARD_UNSPECIFIED | STANDARD_BT601_625 | TRANSFER_UNSPECIFIED | TRANSFER_LINEAR | TRANSFER_SRGB | TRANSFER_SMPTE_170M | RANGE_UNSPECIFIED | RANGE_FULL | V0_JFIF (0x8c20000), .rotation = ROTATION_0}, .physicalCameraId = "", .bufferSize = 0}
11-23 17:17:33.012 946 1133 D mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] operationMode=0
11-23 17:17:33.012 946 1133 D mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] streamId:0 type:OUT (w,h) = (1280,798) format:34 usage:0x100 dataSpace:0 rotation:0 physicalCameraId: bufferSize:0
11-23 17:17:33.012 946 1133 D mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] streamId:1 type:OUT (w,h) = (4608,3456) format:33 usage:0x3 dataSpace:8c20000 rotation:0 physicalCameraId: bufferSize:1737ff8
11-23 17:17:33.012 946 1133 D mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] streamId:2 type:OUT (w,h) = (192,144) format:35 usage:0x3 dataSpace:8c20000 rotation:0 physicalCameraId: bufferSize:0//预览窗口
CamAp_PreviewManager: updatePreviewSize: new size (1280 , 798 ) current size (0 , 0 )
CamAp_PreviewTextureView: previewWidth = 800, previewHeight = 1066, mAspectRatio = 1.3333333333333333//P1HwPolicy
mtkcam-P1HwSettingPolicy: [configP1HwSetting] max_rrzo_size: target size(2560x1922)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] sensor size: target size(4656x3496)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] target rrzo stream: target size(1280x961)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] eis lower bound limitation: target size(1280x962)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] preview upper bound limitation: target size(1280x962)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] rrzo size(1280x962)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] sensor size upper bound limitation: target size(1280x976)
mtkcam-P1HwSettingPolicy: aligned rrzo size(1280x976)//Hal resize
mtkcam-P1HwSettingPolicy: [queryRecommendResizeMaxRatio] Resize-Ratio-Percentage 25 for isp quality
MtkCam/HwInfoHelper: [querySupportResizeRatio] Support Resize-Ratio-Percentage: 25
MtkCam/HwInfoHelper: [alignRrzoHwLimitation] exceeding sensor size, modified size: 1280x976, original target size: 1280x976, crop size: 4656x3496
MtkCam/HwInfoHelper: [alignPass1HwLimitation] rrzo size 1280x976, stride 2400//P1Node
MtkCam/P1NodeImp: [setupAction] [Cam::0 R5 S5 E5 D2 O2 #1] [P1::ENQ][Num Q:5 M:5 F:4 R:4 @3][Type:1 Out:x15 Rec:x0 Raw:1 Cap:0 Exe:1 Flush:x0] [Exp:33333000ns] [MetaCtrl][SCALER_CROP(1) (0,0_4656x3496) ][SENSOR_CROP(0)][RESIZER_SET(0)]
MtkCam/P1NodeImp: [releaseAction] [Cam::0 R6 S6 E5 D3 O2 #1] [P1::DEQ][Num Q:3 M:3 F:2 R:2 @0][Type:1 Out:x15 Rec:x0 Raw:1 Cap:0 Exe:3 Flush:x0] job(0/1) IMG(pure) RRZ0(0-0-4656x3496)(0-0-1280x976)(1280x976) T-ns(EXP: 0)(Src:0)(SOF: m_1150300512000 b_1150300499000)(SS: 1150300512000) ExpExtend(0, 0)Q(SensorTs:11503
(2)MTK平台RrzoHwLimit限制
//vendor/mediatek/proprietary/hardware/mtkcam/utils/hw/HwInfoHelper.cppMBOOL
HwInfoHelper::
alignRrzoHwLimitation(MSize const targetSize,MSize const sensorSize,MSize& result,MUINT32 const recommendResizeRatio
) const
{return mpImp->alignRrzoHwLimitation(targetSize, sensorSize, result, recommendResizeRatio);
}MBOOL
IMPL_CLASSNAME::
alignRrzoHwLimitation(MSize const targetSize,MSize const sensorSize,MSize& result,MUINT32 const recommendResizeRatio
) const
{MUINT32 SupportRatio = 40;bool scaledUp = false;result = targetSize;// figure out the crop region sizeMSize usedRegionSize;usedRegionSize.w = sensorSize.w;usedRegionSize.h = sensorSize.h;// check if the edges are beyond hardware scale limitation(crop region edge * scale ratio)// scale up to cope with the limitation, if neededquerySupportResizeRatio(SupportRatio);//这里可以调整SupportRatio,SupportRatio越大表示Hal对的Limit限制越宽松,Sensor Size进行Resize后的值也越大,画面越清晰int flag = property_get_int32("ro.boot.flag.device", 0);MY_LOGD("SupportRatio = %d, recommendResizeRatio = %d, ctsFlag = %d", SupportRatio,recommendResizeRatio,flag);if(flag == 0){SupportRatio = 60;}else{if (recommendResizeRatio > SupportRatio) {MY_LOGD("Modify resize ratio (%u) to (%u) for isp quality", SupportRatio, recommendResizeRatio);SupportRatio = recommendResizeRatio;}}#define ROUND_UP(x, div) (((x) + (div - 1)) / div)
#define ALIGN16(x) x = (((x) + 15) & ~(15))// check the widthif( (uint32_t)result.w < ROUND_UP(usedRegionSize.w * SupportRatio, 100) ){result = MSize(ROUND_UP(usedRegionSize.w * SupportRatio, 100),result.h * ROUND_UP(usedRegionSize.w * SupportRatio, 100) / result.w);scaledUp = true;ALIGN16(result.w);ALIGN16(result.h);MY_LOGD("width is beyond scale limitation, modified size: %dx%d, original target size: %dx%d, crop size: %dx%d", result.w, result.h, targetSize.w, targetSize.h, usedRegionSize.w, usedRegionSize.h);}// check the heightif( (uint32_t)result.h < ROUND_UP(usedRegionSize.h * SupportRatio, 100) ){result = MSize(result.w * ROUND_UP(usedRegionSize.h * SupportRatio, 100) / result.h,ROUND_UP(usedRegionSize.h * SupportRatio, 100));scaledUp = true;ALIGN16(result.w);ALIGN16(result.h);MY_LOGD("height is beyond scale limitation, modified size: %dx%d, original target size: %dx%d, crop size: %dx%d", result.w, result.h, targetSize.w, targetSize.h, usedRegionSize.w, usedRegionSize.h);}if( !scaledUp ){// we don't attempt to scale down if scaledUp is true,// since it means at least one edge is at the limitMSize temp = result;if( temp.w > sensorSize.w ){temp = MSize(sensorSize.w,temp.h * sensorSize.w / temp.w);}if( temp.h > sensorSize.h ){temp = MSize(temp.w * sensorSize.h / temp.h,sensorSize.h);}if( (uint32_t)temp.w > usedRegionSize.w * SupportRatio / 100 && (uint32_t)temp.h > usedRegionSize.h * SupportRatio / 100 ){result = temp;MY_LOGD("exceeding sensor size, modified size: %dx%d, original target size: %dx%d, crop size: %dx%d", result.w, result.h, targetSize.w, targetSize.h, usedRegionSize.w, usedRegionSize.h);}}
#undef ROUND_UP
#undef ALIGN16return MTRUE;
}
同样的960x720的预览Size,会出现P1Node Resize后的值不一样,可查看如下Log:
//config
mtkcam-dev3-hidl: [0-hidl-session::configureStreams_3_6] +
mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] {.v3_2 = {.id = 0, .streamType = OUTPUT, .width = 960, .height = 720, .format = IMPLEMENTATION_DEFINED, .usage = CPU_READ_NEVER | CPU_WRITE_NEVER | GPU_TEXTURE (0x100), .dataSpace = UNKNOWN | STANDARD_UNSPECIFIED | TRANSFER_UNSPECIFIED | RANGE_UNSPECIFIED (0), .rotation = ROTATION_0}, .physicalCameraId = "", .bufferSize = 0}
mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] {.v3_2 = {.id = 1, .streamType = OUTPUT, .width = 4608, .height = 3456, .format = BLOB, .usage = CPU_READ_NEVER | CPU_READ_RARELY | CPU_READ_OFTEN | CPU_WRITE_NEVER (0x3), .dataSpace = UNKNOWN | STANDARD_UNSPECIFIED | STANDARD_BT601_625 | TRANSFER_UNSPECIFIED | TRANSFER_LINEAR | TRANSFER_SRGB | TRANSFER_SMPTE_170M | RANGE_UNSPECIFIED | RANGE_FULL | V0_JFIF (0x8c20000), .rotation = ROTATION_0}, .physicalCameraId = "", .bufferSize = 24346616}
mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] {.v3_2 = {.id = 2, .streamType = OUTPUT, .width = 192, .height = 144, .format = YCBCR_420_888, .usage = CPU_READ_NEVER | CPU_READ_RARELY | CPU_READ_OFTEN | CPU_WRITE_NEVER (0x3), .dataSpace = UNKNOWN | STANDARD_UNSPECIFIED | STANDARD_BT601_625 | TRANSFER_UNSPECIFIED | TRANSFER_LINEAR | TRANSFER_SRGB | TRANSFER_SMPTE_170M | RANGE_UNSPECIFIED | RANGE_FULL | V0_JFIF (0x8c20000), .rotation = ROTATION_0}, .physicalCameraId = "", .bufferSize = 0}
mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] operationMode=0
mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] streamId:0 type:OUT (w,h) = (960,720) format:34 usage:0x100 dataSpace:0 rotation:0 physicalCameraId: bufferSize:0
mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] streamId:1 type:OUT (w,h) = (4608,3456) format:33 usage:0x3 dataSpace:8c20000 rotation:0 physicalCameraId: bufferSize:1737ff8
mtkcam-dev3-hidl: [0-hidl-session::convertStreamConfigurationFromHidl] streamId:2 type:OUT (w,h) = (192,144) format:35 usage:0x3 dataSpace:8c20000 rotation:0 physicalCameraId: bufferSize:0//预览窗口
CamAp_PreviewManager: updatePreviewSize: new size (960 , 720 ) current size (0 , 0 )
CamAp_PreviewTextureView: previewWidth = 800, previewHeight = 1066, mAspectRatio = 1.3333333333333333//P1HwPolicy
mtkcam-P1HwSettingPolicy: [configP1HwSetting] max_rrzo_size: target size(2560x1922)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] maxYuvStreamSize is too small(960x720)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] maxYuvStreamSize set rrzo to 1280x960
mtkcam-P1HwSettingPolicy: [configP1HwSetting] sensor size: target size(4656x3496)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] target rrzo stream: target size(1280x961)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] eis lower bound limitation: target size(1280x962)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] preview upper bound limitation: target size(1280x962)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] rrzo size(1280x962)
mtkcam-P1HwSettingPolicy: [configP1HwSetting] sensor size upper bound limitation: target size(1280x976)
mtkcam-P1HwSettingPolicy: aligned rrzo size(1280x976)//Hal resize
mtkcam-P1HwSettingPolicy: [queryRecommendResizeMaxRatio] Resize-Ratio-Percentage 25 for isp quality
MtkCam/HwInfoHelper: [querySupportResizeRatio] Support Resize-Ratio-Percentage: 25
MtkCam/HwInfoHelper: [alignRrzoHwLimitation] SupportRatio = 25, recommendResizeRatio = 25, flag = 0
//这里的SupportRatio被设置成60(SupportRatio=60)
MtkCam/HwInfoHelper: [alignRrzoHwLimitation] width is beyond scale limitation, modified size: 2800x2144, original target size: 1280x976, crop size: 4656x3496
MtkCam/HwInfoHelper: [alignPass1HwLimitation] rrzo size 2800x2144, stride 5264//P1Node
MtkCam/P1NodeImp: [setupAction] [Cam::0 R5 S5 E5 D1 O1 #1] [P1::ENQ][Num Q:5 M:5 F:4 R:4 @3][Type:1 Out:x15 Rec:x0 Raw:1 Cap:0 Exe:1 Flush:x0] [Exp:12013000ns] [MetaCtrl][SCALER_CROP(1) (0,0_4656x3496) ][SENSOR_CROP(0)][RESIZER_SET(0)]
MtkCam/P1NodeImp: [releaseAction] [Cam::0 R6 S6 E5 D2 O1 #1] [P1::DEQ][Num Q:2 M:2 F:1 R:1 @0][Type:1 Out:x15 Rec:x0 Raw:1 Cap:0 Exe:3 Flush:x0] job(0/1) IMG(pure) RRZ0(0-0-4656x3496)(0-0-2800x2144)(2800x2144) T-ns(EXP: 0)(Src:0)(SOF: m_284036834000 b_284036828000)(SS: 284036834000) ExpExtend(0, 0)Q(SensorTs:284039
可以看到如上虽然App下的Preview Size为960x720,但是实际P1将Sensor Preview Size进行了Resize后为2800x2144,不在是之前的1280x976。