Name

enum media_entity_type — Media entity type

Synopsis

enum media_entity_type {
  MEDIA_ENTITY_TYPE_BASE,
  MEDIA_ENTITY_TYPE_VIDEO_DEVICE,
  MEDIA_ENTITY_TYPE_V4L2_SUBDEV
};  

Constants

MEDIA_ENTITY_TYPE_BASE

The entity isn't embedded in another subsystem structure.

MEDIA_ENTITY_TYPE_VIDEO_DEVICE

The entity is embedded in a struct video_device instance.

MEDIA_ENTITY_TYPE_V4L2_SUBDEV

The entity is embedded in a struct v4l2_subdev instance.

Description

Media entity objects are often not instantiated directly, but the media entity structure is inherited by (through embedding) other subsystem-specific structures. The media entity type identifies the type of the subclass structure that implements a media entity instance.

This allows runtime type identification of media entities and safe casting to the correct object type. For instance, a media entity structure instance embedded in a v4l2_subdev structure instance will have the type MEDIA_ENTITY_TYPE_V4L2_SUBDEV and can safely be cast to a v4l2_subdev structure using the container_of macro.