Java Code Examples for android.hardware.camera2.CaptureRequest#isReprocess()

The following examples show how to use android.hardware.camera2.CaptureRequest#isReprocess() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CameraCaptureSessionImpl.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
private void checkCaptureRequests(List<CaptureRequest> requests) {
    if (requests == null) {
        throw new IllegalArgumentException("Requests must not be null");
    } else if (requests.isEmpty()) {
        throw new IllegalArgumentException("Requests must have at least one element");
    }

    for (CaptureRequest request : requests) {
        if (request.isReprocess()) {
            if (!isReprocessable()) {
                throw new IllegalArgumentException("This capture session cannot handle " +
                        "reprocess requests");
            } else if (request.getReprocessableSessionId() != mId) {
                throw new IllegalArgumentException("Capture request was created for another " +
                        "session");
            }
        }
    }

}
 
Example 2
Source File: CameraCaptureSessionImpl.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
private void checkCaptureRequest(CaptureRequest request) {
    if (request == null) {
        throw new IllegalArgumentException("request must not be null");
    } else if (request.isReprocess() && !isReprocessable()) {
        throw new IllegalArgumentException("this capture session cannot handle reprocess " +
                "requests");
    } else if (request.isReprocess() && request.getReprocessableSessionId() != mId) {
        throw new IllegalArgumentException("capture request was created for another session");
    }
}
 
Example 3
Source File: CameraCaptureSessionImpl.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
private void checkRepeatingRequest(CaptureRequest request) {
    if (request == null) {
        throw new IllegalArgumentException("request must not be null");
    } else if (request.isReprocess()) {
        throw new IllegalArgumentException("repeating reprocess requests are not supported");
    }
}
 
Example 4
Source File: CameraCaptureSessionImpl.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
private void checkRepeatingRequests(List<CaptureRequest> requests) {
    if (requests == null) {
        throw new IllegalArgumentException("requests must not be null");
    } else if (requests.isEmpty()) {
        throw new IllegalArgumentException("requests must have at least one element");
    }

    for (CaptureRequest r : requests) {
        if (r.isReprocess()) {
            throw new IllegalArgumentException("repeating reprocess burst requests are not " +
                    "supported");
        }
    }
}
 
Example 5
Source File: CameraDeviceImpl.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
/**
 * Create a request-last-frame-numbers holder with a list of requests, request ID, and
 * the last frame number returned by camera service.
 */
public RequestLastFrameNumbersHolder(List<CaptureRequest> requestList, SubmitInfo requestInfo) {
    long lastRegularFrameNumber = CaptureCallback.NO_FRAMES_CAPTURED;
    long lastReprocessFrameNumber = CaptureCallback.NO_FRAMES_CAPTURED;
    long frameNumber = requestInfo.getLastFrameNumber();

    if (requestInfo.getLastFrameNumber() < requestList.size() - 1) {
        throw new IllegalArgumentException(
                "lastFrameNumber: " + requestInfo.getLastFrameNumber() +
                " should be at least " + (requestList.size() - 1) + " for the number of " +
                " requests in the list: " + requestList.size());
    }

    // find the last regular frame number and the last reprocess frame number
    for (int i = requestList.size() - 1; i >= 0; i--) {
        CaptureRequest request = requestList.get(i);
        if (request.isReprocess() && lastReprocessFrameNumber ==
                CaptureCallback.NO_FRAMES_CAPTURED) {
            lastReprocessFrameNumber = frameNumber;
        } else if (!request.isReprocess() && lastRegularFrameNumber ==
                CaptureCallback.NO_FRAMES_CAPTURED) {
            lastRegularFrameNumber = frameNumber;
        }

        if (lastReprocessFrameNumber != CaptureCallback.NO_FRAMES_CAPTURED &&
                lastRegularFrameNumber != CaptureCallback.NO_FRAMES_CAPTURED) {
            break;
        }

        frameNumber--;
    }

    mLastRegularFrameNumber = lastRegularFrameNumber;
    mLastReprocessFrameNumber = lastReprocessFrameNumber;
    mRequestId = requestInfo.getRequestId();
}