[media] media: use media_gobj inside pads

PADs also need unique object IDs that won't conflict with
the entity object IDs.

The pad objects are currently created via media_entity_init()
and, once created, never change.

While this will likely change in the future in order to
support dynamic changes, for now we'll keep PADs as arrays
and initialize the media_gobj embedded structs when
registering the entity.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
Mauro Carvalho Chehab
2015-08-14 12:50:08 -03:00
parent bfab2aaccc
commit 18710dc67a
4 changed files with 19 additions and 0 deletions

View File

@@ -34,9 +34,11 @@
* enum media_gobj_type - type of a graph object
*
* @MEDIA_GRAPH_ENTITY: Identify a media entity
* @MEDIA_GRAPH_PAD: Identify a media pad
*/
enum media_gobj_type {
MEDIA_GRAPH_ENTITY,
MEDIA_GRAPH_PAD,
};
#define MEDIA_BITS_PER_TYPE 8
@@ -72,6 +74,7 @@ struct media_link {
};
struct media_pad {
struct media_gobj graph_obj;
struct media_entity *entity; /* Entity this pad belongs to */
u16 index; /* Pad index in the entity pads array */
unsigned long flags; /* Pad flags (MEDIA_PAD_FL_*) */