微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > Android -- Camera源码简析,启动流程

Android -- Camera源码简析,启动流程

时间:09-12 来源:互联网 点击:

部检测

startFaceDetection();

// Show the tap to focus toast if this is the first start.

// 假如是第一次启动,提示用户“触摸对焦”

if (mFocusAreaSupported

mPreferences.getBoolean(CameraSettings.KEY_CAMERA_FIRST_USE_HINT_SHOWN, true)) {

// Delay the toast for one second to wait for orientation.

mHandler.sendEmptyMessageDelayed(SHOW_TAP_TO_FOCUS_TOAST, 1000);

}

mFirstTimeInitialized = true;

addIdleHandler();

}

复制代码

如果不是,则执行initializeSecondTime();

复制代码

/**

* // If the activity is paused and resumed, this method will be called in

* // onResume.

*/

private void initializeSecondTime() {

// Start orientation listener as soon as possible because it takes

// some time to get first orientation.

//方向翻转设置enable,其中包括翻转的时候的动画

mOrientationListener.enable();

// Start location update if needed.

boolean recordLocation = RecordLocationPreference.get(

mPreferences, getContentResolver());

mLocationManager.recordLocation(recordLocation);

//设置SD卡广播

installIntentFilter();

mImageSaver = new ImageSaver();

//初始化Zoom

initializeZoom();

//mMediaProviderClient=媒体Provider对象

keepMediaProviderInstance();

//检查硬盘

checkStorage();

//淡出retake和done的Button

hidePostCaptureAlert();

if (!mIsImageCaptureIntent) {

//如果不是第三方开启,则更新缩略图

updateThumbnailButton();

mModePicker.setCurrentMode(ModePicker.MODE_CAMERA);

}

}

复制代码

4、surfaceDestroyed

stopPreview();

mSurfaceHolder = null;

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top