栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

Camera-CreateCaptureSession

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Camera-CreateCaptureSession

        Camera CaptureSession is a operation to configure the camera device's internal pipelines and allocating memory buffers to sending images to the desired targets. 

        A configured capture session for a cameraDevice is used for capturing images from the camera or reprocessing images captured from the camera in the same session previously and providing a set of target output surfaces for reprocessable capture session, and once created, the session is active until a new session is created by the camera device, or the camera device is closed.

Part One: createCaptureSession by List

        camera createCaptureSession by List will produce potentially risk to delaying camera startup. For example, if the preview Surface is obtained from SurfaceView, the SurfaceView will only be ready after the UI layout is done, so this opreation will take some time for waiting preview surface to be ready.

        Below is the struct of the createCaptureSession by List and releated API.

         

framework/base/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java

 

Part Two: createCaptureSession by List 

        To speed up camera startup time, the users can configure the CameraCaptureSession with the eventual preview size via OutputConfiguration and defer the preview output comfiguration until the Surface is ready. After the CameraCaptureSession is created successfully with this deferred output and other normal outputs, the application can start submitting requests as long as the do not include deferred out Surfaces. Once a deferred Surface is ready, the application can add the Surface to the Surface to the deferred output configuration with the addSurface method, and then update the deferred output configuration via this method, before it can submit caoture requests with this output target.

         finalizeOutputConfigurations- This function can also be called in case where multiple surfaces share the same OutputConfiguration, and one of the surfaces becomes available after the CameraCaptureSession is created. In that case, the user must first create the outputConfiguration with the available Surface before creating the CameraCaptureSession. After the CameraCaptureSession is created, and once the extra Surface becomes available, the users must then call add Surface before finalizing the configuration with this method, and attention again, if the provided OutputConfigurations are unchanged from session creation, this function call has no effect. This function must only be called once fir a particular output configuration.

        Below is the structure of the createCaptureSession by List and releated API.

 

        Attention: Use this method to quickly create cameraCaptureSession may be produce some errors when outputconfiguration that is different from the surface has been changed as different size and formats.

        Below has some error information to check and stay cautiously.

 

Part Three: createCaptureSession by createCaptureSessionByOutputConfigurations

        This method create a new camera capture session by providing the target output set of Surfaces and its correspending surface configuration to the camera device.

        Below is the releated API and function invoke.

 

 

 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/993094.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号