MTK Camera Launch and Switch Flow

Plartform:ISP6s/ISP7/ISP7S/ISP7SP/ISP8

Key words:Cold Launch(冷启动)、Warm Launch(热启动)、Camera Switch(相机切换)、Mode Switch(模式切换)

本篇主要解释相机启动及切换的流程拆解。其中,App Delay部分耗时需要从Camera APP角度分析,Camera Delay部分耗时需要CameraHal平台部分分析。

    1. Camera launch(相机启动)
      1. Cold launch(冷启动)
        1. Breakdown Stage(阶段拆解)

        1. Stage Systrace Event
  1. Touch Up

  1. Activity Start

  1. Open → Open Done

  1. Configure Streams → Configure Streams Done

  1. Set Repeating Request

  1. 1st Frame out

Camera HAL:

Find the first " Cam:X:Usage:GPU_TEXTURE" (X could be any number, following example is 0) of ACbAdaptor:CbCo after "Set Repeating Request".

Camera Framework:

You also could find the "Stream X: first full buffer" (X could be any number, following example is 0), it is AOSP default systace tag to prove camera hal output first frame.

  1. 1st Frame Show on Panel

Surface View

Please find the first falling edge in SufaceView thread SufaceFlinger process after HAL/FWK output 1st frame.

Surface Texture

Normal Case:

Please find the first rising edge of SufaceTexture in camera APP process after HAL/FWK output 1st frame.

The rising edge means APP has received preview buffer from HAL/FWK, and the falling edge means APP has get buffer from SurfaceTexture and started to draw frame by RenderThread.

After "DrawFrame", please find the first falling edge in camera APP thread of SufaceFlinger process(Such as: com.mediatek.camera).

We can observe the frame in buffer and out buffer as follow

Sometimes, the pulse of 1st frame has twice height than 2nd frame and 3rd frame, that was because camera APP thread of SufaceFlinger process has receive 2 frames in that time, so it has to draw 2 frame, just focus on falling edge, do not care about the pulse height in SufaceFlinger.

After "falling edge", please find the first "onMessageReceived" in surfaceflinger thread of SufaceFlinger process.

      1. 2 Warm launch(热启动)
        1. Breakdown Stage(阶段拆解)

Stage like 1.1 Cold launch

        1. Stage Systrace Event

Breakdown method like 1.1 Cold launch

    1. Camera switch
      1. Camera switch(相机切换)
        1. Breakdown Stage(阶段拆解)

        1. Stage Systrace Event

只补充该小节独有或不一样的部分,剩余部分参照1.1 Cold launch.

Only add the parts that are unique or different from this section. For the rest, see 1.1 Cold Launch  

  1. Close → Close Done

  1. Open → Open Done

      1. Mode  switch(模式切换)
        1. Breakdown Stage(阶段拆解)

只补充该小节独有或不一样的部分,剩余部分参照1.1 Cold launch.

Only add the parts that are unique or different from this section; refer to 1.1 Cold Launch for the rest.  

        1. Stage Systrace Event
  1. Abort Capture → Abort Capture Done

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值