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

Commit aad9f21a authored by Steve Kondik's avatar Steve Kondik
Browse files

camera: Wrap getBufferInfo code in ifdefs.

Define BOARD_CAMERA_USE_GETBUFFERINFO if required.

Change-Id: Ieac0bed92c8a1517a6a7730b9636f3591c55bbcb
parent 731adc40
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -31,6 +31,10 @@ endif

LOCAL_SHARED_LIBRARIES:= libui

ifeq ($(BOARD_CAMERA_USE_GETBUFFERINFO),true)
    LOCAL_CFLAGS += -DUSE_GETBUFFERINFO
endif

include $(BUILD_STATIC_LIBRARY)
endif # USE_CAMERA_STUB

@@ -71,5 +75,9 @@ else
LOCAL_SHARED_LIBRARIES += libcamera 
endif

ifeq ($(BOARD_CAMERA_USE_GETBUFFERINFO),true)
    LOCAL_CFLAGS += -DUSE_GETBUFFERINFO
endif

include $(BUILD_SHARED_LIBRARY)
+2 −0
Original line number Diff line number Diff line
@@ -400,6 +400,7 @@ extern "C" sp<CameraHardwareInterface> openCameraHardware()
    return CameraHardwareStub::createInstance();
}

#ifdef USE_GETBUFFERINFO
status_t CameraHardwareStub::getBufferInfo(sp<IMemory>& Frame, size_t *alignedSize) {
    /* No Support for this API in STUB Camera. Just return NULL */
    Frame = NULL;
@@ -408,4 +409,5 @@ status_t CameraHardwareStub::getBufferInfo(sp<IMemory>& Frame, size_t *alignedSi

    return UNKNOWN_ERROR;
}
#endif
}; // namespace android
+2 −1
Original line number Diff line number Diff line
@@ -60,8 +60,9 @@ public:
    virtual CameraParameters  getParameters() const;
    virtual status_t    sendCommand(int32_t command, int32_t arg1,
                                    int32_t arg2);
#ifdef USE_GETBUFFERINFO
    virtual status_t getBufferInfo( sp<IMemory>& Frame, size_t *alignedSize);

#endif
    virtual void release();

    static sp<CameraHardwareInterface> createInstance();
+13 −11
Original line number Diff line number Diff line
@@ -709,6 +709,19 @@ status_t CameraService::Client::startPreviewMode()
    return ret;
}

#ifdef USE_GETBUFFERINFO
status_t CameraService::Client::getBufferInfo(sp<IMemory>& Frame, size_t *alignedSize)
{
    LOGD(" getBufferInfo : E");
    if (mHardware == NULL) {
        LOGE("mHardware is NULL, returning.");
        Frame = NULL;
	return INVALID_OPERATION;
    }
    return mHardware->getBufferInfo(Frame, alignedSize);
}
#endif

status_t CameraService::Client::startPreview()
{
    LOGV("startPreview (pid %d)", getCallingPid());
@@ -1478,15 +1491,4 @@ status_t CameraService::onTransact(
    return err;
}

status_t CameraService::Client::getBufferInfo(sp<IMemory>& Frame, size_t *alignedSize)
{
    LOGD(" getBufferInfo : E");
    if (mHardware == NULL) {
        LOGE("mHardware is NULL, returning.");
        Frame = NULL;
        return INVALID_OPERATION;
    }
    return mHardware->getBufferInfo(Frame, alignedSize);
}

}; // namespace android
+4 −3
Original line number Diff line number Diff line
@@ -86,6 +86,10 @@ private:
        // preview are handled.
        virtual void            setPreviewCallbackFlag(int callback_flag);

#ifdef USE_GETBUFFERINFO
        // get the recording buffers information from HAL Layer.
        virtual status_t        getBufferInfo(sp<IMemory>& Frame, size_t *alignedSize);
#endif
        // start preview mode, must call setPreviewDisplay first
        virtual status_t        startPreview();

@@ -128,9 +132,6 @@ private:
        // our client...
        const sp<ICameraClient>&    getCameraClient() const { return mCameraClient; }

        // get the recording buffers information from HAL Layer.
        virtual status_t        getBufferInfo(sp<IMemory>& Frame, size_t *alignedSize);

    private:
        friend class CameraService;
                                Client(const sp<CameraService>& cameraService,
Loading