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

Commit a1d1a0dc authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

Camera: Add qcom-compatible symbols

CAF-derived libcamera blobs expect the symbols to be named
*CONTINUOUS_AF*, not *CAF* like in HTC's.
Also, the handleShutter calls are used with a second boolean
argument, to specify whether it's the final shutter callback or just
a sound request. Enable these with BOARD_USE_CAF_LIBCAMERA

Change-Id: I3437c579a686ac64248cefbdf26affdfa0ef6909
parent 0f584c0f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -346,7 +346,9 @@ public:

    //Continuous AF.
    static const char KEY_CAF[];
    static const char KEY_CONTINUOUS_AF[];
    static const char KEY_SUPPORTED_CAF[];
    static const char KEY_SUPPORTED_CONTINUOUS_AF[];

    // Values for white balance settings.
    static const char WHITE_BALANCE_AUTO[];
@@ -455,6 +457,9 @@ public:
    // Values for Continuous AF
    static const char CAF_OFF[] ;
    static const char CAF_ON[] ;
    // Proprietaries from CodeAurora use these...
    static const char CONTINUOUS_AF_OFF[] ;
    static const char CONTINUOUS_AF_ON[] ;

    static const char ISO_AUTO[];
    static const char ISO_HJR[] ;
+5 −0
Original line number Diff line number Diff line
@@ -82,7 +82,9 @@ const char CameraParameters::KEY_SMOOTH_ZOOM_SUPPORTED[] = "smooth-zoom-supporte
const char CameraParameters::KEY_FOCUS_DISTANCES[] = "focus-distances";
const char CameraParameters::KEY_VIDEO_FRAME_FORMAT[] = "video-frame-format";
const char CameraParameters::KEY_CAF[] = "continuous-af";
const char CameraParameters::KEY_CONTINUOUS_AF[] = "continuous-af";
const char CameraParameters::KEY_SUPPORTED_CAF[] = "continuous-af-values";
const char CameraParameters::KEY_SUPPORTED_CONTINUOUS_AF[] = "continuous-af-values";

const char CameraParameters::TRUE[] = "true";
const char CameraParameters::FOCUS_DISTANCE_INFINITY[] = "Infinity";
@@ -204,6 +206,9 @@ const char CameraParameters::LENSSHADE_DISABLE[] = "disable";
//Values for Continuous AF
const char CameraParameters::CAF_OFF[] = "caf-off";
const char CameraParameters::CAF_ON[] = "caf-on";
//Same, for CodeAurora-based blobs
const char CameraParameters::CONTINUOUS_AF_OFF[] = "caf-off";
const char CameraParameters::CONTINUOUS_AF_ON[] = "caf-on";

CameraParameters::CameraParameters()
                : mMap()
+5 −0
Original line number Diff line number Diff line
@@ -83,4 +83,9 @@ LOCAL_CFLAGS += -DUSE_OVERLAY_FORMAT_YCbCr_420_SP
LOCAL_C_INCLUDES += hardware/msm7k/libgralloc-qsd8k
endif

ifeq ($(BOARD_USE_CAF_LIBCAMERA), true)
    LOCAL_CFLAGS += -DBOARD_USE_CAF_LIBCAMERA
endif


include $(BUILD_SHARED_LIBRARY)
+22 −1
Original line number Diff line number Diff line
@@ -1032,7 +1032,11 @@ void CameraService::Client::notifyCallback(int32_t msgType, int32_t ext1,
    switch (msgType) {
        case CAMERA_MSG_SHUTTER:
            // ext1 is the dimension of the yuv picture.
#ifdef BOARD_USE_CAF_LIBCAMERA
            client->handleShutter((image_rect_type *)ext1, (bool)ext2);
#else
            client->handleShutter((image_rect_type *)ext1);
#endif
            break;
        default:
            client->handleGenericNotify(msgType, ext1, ext2);
@@ -1093,8 +1097,25 @@ void CameraService::Client::dataCallbackTimestamp(nsecs_t timestamp,
// snapshot taken callback
// "size" is the width and height of yuv picture for registerBuffer.
// If it is NULL, use the picture size from parameters.
void CameraService::Client::handleShutter(image_rect_type *size) {
void CameraService::Client::handleShutter(image_rect_type *size
#ifdef BOARD_USE_CAF_LIBCAMERA
    , bool playShutterSoundOnly
#endif
) {

#ifdef BOARD_USE_CAF_LIBCAMERA
    if(playShutterSoundOnly) {
#endif
    mCameraService->playSound(SOUND_SHUTTER);
#ifdef BOARD_USE_CAF_LIBCAMERA
    sp<ICameraClient> c = mCameraClient;
    if (c != 0) {
        mLock.unlock();
        c->notifyCallback(CAMERA_MSG_SHUTTER, 0, 0);
    }
    return;
    }
#endif

    // Screen goes black after the buffer is unregistered.
    if (mSurface != 0 && !mUseOverlay) {
+4 −0
Original line number Diff line number Diff line
@@ -146,7 +146,11 @@ private:
        // convert client from cookie
        static sp<Client>       getClientFromCookie(void* user);
        // handlers for messages
#ifdef BOARD_USE_CAF_LIBCAMERA
        void                    handleShutter(image_rect_type *size,  bool playShutterSoundOnly);
#else
        void                    handleShutter(image_rect_type *size);
#endif
        void                    handlePreviewData(const sp<IMemory>& mem);
        void                    handlePostview(const sp<IMemory>& mem);
        void                    handleRawPicture(const sp<IMemory>& mem);