media: vimc: Add vimc-streamer for stream control
Add a linear pipeline logic for the stream control. It's created by
walking backwards on the entity graph. When the stream starts it will
simply loop through the pipeline calling the respective process_frame
function of each entity.
Fixes: f2fe89061d
("vimc: Virtual Media Controller core, capture
and sensor")
Cc: stable@vger.kernel.org # for v4.20
Signed-off-by: Lucas A. M. Magalhães <lucmaga@gmail.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil-cisco@xs4all.nl: fixed small space-after-tab issue in the patch]
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:

committed by
Mauro Carvalho Chehab

parent
276c1f066b
commit
adc589d2a2
@@ -207,41 +207,6 @@ const struct vimc_pix_map *vimc_pix_map_by_pixelformat(u32 pixelformat)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(vimc_pix_map_by_pixelformat);
|
||||
|
||||
int vimc_propagate_frame(struct media_pad *src, const void *frame)
|
||||
{
|
||||
struct media_link *link;
|
||||
|
||||
if (!(src->flags & MEDIA_PAD_FL_SOURCE))
|
||||
return -EINVAL;
|
||||
|
||||
/* Send this frame to all sink pads that are direct linked */
|
||||
list_for_each_entry(link, &src->entity->links, list) {
|
||||
if (link->source == src &&
|
||||
(link->flags & MEDIA_LNK_FL_ENABLED)) {
|
||||
struct vimc_ent_device *ved = NULL;
|
||||
struct media_entity *entity = link->sink->entity;
|
||||
|
||||
if (is_media_entity_v4l2_subdev(entity)) {
|
||||
struct v4l2_subdev *sd =
|
||||
container_of(entity, struct v4l2_subdev,
|
||||
entity);
|
||||
ved = v4l2_get_subdevdata(sd);
|
||||
} else if (is_media_entity_v4l2_video_device(entity)) {
|
||||
struct video_device *vdev =
|
||||
container_of(entity,
|
||||
struct video_device,
|
||||
entity);
|
||||
ved = video_get_drvdata(vdev);
|
||||
}
|
||||
if (ved && ved->process_frame)
|
||||
ved->process_frame(ved, link->sink, frame);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(vimc_propagate_frame);
|
||||
|
||||
/* Helper function to allocate and initialize pads */
|
||||
struct media_pad *vimc_pads_init(u16 num_pads, const unsigned long *pads_flag)
|
||||
{
|
||||
|
Reference in New Issue
Block a user