summaryrefslogtreecommitdiffstats
path: root/camera/inc/CameraHal.h
diff options
context:
space:
mode:
Diffstat (limited to 'camera/inc/CameraHal.h')
-rw-r--r--camera/inc/CameraHal.h64
1 files changed, 55 insertions, 9 deletions
diff --git a/camera/inc/CameraHal.h b/camera/inc/CameraHal.h
index e29518b..02004c9 100644
--- a/camera/inc/CameraHal.h
+++ b/camera/inc/CameraHal.h
@@ -64,6 +64,7 @@
#define HAL_PIXEL_FORMAT_TI_NV12 0x100
#define HAL_PIXEL_FORMAT_TI_Y8 0x103
#define HAL_PIXEL_FORMAT_TI_Y16 0x104
+#define HAL_PIXEL_FORMAT_TI_UYVY 0x105
#define MIN_WIDTH 640
#define MIN_HEIGHT 480
@@ -98,6 +99,8 @@
#define LOCK_BUFFER_TRIES 5
#define HAL_PIXEL_FORMAT_NV12 0x100
+#define OP_STR_SIZE 100
+
#define NONNEG_ASSIGN(x,y) \
if(x > -1) \
y = x
@@ -350,6 +353,17 @@ typedef struct _CameraBuffer {
int stride;
int height;
const char *format;
+
+#if PPM_INSTRUMENTATION || PPM_INSTRUMENTATION_ABS
+
+ struct timeval ppmStamp;
+
+#endif
+
+ /* These are for buffers which include borders */
+ int offset; // where valid data starts
+ int actual_size; // size of the entire buffer with borders
+ int privateData;
} CameraBuffer;
void * camera_buffer_get_omx_ptr (CameraBuffer *buffer);
@@ -617,6 +631,9 @@ public:
//additional methods used for memory mapping
virtual uint32_t * getOffsets() = 0;
virtual int getFd() = 0;
+ virtual CameraBuffer * getBuffers(bool reset = false) { return NULL; }
+ virtual unsigned int getSize() {return 0; }
+ virtual int getBufferCount() {return -1; }
virtual int freeBufferList(CameraBuffer * buf) = 0;
@@ -713,6 +730,7 @@ public:
void setVideoRes(int width, int height);
void flushEventQueue();
+ void setExternalLocking(bool extBuffLocking);
//Internal class definitions
class NotificationThread : public android::Thread {
@@ -748,6 +766,8 @@ private:
void copyAndSendPreviewFrame(CameraFrame* frame, int32_t msgType);
size_t calculateBufferSize(size_t width, size_t height, const char *pixelFormat);
const char* getContstantForPixelFormat(const char *pixelFormat);
+ void lockBufferAndUpdatePtrs(CameraFrame* frame);
+ void unlockBufferAndUpdatePtrs(CameraFrame* frame);
private:
mutable android::Mutex mLock;
@@ -803,6 +823,8 @@ private:
int mVideoWidth;
int mVideoHeight;
+ bool mExternalLocking;
+
};
@@ -1033,9 +1055,9 @@ public:
// Get min buffers display needs at any given time
virtual status_t minUndequeueableBuffers(int& unqueueable) = 0;
-protected:
- virtual const char* getPixFormatConstant(const char* parameters_format) const;
- virtual size_t getBufSize(const char* parameters_format, int width, int height) const;
+
+ // Given a vector of DisplayAdapters find the one corresponding to str
+ virtual bool match(const char * str) { return false; }
private:
#ifdef OMAP_ENHANCEMENT
@@ -1130,6 +1152,11 @@ public:
#endif
/**
+ * Release a tap-in or tap-out point.
+ */
+ int releaseBufferSource(struct preview_stream_ops *tapin, struct preview_stream_ops *tapout);
+
+ /**
* Stop a previously started preview.
*/
void stopPreview();
@@ -1225,6 +1252,9 @@ public:
status_t storeMetaDataInBuffers(bool enable);
+ // Use external locking for graphic buffers
+ void setExternalLocking(bool extBuffLocking);
+
//@}
/*--------------------Internal Member functions - Public---------------------------------*/
@@ -1267,6 +1297,13 @@ public:
void eventCallback(CameraHalEvent* event);
void setEventProvider(int32_t eventMask, MessageNotifier * eventProvider);
+ static const char* getPixelFormatConstant(const char* parameters_format);
+ static size_t calculateBufferSize(const char* parameters_format, int width, int height);
+ static void getXYFromOffset(unsigned int *x, unsigned int *y,
+ unsigned int offset, unsigned int stride,
+ const char* format);
+ static unsigned int getBPP(const char* format);
+
/*--------------------Internal Member functions - Private---------------------------------*/
private:
@@ -1300,8 +1337,7 @@ private:
/** Allocate image capture buffers */
status_t allocImageBufs(unsigned int width, unsigned int height, size_t length,
- const char* previewFormat, unsigned int bufferCount,
- unsigned int *max_queueable);
+ const char* previewFormat, unsigned int bufferCount);
/** Allocate Raw buffers */
status_t allocRawBufs(int width, int height, const char* previewFormat, int bufferCount);
@@ -1346,10 +1382,13 @@ private:
void resetPreviewRes(android::CameraParameters *params);
// Internal __takePicture function - used in public takePicture() and reprocess()
- int __takePicture(const char* params);
+ int __takePicture(const char* params, struct timeval *captureStart = NULL);
//@}
-
+ status_t setTapoutLocked(struct preview_stream_ops *out);
+ status_t releaseTapoutLocked(struct preview_stream_ops *out);
+ status_t setTapinLocked(struct preview_stream_ops *in);
+ status_t releaseTapinLocked(struct preview_stream_ops *in);
/*----------Member variables - Public ---------------------*/
public:
int32_t mMsgEnabled;
@@ -1370,8 +1409,12 @@ public:
android::sp<AppCallbackNotifier> mAppCallbackNotifier;
android::sp<DisplayAdapter> mDisplayAdapter;
android::sp<MemoryManager> mMemoryManager;
- // TODO(XXX): May need to keep this as a vector in the future
- // when we can have multiple tap-in/tap-out points
+
+ android::Vector< android::sp<DisplayAdapter> > mOutAdapters;
+ android::Vector< android::sp<DisplayAdapter> > mInAdapters;
+
+ // TODO(XXX): Even though we support user setting multiple BufferSourceAdapters now
+ // only one tap in surface and one tap out surface is supported at a time.
android::sp<DisplayAdapter> mBufferSourceAdapter_In;
android::sp<DisplayAdapter> mBufferSourceAdapter_Out;
@@ -1441,6 +1484,7 @@ private:
uint32_t *mImageOffsets;
int mImageFd;
int mImageLength;
+ unsigned int mImageCount;
CameraBuffer *mPreviewBuffers;
uint32_t *mPreviewOffsets;
int mPreviewLength;
@@ -1473,6 +1517,8 @@ private:
int mVideoHeight;
android::String8 mCapModeBackup;
+
+ bool mExternalLocking;
};
} // namespace Camera