1 /*
2  * Copyright (C) 2014 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 
17 package com.android.camera.one.v2.core;
18 
19 import android.hardware.camera2.CaptureFailure;
20 import android.hardware.camera2.CaptureResult;
21 import android.hardware.camera2.TotalCaptureResult;
22 
23 /**
24  * Like {@link android.hardware.camera2.CameraCaptureSession.CaptureCallback},
25  * but for events related to single requests.
26  * <p>
27  * See {@link ResponseListeners} for helper functions.
28  */
29 public abstract class ResponseListener {
30     /**
31      * Note that this is typically invoked on the camera thread and at high
32      * frequency, so implementations must execute quickly and not make
33      * assumptions regarding the thread they are on.
34      *
35      * @See {@link android.hardware.camera2.CameraCaptureSession.CaptureCallback#onCaptureStarted}
36      */
onStarted(long timestamp)37     public void onStarted(long timestamp) {
38     }
39 
40     /**
41      * Note that this is typically invoked on the camera thread and at high
42      * frequency, so implementations must execute quickly and not make
43      * assumptions regarding the thread they are on.
44      *
45      * @See {@link android.hardware.camera2.CameraCaptureSession.CaptureCallback#onCaptureProgressed}
46      */
onProgressed(CaptureResult partialResult)47     public void onProgressed(CaptureResult partialResult) {
48     }
49 
50     /**
51      * Note that this is typically invoked on the camera thread and at high
52      * frequency, so implementations must execute quickly and not make
53      * assumptions regarding the thread they are on.
54      *
55      * @See {@link android.hardware.camera2.CameraCaptureSession.CaptureCallback#onCaptureCompleted}
56      */
onCompleted(TotalCaptureResult result)57     public void onCompleted(TotalCaptureResult result) {
58     }
59 
60     /**
61      * Note that this is typically invoked on the camera thread and at high
62      * frequency, so implementations must execute quickly and not make
63      * assumptions regarding the thread they are on.
64      *
65      * @See {@link android.hardware.camera2.CameraCaptureSession.CaptureCallback#onCaptureFailed}
66      */
onFailed(CaptureFailure failure)67     public void onFailed(CaptureFailure failure) {
68     }
69 
70     /**
71      * Note that this is typically invoked on the camera thread and at high
72      * frequency, so implementations must execute quickly and not make
73      * assumptions regarding the thread they are on.
74      *
75      * @See {@link android.hardware.camera2.CameraCaptureSession.CaptureCallback#onCaptureSequenceAborted}
76      */
onSequenceAborted(int sequenceId)77     public void onSequenceAborted(int sequenceId) {
78     }
79 
80     /**
81      * Note that this is typically invoked on the camera thread and at high
82      * frequency, so implementations must execute quickly and not make
83      * assumptions regarding the thread they are on.
84      *
85      * @See {@link android.hardware.camera2.CameraCaptureSession.CaptureCallback#onCaptureSequenceCompleted}
86      */
onSequenceCompleted(int sequenceId, long frameNumber)87     public void onSequenceCompleted(int sequenceId, long frameNumber) {
88     }
89 }
90