和你一起终身学习,这里是程序员Android
经典好文推荐,通过阅读本文,您将收获以下知识点:
一、In-sensor zoom 概述
二、如何开启 In-sensor zoom
2.1 开启 camxsettings.xml setting
2.2 多摄像头,需要添加特殊的逻辑
2.3 在 MetaTransitionTable 配置 sensorModeGroupId 的范围
2.4 在Sensor.xml 中设置兼容性 INSENSORZOOM
2.5 InSensor zoom log
一、In-sensor zoom 概述
InSensor Zoom 不仅需要高通平台支持,而且需要Camera sensor 模组支持(需要跟Sensor FAE 确认)。
与正常的zoom 对比,Insensor zoom 使用full remosaic size mode 替换1/4 binng mode, 当zoom > 2x, sensor crop输出2x zoom.
二、如何开启 In-sensor zoom
2.1 开启 camxsettings.xml setting
vendor/qcom/proprietary/camx-common/settings/common/camxsettings.xml
设置 Enable In Sensor Zoom DefaultValue
<setting>
<Name>Enable In Sensor Zoom</Name>
<Help>Settings to enable In sensor Zoom</Help>
<VariableName>enableInSensorZoom</VariableName>
<VariableType>BOOL</VariableType>
<SetpropKey>vendor.debug.camera.enableInSensorZoom</SetpropKey>
// 设置 Enable In Sensor Zoom DefaultValue
<DefaultValue>TRUE</DefaultValue>
<Dynamic>FALSE</Dynamic>
<Public>TRUE</Public>
</setting>
2.2 多摄像头,需要添加特殊的逻辑
oem/qcom/multicamera/chimcxcameraconfig/configs/netrani/netrani.xml
配置 SensorMode Group id 是否否支持 Insensor zoom 1 支持 、0 不支持
<!-- Transition Modes ============================================================== ====================-->
<TransitionMode id="0" sensorModeGroupId="0" skipRate="0" physicalDeviceRef="UltrawidePhysicalCam" />
<TransitionMode id="1" sensorModeGroupId="0" skipRate="0" physicalDeviceRef="WidePhysicalCam" />
<TransitionMode id="2" sensorModeGroupId="0" skipRate="0" physicalDeviceRef="TelePhysicalCam" />
<TransitionMode id="3" sensorModeGroupId="1" skipRate="0" physicalDeviceRef="WidePhysicalCam" />
<TransitionMode id="4" sensorModeGroupId="1" skipRate="0" physicalDeviceRef="TelePhysicalCam" />
<!-- Transition Tables ==================================================================================-->
2.3 在 MetaTransitionTable 配置 sensorModeGroupId 的范围
<MetaTransitionTable id="2" metadata="zoomRatio" type="Float">
<Transition activeRangeStart="0.6" activeRangeEnd="0.9999" hysteresisMinFactor="0.0" hysteresisMaxFactor="0.0" transition_modes="(0)"/>
<Transition activeRangeStart="1.0" activeRangeEnd="1.9999" hysteresisMinFactor="0.0" hysteresisMaxFactor="0.0" transition_modes="(1)"/>
<Transition activeRangeStart="2.0" activeRangeEnd="2.9999" hysteresisMinFactor="0.0" hysteresisMaxFactor="0.0" transition_modes="(3)"/>
<Transition activeRangeStart="3.0" activeRangeEnd="6.0999" hysteresisMinFactor="0.0" hysteresisMaxFactor="0.0" transition_modes="(2)"/>
<Transition activeRangeStart="6.1" activeRangeEnd="120.01" hysteresisMinFactor="0.0" hysteresisMaxFactor="0.0" transition_modes="(4)"/>
</MetaTransitionTable>
2.4 在Sensor.xml 中设置兼容性 INSENSORZOOM
找FAE 要Sensor FAE 要一组 支持remosaic 的insensor zoom 的 resolution
<!--res5 4624x3472_30fps for QCFA insensorzoom mode with remosaic enable -->
<!--Frame dimension: contains xStart, yStart, width and height -->
<frameDimension>
<xStart> </xStart>
<yStart> </yStart>
<width>4624</width>
<height>3472</height>
</frameDimension>
<!--List of features / capabilities supported by sensor -->
<capability>INSENSORZOOM</capability>
<transitionGroups>BINCROP43 BINCROP169</transitionGroups>
<RemosaicTypeInfo>NoRemosaic</RemosaicTypeInfo>
2.5 InSensor zoom log
log 关键字:SetInSensorZoomInfo|PublishPerFrameSensorMetaData .*resID|ApplySensorUpdate
bEnableInSensorZoomMode: 1 表示成功开启Insensor Zooom
触发Insensorroom 后 会切换对应的senmode 的resolution(比如:从 mode 1-->mode 5 bEnableInSensorZoomMode: 1 )
bEnableInSensorZoomMode: 1
01-01 18:53:41.468933 1501 11723 I CHIUSECASE: [CORE_CFG ] chifeature2graphselector.cpp:7391 SetInSensorZoomInfo() [InSensorZoom] cameraId:0 bEnableInSensorZoomMode: 0zoomStatusChanged = 0 requested zoomState: 1 m_inSensorZoomInfo.zoomState 1 appFrameIndex 91 size 3
01-01 18:53:41.469350 1501 11723 I CHIUSECASE: [CORE_CFG ] chifeature2graphselector.cpp:7391 SetInSensorZoomInfo() [InSensorZoom] cameraId:3 bEnableInSensorZoomMode: 1zoomStatusChanged = 0 requested zoomState: 2 m_inSensorZoomInfo.zoomState 2 appFrameIndex 91 size 3
mode 1-->mode 5
01-01 18:53:28.041499 1501 3338 I CamX : [CORE_CFG][SENSOR ] camxsensornode.cpp:2266 PublishPerFrameSensorMetaData() Sensor[3] AppliedGains: ReqId[11],... ... resID 1, ContextTypeID: 0
01-01 18:53:28.185560 1501 3339 I CamX : [CORE_CFG][SENSOR ] camxsensornode.cpp:2266 PublishPerFrameSensorMetaData() Sensor[3] AppliedGains: ReqId[12],... ... resID 1, ContextTypeID: 0
01-01 18:53:28.293122 1501 3341 I CamX : [CORE_CFG][SENSOR ] camxsensornode.cpp:2266 PublishPerFrameSensorMetaData() Sensor[3] AppliedGains: ReqId[13],... ... resID 1, ContextTypeID: 0
01-01 18:53:28.440977 1501 3341 I CamX : [CORE_CFG][SENSOR ] camxsensornode.cpp:2266 PublishPerFrameSensorMetaData() Sensor[3] AppliedGains: ReqId[14],... ... resID 1, ContextTypeID: 0
01-01 18:53:28.775161 1501 3
参考文献:
【腾讯文档】Camera学习知识库
https://docs.qq.com/doc/DSWZ6dUlNemtUWndv
至此,本篇已结束。转载网络的文章,小编觉得很优秀,欢迎点击阅读原文,支持原创作者,如有侵权,恳请联系小编删除,欢迎您的建议与指正。同时期待您的关注,感谢您的阅读,谢谢!
点击阅读原文,为大佬点赞!