Camera2: State must be STOPPED before JPEG callback is fired.
Move handling of JPEG callback to CaptureSequencer instead of
JpegProcessor, so that we can be sure the camera state is updated to
STOPPED before the JPEG callback is sent to the application layer.
Bug: 7172743
Change-Id: Ie8752d946d3eb8254230c77f10e5c38a83dc5371
diff --git a/services/camera/libcameraservice/camera2/CaptureSequencer.h b/services/camera/libcameraservice/camera2/CaptureSequencer.h
index 474bdac..f0d1e79 100644
--- a/services/camera/libcameraservice/camera2/CaptureSequencer.h
+++ b/services/camera/libcameraservice/camera2/CaptureSequencer.h
@@ -17,6 +17,7 @@
#ifndef ANDROID_SERVERS_CAMERA_CAMERA2_CAPTURESEQUENCER_H
#define ANDROID_SERVERS_CAMERA_CAMERA2_CAPTURESEQUENCER_H
+#include <binder/MemoryBase.h>
#include <utils/Thread.h>
#include <utils/String16.h>
#include <utils/Vector.h>
@@ -58,8 +59,8 @@
// Notifications from the frame processor
virtual void onFrameAvailable(int32_t frameId, CameraMetadata &frame);
- // Notifications from the capture processor
- void onCaptureAvailable(nsecs_t timestamp);
+ // Notifications from the JPEG processor
+ void onCaptureAvailable(nsecs_t timestamp, sp<MemoryBase> captureBuffer);
void dump(int fd, const Vector<String16>& args);
@@ -85,6 +86,7 @@
bool mNewCaptureReceived;
nsecs_t mCaptureTimestamp;
+ sp<MemoryBase> mCaptureBuffer;
Condition mNewCaptureSignal;
/**