CameraCaptureSessionCore.java revision 639fffee624302ec5b175503d7bd8a441340a629
1/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.hardware.camera2.impl;
18
19/**
20 * Internal interface for CameraDeviceImpl to CameraCaptureSessionImpl(s) communication
21 */
22public interface CameraCaptureSessionCore {
23
24    /**
25     * Replace this session with another session.
26     *
27     * <p>This is an optimization to avoid unconfiguring and then immediately having to
28     * reconfigure again.</p>
29     *
30     * <p>The semantics are identical to {@link #close}, except that unconfiguring will be skipped.
31     * </p>
32     *
33     * <p>After this call completes, the session will not call any further methods on the camera
34     * device.</p>
35     *
36     * @see CameraCaptureSession#close
37     */
38    void replaceSessionClose();
39
40    /**
41     *
42     * Create an internal state callback, to be invoked on the mDeviceHandler
43     *
44     * <p>It has a few behaviors:
45     * <ul>
46     * <li>Convert device state changes into session state changes.
47     * <li>Keep track of async tasks that the session began (idle, abort).
48     * </ul>
49     * </p>
50     * */
51    CameraDeviceImpl.StateCallbackKK getDeviceStateCallback();
52
53    /**
54     * Whether currently in mid-abort.
55     *
56     * <p>This is used by the implementation to set the capture failure
57     * reason, in lieu of more accurate error codes from the camera service.
58     * Unsynchronized to avoid deadlocks between simultaneous session->device,
59     * device->session calls.</p>
60     *
61     */
62    boolean isAborting();
63
64}
65