當前位置: 首頁>>代碼示例>>Java>>正文


Java CaptureRequest.getTag方法代碼示例

本文整理匯總了Java中android.hardware.camera2.CaptureRequest.getTag方法的典型用法代碼示例。如果您正苦於以下問題:Java CaptureRequest.getTag方法的具體用法?Java CaptureRequest.getTag怎麽用?Java CaptureRequest.getTag使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.hardware.camera2.CaptureRequest的用法示例。


在下文中一共展示了CaptureRequest.getTag方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCaptureCompleted

import android.hardware.camera2.CaptureRequest; //導入方法依賴的package包/類
@Override
public void onCaptureCompleted(@NonNull CameraCaptureSession session, @NonNull CaptureRequest request, @NonNull TotalCaptureResult result) {
    if(request.getTag() == ("FOCUS_TAG")) {
        //The focus trigger is complete!
        //Resume repeating request, clear AF trigger.
        mAutoFocusCallback.onAutoFocus(true);
        mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER, null);
        mPreviewRequestBuilder.setTag("");
        mPreviewRequest = mPreviewRequestBuilder.build();
        try {
            mCaptureSession.setRepeatingRequest(mPreviewRequest, mCaptureCallback, mBackgroundHandler);
        } catch(CameraAccessException ex) {
            Log.d(TAG, "AUTO FOCUS FAILURE: "+ex);
        }
    } else {
        process(result);
    }
}
 
開發者ID:EzequielAdrianM,項目名稱:Camera2Vision,代碼行數:19,代碼來源:Camera2Source.java

示例2: onCaptureStarted

import android.hardware.camera2.CaptureRequest; //導入方法依賴的package包/類
@Override
public void onCaptureStarted(CameraCaptureSession session, CaptureRequest request,
                             long timestamp, long frameNumber) {
    String currentDateTime = Utils.generateTimestamp();
    File rawFile = new File(Environment.
            getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM),
            "RAW_" + currentDateTime + ".dng");
    File jpegFile = new File(Environment.
            getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM),
            "JPEG_" + currentDateTime + ".jpg");

    // Look up the ImageSaverBuilder for this request and update it with the file name
    // based on the capture start time.
    ImageSaver.ImageSaverBuilder jpegBuilder;
    ImageSaver.ImageSaverBuilder rawBuilder;
    int requestId = (int) request.getTag();
    synchronized (mCameraStateLock) {
        jpegBuilder = mJpegResultQueue.get(requestId);
        rawBuilder = mRawResultQueue.get(requestId);
    }

    if (jpegBuilder != null) jpegBuilder.setFile(jpegFile);
    if (rawBuilder != null) rawBuilder.setFile(rawFile);
}
 
開發者ID:OkayCamera,項目名稱:OkayCamera-Android,代碼行數:25,代碼來源:Camera2RawFragment.java

示例3: onCaptureFailed

import android.hardware.camera2.CaptureRequest; //導入方法依賴的package包/類
@Override
public void onCaptureFailed(@NonNull CameraCaptureSession session, @NonNull CaptureRequest request, @NonNull CaptureFailure failure) {
    if(request.getTag() == "FOCUS_TAG") {
        Log.d(TAG, "Manual AF failure: "+failure);
        mAutoFocusCallback.onAutoFocus(false);
    }
}
 
開發者ID:EzequielAdrianM,項目名稱:Camera2Vision,代碼行數:8,代碼來源:Camera2Source.java

示例4: onCaptureCompleted

import android.hardware.camera2.CaptureRequest; //導入方法依賴的package包/類
@Override
public void onCaptureCompleted(CameraCaptureSession session, CaptureRequest request,
                               TotalCaptureResult result) {
    int requestId = (int) request.getTag();
    ImageSaver.ImageSaverBuilder jpegBuilder;
    ImageSaver.ImageSaverBuilder rawBuilder;
    StringBuilder sb = new StringBuilder();

    // Look up the ImageSaverBuilder for this request and update it with the CaptureResult
    synchronized (mCameraStateLock) {
        jpegBuilder = mJpegResultQueue.get(requestId);
        rawBuilder = mRawResultQueue.get(requestId);

        if (jpegBuilder != null) {
            jpegBuilder.setResult(result);
            sb.append("Saving JPEG as: ");
            sb.append(jpegBuilder.getSaveLocation());
        }
        if (rawBuilder != null) {
            rawBuilder.setResult(result);
            if (jpegBuilder != null) sb.append(", ");
            sb.append("Saving RAW as: ");
            sb.append(rawBuilder.getSaveLocation());
        }

        // If we have all the results necessary, save the image to a file in the background.
        handleCompletionLocked(requestId, jpegBuilder, mJpegResultQueue);
        handleCompletionLocked(requestId, rawBuilder, mRawResultQueue);

        finishedCaptureLocked();
    }

    showToast(sb.toString());
}
 
開發者ID:OkayCamera,項目名稱:OkayCamera-Android,代碼行數:35,代碼來源:Camera2RawFragment.java

示例5: onCaptureFailed

import android.hardware.camera2.CaptureRequest; //導入方法依賴的package包/類
@Override
public void onCaptureFailed(CameraCaptureSession session, CaptureRequest request,
                            CaptureFailure failure) {
    int requestId = (int) request.getTag();
    synchronized (mCameraStateLock) {
        mJpegResultQueue.remove(requestId);
        mRawResultQueue.remove(requestId);
        finishedCaptureLocked();
    }
    showToast("Capture failed!");
}
 
開發者ID:OkayCamera,項目名稱:OkayCamera-Android,代碼行數:12,代碼來源:Camera2RawFragment.java


注:本文中的android.hardware.camera2.CaptureRequest.getTag方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。