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

Commit 39215374 authored by Steve Kondik's avatar Steve Kondik Committed by cyanogen
Browse files

Camera: Add support for getBufferInfo API

Reworked to avoid ABI breakage.

This reverts commit b5d9f649.

Change-Id: I602faec8e85d80a30dadceed8c7942dc133989b8
parent 7f03aa87
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
/*
**
** Copyright 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.
@@ -399,4 +400,12 @@ extern "C" sp<CameraHardwareInterface> openCameraHardware()
    return CameraHardwareStub::createInstance();
}

status_t CameraHardwareStub::getBufferInfo(sp<IMemory>& Frame, size_t *alignedSize) {
    /* No Support for this API in STUB Camera. Just return NULL */
    Frame = NULL;
    if( alignedSize != NULL)
        *alignedSize = 0;

    return UNKNOWN_ERROR;
}
}; // namespace android
+3 −0
Original line number Diff line number Diff line
/*
**
** Copyright 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.
@@ -59,6 +60,8 @@ public:
    virtual CameraParameters  getParameters() const;
    virtual status_t    sendCommand(int32_t command, int32_t arg1,
                                    int32_t arg2);
    virtual status_t getBufferInfo( sp<IMemory>& Frame, size_t *alignedSize);

    virtual void release();

    static sp<CameraHardwareInterface> createInstance();
+14 −1
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.
@@ -1456,4 +1458,15 @@ 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
+5 −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.
@@ -126,6 +128,9 @@ 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,
+5 −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.
@@ -127,6 +129,9 @@ public:
            status_t    setPreviewDisplay(const sp<Surface>& surface);
            status_t    setPreviewDisplay(const sp<ISurface>& surface);

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

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

Loading