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


Java CameraDevice.createCaptureRequest方法代碼示例

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


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

示例1: setupCaptureRequestForPreview

import android.hardware.camera2.CameraDevice; //導入方法依賴的package包/類
/**
 * does setup the repeating capture request for taking images for the preview
 */
@VisibleForTesting
void setupCaptureRequestForPreview(@NonNull CameraCaptureSession previewSession, @NonNull CameraDevice camera,
                                   @NonNull List<Surface> surfaces) {
    try {
        CaptureRequest.Builder previewRequestBuilder = camera.createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW);
        for (Surface surface : surfaces) {
            previewRequestBuilder.addTarget(surface);
        }
        previewRequestBuilder.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE);

        previewSession.setRepeatingRequest(previewRequestBuilder.build(), null, null);

    } catch (CameraAccessException | IllegalStateException e) {
        throw new CameraException(e);
    }
}
 
開發者ID:BioID-GmbH,項目名稱:BWS-Android,代碼行數:20,代碼來源:CameraHelper.java

示例2: createCaptureRequest

import android.hardware.camera2.CameraDevice; //導入方法依賴的package包/類
/**
 * Get a request builder for the current camera.
 */
public CaptureRequest.Builder createCaptureRequest(int template) throws CameraAccessException {
    CameraDevice device = mCameraDevice;
    if (device == null) {
        throw new IllegalStateException("Can't get requests when no camera is open");
    }
    return device.createCaptureRequest(template);
}
 
開發者ID:lydia-schiff,項目名稱:hella-renderscript,代碼行數:11,代碼來源:CameraOps.java

示例3: onOpened

import android.hardware.camera2.CameraDevice; //導入方法依賴的package包/類
@Override
public void onOpened(CameraDevice cameraDevice) {
    Log.d(TAG, "相機已經打開");
    try {
        mPreViewBuilder = cameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW);
        SurfaceTexture texture = mTextureView.getSurfaceTexture();
        texture.setDefaultBufferSize(mPreViewSize.getWidth(), mPreViewSize.getHeight());
        surface = new Surface(texture);
        mPreViewBuilder.addTarget(surface);
        cameraDevice.createCaptureSession(Arrays.asList(surface, mImageReader.getSurface
                ()), mSessionStateCallBack, mHandler);
    } catch (CameraAccessException e) {
        e.printStackTrace();
    }
}
 
開發者ID:lupwei,項目名稱:Croprotector,代碼行數:16,代碼來源:Shoot_fragment.java


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