0%

Android Camera device HAL 3.6文档翻译——S3:操作模式

HAL3相机设备被要求支持两种可能操作模式,两种操作模式分别为受限模式和完整模式。高端设备应当支持完整模式。限制模式则被要求其硬件与HAL1版本的设备实现大致相同,并且应当被使用在更老或相对低端的设备中。完整模式应当是受限模式的严格超集,并且都具有文档所示的必要的操作流程。

The camera 3 HAL device can implement one of two possible operational modes; limited and full. Full support is expected from new higher-end devices. Limited mode has hardware requirements roughly in line with those for a camera HAL device v1 implementation, and is expected from older or inexpensive devices. Full is a strict superset of limited, and they share the same essential operational flow, as documented above.

HAL必须在android.info.supportedHardwareLevel静态元数据条目中给出支持的操作模式,为0是表明支持受限模式,为1表示支持完整模式。

The HAL must indicate its level of support with the android.info.supportedHardwareLevel static metadata entry, with 0 indicating limited mode, and 1 indicating full mode support.

粗略的说,受限模式的设备不允许应用控制捕获设置(只支持3A设置)、高分辨率图像的高帧率捕获、读出传感器生成的生数据或高于最大纪录分辨率的YUV输出流支持(JPEG仅适用于大图像)。

Roughly speaking, limited-mode devices do not allow for application control of capture settings (3A control only), high-rate capture of high-resolution images, raw sensor readout, or support for YUV output streams above maximum recording resolution (JPEG only for large images).

限制模式行为的细节:

Details of limited mode behavior:

  • 限制模式设备不需要实现捕获请求设置和实际图像数据被捕获间的精确捕获。相反的,设置的修改将可能会在之后的一段时间后才生效,并可能不会对一个输出帧应用全部的设置条目修改。快速的改变设置可能会导致一些设置从未被任何捕获使用。然而,包含高分辨率输出缓冲区(>1080p)的捕获必须使用指定的设置(关于处理帧率,请参阅下文)。

    Limited-mode devices do not need to implement accurate synchronization between capture request settings and the actual image data captured. Instead, changes to settings may take effect some time in the future, and possibly not for the same output frame for each settings entry. Rapid changes in settings may result in some settings never being used for a capture. However, captures that include high-resolution output buffers ( > 1080p ) have to use the settings as specified (but see below for processing rate).

  • 限制模式设备不需要支持大多数设置/结果/静态元数据信息。特别的,只希望如下设置被限制模式设备消费或制造:

    Limited-mode devices do not need to support most of the settings/result/static info metadata. Specifically, only the following settings are expected to be consumed or produced by a limited-mode HAL device:

    android.control.aeAntibandingMode (controls and dynamic)
    android.control.aeExposureCompensation (controls and dynamic)
    android.control.aeLock (controls and dynamic)
    android.control.aeMode (controls and dynamic)
    android.control.aeRegions (controls and dynamic)
    android.control.aeTargetFpsRange (controls and dynamic)
    android.control.aePrecaptureTrigger (controls and dynamic)
    android.control.afMode (controls and dynamic)
    android.control.afRegions (controls and dynamic)
    android.control.awbLock (controls and dynamic)
    android.control.awbMode (controls and dynamic)
    android.control.awbRegions (controls and dynamic)
    android.control.captureIntent (controls and dynamic)
    android.control.effectMode (controls and dynamic)
    android.control.mode (controls and dynamic)
    android.control.sceneMode (controls and dynamic)
    android.control.videoStabilizationMode (controls and dynamic)
    android.control.aeAvailableAntibandingModes (static)
    android.control.aeAvailableModes (static)
    android.control.aeAvailableTargetFpsRanges (static)
    android.control.aeCompensationRange (static)
    android.control.aeCompensationStep (static)
    android.control.afAvailableModes (static)
    android.control.availableEffects (static)
    android.control.availableSceneModes (static)
    android.control.availableVideoStabilizationModes (static)
    android.control.awbAvailableModes (static)
    android.control.maxRegions (static)
    android.control.sceneModeOverrides (static)
    android.control.aeState (dynamic)
    android.control.afState (dynamic)
    android.control.awbState (dynamic)

    android.flash.mode (controls and dynamic)
    android.flash.info.available (static)

    android.info.supportedHardwareLevel (static)

    android.jpeg.gpsCoordinates (controls and dynamic)
    android.jpeg.gpsProcessingMethod (controls and dynamic)
    android.jpeg.gpsTimestamp (controls and dynamic)
    android.jpeg.orientation (controls and dynamic)
    android.jpeg.quality (controls and dynamic)
    android.jpeg.thumbnailQuality (controls and dynamic)
    android.jpeg.thumbnailSize (controls and dynamic)
    android.jpeg.availableThumbnailSizes (static)
    android.jpeg.maxSize (static)

    android.lens.info.minimumFocusDistance (static)

    android.request.id (controls and dynamic)

    android.scaler.cropRegion (controls and dynamic)
    android.scaler.availableStreamConfigurations (static)
    android.scaler.availableMinFrameDurations (static)
    android.scaler.availableStallDurations (static)
    android.scaler.availableMaxDigitalZoom (static)
    android.scaler.maxDigitalZoom (static)
    android.scaler.croppingType (static)

    android.sensor.orientation (static)
    android.sensor.timestamp (dynamic)

    android.statistics.faceDetectMode (controls and dynamic)
    android.statistics.info.availableFaceDetectModes (static)
    android.statistics.faceIds (dynamic)
    android.statistics.faceLandmarks (dynamic)
    android.statistics.faceRectangles (dynamic)
    android.statistics.faceScores (dynamic)

    android.sync.frameNumber (dynamic)
    android.sync.maxLatency (static)

  • 包含高分辨率输出缓冲区(>1080p)的受限模式设备捕获可能会阻塞在process_capture_request()直到所有输出缓冲区完成填充。一个完全模式的HAL设备必须按照对应像素格式的静态元数据中指定的速率处理高分辨率请求序列。HAL仍将调用process_capture_result()用于提供输出;对于受限模式设备,框架层将简单的阻塞在process_capture_request()直到对应高分辨率捕获请求的process_capture_result()的调用完成。

    Captures in limited mode that include high-resolution (> 1080p) output buffers may block in process_capture_request() until all the output buffers have been filled. A full-mode HAL device must process sequences of high-resolution requests at the rate indicated in the static metadata for that pixel format. The HAL must still call process_capture_result() to provide the output; the framework must simply be prepared for process_capture_request() to block until after process_capture_result() for that request completes for high-resolution captures for limited-mode devices.

  • 完全模式设备必须支持如下额外功能:

    Full-mode devices must support below additional capabilities:

    • 必须在最大分辨率下具有大于20fps的帧率,最好能达到30fps。

      30fps at maximum resolution is preferred, more than 20fps is required.

    • 逐帧控制(android.sync.maxLatency == PER_FRAME_CONTROL

      Per frame control (android.sync.maxLatency == PER_FRAME_CONTROL).

    • 传感器手动控制元数据。详见在android.request.availableCapabilities中定义的MANUAL_SENSOR

      Sensor manual control metadata. See MANUAL_SENSOR defined in android.request.availableCapabilities.

    • 后处理手动控制元数据。详见在android.request.availableCapabilities中定义的MANUAL_POST_PROCESSING

      Post-processing manual control metadata. See MANUAL_POST_PROCESSING defined in android.request.availableCapabilities.