summaryrefslogtreecommitdiff
path: root/isp/omap3isp.c
diff options
context:
space:
mode:
Diffstat (limited to 'isp/omap3isp.c')
-rw-r--r--isp/omap3isp.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/isp/omap3isp.c b/isp/omap3isp.c
index 20ef13d..6a9bfa5 100644
--- a/isp/omap3isp.c
+++ b/isp/omap3isp.c
@@ -1161,6 +1161,50 @@ int omap3_isp_viewfinder_setup(struct omap3_isp_device *isp,
return 0;
}
+int omap3_isp_viewfinder_alloc_pool(struct omap3_isp_device *isp,
+ unsigned int nbufs)
+{
+ struct v4l2_buffers_pool *pool;
+ int ret;
+
+ pool = v4l2_buffers_pool_new(nbufs);
+ if (pool == NULL) {
+ printf("error: unable to allocate buffers pool for viewfinder.\n");
+ return -ENOMEM;
+ }
+
+ ret = v4l2_alloc_buffers(isp->viewfinder.output->video, pool,
+ V4L2_MEMORY_MMAP);
+ if (ret < 0) {
+ printf("error: unable to allocate buffers for viewfinder.\n");
+ return ret;
+ }
+
+ isp->viewfinder.output->pool = pool;
+ isp->viewfinder.output->queued = 0;
+
+ return 0;
+}
+
+void omap3_isp_viewfinder_free_pool(struct omap3_isp_device *isp)
+{
+ int ret;
+
+ ret = v4l2_free_buffers(isp->viewfinder.output->video);
+ if (ret < 0)
+ printf("error: unable to free viewfinder buffers.\n");
+
+ v4l2_buffers_pool_delete(isp->viewfinder.output->pool);
+
+ isp->viewfinder.output->pool = NULL;
+}
+
+struct v4l2_buffers_pool *
+omap3_isp_viewfinder_get_pool(struct omap3_isp_device *isp)
+{
+ return isp->viewfinder.output->pool;
+}
+
int omap3_isp_viewfinder_set_pool(struct omap3_isp_device *isp,
struct v4l2_buffers_pool *pool)
{