类android.hardware.Camera.ShutterCallback源码实例Demo

下面列出了怎么用android.hardware.Camera.ShutterCallback的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: Camera2   文件: AndroidCameraAgentImpl.java
CaptureCallbacks(ShutterCallback shutter, PictureCallback raw, PictureCallback postView,
        PictureCallback jpeg) {
    mShutter = shutter;
    mRaw = raw;
    mPostView = postView;
    mJpeg = jpeg;
}
 
源代码2 项目: Camera2   文件: AndroidCameraAgentImpl.java
public void requestTakePicture(
        final ShutterCallback shutter,
        final PictureCallback raw,
        final PictureCallback postView,
        final PictureCallback jpeg) {
    final CaptureCallbacks callbacks = new CaptureCallbacks(shutter, raw, postView, jpeg);
    obtainMessage(CameraActions.CAPTURE_PHOTO, callbacks).sendToTarget();
}
 
源代码3 项目: Camdroid   文件: AutoFocusManager.java
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public AutoFocusManager(final Context context, Camera camera,
                        final boolean canDisableSystemShutterSound) {
    this.camera = camera;
    this.executor = Executors.newSingleThreadScheduledExecutor();

    this.focusAccelerationEventListener = new FocusAccelerationEventListener(
            context, SensorManager.SENSOR_DELAY_GAME);
    this.focusAmbientLightEventListener = new FocusAmbientLightEventListener(
            context, SensorManager.SENSOR_DELAY_GAME);

    String focusMode = this.camera.getParameters().getFocusMode();
    this.must_call_auto_focus = Camera.Parameters.FOCUS_MODE_AUTO
            .equals(focusMode)
            || Camera.Parameters.FOCUS_MODE_MACRO.equals(focusMode);

    int[] soundRes = new int[0];
    if (this.must_call_auto_focus) {
        soundRes = Arrays.copyOf(soundRes, soundRes.length + 1);
        soundRes[soundRes.length - 1] = R.raw.beep;
    }
    if (canDisableSystemShutterSound) {
        soundRes = Arrays.copyOf(soundRes, soundRes.length + 1);
        soundRes[soundRes.length - 1] = R.raw.shutter;
    }

    this.soundManager = new SoundManager(context, soundRes);

    if (canDisableSystemShutterSound) {
        this.shutterCallback = new ShutterCallback() {
            @Override
            public void onShutter() {
                AutoFocusManager.this.soundManager.play(R.raw.shutter);
            }
        };
    }

}
 
 类所在包
 同包方法