mtk 拍照流程分析

来源:互联网 发布:云计算全球的影响力 编辑:程序博客网 时间:2024/06/05 06:39
以下是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
原创粉丝点击