summaryrefslogtreecommitdiffstats
path: root/camera/BufferSourceAdapter.cpp
diff options
context:
space:
mode:
authorTyler Luu <tluu@ti.com>2012-06-21 11:17:08 -0500
committerDaniel Levin <dendy@ti.com>2012-11-26 20:03:35 +0200
commit85855ca02333f8cc9a6a3b821ed35a06a8fec232 (patch)
treed519afff4f5a2b231e178ac1f5189f668941d5ae /camera/BufferSourceAdapter.cpp
parentc143e22be6a85a75d247fea47c4aba577fb0002d (diff)
downloadhardware_ti_omap4-85855ca02333f8cc9a6a3b821ed35a06a8fec232.tar.gz
hardware_ti_omap4-85855ca02333f8cc9a6a3b821ed35a06a8fec232.tar.bz2
hardware_ti_omap4-85855ca02333f8cc9a6a3b821ed35a06a8fec232.zip
CameraHal: Add support for setting multiple tap in/outs
- Adding support for setting multiple tap in and tap out points that the application can set at any time. Applications need to provide name of tap-in and tap-outs with their shot config for us to find the tap-in or tap-out point from the vector we are keeping. - Patch for releasing tap in/outs to follow Depends on frameworks/av change Ia21c4a26: http://review.omapzoom.org/#/c/28899/ Change-Id: I6fa91de68c7bf71525596ee5e1a5ebb2a7b3b5da Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
Diffstat (limited to 'camera/BufferSourceAdapter.cpp')
-rw-r--r--camera/BufferSourceAdapter.cpp33
1 files changed, 27 insertions, 6 deletions
diff --git a/camera/BufferSourceAdapter.cpp b/camera/BufferSourceAdapter.cpp
index 214d4ed..b4317e4 100644
--- a/camera/BufferSourceAdapter.cpp
+++ b/camera/BufferSourceAdapter.cpp
@@ -195,12 +195,33 @@ int BufferSourceAdapter::setPreviewWindow(preview_stream_ops_t *source)
return BAD_VALUE;
}
- if ( source == mBufferSource ) {
- return ALREADY_EXISTS;
- }
+ if (mBufferSource) {
+ char id1[OP_STR_SIZE], id2[OP_STR_SIZE];
+ status_t ret;
- // Destroy the existing source, if it exists
- destroy();
+ ret = extendedOps()->get_id(mBufferSource, id1, sizeof(id1));
+ if (ret != 0) {
+ CAMHAL_LOGE("Surface::getId returned error %d", ret);
+ return ret;
+ }
+
+ ret = extendedOps()->get_id(source, id2, sizeof(id2));
+ if (ret != 0) {
+ CAMHAL_LOGE("Surface::getId returned error %d", ret);
+ return ret;
+ }
+ if ((0 >= strlen(id1)) || (0 >= strlen(id2))) {
+ CAMHAL_LOGE("Cannot set ST without name: id1:\"%s\" id2:\"%s\"",
+ id1, id2);
+ return NOT_ENOUGH_DATA;
+ }
+ if (0 == strcmp(id1, id2)) {
+ return ALREADY_EXISTS;
+ }
+
+ // client has to unset mBufferSource before being able to set a new one
+ return BAD_VALUE;
+ }
// Move to new source obj
mBufferSource = source;
@@ -354,7 +375,7 @@ CameraBuffer* BufferSourceAdapter::allocateBufferList(int width, int dummyHeight
return NULL;
}
- CAMHAL_LOGDB("Number of buffers set to ANativeWindow %d", numBufs);
+ CAMHAL_LOGDB("Number of buffers set to BufferSourceAdapter %d", numBufs);
// Set the number of buffers needed for this buffer source
err = mBufferSource->set_buffer_count(mBufferSource, numBufs);
if (err != 0) {