From 9d6d20e652c0d304f98de30d51805658f98ba27d Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 31 Jul 2018 09:22:40 -0400 Subject: media: v4l2-mc: switch it to use the new approach to setup pipelines Instead of relying on a static map for pids, use the new sig_type "taint" type to setup the pipelines with the same tipe between different entities. Acked-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/media-entity.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'include/media') diff --git a/include/media/media-entity.h b/include/media/media-entity.h index b7a53f5d3e12..e5f6960d92f6 100644 --- a/include/media/media-entity.h +++ b/include/media/media-entity.h @@ -670,6 +670,24 @@ static inline void media_entity_cleanup(struct media_entity *entity) {} #define media_entity_cleanup(entity) do { } while (false) #endif +/** + * media_get_pad_index() - retrieves a pad index from an entity + * + * @entity: entity where the pads belong + * @is_sink: true if the pad is a sink, false if it is a source + * @sig_type: type of signal of the pad to be search + * + * This helper function finds the first pad index inside an entity that + * satisfies both @is_sink and @sig_type conditions. + * + * Return: + * + * On success, return the pad number. If the pad was not found or the media + * entity is a NULL pointer, return -EINVAL. + */ +int media_get_pad_index(struct media_entity *entity, bool is_sink, + enum media_pad_signal_type sig_type); + /** * media_create_pad_link() - creates a link between two entities. * -- cgit v1.2.3