Merge "Camera: Bump up the extension jpeg processor blob size" am: 7f84edad87

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2541630

Change-Id: I4b3ecd79335f23791f5ba0e12c83208efef3fc16
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2023-04-21 02:15:58 +00:00
committed by Automerger Merge Worker

View File

@@ -46,6 +46,7 @@ import java.util.concurrent.ConcurrentLinkedQueue;
public class CameraExtensionJpegProcessor implements ICaptureProcessorImpl { public class CameraExtensionJpegProcessor implements ICaptureProcessorImpl {
public final static String TAG = "CameraExtensionJpeg"; public final static String TAG = "CameraExtensionJpeg";
private final static int JPEG_QUEUE_SIZE = 1; private final static int JPEG_QUEUE_SIZE = 1;
private final static int JPEG_APP_SEGMENT_SIZE = 64 * 1024;
private final Handler mHandler; private final Handler mHandler;
private final HandlerThread mHandlerThread; private final HandlerThread mHandlerThread;
@@ -225,9 +226,10 @@ public class CameraExtensionJpegProcessor implements ICaptureProcessorImpl {
private void initializePipeline() throws RemoteException { private void initializePipeline() throws RemoteException {
if ((mFormat != -1) && (mOutputSurface != null) && (mResolution != null) && if ((mFormat != -1) && (mOutputSurface != null) && (mResolution != null) &&
(mYuvReader == null)) { (mYuvReader == null)) {
// Jpeg/blobs are expected to be configured with (w*h)x1 // Jpeg/blobs are expected to be configured with (w*h)x1.5 + 64k Jpeg APP1 segment
mOutputWriter = ImageWriter.newInstance(mOutputSurface, 1 /*maxImages*/, mOutputWriter = ImageWriter.newInstance(mOutputSurface, 1 /*maxImages*/,
ImageFormat.JPEG, mResolution.width * mResolution.height, 1); ImageFormat.JPEG,
(mResolution.width * mResolution.height * 3)/2 + JPEG_APP_SEGMENT_SIZE, 1);
mYuvReader = ImageReader.newInstance(mResolution.width, mResolution.height, mFormat, mYuvReader = ImageReader.newInstance(mResolution.width, mResolution.height, mFormat,
JPEG_QUEUE_SIZE); JPEG_QUEUE_SIZE);
mYuvReader.setOnImageAvailableListener(new YuvCallback(), mHandler); mYuvReader.setOnImageAvailableListener(new YuvCallback(), mHandler);