本文整理汇总了Java中android.hardware.Camera.setOneShotPreviewCallback方法的典型用法代码示例。如果您正苦于以下问题:Java Camera.setOneShotPreviewCallback方法的具体用法?Java Camera.setOneShotPreviewCallback怎么用?Java Camera.setOneShotPreviewCallback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.hardware.Camera
的用法示例。
在下文中一共展示了Camera.setOneShotPreviewCallback方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: requestPreviewFrame
import android.hardware.Camera; //导入方法依赖的package包/类
/**
* A single preview frame will be returned to the handler supplied. The data
* will arrive as byte[] in the message.obj field, with width and height
* encoded as message.arg1 and message.arg2, respectively.
*
* @param handler
* The handler to send the message to.
* @param message
* The what field of the message to be sent.
*/
public synchronized void requestPreviewFrame(Handler handler, int message) {
Camera theCamera = camera;
if (theCamera != null && previewing) {
previewCallback.setHandler(handler, message);
theCamera.setOneShotPreviewCallback(previewCallback);
}
}
示例2: requestPreviewFrame
import android.hardware.Camera; //导入方法依赖的package包/类
/**
* A single preview frame will be returned to the handler supplied. The data will arrive as byte[]
* in the message.obj field, with width and height encoded as message.arg1 and message.arg2,
* respectively.
*
* @param handler The handler to send the message to.
* @param message The what field of the message to be sent.
*/
public synchronized void requestPreviewFrame(Handler handler, int message) {
Camera theCamera = camera;
if (theCamera != null && previewing) {
previewCallback.setHandler(handler, message);
theCamera.setOneShotPreviewCallback(previewCallback);
}
}
示例3: requestPreviewFrame
import android.hardware.Camera; //导入方法依赖的package包/类
/**
* A single preview frame will be returned to the handler supplied. The data
* will arrive as byte[] in the message.obj field, with width and height
* encoded as message.arg1 and message.arg2, respectively.
*
* @param handler The handler to send the message to.
* @param message The what field of the message to be sent.
*/
public synchronized void requestPreviewFrame(Handler handler, int message) {
Camera theCamera = camera;
if (theCamera != null && previewing) {
previewCallback.setHandler(handler, message);
theCamera.setOneShotPreviewCallback(previewCallback);
}
}
示例4: requestPreviewFrame
import android.hardware.Camera; //导入方法依赖的package包/类
/**
* A single preview frame will be returned to the supplied callback.
*
* The thread on which this called is undefined, so a Handler should be used to post the result
* to the correct thread.
*
* @param callback The callback to receive the preview.
*/
public void requestPreviewFrame(PreviewCallback callback) {
Camera theCamera = camera;
if (theCamera != null && previewing) {
cameraPreviewCallback.setCallback(callback);
theCamera.setOneShotPreviewCallback(cameraPreviewCallback);
}
}
示例5: requestPreviewFrame
import android.hardware.Camera; //导入方法依赖的package包/类
/**
* A single preview frame will be returned to the handler supplied. The data will arrive as byte[]
* in the message.obj field, with width and height encoded as message.arg1 and message.arg2,
* respectively.
*
* @param handler The handler to send the message to.
* @param message The what field of the message to be sent.
*/
public synchronized void requestPreviewFrame(Handler handler, int message) {
Camera theCamera = camera;
if (theCamera != null && previewing) {
previewCallback.setHandler(handler, message);
theCamera.setOneShotPreviewCallback(previewCallback);
}
}
示例6: requestPreviewFrame
import android.hardware.Camera; //导入方法依赖的package包/类
/**
* A single preview frame will be returned to the handler supplied. The data
* will arrive as byte[] in the message.obj field, with width and height
* encoded as message.arg1 and message.arg2, respectively. <br/>
*
* 两个绑定操作:<br/>
* 1:将handler与回调函数绑定;<br/>
* 2:将相机与回调函数绑定<br/>
* 综上,该函数的作用是当相机的预览界面准备就绪后就会调用hander向其发送传入的message
*
* @param handler
* The handler to send the message to.
* @param message
* The what field of the message to be sent.
*/
public synchronized void requestPreviewFrame(Handler handler, int message) {
Camera theCamera = camera;
if (theCamera != null && previewing) {
previewCallback.setHandler(handler, message);
// 绑定相机回调函数,当预览界面准备就绪后会回调Camera.PreviewCallback.onPreviewFrame
theCamera.setOneShotPreviewCallback(previewCallback);
}
}