Loading include/camera/Camera.h +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. Loading Loading @@ -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(); Loading include/camera/CameraHardwareInterface.h +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. Loading Loading @@ -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. */ Loading Loading @@ -213,6 +223,7 @@ public: * Dump state of the camera hardware */ virtual status_t dump(int fd, const Vector<String16>& args) const = 0; }; /** Loading include/camera/ICamera.h +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. Loading Loading @@ -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; Loading Loading @@ -90,6 +96,7 @@ public: // send command to camera driver virtual status_t sendCommand(int32_t cmd, int32_t arg1, int32_t arg2) = 0; }; // ---------------------------------------------------------------------------- Loading libs/camera/Android.mk +4 −0 Original line number Diff line number Diff line Loading @@ -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 Loading libs/camera/Camera.cpp +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. Loading Loading @@ -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 Loading
include/camera/Camera.h +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. Loading Loading @@ -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(); Loading
include/camera/CameraHardwareInterface.h +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. Loading Loading @@ -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. */ Loading Loading @@ -213,6 +223,7 @@ public: * Dump state of the camera hardware */ virtual status_t dump(int fd, const Vector<String16>& args) const = 0; }; /** Loading
include/camera/ICamera.h +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. Loading Loading @@ -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; Loading Loading @@ -90,6 +96,7 @@ public: // send command to camera driver virtual status_t sendCommand(int32_t cmd, int32_t arg1, int32_t arg2) = 0; }; // ---------------------------------------------------------------------------- Loading
libs/camera/Android.mk +4 −0 Original line number Diff line number Diff line Loading @@ -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 Loading
libs/camera/Camera.cpp +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. Loading Loading @@ -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