当前位置: 首页>>代码示例>>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;未经允许,请勿转载。