summaryrefslogtreecommitdiff
path: root/isp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2011-07-25 13:27:58 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2011-09-04 15:38:33 +0200
commit9bc3d4c9a76886f62899365aca3a65d123395994 (patch)
treec962e646c4a435bad81d68857bc0756e1261b215 /isp
parent42dba873f0da63e8ef40b233438eaf623515e294 (diff)
oamp3isp: Move video device open to omap3_isp_pipeline_build()
Open video devices right away when they're added to the pipeline. This will help pools implementation. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'isp')
-rw-r--r--isp/omap3isp.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/isp/omap3isp.c b/isp/omap3isp.c
index 7bd58c8..be5ea3d 100644
--- a/isp/omap3isp.c
+++ b/isp/omap3isp.c
@@ -108,6 +108,7 @@ static void omap3_isp_pipeline_destroy(struct omap3_isp_pipeline *pipe)
switch (entity->type) {
case OMAP3_ISP_ENTITY_VIDEO:
video = to_omap3_isp_video(entity);
+ v4l2_close(video->video);
free(video);
break;
@@ -148,6 +149,15 @@ static int omap3_isp_pipeline_build(struct omap3_isp_device *isp,
}
memset(video, 0, sizeof *video);
+
+ video->video = v4l2_open(entity->devname);
+ if (video->video == NULL) {
+ printf("error: unable to open video device %s\n",
+ entity->devname);
+ ret = -ENXIO;
+ goto done;
+ }
+
sink = &video->entity;
} else {
sink = malloc(sizeof *entity);
@@ -511,14 +521,6 @@ int omap3_isp_viewfinder_setup(struct omap3_isp_device *isp,
if (ret < 0)
return ret;
- /* Open the V4L2 device. */
- isp->viewfinder.output->video = v4l2_open(isp->viewfinder.output->entity.entity->devname);
- if (isp->viewfinder.output->video == NULL) {
- printf("error: unable to open video capture device %s\n",
- isp->viewfinder.output->entity.entity->devname);
- return -ENXIO;
- }
-
/* Set the capture format on the output video node. */
memset(&format, 0, sizeof format);
format.pixelformat = mbus_to_pix(ofmt->code);
@@ -728,14 +730,6 @@ int omap3_isp_snapshot_setup(struct omap3_isp_device *isp,
isp->snapshot.output->format = *ofmt;
- /* Open the V4L2 device. */
- isp->snapshot.output->video = v4l2_open(isp->snapshot.output->entity.entity->devname);
- if (isp->snapshot.output->video == NULL) {
- printf("error: unable to open snapshot capture device %s\n",
- isp->snapshot.output->entity.entity->devname);
- return -ENODEV;
- }
-
/* Set the capture format on the output video node. */
memset(&format, 0, sizeof format);
format.pixelformat = mbus_to_pix(ofmt->code);