diff options
Diffstat (limited to 'isp')
| -rw-r--r-- | isp/omap3isp.c | 26 | 
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); | 
