Hi Mauro,
On Mon, Oct 12, 2015 at 01:42:53PM -0300, Mauro Carvalho Chehab wrote:
Due to the MC API proposed changes, we'll need to have an unique object ID for all graph objects, and have some shared fields that will be common on all media graph objects.
Right now, the only common object is the object ID, but other fields will be added later on.
Change-Id: Ieb4470a173004c2b67a240e6fe2b7e6a8c02ad52 Signed-off-by: Mauro Carvalho Chehab mchehab@osg.samsung.com Acked-by: Hans Verkuil hans.verkuil@cisco.com
drivers/media/media-entity.c | 32 +++++++++++++++++++++++ include/media/media-entity.h | 61 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+)
diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c index cb0ac4e0dfa5..4834172bf6f8 100644 --- a/drivers/media/media-entity.c +++ b/drivers/media/media-entity.c @@ -27,6 +27,38 @@ #include <media/media-device.h>
/**
- media_gobj_init - Initialize a graph object
- @mdev: Pointer to the media_device that contains the object
- @type: Type of the object
- @gobj: Pointer to the object
- This routine initializes the embedded struct media_gobj inside a
- media graph object. It is called automatically if media_*_create()
- calls are used. However, if the object (entity, link, pad, interface)
- is embedded on some other object, this function should be called before
- registering the object at the media controller.
- */
+void media_gobj_init(struct media_device *mdev,
enum media_gobj_type type,
struct media_gobj *gobj)
+{
media_gobj_init() does a number of things very soon, including adding the graph object to the media device's relevant list of objects.
I think I'd call this media_gobj_register() instead, since this function not only changes the internal state of this object, but also the media device itself.
- /* For now, nothing to do */
+}
+/**
- media_gobj_remove - Stop using a graph object on a media device
- @graph_obj: Pointer to the object
- This should be called at media_device_unregister_*() routines
- */
+void media_gobj_remove(struct media_gobj *gobj) +{
- /* For now, nothing to do */
+}
And media_gobj_unregister() here.
+/**
- media_entity_init - Initialize a media entity
- @num_pads: Total number of sink and source pads.