A Tutorial on android.hardware.camera2.*
来源:互联网 发布:手机淘宝怎么查号截图 编辑:程序博客网 时间:2024/06/05 16:30
http://jylee-world.blogspot.com/2014/12/a-tutorial-of-androidhardwarecamera2.html
Introduction
Since android.hardware.camera is deprecated after API V21, we use android.hardware.camera2.*. The related reference ishttp://developer.android.com/reference/android/hardware/camera2/package-summary.html . But this is a kind of a dictionary. We need simple tutorials. There is no good sample code even in http://developer.android.com .After long googling I found good one :
http://blog.csdn.net/torvalbill/article/details/40378539 . And I made my own document focused on only Camera Preview.
All of my code is here : https://github.com/stereoboy/android_samples
Setup All of related objects
The following list is as follows:- CameraManager
- Select Camera
- Create CameraDevice
- CameraDevice
- Create CaptureRequest
- Create CameraCaptureSession
- CaptureRequest, CaptureRequest.CameraBuilder
- Link Surface for Viewing
- Make CaptureRequest
- CameraCaptureSession
- Capture Camare Image and put the result on the Surface registered in CaptureRequest.
One of reasons why the related objects are a little bit complex is most of set-up process is done asynchronously. For example when we create CameraDevice, at first we register a callback function on CameraManager. When CameraDevice is created and the callback is called, we get CameraDevice in the callback code.
Repeated Capture by using HandlerThread
Main thread should not be blocked by Camera Capture. So we set up a background thread using HandlerThread and Handler
0 0
- A Tutorial on android.hardware.camera2.*
- android.hardware.camera2使用指南
- android.hardware.camera2使用指南
- android.hardware.camera2使用指南
- android.hardware.camera2使用指南
- android.hardware.camera2使用指南
- 一、Camera2 操作android.hardware.Camera 分析
- Android实战技巧之三十三:android.hardware.camera2使用指南
- Android实战技巧之三十三:android.hardware.camera2使用指南
- 使用android.hardware.camera2打造新的自定义相机
- cts android.hardware.camera2.cts.RecordingTest --testBasicRecording fail
- android.hardware.camera2详解(实时更新,未完待续...)
- A tutorial on Matrix
- A Tutorial on IP Multicast
- A Tutorial on Clustering Algorithms
- A Tutorial on Clustering Algorithms
- A Tutorial on Clustering Algorithms
- A Tutorial on Clustering Algorithms
- iOS设计模式——单例模式,你看我就够了.两行代码创建单例(兼容ARC/MRC)
- 在代码中使用Autolayout (1) – 按比例缩放和优先级
- js 点击按钮跳转 window.location.href
- Pull解析器解析XML
- 微内核与宏内核
- A Tutorial on android.hardware.camera2.*
- Python 递归函数
- struts2入门
- OC学习:文件读写
- How to Tune Java Garbage Collection
- js 对象方式传参数
- Java反射机制
- 新的开始
- 我的iOS开发之Objective-C第3天之面向对象特性之继承、多态