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

Commit 47442948 authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "Camera: Add support for getBufferInfo API" into gingerbread

parents df6bfa19 5b798452
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2008 The Android Open Source Project
 * Copyright (C) 2008 HTC Inc.
 * Copyright (C) 2010, Code Aurora Forum. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -170,6 +172,11 @@ public:
            status_t    setPreviewDisplay(const sp<Surface>& surface);
            status_t    setPreviewDisplay(const sp<ISurface>& surface);

#ifdef USE_GETBUFFERINFO
            // query the recording buffer information from HAL layer.
            status_t    getBufferInfo(sp<IMemory>& Frame, size_t *alignedSize);
#endif

            // start preview mode, must call setPreviewDisplay first
            status_t    startPreview();

+11 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2008 The Android Open Source Project
 * Copyright (C) 2010, Code Aurora Forum. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -126,6 +127,15 @@ public:
     */
    virtual status_t    startPreview() = 0;

#ifdef USE_GETBUFFERINFO
    /**
     * Query the recording buffer information from HAL.
     * This is needed because the opencore expects the buffer
     * information before starting the recording.
     */
    virtual status_t    getBufferInfo(sp<IMemory>& Frame, size_t *alignedSize) = 0;
#endif

    /**
     * Only used if overlays are used for camera preview.
     */
@@ -213,6 +223,7 @@ public:
     * Dump state of the camera hardware
     */
    virtual status_t dump(int fd, const Vector<String16>& args) const = 0;

};

/**
+8 −1
Original line number Diff line number Diff line
/*
 * Copyright (C) 2008 The Android Open Source Project
 * Copyright (C) 2010, Code Aurora Forum. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -52,6 +53,11 @@ public:
    // preview are handled.
    virtual void            setPreviewCallbackFlag(int flag) = 0;

#ifdef USE_GETBUFFERINFO
    // get the recording buffer information from HAL layer.
    virtual status_t        getBufferInfo(sp<IMemory>& Frame, size_t *alignedSize) = 0;
#endif

    // start preview mode, must call setPreviewDisplay first
    virtual status_t        startPreview() = 0;

@@ -90,6 +96,7 @@ public:

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

};

// ----------------------------------------------------------------------------
+4 −0
Original line number Diff line number Diff line
@@ -18,6 +18,10 @@ LOCAL_SHARED_LIBRARIES := \

LOCAL_MODULE:= libcamera_client

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

ifeq ($(TARGET_SIMULATOR),true)
    LOCAL_LDLIBS += -lpthread
endif
+11 −0
Original line number Diff line number Diff line
/*
**
** Copyright (C) 2008, The Android Open Source Project
** Copyright (C) 2008 HTC Inc.
** Copyright (C) 2010, Code Aurora Forum. All rights reserved.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
@@ -192,6 +194,15 @@ status_t Camera::setPreviewDisplay(const sp<ISurface>& surface)
    return c->setPreviewDisplay(surface);
}

#ifdef USE_GETBUFFERINFO
status_t Camera::getBufferInfo(sp<IMemory>& Frame, size_t *alignedSize)
{
    LOGV("getBufferInfo");
    sp <ICamera> c = mCamera;
    if (c == 0) return NO_INIT;
    return c->getBufferInfo(Frame, alignedSize);
}
#endif

// start preview mode
status_t Camera::startPreview()
Loading