|
|
|
@ -40,6 +40,9 @@ static const uint64_t kMaxExposureTime = static_cast<uint64_t>(250000000);
|
|
|
|
|
#define WAIT_AF_LOCKED 4
|
|
|
|
|
|
|
|
|
|
#define PREVIEW_REQUEST_IDX 0
|
|
|
|
|
#define CAPTURE_REQUEST_IDX 1
|
|
|
|
|
|
|
|
|
|
#define DEFAULT_WARMUP_TIME 250 // 250ms
|
|
|
|
|
|
|
|
|
|
class CameraManager
|
|
|
|
|
{
|
|
|
|
@ -161,7 +164,7 @@ public:
|
|
|
|
|
void CreateSession(ANativeWindow* previewWindow, ANativeWindow* jpgWindow, bool manaulPreview, int32_t imageRotation, int32_t width, int32_t height);
|
|
|
|
|
void CreateSession(ANativeWindow* previewWindow);
|
|
|
|
|
|
|
|
|
|
CaptureRequest* CreateRequest(bool isPreviewRequest);
|
|
|
|
|
CaptureRequest* CreateRequest(bool isPreviewRequest, int32_t sensitivity = -1);
|
|
|
|
|
void DestroyRequest(CaptureRequest* request);
|
|
|
|
|
|
|
|
|
|
void DestroySession();
|
|
|
|
@ -203,7 +206,7 @@ public:
|
|
|
|
|
static void EnumCameraResult(ACameraMetadata* result, CAPTURE_RESULT& captureResult);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void SetupMFNR(ACameraMetadata* characteristics, ACaptureRequest* request);
|
|
|
|
|
void SetupMFNR(ACameraMetadata* characteristics, ACaptureRequest* request, bool ais, int32_t sensitivity);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
std::mutex m_locker;
|
|
|
|
@ -243,10 +246,10 @@ protected:
|
|
|
|
|
bool mCaptureTriggered;
|
|
|
|
|
bool mFocusTriggered;
|
|
|
|
|
bool mCaptureDispatched;
|
|
|
|
|
uint32_t mStableFrameCount;
|
|
|
|
|
|
|
|
|
|
CAPTURE_RESULT mResult;
|
|
|
|
|
uint64_t m_startTime;
|
|
|
|
|
uint64_t m_delayFrames;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
@ -262,14 +265,22 @@ protected:
|
|
|
|
|
ACameraOutputTarget* mPreviewOutputTarget;
|
|
|
|
|
ACaptureSessionOutput* mPreviewSessionOutput;
|
|
|
|
|
|
|
|
|
|
AImageReader* mImageReader;
|
|
|
|
|
ANativeWindow* mImageWindow;
|
|
|
|
|
ACameraOutputTarget* mOutputTarget;
|
|
|
|
|
ACaptureSessionOutput* mSessionOutput;
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<ACameraMetadata> mCharacteristics;
|
|
|
|
|
std::vector<CaptureRequest*> mCaptureRequests;
|
|
|
|
|
|
|
|
|
|
ACameraCaptureSession* capture_session;
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<ACameraMetadata> mPreviewResults;
|
|
|
|
|
std::vector<std::shared_ptr<ACameraMetadata> > mCaptureResults;
|
|
|
|
|
std::map<int64_t, std::shared_ptr<ACameraMetadata> > mCaptureResultMap;
|
|
|
|
|
uint32_t mLdr;
|
|
|
|
|
uint32_t mFinalLdr;
|
|
|
|
|
uint32_t mFinalBurstCaptures;
|
|
|
|
|
int32_t mFinalOutputFormat;
|
|
|
|
|
std::vector<std::shared_ptr<AImage> > mCaptureFrames;
|
|
|
|
|
|
|
|
|
@ -278,12 +289,6 @@ protected:
|
|
|
|
|
std::vector<std::vector<uint8_t> > mRawFrames;
|
|
|
|
|
int64_t m_minTimestamp;
|
|
|
|
|
|
|
|
|
|
// AImageReader* image_reader;
|
|
|
|
|
// ANativeWindow* image_reader_surface;
|
|
|
|
|
// ACameraOutputTarget* image_reader_target;
|
|
|
|
|
// ACaptureRequest* capture_request;
|
|
|
|
|
// ACaptureSessionOutput* capture_session_output;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // NDKCAMERA_H
|
|
|
|
|