mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
media: staging: imx-csi: explicitly start media pipeline on pad 0
entity->pads is an array that contains all the pads of an entity. Calling __media_pipeline_start() or __media_pipeline_stop() on the pads, implicitly starts the pipeline with the first pad in this array as origin. Explicitly use the first pad to start the pipeline to make this more obvious to the reader. Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
parent
e52b90b827
commit
262d2e7cfc
|
|
@ -754,6 +754,7 @@ int imx_media_pipeline_set_stream(struct imx_media_dev *imxmd,
|
|||
bool on)
|
||||
{
|
||||
struct v4l2_subdev *sd;
|
||||
struct media_pad *pad;
|
||||
int ret = 0;
|
||||
|
||||
if (!is_media_entity_v4l2_subdev(entity))
|
||||
|
|
@ -762,17 +763,19 @@ int imx_media_pipeline_set_stream(struct imx_media_dev *imxmd,
|
|||
|
||||
mutex_lock(&imxmd->md.graph_mutex);
|
||||
|
||||
pad = &entity->pads[0];
|
||||
|
||||
if (on) {
|
||||
ret = __media_pipeline_start(entity->pads, &vdev->pipe);
|
||||
ret = __media_pipeline_start(pad, &vdev->pipe);
|
||||
if (ret)
|
||||
goto out;
|
||||
ret = v4l2_subdev_call(sd, video, s_stream, 1);
|
||||
if (ret)
|
||||
__media_pipeline_stop(entity->pads);
|
||||
__media_pipeline_stop(pad);
|
||||
} else {
|
||||
v4l2_subdev_call(sd, video, s_stream, 0);
|
||||
if (media_pad_pipeline(entity->pads))
|
||||
__media_pipeline_stop(entity->pads);
|
||||
if (media_pad_pipeline(pad))
|
||||
__media_pipeline_stop(pad);
|
||||
}
|
||||
|
||||
out:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user