gpt4 book ai didi

java - CameraView.takePicture() 将捕获的图像字节发送到哪里?

转载 作者:行者123 更新时间:2023-12-02 02:25:20 27 4
gpt4 key购买 nike

我正在查看消息应用程序 Signal 的 Android 代码,并尝试查看捕获的图像字节发送到的位置。

  public void takePicture(final Rect previewRect) {
if (!camera.isPresent() || camera.get().getParameters() == null) {
Log.w(TAG, "camera not in capture-ready state");
return;
}

camera.get().setOneShotPreviewCallback(new Camera.PreviewCallback() {
@Override
public void onPreviewFrame(byte[] data, final Camera camera) {
final int rotation = getCameraPictureOrientation();
final Size previewSize = camera.getParameters().getPreviewSize();
final Rect croppingRect = getCroppedRect(previewSize, previewRect, rotation);

Log.w(TAG, "previewSize: " + previewSize.width + "x" + previewSize.height);
Log.w(TAG, "data bytes: " + data.length);
Log.w(TAG, "previewFormat: " + camera.getParameters().getPreviewFormat());
Log.w(TAG, "croppingRect: " + croppingRect.toString());
Log.w(TAG, "rotation: " + rotation);
new CaptureTask(previewSize, rotation, croppingRect).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, data);
}
});
}

它是否被发送到 CaptureTask 构造函数?我对图像写入存储的时间/位置特别感兴趣。这是代码相关部分的链接:CameraView.java

最佳答案

I'm trying to see where the captured image bytes are sent to.

捕获的图像字节是byte[]数据data 被传递给 executeOnExecutor()CaptureTask 是一个AsyncTaskbyte[] 被传递给 doInBackground()

关于java - CameraView.takePicture() 将捕获的图像字节发送到哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47873196/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com