CaptureBuilder=mCameraDevice. CreateCaptureRequest (CameraDevice. TEMPLATE_STILL_CAPTURE);
//will imageReader surface as CaptureRequest. The goal of Builder
CaptureBuilder. AddTarget (mImageReader getSurface ());
//af
CaptureBuilder. Set (CaptureRequest CONTROL_AF_MODE, CaptureRequest CONTROL_AF_MODE_CONTINUOUS_PICTURE);
//ae
CaptureBuilder. Set (CaptureRequest CONTROL_AE_MODE, CaptureRequest CONTROL_AE_MODE_ON_AUTO_FLASH);
//phone
Int rotation=getActivity (). GetWindowManager (.) getDefaultDisplay () getRotation ();
Calculate according to the direction of equipment//set the direction of the picture
//the following code sets the direction of the value on the part of the model fully use
CaptureBuilder. Set (CaptureRequest JPEG_ORIENTATION, ORIENTATIONS, the get (rotation));
//photo
CaptureRequest mCaptureRequest=captureBuilder. The build ();
MCaptureSession. The capture (mCaptureRequest, null, null);