1.概述
11.0定制化开发时,在Camera2静音情况下有快门拍照声音,这就不符合使用规范了
静音的情况下拍照也不应该发出声音,所以在静音拍照流程中要求去掉快门声音
2.Camera2静音拍照去掉快门声音核心代码
Camera2拍照主要代码:
/packages/apps/Camera2/src/com/android/camera/one/v2/photo/PictureTakerImpl.java
/packages/apps/Camera2/src/com/android/camera/one/v2/photo/PictureCallbackAdapter.java
/packages/apps/Camera2/src/com/android/camera/CaptureModule.java
3.Camera2静音拍照去掉快门声音核心代码功能分析
3.1 拍照功能在PictureTakerImpl.java中
/packages/apps/Camera2/src/com/android/camera/one/v2/photo/PictureTakerImpl.java
@Override
public void takePicture(OneCamera.PhotoCaptureParameters params, final CaptureSession session) {
OneCamera.PictureCallback pictureCallback = params.callback;
// Wrap the pictureCallback with a thread-safe adapter which guarantees
// that they are always invoked on the main thread.
PictureCallbackAdapter pictureCallbackAdapter =
new PictureCallbackAdapter(pictureC