summaryrefslogtreecommitdiff
path: root/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/ProcessResultImpl.java
blob: 518942e9d14e8a5d14e1d0bdba198077a64338a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
 * Copyright 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package androidx.camera.extensions.impl;

import android.hardware.camera2.CaptureResult;
import android.util.Pair;

import java.util.List;

/**
 * Allows clients to receive information about the capture result values of processed frames.
 *
 */
public interface ProcessResultImpl {
    /**
     * Capture result callback that needs to be called when the process capture results are
     * ready as part of frame post-processing.
     *
     * @param shutterTimestamp     The shutter time stamp of the processed frame.
     * @param result               Key value pairs for all supported capture results. Do note that
     *                             if results 'android.jpeg.quality' and 'android.jpeg.orientation'
     *                             are present in the process capture input results, then the values
     *                             must also be passed as part of this callback. Both Camera2 and
     *                             CameraX guarantee that those two settings and results are always
     *                             supported and applied by the corresponding framework.
     * @since 1.3
     */
    void onCaptureCompleted(long shutterTimestamp, List<Pair<CaptureResult.Key, Object>> result);


    /**
     * Capture progress callback that needs to be called when the process capture is
     * ongoing and includes the estimated progress of the processing.
     *
     * <p>Extensions must ensure that they always call this callback with monotonically increasing
     * values.</p>
     *
     * <p>Extensions are allowed to trigger this callback multiple times but at the minimum the
     * callback is expected to be called once when processing is done with value 100.</p>
     *
     * @param progress             Value between 0 and 100.
     * @since 1.4
     */
    void onCaptureProcessProgressed(int progress);
}