Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5018d39c authored by Emilian Peev's avatar Emilian Peev Committed by Ricardo Cerqueira
Browse files

CameraService: Adds support for longshot mode

- This change introduces additional functionality inside
  CameraClient for supporting continuous compressed data
  callbacks. This is needed for 'Burst/Long shot' mode
  where we could have indefinite number of callbacks after
  capture is triggered.

CRs-Fixed: 514199
Change-Id: I8b155e305a836729b071e5388a7046c6347bb9f3
parent 0296537c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -960,6 +960,7 @@ CameraService::Client::Client(const sp<CameraService>& cameraService,
    LOG1("Client::Client E (pid %d, id %d)", callingPid, cameraId);

    mRemoteCallback = cameraClient;
    mLongshotEnabled = false;

    cameraService->setCameraBusy(cameraId);
    cameraService->loadSound();
+1 −1
Original line number Diff line number Diff line
@@ -267,11 +267,11 @@ public:

        virtual void         notifyError();

        // Initialized in constructor

        // - The app-side Binder interface to receive callbacks from us
        sp<ICameraClient>               mRemoteCallback;

        bool                 mLongshotEnabled;
    }; // class Client

    class ProClient : public BnProCameraUser, public BasicClient {
+10 −2
Original line number Diff line number Diff line
@@ -693,6 +693,12 @@ status_t CameraClient::sendCommand(int32_t cmd, int32_t arg1, int32_t arg2) {
        enableMsgType(CAMERA_MSG_META_DATA);
    } else if (cmd == CAMERA_CMD_METADATA_OFF) {
        disableMsgType(CAMERA_MSG_META_DATA);
    } else if ( cmd == CAMERA_CMD_LONGSHOT_ON ) {
        mLongshotEnabled = true;
    } else if ( cmd == CAMERA_CMD_LONGSHOT_OFF ) {
        mLongshotEnabled = false;
        disableMsgType(CAMERA_MSG_SHUTTER);
        disableMsgType(CAMERA_MSG_COMPRESSED_IMAGE);
#endif
    }

@@ -871,7 +877,9 @@ void CameraClient::handleShutter(void) {
        c->notifyCallback(CAMERA_MSG_SHUTTER, 0, 0);
        if (!lockIfMessageWanted(CAMERA_MSG_SHUTTER)) return;
    }
    if ( !mLongshotEnabled ) {
        disableMsgType(CAMERA_MSG_SHUTTER);
    }

    mLock.unlock();
}
@@ -954,7 +962,7 @@ void CameraClient::handleCompressedPicture(const sp<IMemory>& mem) {
    if (mBurstCnt)
        mBurstCnt--;

    if (!mBurstCnt) {
    if (!mBurstCnt && !mLongshotEnabled) {
        LOG1("handleCompressedPicture mBurstCnt = %d", mBurstCnt);
#endif
        disableMsgType(CAMERA_MSG_COMPRESSED_IMAGE);