1.CameraContext 实现了interface ICameraContext
2.同步了CameraActivity 生命周期
3.几个关键的变量,是camera 逻辑处理类获取类
@Override
public void create(IApp app, Activity activity) {
mActivity = activity;
mSoundPlayback = new SoundPlaybackImpl(activity);
mLocationManager = new LocationManager(activity);
mMediaSaver = new MediaSaver(activity);
mDataStore = new DataStore(activity);
mStatusMonitorFactory = new StatusMonitorFactory();
mFeatureProvider = new FeatureProvider(app);
mCameraDeviceManagerFactory = CameraDeviceManagerFactory.getInstance();
mSettingManagerFactory = new SettingManagerFactory(app, this);
mStorageService = new StorageServiceImpl(app, this);
mThermalThrottle = new ThermalThrottle(app);
}
mSoundPlayback = new SoundPlaybackImpl(activity);
负责播放拍照提示音,录像提示音等
mLocationManager = new LocationManager(activity);
位置信息管理类,可以打开或者关闭 获取位置信息。
public class LocationManager {
LocationProvider mLocationProvider;
/**
* init LocationManager, get location provider.
* @param context the activity context.
*/
public LocationManager(Context context) {
mLocationProvider = new LocationProvider(context);
}
/**
* Start/stop location recording.
* @param recordLocation true to start record location.
* false to stop record location.
*/
public void recordLocation(boolean recordLocation) {
mLocationProvider.recordLocation(recordLocation);
}
/**
* Returns the current location from the location provider or null, if
* location could not be determined or is switched off.
* @return the location info.
*/
public Location getCurrentLocation() {
return mLocationProvider.getCurrentLocation();
}
}
mMediaSaver = new MediaSaver(activity);
处理相机拍照,录像后,媒体文件的保存工作
mDataStore = new DataStore(activity);
处理设置项的保存,读取工作
mFeatureProvider = new FeatureProvider(app);
相机中feature的加载,读取
mCameraDeviceManagerFactory = CameraDeviceManagerFactory.getInstance();
device 管理工厂类,可以通过CameraDeviceManager getCameraDeviceManager(Context context, CameraApi api) 获取对应的
mSettingManagerFactory = new SettingManagerFactory(app, this);
获取settingManager,负责feature 的加载,以及camera parameter处理
mStorageService = new StorageServiceImpl(app, this);
获取存储空间的信息,主要MediaSaver 用的比较多
mThermalThrottle = new ThermalThrottle(app);
高温警告