mtk 拍照流程分析

21 篇文章 2 订阅
以下是16中intent:
typedef enum {
     eIntent_CameraPreviewStart = ECmd_CameraPreviewStart,
     eIntent_CameraPreviewEnd = ECmd_CameraPreviewEnd,
     eIntent_CamcorderPreviewStart = ECmd_CamcorderPreviewStart,
     eIntent_CamcorderPreviewEnd = ECmd_CamcorderPreviewEn
     eIntent_PrecaptureStart = ECmd_PrecaptureStart,
     eIntent_PrecaptureEnd = ECmd_PrecaptureEnd,
     eIntent_CaptureStart = ECmd_CaptureStart,
     eIntent_CaptureEnd = ECmd_CaptureEnd,
     eIntent_RecordingStart = ECmd_RecordingStart,
     eIntent_RecordingEnd = ECmd_RecordingEnd,
     eIntent_VsyncUpdate = ECmd_Update,
     eIntent_AFUpdate = ECmd_AFUpdate,
     eIntent_AFStart = ECmd_AFStart,
     eIntent_AFEnd = ECmd_AFEnd,
     eIntent_Init = ECmd_Init,
     eIntent_Uninit = ECmd_Uninit
} EIntent_T;

以下是9中状态:

typedef enum
{
    eState_Invalid=-1,
    eState_Uninit,
    eState_Init,
    eState_CameraPreview,
    eState_CamcorderPreview,
    eState_Precapture,
    eState_Capture,
    eState_Recording,
    eState_AF
} EState_T;
camera各种动作就是5种大的eState ,每个eState配置相应的intent。查看aaa_state.h可以看到组合方式。

aaa_state.cpp:

sendIntent(intent2type<eIntent_CameraPreviewStart>)   ---->          transitState(eState_Init, eState_CameraPreview);
sendIntent(intent2type<eIntent_CamcorderPreviewStart>)--->         transitState(eState_Init, eState_CamcorderPreview);

aaa_state_af.cpp :

sendIntent(intent2type<eIntent_AFStart>)    ----->  return  S_3A_OK;

sendIntent(intent2type<eIntent_AFEnd>)  ------> 根据g_nextState设置:transitState(eState_AF, g_nextState) or   transitState(eState_AF, g_ePrevState);

sendIntent(intent2type<eIntent_CameraPreviewStart>)  ----->设置 g_nextState = eState_Invalid;

sendIntent(intent2type<eIntent_RecordingEnd>)   ------->return  S_3A_OK;

sendIntent(intent2type<eIntent_CamcorderPreviewStart>)  ----> 设置   g_nextState = eState_Invalid;

sendIntent(intent2type<eIntent_CameraPreviewEnd>) ---->    g_nextState = eState_Invalid;

sendIntent(intent2type<eIntent_CamcorderPreviewEnd>)  ---->    g_nextState = eState_Invalid;

sendIntent(intent2type<eIntent_VsyncUpdate>)  ------>

sendIntent(intent2type<eIntent_PrecaptureStart>) ---->  g_nextState = eState_Precapture;

sendAFIntent(intent2type<eIntent_VsyncUpdate>, state2type<eAFState_PreAF>)    ----> transitAFState(eAFState_AF);


aaa_state_camera_preview.cpp

sendIntent(intent2type<eIntent_CameraPreviewStart>)   ------>

sendIntent(intent2type<eIntent_CameraPreviewEnd>)  ---------> transitState(eState_CameraPreview, eState_Init);

sendIntent(intent2type<eIntent_VsyncUpdate>)

sendIntent(intent2type<eIntent_AFUpdate>)

sendIntent(intent2type<eIntent_PrecaptureStart>)  -----> transitState(eState_CameraPreview, eState_Precapture);

sendIntent(intent2type<eIntent_CaptureStart>) ---->  transitState(eState_CameraPreview, eState_Capture);

sendIntent(intent2type<eIntent_AFStart>) ---->     transitState(eState_CameraPreview, eState_AF);

sendIntent(intent2type<eIntent_AFEnd>) --->

sendIntent(intent2type<eIntent_RecordingStart>) ---->

sendIntent(intent2type<eIntent_RecordingEnd>)------>


aaa_state_precapture.cpp   类继承:struct StatePrecapture : public IState

sendIntent(intent2type<eIntent_PrecaptureStart>)---->

sendIntent(intent2type<eIntent_PrecaptureEnd>) ---->

sendIntent(intent2type<eIntent_VsyncUpdate>)---->  transitState(eState_Precapture, eState_AF);

sendIntent(intent2type<eIntent_AFUpdate>) ---->

sendIntent(intent2type<eIntent_CaptureStart>)  -----> transitState(eState_Precapture, eState_Capture);

sendIntent(intent2type<eIntent_CameraPreviewEnd>)  ---->

sendIntent(intent2type<eIntent_CamcorderPreviewEnd>) ---->

sendIntent(intent2type<eIntent_AFEnd>)------>


IState是以上所有类的基类,如果没有实例化对应类而直接调到基类函数,会打印E_3A_UNSUPPORT_COMMAND的信息。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值