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

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

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

parents 0bdfdcd2 57495aaf
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.
@@ -690,6 +692,17 @@ status_t CameraService::Client::startPreviewMode()
    return ret;
}

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);
}

status_t CameraService::Client::startPreview()
{
    LOGV("startPreview (pid %d)", getCallingPid());
+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.
@@ -84,6 +86,9 @@ private:
        // preview are handled.
        virtual void            setPreviewCallbackFlag(int callback_flag);

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

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

+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