Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1706628

Re: [PATCH v4 09/21] media: camss: Add files which handle the video device nodes

From Sakari Ailus <sakari.ailus@iki.fi>
Newsgroups linux.kernel
Subject Re: [PATCH v4 09/21] media: camss: Add files which handle the video device nodes
Date 2017-08-08 16:50 +0200
Message-ID <ucdZw-1lD-13@gated-at.bofh.it> (permalink)
References <uccTL-z0-9@gated-at.bofh.it> <uccTM-z0-37@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Todor,

On Tue, Aug 08, 2017 at 04:30:06PM +0300, Todor Tomov wrote:
...
> +static int video_start_streaming(struct vb2_queue *q, unsigned int count)
> +{
> +	struct camss_video *video = vb2_get_drv_priv(q);
> +	struct video_device *vdev = &video->vdev;
> +	struct media_entity *entity;
> +	struct media_pad *pad;
> +	struct v4l2_subdev *subdev;
> +	int ret;
> +
> +	ret = media_pipeline_start(&vdev->entity, &video->pipe);
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = video_check_format(video);
> +	if (ret < 0)
> +		goto error;
> +
> +	entity = &vdev->entity;
> +	while (1) {
> +		pad = &entity->pads[0];
> +		if (!(pad->flags & MEDIA_PAD_FL_SINK))
> +			break;

Could you align starting and stopping the streaming with this patch:

<URL:http://www.spinics.net/lists/linux-media/msg117737.html>

I'll send a pull request on it shortly.

Feel free to postpone for now, this isn't urgent.

> +
> +		pad = media_entity_remote_pad(pad);
> +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> +			break;
> +
> +		entity = pad->entity;
> +		subdev = media_entity_to_v4l2_subdev(entity);
> +
> +		ret = v4l2_subdev_call(subdev, video, s_stream, 1);
> +		if (ret < 0 && ret != -ENOIOCTLCMD)
> +			goto error;
> +	}
> +
> +	return 0;
> +
> +error:
> +	media_pipeline_stop(&vdev->entity);
> +
> +	video->ops->flush_buffers(video, VB2_BUF_STATE_QUEUED);
> +
> +	return ret;
> +}
> +
> +static void video_stop_streaming(struct vb2_queue *q)
> +{
> +	struct camss_video *video = vb2_get_drv_priv(q);
> +	struct video_device *vdev = &video->vdev;
> +	struct media_entity *entity;
> +	struct media_pad *pad;
> +	struct v4l2_subdev *subdev;
> +	struct v4l2_subdev *subdev_vfe = NULL;
> +
> +	entity = &vdev->entity;
> +	while (1) {
> +		pad = &entity->pads[0];
> +		if (!(pad->flags & MEDIA_PAD_FL_SINK))
> +			break;
> +
> +		pad = media_entity_remote_pad(pad);
> +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> +			break;
> +
> +		entity = pad->entity;
> +		subdev = media_entity_to_v4l2_subdev(entity);
> +
> +		if (strstr(subdev->name, "vfe")) {
> +			subdev_vfe = subdev;
> +		} else if (strstr(subdev->name, "ispif")) {
> +			v4l2_subdev_call(subdev, video, s_stream, 0);
> +			v4l2_subdev_call(subdev_vfe, video, s_stream, 0);
> +		} else {
> +			v4l2_subdev_call(subdev, video, s_stream, 0);
> +		}
> +	}
> +
> +	media_pipeline_stop(&vdev->entity);
> +
> +	video->ops->flush_buffers(video, VB2_BUF_STATE_ERROR);
> +}

-- 
Regards,

Sakari Ailus
e-mail: sakari.ailus@iki.fi	XMPP: sailus@retiisi.org.uk

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH v4 09/21] media: camss: Add files which handle the video device nodes Todor Tomov <todor.tomov@linaro.org> - 2017-08-08 15:40 +0200
  Re: [PATCH v4 09/21] media: camss: Add files which handle the video  device nodes Sakari Ailus <sakari.ailus@iki.fi> - 2017-08-08 16:50 +0200

csiph-web