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

Commit e6a550d0 authored by Wu-cheng Li's avatar Wu-cheng Li
Browse files

Add zoom functions and sendCommand.

b2060030
parent 7854a353
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -368,6 +368,12 @@ CameraParameters CameraHardwareStub::getParameters() const
    return mParameters;
}

status_t CameraHardwareStub::sendCommand(int32_t command, int32_t arg1,
                                         int32_t arg2)
{
    return BAD_VALUE;
}

void CameraHardwareStub::release()
{
}
+2 −0
Original line number Diff line number Diff line
@@ -57,6 +57,8 @@ public:
    virtual status_t    dump(int fd, const Vector<String16>& args) const;
    virtual status_t    setParameters(const CameraParameters& params);
    virtual CameraParameters  getParameters() const;
    virtual status_t    sendCommand(int32_t command, int32_t arg1,
                                    int32_t arg2);
    virtual void release();

    static sp<CameraHardwareInterface> createInstance();
+18 −3
Original line number Diff line number Diff line
@@ -1134,6 +1134,21 @@ String8 CameraService::Client::getParameters() const
    return params;
}

status_t CameraService::Client::sendCommand(int32_t cmd, int32_t arg1, int32_t arg2)
{
    LOGD("sendCommand (pid %d)", getCallingPid());
    Mutex::Autolock lock(mLock);
    status_t result = checkPid();
    if (result != NO_ERROR) return result;

    if (mHardware == 0) {
        LOGE("mHardware is NULL, returning.");
        return INVALID_OPERATION;
    }

    return mHardware->sendCommand(cmd, arg1, arg2);
}

void CameraService::Client::copyFrameAndPostCopiedFrame(sp<IMemoryHeap> heap, size_t offset, size_t size)
{
    LOGV("copyFrameAndPostCopiedFrame");
+3 −0
Original line number Diff line number Diff line
@@ -122,6 +122,9 @@ private:
        // get preview/capture parameters - key/value pairs
        virtual String8         getParameters() const;

        // send command to camera driver
        virtual status_t        sendCommand(int32_t cmd, int32_t arg1, int32_t arg2);

        // our client...
        const sp<ICameraClient>&    getCameraClient() const { return mCameraClient; }

+9 −0
Original line number Diff line number Diff line
@@ -78,6 +78,12 @@ enum {
    CAMERA_MSG_ALL_MSGS         = 0x1FF
};

// cmdType in sendCommand functions
enum {
    CAMERA_CMD_START_SMOOTH_ZOOM     = 1,
    CAMERA_CMD_STOP_SMOOTH_ZOOM      = 2,
};

// camera fatal errors
enum {
    CAMERA_ERROR_UKNOWN  = 1,
@@ -155,6 +161,9 @@ public:
            // get preview/capture parameters - key/value pairs
            String8     getParameters() const;

            // send command to camera driver
            status_t    sendCommand(int32_t cmd, int32_t arg1, int32_t arg2);

            void        setListener(const sp<CameraListener>& listener);
            void        setPreviewCallbackFlags(int preview_callback_flag);

Loading